From b3ef639caf525992354684f8b353f5757c390159 Mon Sep 17 00:00:00 2001 From: Steven Zou Date: Tue, 28 Mar 2017 15:18:51 +0800 Subject: [PATCH 1/2] control the button status based on app config --- src/ui_ng/src/app/user/user.component.html | 2 +- src/ui_ng/src/app/user/user.component.ts | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ui_ng/src/app/user/user.component.html b/src/ui_ng/src/app/user/user.component.html index 48c1987d1..fd71f7f1f 100644 --- a/src/ui_ng/src/app/user/user.component.html +++ b/src/ui_ng/src/app/user/user.component.html @@ -2,7 +2,7 @@

{{'SIDE_NAV.SYSTEM_MGMT.USER' | translate}}

- + diff --git a/src/ui_ng/src/app/user/user.component.ts b/src/ui_ng/src/app/user/user.component.ts index 471307608..ffafc8a7d 100644 --- a/src/ui_ng/src/app/user/user.component.ts +++ b/src/ui_ng/src/app/user/user.component.ts @@ -12,6 +12,7 @@ import { ConfirmationState, ConfirmationTargets } from '../shared/shared.const' import { MessageHandlerService } from '../shared/message-handler/message-handler.service'; import { SessionService } from '../shared/session.service'; +import { AppConfigService } from '../app-config.service'; @Component({ selector: 'harbor-user', @@ -37,7 +38,8 @@ export class UserComponent implements OnInit, OnDestroy { private translate: TranslateService, private deletionDialogService: ConfirmationDialogService, private msgHandler: MessageHandlerService, - private session: SessionService) { + private session: SessionService, + private appConfigService: AppConfigService) { this.deletionSubscription = deletionDialogService.confirmationConfirm$.subscribe(confirmed => { if (confirmed && confirmed.source === ConfirmationTargets.USER && @@ -62,6 +64,15 @@ export class UserComponent implements OnInit, OnDestroy { return testedItem.indexOf(terms) != -1; } + public get canCreateUser(): boolean { + let appConfig = this.appConfigService.getConfig(); + if (appConfig) { + return appConfig.auth_mode != 'ldap_auth'; + } else { + return true; + } + } + isSystemAdmin(u: User): string { if (!u) { return "{{MISS}}"; From cd3343226450d19c7035fb6454942defcc10182f Mon Sep 17 00:00:00 2001 From: Steven Zou Date: Tue, 28 Mar 2017 18:37:03 +0800 Subject: [PATCH 2/2] fix issue 1795 --- .../account-settings-modal.component.html | 2 +- .../account-settings-modal.component.ts | 10 +++------- .../password/password-setting.component.html | 2 +- .../app/account/sign-up/sign-up.component.html | 2 +- src/ui_ng/src/app/app-config.ts | 2 ++ .../about-dialog/about-dialog.component.html | 2 -- .../shared/about-dialog/about-dialog.component.ts | 14 +++++++++++--- .../inline-alert/inline-alert.component.css | 4 ++++ .../inline-alert/inline-alert.component.html | 3 ++- .../shared/inline-alert/inline-alert.component.ts | 15 ++++++++++++--- .../statictics/statistics-panel.component.html | 4 ++-- .../statictics/statistics-panel.component.ts | 5 ++++- .../shared/statictics/statistics.component.css | 5 +++-- .../src/app/user/new-user-modal.component.html | 2 +- 14 files changed, 47 insertions(+), 25 deletions(-) create mode 100644 src/ui_ng/src/app/shared/inline-alert/inline-alert.component.css diff --git a/src/ui_ng/src/app/account/account-settings/account-settings-modal.component.html b/src/ui_ng/src/app/account/account-settings/account-settings-modal.component.html index 556a1bc59..820b6a792 100644 --- a/src/ui_ng/src/app/account/account-settings/account-settings-modal.component.html +++ b/src/ui_ng/src/app/account/account-settings/account-settings-modal.component.html @@ -1,4 +1,4 @@ - +