@@ -24,10 +24,32 @@ export class EditOrganizationComponent implements OnInit {
24
24
organization : Organization = new Organization ( ) ;
25
25
authorities : Map < string , OrganizationAuthorityModel > = new Map < string , OrganizationAuthorityModel > ( ) ;
26
26
27
+ // Slack OAuth
28
+ slackSyncStatus : string = 'idle' ;
29
+ slackDisconnectStatus : string = 'idle' ;
30
+ slackClientId : string = '' ;
31
+ redirectUrlSlackOAuth : string = '' ;
32
+ code : string = '' ;
33
+
34
+ // Microsoft OAuth
35
+ microsoftEnabled : boolean = false ;
36
+ microsoftSyncStatus : string = 'idle' ;
37
+ microsoftDisconnectStatus : string = 'idle' ;
38
+ microsoftTenantId : string = '' ;
39
+ microsoftClientId : string = '' ;
40
+ microsoftState : string = '' ;
41
+ microsoftRedirectUrl : string = '' ;
42
+ microsoftCode : string = '' ;
43
+ msDisconnectStatus : string = 'idle' ;
44
+ msTeam : MsTeamModel = new MsTeamModel ( ) ;
45
+
27
46
// Forms
28
47
editOrgForm : FormGroup = this . formBuilder . group ( {
29
48
name : [ this . organization . name , Validators . required ] ,
30
- logoUrl : [ this . organization . logoUrl ]
49
+ logoUrl : [ this . organization . logoUrl ] ,
50
+ msPublicationGroupId : [ this . msTeam . groupId ] ,
51
+ msPublicationChannelId : [ this . msTeam . channelId ] ,
52
+ msCompanyFilter : [ this . msTeam . companyFilter ]
31
53
} ) ;
32
54
addMemberOrgForm : FormGroup = this . formBuilder . group ( {
33
55
email : [ '' , Validators . required ]
@@ -46,25 +68,6 @@ export class EditOrganizationComponent implements OnInit {
46
68
addStatus : string = 'idle' ;
47
69
submitStatus : string = 'idle' ;
48
70
49
- // Slack OAuth
50
- slackSyncStatus : string = 'idle' ;
51
- slackDisconnectStatus : string = 'idle' ;
52
- slackClientId : string = '' ;
53
- redirectUrlSlackOAuth : string = '' ;
54
- code : string = '' ;
55
-
56
- // Microsoft OAuth
57
- microsoftEnabled : boolean = false ;
58
- microsoftSyncStatus : string = 'idle' ;
59
- microsoftDisconnectStatus : string = 'idle' ;
60
- microsoftTenantId : string = '' ;
61
- microsoftClientId : string = '' ;
62
- microsoftState : string = '' ;
63
- microsoftRedirectUrl : string = '' ;
64
- microsoftCode : string = '' ;
65
- msDisconnectStatus : string = 'idle' ;
66
- msTeam : MsTeamModel = new MsTeamModel ( ) ;
67
-
68
71
// Members card
69
72
private rawResponseMembers : any ;
70
73
pagerMembers : any = { } ;
@@ -515,7 +518,7 @@ export class EditOrganizationComponent implements OnInit {
515
518
grant ( userId : number , role : string ) {
516
519
var organizationAuthority = this . organization . organizationAuthorities . find ( authority => authority . name === role ) ;
517
520
if ( organizationAuthority !== undefined ) {
518
- this . userService . grant ( userId , organizationAuthority )
521
+ this . userService . grantOrgAuthority ( userId , organizationAuthority )
519
522
. subscribe ( ( ) => {
520
523
this . refreshMembers ( this . pagerMembers . currentPage ) ;
521
524
} ) ;
@@ -538,6 +541,16 @@ export class EditOrganizationComponent implements OnInit {
538
541
organization . logoUrl = "https://eu.ui-avatars.com/api/?name=" + organization . name ;
539
542
}
540
543
544
+ if ( this . msTeam . id > 0 ) {
545
+ this . msTeamService . update ( this . msTeam )
546
+ . subscribe (
547
+ ( ) => { } ,
548
+ error => {
549
+ console . log ( error ) ;
550
+ }
551
+ )
552
+ }
553
+
541
554
if ( this . id > 0 ) {
542
555
organization . id = this . id ;
543
556
this . organizationService . update ( organization )
0 commit comments