diff --git a/ui-ngx/src/app/modules/home/components/device/device-credentials-mqtt-basic.component.html b/ui-ngx/src/app/modules/home/components/device/device-credentials-mqtt-basic.component.html index 0b798e6dbf..126177ba11 100644 --- a/ui-ngx/src/app/modules/home/components/device/device-credentials-mqtt-basic.component.html +++ b/ui-ngx/src/app/modules/home/components/device/device-credentials-mqtt-basic.component.html @@ -35,12 +35,8 @@ - + type="password"> + admin.aws-secret-access-key + {{ 'admin.aws-secret-access-key-required' | translate }} diff --git a/ui-ngx/src/app/modules/home/components/sms/twilio-sms-provider-configuration.component.html b/ui-ngx/src/app/modules/home/components/sms/twilio-sms-provider-configuration.component.html index 3af73e8932..d636ddffc0 100644 --- a/ui-ngx/src/app/modules/home/components/sms/twilio-sms-provider-configuration.component.html +++ b/ui-ngx/src/app/modules/home/components/sms/twilio-sms-provider-configuration.component.html @@ -37,6 +37,7 @@ admin.twilio-account-token + {{ 'admin.twilio-account-token-required' | translate }} diff --git a/ui-ngx/src/app/modules/home/pages/admin/mail-server.component.html b/ui-ngx/src/app/modules/home/pages/admin/mail-server.component.html index 1809e28b0a..1c66d02275 100644 --- a/ui-ngx/src/app/modules/home/pages/admin/mail-server.component.html +++ b/ui-ngx/src/app/modules/home/pages/admin/mail-server.component.html @@ -119,6 +119,7 @@ admin.proxy-password + @@ -130,6 +131,7 @@ common.password +
diff --git a/ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.ts b/ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.ts index bf5dc75023..61e001e75b 100644 --- a/ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.ts +++ b/ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.ts @@ -98,9 +98,9 @@ export class OAuth2SettingsComponent extends PageComponent implements OnInit, Ha mapperConfigType = MapperConfigType; mapperConfigTypes = Object.keys(MapperConfigType); tenantNameStrategies = Object.keys(TenantNameStrategy); - protocols = Object.keys(DomainSchema); + protocols = Object.values(DomainSchema); domainSchemaTranslations = domainSchemaTranslations; - platformTypes = Object.keys(PlatformType); + platformTypes = Object.values(PlatformType); platformTypeTranslations = platformTypeTranslations; templateProvider = ['Custom']; diff --git a/ui-ngx/src/app/modules/home/pages/profile/change-password-dialog.component.html b/ui-ngx/src/app/modules/home/pages/profile/change-password-dialog.component.html index 8810956a63..aac4c7b045 100644 --- a/ui-ngx/src/app/modules/home/pages/profile/change-password-dialog.component.html +++ b/ui-ngx/src/app/modules/home/pages/profile/change-password-dialog.component.html @@ -33,16 +33,19 @@ profile.current-password lock +
login.new-password lock + login.new-password-again lock +
diff --git a/ui-ngx/src/app/modules/login/pages/login/create-password.component.html b/ui-ngx/src/app/modules/login/pages/login/create-password.component.html index 30c8823149..778bb0e409 100644 --- a/ui-ngx/src/app/modules/login/pages/login/create-password.component.html +++ b/ui-ngx/src/app/modules/login/pages/login/create-password.component.html @@ -32,11 +32,13 @@ common.password lock + login.password-again lock +
diff --git a/ui-ngx/src/app/modules/login/pages/login/login.component.html b/ui-ngx/src/app/modules/login/pages/login/login.component.html index 3fbd055da0..3a475467b6 100644 --- a/ui-ngx/src/app/modules/login/pages/login/login.component.html +++ b/ui-ngx/src/app/modules/login/pages/login/login.component.html @@ -51,12 +51,8 @@ common.password - - + + lock
diff --git a/ui-ngx/src/app/modules/login/pages/login/login.component.ts b/ui-ngx/src/app/modules/login/pages/login/login.component.ts index de66448c73..2526cfe376 100644 --- a/ui-ngx/src/app/modules/login/pages/login/login.component.ts +++ b/ui-ngx/src/app/modules/login/pages/login/login.component.ts @@ -37,8 +37,7 @@ export class LoginComponent extends PageComponent implements OnInit { password: '' }); oauth2Clients: Array = null; - hidePassword = true; - + constructor(protected store: Store, private authService: AuthService, public fb: FormBuilder, diff --git a/ui-ngx/src/app/modules/login/pages/login/reset-password.component.html b/ui-ngx/src/app/modules/login/pages/login/reset-password.component.html index 3e1923ef37..59d03d7a9a 100644 --- a/ui-ngx/src/app/modules/login/pages/login/reset-password.component.html +++ b/ui-ngx/src/app/modules/login/pages/login/reset-password.component.html @@ -35,11 +35,13 @@ login.new-password lock + login.new-password-again lock +
diff --git a/ui-ngx/src/app/shared/components/button/toggle-password.component.html b/ui-ngx/src/app/shared/components/button/toggle-password.component.html new file mode 100644 index 0000000000..0f3843f65d --- /dev/null +++ b/ui-ngx/src/app/shared/components/button/toggle-password.component.html @@ -0,0 +1,20 @@ + + diff --git a/ui-ngx/src/app/shared/components/button/toggle-password.component.ts b/ui-ngx/src/app/shared/components/button/toggle-password.component.ts new file mode 100644 index 0000000000..a4c4bb9aec --- /dev/null +++ b/ui-ngx/src/app/shared/components/button/toggle-password.component.ts @@ -0,0 +1,44 @@ +/// +/// Copyright © 2016-2021 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 { AfterViewInit, Component, ElementRef } from '@angular/core'; + +@Component({ + selector: 'tb-toggle-password', + templateUrl: 'toggle-password.component.html', + styleUrls: [], +}) +export class TogglePasswordComponent implements AfterViewInit { + showPassword = false; + hideToggle = false; + private input: HTMLInputElement = null; + + constructor(private hostElement: ElementRef) { } + + togglePassword($event: Event) { + $event.stopPropagation(); + $event.preventDefault(); + this.showPassword = !this.showPassword; + this.input.type = this.showPassword ? 'text' : 'password'; + } + + ngAfterViewInit() { + this.input = this.hostElement.nativeElement.closest('mat-form-field').querySelector('input[type="password"]'); + if (this.input === null) { + this.hideToggle = true; + } + } +} diff --git a/ui-ngx/src/app/shared/shared.module.ts b/ui-ngx/src/app/shared/shared.module.ts index f2bcdc97a4..02c5824807 100644 --- a/ui-ngx/src/app/shared/shared.module.ts +++ b/ui-ngx/src/app/shared/shared.module.ts @@ -144,6 +144,7 @@ import { QuickTimeIntervalComponent } from '@shared/components/time/quick-time-i import { OtaPackageAutocompleteComponent } from '@shared/components/ota-package/ota-package-autocomplete.component'; import { MAT_DATE_LOCALE } from '@angular/material/core'; import { CopyButtonComponent } from '@shared/components/button/copy-button.component'; +import { TogglePasswordComponent } from '@shared/components/button/toggle-password.component'; @NgModule({ providers: [ @@ -242,7 +243,8 @@ import { CopyButtonComponent } from '@shared/components/button/copy-button.compo ContactComponent, OtaPackageAutocompleteComponent, WidgetsBundleSearchComponent, - CopyButtonComponent + CopyButtonComponent, + TogglePasswordComponent ], imports: [ CommonModule, @@ -415,7 +417,8 @@ import { CopyButtonComponent } from '@shared/components/button/copy-button.compo ContactComponent, OtaPackageAutocompleteComponent, WidgetsBundleSearchComponent, - CopyButtonComponent + CopyButtonComponent, + TogglePasswordComponent ] }) export class SharedModule { }