|
|
|
@ -205,13 +205,22 @@ export class OAuth2SettingsComponent extends PageComponent implements OnInit, Ha |
|
|
|
this.oauth2SettingsForm = this.fb.group({ |
|
|
|
oauth2ParamsInfos: this.fb.array([]), |
|
|
|
enabled: [false], |
|
|
|
edgeEnabled: [false] |
|
|
|
edgeEnabled: [{value: false, disabled: true}] |
|
|
|
}); |
|
|
|
|
|
|
|
this.subscriptions.push(this.oauth2SettingsForm.get('enabled').valueChanges.subscribe(enabled => { |
|
|
|
if (enabled) { |
|
|
|
this.oauth2SettingsForm.get('edgeEnabled').enable(); |
|
|
|
} else { |
|
|
|
this.oauth2SettingsForm.get('edgeEnabled').patchValue(false); |
|
|
|
this.oauth2SettingsForm.get('edgeEnabled').disable(); |
|
|
|
} |
|
|
|
})) |
|
|
|
} |
|
|
|
|
|
|
|
private initOAuth2Settings(oauth2Info: OAuth2Info): void { |
|
|
|
if (oauth2Info) { |
|
|
|
this.oauth2SettingsForm.patchValue({enabled: oauth2Info.enabled, edgeEnabled: oauth2Info.edgeEnabled}, {emitEvent: false}); |
|
|
|
this.oauth2SettingsForm.patchValue({enabled: oauth2Info.enabled, edgeEnabled: oauth2Info.edgeEnabled}); |
|
|
|
oauth2Info.oauth2ParamsInfos.forEach((oauth2ParamsInfo) => { |
|
|
|
this.oauth2ParamsInfos.push(this.buildOAuth2ParamsInfoForm(oauth2ParamsInfo)); |
|
|
|
}); |
|
|
|
|