From 21379a1d3da8bee8833e1df9c785ba392c52ff23 Mon Sep 17 00:00:00 2001 From: pengpengshui Date: Thu, 3 Aug 2017 18:26:33 +0800 Subject: [PATCH] fix #2889 #2892 about tooltips of self-registration and member model add button problem --- .../src/app/config/auth/config-auth.component.html | 3 ++- .../src/app/config/auth/config-auth.component.ts | 6 ++++++ .../member/add-member/add-member.component.ts | 12 +++++++++--- src/ui_ng/src/i18n/lang/en-us-lang.json | 3 ++- src/ui_ng/src/i18n/lang/es-es-lang.json | 3 ++- src/ui_ng/src/i18n/lang/zh-cn-lang.json | 3 ++- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/ui_ng/src/app/config/auth/config-auth.component.html b/src/ui_ng/src/app/config/auth/config-auth.component.html index 1a7b135a3..d982f0894 100644 --- a/src/ui_ng/src/app/config/auth/config-auth.component.html +++ b/src/ui_ng/src/app/config/auth/config-auth.component.html @@ -131,7 +131,8 @@ - {{'CONFIG.TOOLTIP.SELF_REGISTRATION' | translate}} + {{'CONFIG.TOOLTIP.SELF_REGISTRATION_ENABLE' | translate}} + {{'CONFIG.TOOLTIP.SELF_REGISTRATION_DISABLE' | translate}} diff --git a/src/ui_ng/src/app/config/auth/config-auth.component.ts b/src/ui_ng/src/app/config/auth/config-auth.component.ts index b2a053dda..37a9afb6e 100644 --- a/src/ui_ng/src/app/config/auth/config-auth.component.ts +++ b/src/ui_ng/src/app/config/auth/config-auth.component.ts @@ -28,6 +28,12 @@ export class ConfigurationAuthComponent { @ViewChild("authConfigFrom") authForm: NgForm; + get checkboxenable(){ + return this.currentConfig && + this.currentConfig.self_registration && + this.currentConfig.self_registration.value === true; + } + constructor() { } public get showLdap(): boolean { diff --git a/src/ui_ng/src/app/project/member/add-member/add-member.component.ts b/src/ui_ng/src/app/project/member/add-member/add-member.component.ts index 335358f49..e62b6883f 100644 --- a/src/ui_ng/src/app/project/member/add-member/add-member.component.ts +++ b/src/ui_ng/src/app/project/member/add-member/add-member.component.ts @@ -19,7 +19,7 @@ import { ViewChild, AfterViewChecked, OnInit, - OnDestroy + OnDestroy, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'; import { Response } from '@angular/http'; import { NgForm } from '@angular/forms'; @@ -40,7 +40,8 @@ import 'rxjs/add/operator/distinctUntilChanged'; @Component({ selector: 'add-member', templateUrl: 'add-member.component.html', - styleUrls: ['add-member.component.css'] + styleUrls: ['add-member.component.css'], + changeDetection: ChangeDetectionStrategy.OnPush }) export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy { @@ -71,7 +72,8 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy { constructor(private memberService: MemberService, private messageHandlerService: MessageHandlerService, - private translateService: TranslateService) { } + private translateService: TranslateService, + private ref: ChangeDetectorRef) { } ngOnInit(): void { this.nameChecker @@ -140,6 +142,10 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy { } } ); + + setTimeout(() => { + setInterval(() => this.ref.markForCheck(), 100); + }, 1000); } onCancel() { diff --git a/src/ui_ng/src/i18n/lang/en-us-lang.json b/src/ui_ng/src/i18n/lang/en-us-lang.json index 040f8e6b7..e72c8bc1d 100644 --- a/src/ui_ng/src/i18n/lang/en-us-lang.json +++ b/src/ui_ng/src/i18n/lang/en-us-lang.json @@ -391,7 +391,8 @@ "ROOT_CERT": "Registry Root Certificate", "ROOT_CERT_LINK": "Download", "TOOLTIP": { - "SELF_REGISTRATION": "Enable sign up.", + "SELF_REGISTRATION_ENABLE": "Enable sign up.", + "SELF_REGISTRATION_DISABLE": "Disable sign up.", "VERIFY_REMOTE_CERT": "Determine whether the image replication should verify the certificate of a remote Harbor registry. Uncheck this box when the remote registry uses a self-signed or untrusted certificate.", "AUTH_MODE": "By default the authentication mode is database, i.e. the credentials are stored in a local database. Set it to LDAP if you want to verify a user's credential against an LDAP server.", "LDAP_SEARCH_DN": "A user's DN who has the permission to search the LDAP/AD server. If your LDAP/AD server does not support anonymous search, you should configure this DN and ldap_search_pwd.", diff --git a/src/ui_ng/src/i18n/lang/es-es-lang.json b/src/ui_ng/src/i18n/lang/es-es-lang.json index 797aee325..bb3e39608 100644 --- a/src/ui_ng/src/i18n/lang/es-es-lang.json +++ b/src/ui_ng/src/i18n/lang/es-es-lang.json @@ -392,7 +392,8 @@ "ROOT_CERT": "Registro Certificado Raíz", "ROOT_CERT_LINK": "Descargar", "TOOLTIP": { - "SELF_REGISTRATION": "Activar registro.", + "SELF_REGISTRATION_ENABLE": "Activar registro.", + "SELF_REGISTRATION_DISABLE": "Disable sign up.", "VERIFY_REMOTE_CERT": "Determina si la replicación de la imagen debería verificar el certificado de un registro Harbor remoto. Desmarque esta opción cuando el registro remoto use un certificado de confianza o autofirmado.", "AUTH_MODE": "Por defecto el modo de autentificación es base de datos, es decir, las credenciales se almacenan en una base de datos local. Seleccione LDAP si quiere verificar las credenciales de usuarios a través del servidor LDAP.", "LDAP_SEARCH_DN": "Un DN de usuario que tenga permisos para buscar el servidor LDAP/AD. Si el servidor LDAP/AD no soporta búsquedas anónimas, debería configurar este DN y ldap_search_pwd.", diff --git a/src/ui_ng/src/i18n/lang/zh-cn-lang.json b/src/ui_ng/src/i18n/lang/zh-cn-lang.json index 43c12b8f5..50544b67b 100644 --- a/src/ui_ng/src/i18n/lang/zh-cn-lang.json +++ b/src/ui_ng/src/i18n/lang/zh-cn-lang.json @@ -391,7 +391,8 @@ "ROOT_CERT": "镜像库根证书", "ROOT_CERT_LINK": "下载", "TOOLTIP": { - "SELF_REGISTRATION": "激活注册功能。", + "SELF_REGISTRATION_ENABLE": "激活注册功能。", + "SELF_REGISTRATION_DISABLE": "禁用注册功能。", "VERIFY_REMOTE_CERT": "确定镜像复制是否要验证远程Harbor实例的证书。如果远程实例使用的是自签或者非信任证书,不要勾选此项。", "AUTH_MODE": "默认认证模式为数据库认证,即用户凭证存储在本地数据库。如果使用LDAP来认证用户,则设置为LDAP。", "LDAP_SEARCH_DN": "有搜索权限的LDAP用户DN。如果LDAP服务器不支持匿名搜索,则需要配置此DN及其密码。",