diff --git a/tools/src/main/python/license-headers/curations.json b/tools/src/main/python/license-headers/curations.json index d2cc8e8281..1eea613304 100644 --- a/tools/src/main/python/license-headers/curations.json +++ b/tools/src/main/python/license-headers/curations.json @@ -1247,7 +1247,7 @@ "path": "ui-ngx/src/app/modules/home/components/converter/converter-dialog.component.html", "header": "busl", "reason": "PE view template converter-dialog.component.html. Reviewed form fields, bindings and entity/component selection implement the PE feature; the candidate shares standard Material dialog/form/tab scaffolding rather than a CE feature implementation. Reviewed CE candidate ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 955f8f58be2d9d462570164005f4a2ee693b0dd7).", - "contentHash": "sha256:845e3846f9f41be29dc209df6c28c8870c3886886018155735affb0c49c5a9f9" + "contentHash": "sha256:d66640c8359f2341173ab63f009062a7b6382c58c4677ff754024a5fa2534c95" }, { "path": "ui-ngx/src/app/modules/home/components/converter/converter-test-dialog.component.scss", diff --git a/ui-ngx/src/app/modules/home/components/converter/converter-dialog.component.html b/ui-ngx/src/app/modules/home/components/converter/converter-dialog.component.html index 3e8820dcc7..40964cfeca 100644 --- a/ui-ngx/src/app/modules/home/components/converter/converter-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/converter/converter-dialog.component.html @@ -25,7 +25,8 @@ + [isEdit]="true" + [converterName]="converterName">
diff --git a/ui-ngx/src/app/modules/home/components/converter/converter-dialog.component.ts b/ui-ngx/src/app/modules/home/components/converter/converter-dialog.component.ts index caccd781a0..898f7feffe 100644 --- a/ui-ngx/src/app/modules/home/components/converter/converter-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/converter/converter-dialog.component.ts @@ -39,6 +39,7 @@ export class ConverterDialogComponent extends DialogComponent implements On } this.updateForm(converter, false); } else { - this.entityForm.get('name').patchValue('', {emitEvent: false}); + this.entityForm.get('name').patchValue(this.predefinedConverterName ?? '', {emitEvent: false}); } } diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.html b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.html index 936eaf624a..0a153045f3 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.html @@ -11,11 +11,33 @@
{{ data.update.converter.name }}
@if (data.usedBy.length) { {{ 'iot-hub.device-update-shared' | translate }} - +
+ @if (usedByHidden.length) { + + } } @if (data.modified) { diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.scss b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.scss index ae19cef879..926023ed3b 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.scss +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.scss @@ -43,6 +43,38 @@ color: rgba(0, 0, 0, 0.54); } +// Material expansion-panel timing +.tb-converter-update-more { + display: grid; + grid-template-rows: 0fr; + transition: grid-template-rows 225ms cubic-bezier(0.4, 0, 0.2, 1); + > ul { + overflow: hidden; + min-height: 0; + } + &.expanded { + grid-template-rows: 1fr; + } + @media (prefers-reduced-motion: reduce) { + transition: none; + } +} + +.tb-converter-update-toggle { + padding: 0; + border: none; + background: none; + font-size: 12px; + font-weight: 500; + line-height: 16px; + color: var(--tb-primary-500); + cursor: pointer; + &:hover, + &:focus-visible { + text-decoration: underline; + } +} + .tb-converter-update-link { color: #305680; text-decoration: underline; diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.ts b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.ts index 3db43abe6f..b33d11b2b6 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.ts @@ -21,6 +21,8 @@ export interface IotHubConverterUpdateDialogData { usedBy: string[]; } +const USED_BY_SHOWN = 3; + /** * Brings an installed device package's default converter to ThingsBoard's default converter now, without a new version of * the package. Closes with true once it is updated. @@ -34,6 +36,9 @@ export interface IotHubConverterUpdateDialogData { export class TbIotHubConverterUpdateDialogComponent extends DialogComponent { readonly modifiedHint = splitTextWithLink(this.translate.instant('iot-hub.device-update-modified')); + readonly usedByShown: string[]; + readonly usedByHidden: string[]; + usedByExpanded = false; updating = false; errorMessage: string | null = null; @@ -46,6 +51,10 @@ export class TbIotHubConverterUpdateDialogComponent extends DialogComponent