38 changed files with 592 additions and 400 deletions
@ -0,0 +1,41 @@ |
|||
<!-- |
|||
|
|||
Copyright © 2016-2022 The Thingsboard Authors |
|||
|
|||
Licensed under the Apache License, Version 2.0 (the "License"); |
|||
you may not use this file except in compliance with the License. |
|||
You may obtain a copy of the License at |
|||
|
|||
http://www.apache.org/licenses/LICENSE-2.0 |
|||
|
|||
Unless required by applicable law or agreed to in writing, software |
|||
distributed under the License is distributed on an "AS IS" BASIS, |
|||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|||
See the License for the specific language governing permissions and |
|||
limitations under the License. |
|||
|
|||
--> |
|||
<section style="min-width: 300px;"> |
|||
<form [formGroup]="confirmFormGroup" style="padding-top: 16px;"> |
|||
<fieldset [disabled]="(isLoading$ | async)"> |
|||
<div style="user-select: none;" [innerHTML]="removeOtherEntitiesConfirmText"></div> |
|||
<mat-form-field class="mat-block"> |
|||
<input matInput formControlName="verification"/> |
|||
</mat-form-field> |
|||
</fieldset> |
|||
</form> |
|||
<div fxLayoutAlign="end center" fxLayoutGap="8px"> |
|||
<button mat-button color="primary" |
|||
type="button" |
|||
[disabled]="(isLoading$ | async)" |
|||
(click)="cancel()" cdkFocusInitial> |
|||
{{ 'action.cancel' | translate }} |
|||
</button> |
|||
<button mat-raised-button color="primary" |
|||
type="button" |
|||
(click)="confirm()" |
|||
[disabled]="(isLoading$ | async) || confirmFormGroup.invalid || confirmFormGroup.get('verification').value !== removeOtherEntitiesVerificationText"> |
|||
{{ 'action.confirm' | translate }} |
|||
</button> |
|||
</div> |
|||
</section> |
|||
@ -0,0 +1,66 @@ |
|||
///
|
|||
/// Copyright © 2016-2022 The Thingsboard Authors
|
|||
///
|
|||
/// Licensed under the Apache License, Version 2.0 (the "License");
|
|||
/// you may not use this file except in compliance with the License.
|
|||
/// You may obtain a copy of the License at
|
|||
///
|
|||
/// http://www.apache.org/licenses/LICENSE-2.0
|
|||
///
|
|||
/// Unless required by applicable law or agreed to in writing, software
|
|||
/// distributed under the License is distributed on an "AS IS" BASIS,
|
|||
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
/// See the License for the specific language governing permissions and
|
|||
/// limitations under the License.
|
|||
///
|
|||
|
|||
import { Component, Input, OnInit } from '@angular/core'; |
|||
import { PageComponent } from '@shared/components/page.component'; |
|||
import { Store } from '@ngrx/store'; |
|||
import { AppState } from '@core/core.state'; |
|||
import { TranslateService } from '@ngx-translate/core'; |
|||
import { FormBuilder, FormGroup } from '@angular/forms'; |
|||
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; |
|||
|
|||
@Component({ |
|||
selector: 'tb-remove-other-entities-confirm', |
|||
templateUrl: './remove-other-entities-confirm.component.html', |
|||
styleUrls: [] |
|||
}) |
|||
export class RemoveOtherEntitiesConfirmComponent extends PageComponent implements OnInit { |
|||
|
|||
@Input() |
|||
onClose: (result: boolean | null) => void; |
|||
|
|||
confirmFormGroup: FormGroup; |
|||
|
|||
removeOtherEntitiesConfirmText: SafeHtml; |
|||
|
|||
removeOtherEntitiesVerificationText = 'remove other entities'; |
|||
|
|||
constructor(protected store: Store<AppState>, |
|||
private translate: TranslateService, |
|||
private sanitizer: DomSanitizer, |
|||
private fb: FormBuilder) { |
|||
super(store); |
|||
this.removeOtherEntitiesConfirmText = this.sanitizer.bypassSecurityTrustHtml(this.translate.instant('version-control.remove-other-entities-confirm-text')); |
|||
} |
|||
|
|||
ngOnInit(): void { |
|||
this.confirmFormGroup = this.fb.group({ |
|||
verification: [null, []] |
|||
}); |
|||
} |
|||
|
|||
cancel(): void { |
|||
if (this.onClose) { |
|||
this.onClose(null); |
|||
} |
|||
} |
|||
|
|||
confirm(): void { |
|||
if (this.onClose) { |
|||
this.onClose(true); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,216 @@ |
|||
///
|
|||
/// Copyright © 2016-2022 The Thingsboard Authors
|
|||
///
|
|||
/// Licensed under the Apache License, Version 2.0 (the "License");
|
|||
/// you may not use this file except in compliance with the License.
|
|||
/// You may obtain a copy of the License at
|
|||
///
|
|||
/// http://www.apache.org/licenses/LICENSE-2.0
|
|||
///
|
|||
/// Unless required by applicable law or agreed to in writing, software
|
|||
/// distributed under the License is distributed on an "AS IS" BASIS,
|
|||
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
/// See the License for the specific language governing permissions and
|
|||
/// limitations under the License.
|
|||
///
|
|||
|
|||
import { Component, Input, OnInit } from '@angular/core'; |
|||
import { PageComponent } from '@shared/components/page.component'; |
|||
import { FormBuilder, FormGroup, FormGroupDirective, Validators } from '@angular/forms'; |
|||
import { select, Store } from '@ngrx/store'; |
|||
import { AppState } from '@core/core.state'; |
|||
import { AdminService } from '@core/http/admin.service'; |
|||
import { |
|||
RepositorySettings, |
|||
RepositoryAuthMethod, |
|||
repositoryAuthMethodTranslationMap |
|||
} from '@shared/models/settings.models'; |
|||
import { ActionNotificationShow } from '@core/notification/notification.actions'; |
|||
import { TranslateService } from '@ngx-translate/core'; |
|||
import { isNotEmptyStr } from '@core/utils'; |
|||
import { DialogService } from '@core/services/dialog.service'; |
|||
import { ActionAuthUpdateHasRepository } from '@core/auth/auth.actions'; |
|||
import { selectHasRepository } from '@core/auth/auth.selectors'; |
|||
import { catchError, mergeMap, take } from 'rxjs/operators'; |
|||
import { of } from 'rxjs'; |
|||
|
|||
@Component({ |
|||
selector: 'tb-repository-settings', |
|||
templateUrl: './repository-settings.component.html', |
|||
styleUrls: ['./repository-settings.component.scss', './../../pages/admin/settings-card.scss'] |
|||
}) |
|||
export class RepositorySettingsComponent extends PageComponent implements OnInit { |
|||
|
|||
@Input() |
|||
detailsMode = false; |
|||
|
|||
repositorySettingsForm: FormGroup; |
|||
settings: RepositorySettings = null; |
|||
|
|||
repositoryAuthMethod = RepositoryAuthMethod; |
|||
repositoryAuthMethods = Object.values(RepositoryAuthMethod); |
|||
repositoryAuthMethodTranslations = repositoryAuthMethodTranslationMap; |
|||
|
|||
showChangePassword = false; |
|||
changePassword = false; |
|||
|
|||
showChangePrivateKeyPassword = false; |
|||
changePrivateKeyPassword = false; |
|||
|
|||
constructor(protected store: Store<AppState>, |
|||
private adminService: AdminService, |
|||
private dialogService: DialogService, |
|||
private translate: TranslateService, |
|||
public fb: FormBuilder) { |
|||
super(store); |
|||
} |
|||
|
|||
ngOnInit() { |
|||
this.repositorySettingsForm = this.fb.group({ |
|||
repositoryUri: [null, [Validators.required]], |
|||
defaultBranch: ['main', []], |
|||
authMethod: [RepositoryAuthMethod.USERNAME_PASSWORD, [Validators.required]], |
|||
username: [null, []], |
|||
password: [null, []], |
|||
privateKeyFileName: [null, [Validators.required]], |
|||
privateKey: [null, []], |
|||
privateKeyPassword: [null, []] |
|||
}); |
|||
this.updateValidators(false); |
|||
this.repositorySettingsForm.get('authMethod').valueChanges.subscribe(() => { |
|||
this.updateValidators(true); |
|||
}); |
|||
this.repositorySettingsForm.get('privateKeyFileName').valueChanges.subscribe(() => { |
|||
this.updateValidators(false); |
|||
}); |
|||
this.store.pipe( |
|||
select(selectHasRepository), |
|||
take(1), |
|||
mergeMap((hasRepository) => { |
|||
if (hasRepository) { |
|||
return this.adminService.getRepositorySettings({ignoreErrors: true}).pipe( |
|||
catchError(() => of(null)) |
|||
); |
|||
} else { |
|||
return of(null); |
|||
} |
|||
}) |
|||
).subscribe( |
|||
(settings) => { |
|||
this.settings = settings; |
|||
if (this.settings != null) { |
|||
if (this.settings.authMethod === RepositoryAuthMethod.USERNAME_PASSWORD) { |
|||
this.showChangePassword = true; |
|||
} else { |
|||
this.showChangePrivateKeyPassword = true; |
|||
} |
|||
this.repositorySettingsForm.reset(this.settings); |
|||
this.updateValidators(false); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
checkAccess(): void { |
|||
const settings: RepositorySettings = this.repositorySettingsForm.value; |
|||
this.adminService.checkRepositoryAccess(settings).subscribe(() => { |
|||
this.store.dispatch(new ActionNotificationShow({ message: this.translate.instant('admin.check-repository-access-success'), |
|||
type: 'success' })); |
|||
}); |
|||
} |
|||
|
|||
save(): void { |
|||
const settings: RepositorySettings = this.repositorySettingsForm.value; |
|||
this.adminService.saveRepositorySettings(settings).subscribe( |
|||
(savedSettings) => { |
|||
this.settings = savedSettings; |
|||
if (this.settings.authMethod === RepositoryAuthMethod.USERNAME_PASSWORD) { |
|||
this.showChangePassword = true; |
|||
this.changePassword = false; |
|||
} else { |
|||
this.showChangePrivateKeyPassword = true; |
|||
this.changePrivateKeyPassword = false; |
|||
} |
|||
this.repositorySettingsForm.reset(this.settings); |
|||
this.updateValidators(false); |
|||
this.store.dispatch(new ActionAuthUpdateHasRepository({ hasRepository: true })); |
|||
} |
|||
); |
|||
} |
|||
|
|||
delete(formDirective: FormGroupDirective): void { |
|||
this.dialogService.confirm( |
|||
this.translate.instant('admin.delete-repository-settings-title', ), |
|||
this.translate.instant('admin.delete-repository-settings-text'), null, |
|||
this.translate.instant('action.delete') |
|||
).subscribe((data) => { |
|||
if (data) { |
|||
this.adminService.deleteRepositorySettings().subscribe( |
|||
() => { |
|||
this.settings = null; |
|||
this.showChangePassword = false; |
|||
this.changePassword = false; |
|||
this.showChangePrivateKeyPassword = false; |
|||
this.changePrivateKeyPassword = false; |
|||
formDirective.resetForm(); |
|||
this.repositorySettingsForm.reset({ defaultBranch: 'main', authMethod: RepositoryAuthMethod.USERNAME_PASSWORD }); |
|||
this.updateValidators(false); |
|||
this.store.dispatch(new ActionAuthUpdateHasRepository({ hasRepository: false })); |
|||
} |
|||
); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
changePasswordChanged() { |
|||
if (this.changePassword) { |
|||
this.repositorySettingsForm.get('password').patchValue(''); |
|||
this.repositorySettingsForm.get('password').markAsDirty(); |
|||
} |
|||
this.updateValidators(false); |
|||
} |
|||
|
|||
changePrivateKeyPasswordChanged() { |
|||
if (this.changePrivateKeyPassword) { |
|||
this.repositorySettingsForm.get('privateKeyPassword').patchValue(''); |
|||
this.repositorySettingsForm.get('privateKeyPassword').markAsDirty(); |
|||
} |
|||
this.updateValidators(false); |
|||
} |
|||
|
|||
updateValidators(emitEvent?: boolean): void { |
|||
const authMethod: RepositoryAuthMethod = this.repositorySettingsForm.get('authMethod').value; |
|||
const privateKeyFileName: string = this.repositorySettingsForm.get('privateKeyFileName').value; |
|||
if (authMethod === RepositoryAuthMethod.USERNAME_PASSWORD) { |
|||
this.repositorySettingsForm.get('username').enable({emitEvent}); |
|||
if (this.changePassword || !this.showChangePassword) { |
|||
this.repositorySettingsForm.get('password').enable({emitEvent}); |
|||
} else { |
|||
this.repositorySettingsForm.get('password').disable({emitEvent}); |
|||
} |
|||
this.repositorySettingsForm.get('privateKeyFileName').disable({emitEvent}); |
|||
this.repositorySettingsForm.get('privateKey').disable({emitEvent}); |
|||
this.repositorySettingsForm.get('privateKeyPassword').disable({emitEvent}); |
|||
} else { |
|||
this.repositorySettingsForm.get('username').disable({emitEvent}); |
|||
this.repositorySettingsForm.get('password').disable({emitEvent}); |
|||
this.repositorySettingsForm.get('privateKeyFileName').enable({emitEvent}); |
|||
this.repositorySettingsForm.get('privateKey').enable({emitEvent}); |
|||
if (this.changePrivateKeyPassword || !this.showChangePrivateKeyPassword) { |
|||
this.repositorySettingsForm.get('privateKeyPassword').enable({emitEvent}); |
|||
} else { |
|||
this.repositorySettingsForm.get('privateKeyPassword').disable({emitEvent}); |
|||
} |
|||
if (isNotEmptyStr(privateKeyFileName)) { |
|||
this.repositorySettingsForm.get('privateKey').clearValidators(); |
|||
} else { |
|||
this.repositorySettingsForm.get('privateKey').setValidators([Validators.required]); |
|||
} |
|||
} |
|||
this.repositorySettingsForm.get('username').updateValueAndValidity({emitEvent: false}); |
|||
this.repositorySettingsForm.get('password').updateValueAndValidity({emitEvent: false}); |
|||
this.repositorySettingsForm.get('privateKeyFileName').updateValueAndValidity({emitEvent: false}); |
|||
this.repositorySettingsForm.get('privateKey').updateValueAndValidity({emitEvent: false}); |
|||
this.repositorySettingsForm.get('privateKeyPassword').updateValueAndValidity({emitEvent: false}); |
|||
} |
|||
|
|||
} |
|||
@ -1,218 +0,0 @@ |
|||
///
|
|||
/// Copyright © 2016-2022 The Thingsboard Authors
|
|||
///
|
|||
/// Licensed under the Apache License, Version 2.0 (the "License");
|
|||
/// you may not use this file except in compliance with the License.
|
|||
/// You may obtain a copy of the License at
|
|||
///
|
|||
/// http://www.apache.org/licenses/LICENSE-2.0
|
|||
///
|
|||
/// Unless required by applicable law or agreed to in writing, software
|
|||
/// distributed under the License is distributed on an "AS IS" BASIS,
|
|||
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
/// See the License for the specific language governing permissions and
|
|||
/// limitations under the License.
|
|||
///
|
|||
|
|||
import { Component, Input, OnInit } from '@angular/core'; |
|||
import { PageComponent } from '@shared/components/page.component'; |
|||
import { HasConfirmForm } from '@core/guards/confirm-on-exit.guard'; |
|||
import { FormBuilder, FormGroup, FormGroupDirective, Validators } from '@angular/forms'; |
|||
import { select, Store } from '@ngrx/store'; |
|||
import { AppState } from '@core/core.state'; |
|||
import { AdminService } from '@core/http/admin.service'; |
|||
import { |
|||
EntitiesVersionControlSettings, |
|||
VersionControlAuthMethod, |
|||
versionControlAuthMethodTranslationMap |
|||
} from '@shared/models/settings.models'; |
|||
import { ActionNotificationShow } from '@core/notification/notification.actions'; |
|||
import { TranslateService } from '@ngx-translate/core'; |
|||
import { isNotEmptyStr } from '@core/utils'; |
|||
import { DialogService } from '@core/services/dialog.service'; |
|||
import { ActionSettingsChangeLanguage } from '@core/settings/settings.actions'; |
|||
import { ActionAuthUpdateHasVersionControl } from '@core/auth/auth.actions'; |
|||
import { selectHasVersionControl } from '@core/auth/auth.selectors'; |
|||
import { catchError, mergeMap, take } from 'rxjs/operators'; |
|||
import { of } from 'rxjs'; |
|||
|
|||
@Component({ |
|||
selector: 'tb-version-control-settings', |
|||
templateUrl: './version-control-settings.component.html', |
|||
styleUrls: ['./version-control-settings.component.scss', './../../pages/admin/settings-card.scss'] |
|||
}) |
|||
export class VersionControlSettingsComponent extends PageComponent implements OnInit { |
|||
|
|||
@Input() |
|||
detailsMode = false; |
|||
|
|||
versionControlSettingsForm: FormGroup; |
|||
settings: EntitiesVersionControlSettings = null; |
|||
|
|||
versionControlAuthMethod = VersionControlAuthMethod; |
|||
versionControlAuthMethods = Object.values(VersionControlAuthMethod); |
|||
versionControlAuthMethodTranslations = versionControlAuthMethodTranslationMap; |
|||
|
|||
showChangePassword = false; |
|||
changePassword = false; |
|||
|
|||
showChangePrivateKeyPassword = false; |
|||
changePrivateKeyPassword = false; |
|||
|
|||
constructor(protected store: Store<AppState>, |
|||
private adminService: AdminService, |
|||
private dialogService: DialogService, |
|||
private translate: TranslateService, |
|||
public fb: FormBuilder) { |
|||
super(store); |
|||
} |
|||
|
|||
ngOnInit() { |
|||
this.versionControlSettingsForm = this.fb.group({ |
|||
repositoryUri: [null, [Validators.required]], |
|||
defaultBranch: ['main', []], |
|||
authMethod: [VersionControlAuthMethod.USERNAME_PASSWORD, [Validators.required]], |
|||
username: [null, []], |
|||
password: [null, []], |
|||
privateKeyFileName: [null, [Validators.required]], |
|||
privateKey: [null, []], |
|||
privateKeyPassword: [null, []] |
|||
}); |
|||
this.updateValidators(false); |
|||
this.versionControlSettingsForm.get('authMethod').valueChanges.subscribe(() => { |
|||
this.updateValidators(true); |
|||
}); |
|||
this.versionControlSettingsForm.get('privateKeyFileName').valueChanges.subscribe(() => { |
|||
this.updateValidators(false); |
|||
}); |
|||
this.store.pipe( |
|||
select(selectHasVersionControl), |
|||
take(1), |
|||
mergeMap((hasVersionControl) => { |
|||
if (hasVersionControl) { |
|||
return this.adminService.getEntitiesVersionControlSettings({ignoreErrors: true}).pipe( |
|||
catchError(() => of(null)) |
|||
); |
|||
} else { |
|||
return of(null); |
|||
} |
|||
}) |
|||
).subscribe( |
|||
(settings) => { |
|||
this.settings = settings; |
|||
if (this.settings != null) { |
|||
if (this.settings.authMethod === VersionControlAuthMethod.USERNAME_PASSWORD) { |
|||
this.showChangePassword = true; |
|||
} else { |
|||
this.showChangePrivateKeyPassword = true; |
|||
} |
|||
this.versionControlSettingsForm.reset(this.settings); |
|||
this.updateValidators(false); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
checkAccess(): void { |
|||
const settings: EntitiesVersionControlSettings = this.versionControlSettingsForm.value; |
|||
this.adminService.checkVersionControlAccess(settings).subscribe(() => { |
|||
this.store.dispatch(new ActionNotificationShow({ message: this.translate.instant('admin.check-vc-access-success'), |
|||
type: 'success' })); |
|||
}); |
|||
} |
|||
|
|||
save(): void { |
|||
const settings: EntitiesVersionControlSettings = this.versionControlSettingsForm.value; |
|||
this.adminService.saveEntitiesVersionControlSettings(settings).subscribe( |
|||
(savedSettings) => { |
|||
this.settings = savedSettings; |
|||
if (this.settings.authMethod === VersionControlAuthMethod.USERNAME_PASSWORD) { |
|||
this.showChangePassword = true; |
|||
this.changePassword = false; |
|||
} else { |
|||
this.showChangePrivateKeyPassword = true; |
|||
this.changePrivateKeyPassword = false; |
|||
} |
|||
this.versionControlSettingsForm.reset(this.settings); |
|||
this.updateValidators(false); |
|||
this.store.dispatch(new ActionAuthUpdateHasVersionControl({ hasVersionControl: true })); |
|||
} |
|||
); |
|||
} |
|||
|
|||
delete(formDirective: FormGroupDirective): void { |
|||
this.dialogService.confirm( |
|||
this.translate.instant('admin.delete-git-settings-title', ), |
|||
this.translate.instant('admin.delete-git-settings-text'), null, |
|||
this.translate.instant('action.delete') |
|||
).subscribe((data) => { |
|||
if (data) { |
|||
this.adminService.deleteEntitiesVersionControlSettings().subscribe( |
|||
() => { |
|||
this.settings = null; |
|||
this.showChangePassword = false; |
|||
this.changePassword = false; |
|||
this.showChangePrivateKeyPassword = false; |
|||
this.changePrivateKeyPassword = false; |
|||
formDirective.resetForm(); |
|||
this.versionControlSettingsForm.reset({ defaultBranch: 'main', authMethod: VersionControlAuthMethod.USERNAME_PASSWORD }); |
|||
this.updateValidators(false); |
|||
this.store.dispatch(new ActionAuthUpdateHasVersionControl({ hasVersionControl: false })); |
|||
} |
|||
); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
changePasswordChanged() { |
|||
if (this.changePassword) { |
|||
this.versionControlSettingsForm.get('password').patchValue(''); |
|||
this.versionControlSettingsForm.get('password').markAsDirty(); |
|||
} |
|||
this.updateValidators(false); |
|||
} |
|||
|
|||
changePrivateKeyPasswordChanged() { |
|||
if (this.changePrivateKeyPassword) { |
|||
this.versionControlSettingsForm.get('privateKeyPassword').patchValue(''); |
|||
this.versionControlSettingsForm.get('privateKeyPassword').markAsDirty(); |
|||
} |
|||
this.updateValidators(false); |
|||
} |
|||
|
|||
updateValidators(emitEvent?: boolean): void { |
|||
const authMethod: VersionControlAuthMethod = this.versionControlSettingsForm.get('authMethod').value; |
|||
const privateKeyFileName: string = this.versionControlSettingsForm.get('privateKeyFileName').value; |
|||
if (authMethod === VersionControlAuthMethod.USERNAME_PASSWORD) { |
|||
this.versionControlSettingsForm.get('username').enable({emitEvent}); |
|||
if (this.changePassword || !this.showChangePassword) { |
|||
this.versionControlSettingsForm.get('password').enable({emitEvent}); |
|||
} else { |
|||
this.versionControlSettingsForm.get('password').disable({emitEvent}); |
|||
} |
|||
this.versionControlSettingsForm.get('privateKeyFileName').disable({emitEvent}); |
|||
this.versionControlSettingsForm.get('privateKey').disable({emitEvent}); |
|||
this.versionControlSettingsForm.get('privateKeyPassword').disable({emitEvent}); |
|||
} else { |
|||
this.versionControlSettingsForm.get('username').disable({emitEvent}); |
|||
this.versionControlSettingsForm.get('password').disable({emitEvent}); |
|||
this.versionControlSettingsForm.get('privateKeyFileName').enable({emitEvent}); |
|||
this.versionControlSettingsForm.get('privateKey').enable({emitEvent}); |
|||
if (this.changePrivateKeyPassword || !this.showChangePrivateKeyPassword) { |
|||
this.versionControlSettingsForm.get('privateKeyPassword').enable({emitEvent}); |
|||
} else { |
|||
this.versionControlSettingsForm.get('privateKeyPassword').disable({emitEvent}); |
|||
} |
|||
if (isNotEmptyStr(privateKeyFileName)) { |
|||
this.versionControlSettingsForm.get('privateKey').clearValidators(); |
|||
} else { |
|||
this.versionControlSettingsForm.get('privateKey').setValidators([Validators.required]); |
|||
} |
|||
} |
|||
this.versionControlSettingsForm.get('username').updateValueAndValidity({emitEvent: false}); |
|||
this.versionControlSettingsForm.get('password').updateValueAndValidity({emitEvent: false}); |
|||
this.versionControlSettingsForm.get('privateKeyFileName').updateValueAndValidity({emitEvent: false}); |
|||
this.versionControlSettingsForm.get('privateKey').updateValueAndValidity({emitEvent: false}); |
|||
this.versionControlSettingsForm.get('privateKeyPassword').updateValueAndValidity({emitEvent: false}); |
|||
} |
|||
|
|||
} |
|||
Loading…
Reference in new issue