Browse Source

fix(iot-hub): mobile detail-dialog stacks preview+description, hero shrinks on lt-sm, device install URL falls back to first created device

Detail dialog non-CF/RC layout stacks the preview and description on lt-md instead of overflowing horizontally. Hero cluster moves up to 15% and title drops to 28px on the smallest viewport. getInstalledItemUrl for DEVICE descriptors now falls back to the first DEVICE entry in createdEntityIds when dashboardId is missing, so single-device packages still resolve to an entity URL.
pull/15842/head
Igor Kulikov 4 months ago
parent
commit
78cfbf4b32
  1. 2
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.html
  2. 8
      ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.scss
  3. 12
      ui-ngx/src/app/shared/models/iot-hub/iot-hub-installed-item.models.ts

2
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.html

@ -96,7 +96,7 @@
</div> </div>
} @else { } @else {
<!-- Widget/Dashboard/Solution: image + description side by side --> <!-- Widget/Dashboard/Solution: image + description side by side -->
<div class="flex gap-6"> <div class="flex gap-6 lt-md:flex-col">
<div class="dlg-preview" <div class="dlg-preview"
[class.dlg-preview-carousel]="item.type === ItemType.SOLUTION_TEMPLATE && carouselImages.length > 1"> [class.dlg-preview-carousel]="item.type === ItemType.SOLUTION_TEMPLATE && carouselImages.length > 1">
@if (item.type === ItemType.SOLUTION_TEMPLATE && carouselImages.length > 1) { @if (item.type === ItemType.SOLUTION_TEMPLATE && carouselImages.length > 1) {

8
ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.scss

@ -757,6 +757,14 @@
padding: 140px 16px 40px; padding: 140px 16px 40px;
} }
.tb-iot-hub-hero-cluster {
top: 15%;
}
.tb-iot-hub-hero-title {
font-size: 28px;
}
.tb-iot-hub-categories { .tb-iot-hub-categories {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }

12
ui-ngx/src/app/shared/models/iot-hub/iot-hub-installed-item.models.ts

@ -140,8 +140,16 @@ export const getInstalledItemUrl = (descriptor?: IotHubInstalledItemDescriptor):
let query: string | null = null; let query: string | null = null;
switch (descriptor.type) { switch (descriptor.type) {
case 'DEVICE': case 'DEVICE':
entityId = descriptor.dashboardId?.id; if (descriptor.dashboardId) {
entityType = EntityType.DASHBOARD; entityId = descriptor.dashboardId?.id;
entityType = EntityType.DASHBOARD;
} else if (descriptor.createdEntityIds) {
const found = descriptor.createdEntityIds.find(id => id.entityType === EntityType.DEVICE);
if (found) {
entityId = found.id;
entityType = EntityType.DEVICE;
}
}
break; break;
case 'WIDGET': case 'WIDGET':
entityId = descriptor.widgetTypeId?.id; entityId = descriptor.widgetTypeId?.id;

Loading…
Cancel
Save