From 79a0a06dcb8039e7b1cd9c5926c55893b7392c1f Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Wed, 3 May 2023 13:52:22 +0300 Subject: [PATCH 1/4] UI: Added action copy and generate for device credentials --- ...vice-credentials-mqtt-basic.component.html | 57 +++++++++++++++++++ ...device-credentials-mqtt-basic.component.ts | 6 +- .../device/device-credentials.component.html | 18 ++++++ .../admin/oauth2-settings.component.html | 3 + .../button/copy-button.component.html | 1 + .../button/copy-button.component.scss | 13 +++-- .../button/copy-button.component.ts | 5 ++ .../assets/locale/locale.constant-en_US.json | 8 +++ 8 files changed, 105 insertions(+), 6 deletions(-) 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 4025e34dda..03b0f7a28b 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 @@ -19,6 +19,25 @@ device.client-id + + + {{ 'device.client-id-pattern' | translate }} @@ -26,6 +45,25 @@ device.user-name + + + {{ 'device.user-name-required' | translate }} @@ -37,6 +75,25 @@ (ngModelChange)="passwordChanged()" type="password"> + + + device.access-token + + {{ 'device.access-token-required' | translate }} @@ -41,6 +50,15 @@ device.certificate-pem-format + + {{ 'device.certificate-pem-format-required' | translate }} diff --git a/ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.html b/ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.html index fb78ba0b97..00492970dc 100644 --- a/ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.html +++ b/ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.html @@ -95,6 +95,7 @@ Date: Wed, 3 May 2023 15:59:31 +0300 Subject: [PATCH 3/4] UI: Refactoring --- ...vice-credentials-mqtt-basic.component.html | 65 ++++++++++--------- ...device-credentials-mqtt-basic.component.ts | 2 +- .../device/device-credentials.component.html | 23 +++---- .../device/device-credentials.component.ts | 2 +- .../admin/oauth2-settings.component.html | 6 +- .../button/copy-button.component.html | 2 +- .../button/copy-button.component.scss | 2 +- .../button/copy-button.component.ts | 3 +- 8 files changed, 56 insertions(+), 49 deletions(-) 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 03b0f7a28b..692289b753 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 @@ -26,18 +26,19 @@ matTooltip="{{ 'device.generate-client-id' | translate }}" matTooltipPosition="above" (click)="generate('clientId')" - *ngIf="!deviceCredentialsMqttFormGroup.get('clientId').value"> + *ngIf="!deviceCredentialsMqttFormGroup.get('clientId').value; else copyClientId"> autorenew - - + + + + {{ 'device.client-id-pattern' | translate }} @@ -52,18 +53,20 @@ matTooltip="{{ 'device.generate-user-name' | translate }}" matTooltipPosition="above" (click)="generate('userName')" - *ngIf="!deviceCredentialsMqttFormGroup.get('userName').value"> + *ngIf="!deviceCredentialsMqttFormGroup.get('userName').value; else copyUserName"> autorenew - - + + + + {{ 'device.user-name-required' | translate }} @@ -82,18 +85,20 @@ matTooltip="{{ 'device.generate-password' | translate }}" matTooltipPosition="above" (click)="generate('password')" - *ngIf="!deviceCredentialsMqttFormGroup.get('password').value"> + *ngIf="!deviceCredentialsMqttFormGroup.get('password').value; else copyPassword"> autorenew - - + + + + + *ngIf="!deviceCredentialsFormGroup.get('credentialsId').value; else copyAccessToken"> autorenew - - + + + + {{ 'device.access-token-required' | translate }} @@ -62,7 +63,7 @@