From bb453f9b051009dca28cac1e8882369fc3903fbd Mon Sep 17 00:00:00 2001 From: Shvaika Dmytro Date: Fri, 13 Nov 2026 14:38:45 +0200 Subject: [PATCH 1/2] IoT Hub: shorter package list in the default converter update dialog (#16652) * IoT Hub: the default converter update dialog shows the first three packages that use the converter, the rest on request * IoT Hub: the rest of the packages slide open in the default converter update dialog * IoT Hub: the converter update dialog hides at least two packages, says "and N more", and its toggle reads as a link * IoT Hub: the converter update dialog's class comment stays on the class * IoT Hub: converter update dialog cleanup (self-start class, trim comments) --------- Co-authored-by: Vladyslav_Prykhodko --- ...hub-converter-update-dialog.component.html | 30 ++++++++++++++--- ...hub-converter-update-dialog.component.scss | 32 +++++++++++++++++++ ...t-hub-converter-update-dialog.component.ts | 9 ++++++ .../assets/locale/locale.constant-en_US.json | 2 ++ 4 files changed, 69 insertions(+), 4 deletions(-) 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