Browse Source

style(iot-hub): close the formatting left behind by the layout and grouping changes

The results container kept its old indentation after being wrapped in
.tb-search-layout, so it read as a sibling of the wrapper and the two closing tags
lined up at the same depth while closing different elements. The popup's @for sat in
an ng-container carrying no directive. Removing the -compact rule left a blank line
before the closing brace in four places.
pull/16148/head
dshvaika 2 months ago
parent
commit
2d72735070
  1. 80
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.html
  2. 4
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.scss
  3. 48
      ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.html

80
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.html

@ -142,48 +142,48 @@
</aside>
}
<div class="tb-results-container">
<!-- Error -->
@if (hasError) {
<div class="tb-search-empty flex flex-col items-center py-10">
<div class="tb-no-service-bg"></div>
<h3>{{ 'iot-hub.network-server-unavailable' | translate }}</h3>
<p>{{ 'iot-hub.network-server-unavailable-text' | translate }}</p>
<button mat-flat-button color="primary" (click)="retryLoadResults()">
{{ 'iot-hub.try-again' | translate }}
</button>
</div>
}
<div class="tb-results-container">
<!-- Error -->
@if (hasError) {
<div class="tb-search-empty flex flex-col items-center py-10">
<div class="tb-no-service-bg"></div>
<h3>{{ 'iot-hub.network-server-unavailable' | translate }}</h3>
<p>{{ 'iot-hub.network-server-unavailable-text' | translate }}</p>
<button mat-flat-button color="primary" (click)="retryLoadResults()">
{{ 'iot-hub.try-again' | translate }}
</button>
</div>
}
<!-- No results -->
@if (!hasError && totalElements === 0 && searchText?.trim()) {
<div class="tb-search-empty flex flex-col items-center py-10">
<div class="tb-no-data-bg"></div>
<h3>{{ 'iot-hub.no-items-found' | translate }}</h3>
<p>{{ 'iot-hub.try-adjusting-search' | translate }}</p>
</div>
}
<!-- No results -->
@if (!hasError && totalElements === 0 && searchText?.trim()) {
<div class="tb-search-empty flex flex-col items-center py-10">
<div class="tb-no-data-bg"></div>
<h3>{{ 'iot-hub.no-items-found' | translate }}</h3>
<p>{{ 'iot-hub.try-adjusting-search' | translate }}</p>
</div>
}
<!-- Results -->
@if (results.length > 0) {
<div class="tb-search-card-grid">
@for (item of results; track item.id) {
<tb-iot-hub-item-card
layout="preview"
[item]="item"
[installedItem]="getInstalledItem(item)"
[installedItemsCount]="getInstalledItemsCount(item)"
[showCreator]="showCreator"
(cardClick)="openItemDetail($event)"
(creatorClick)="navigateToCreator($event)"
(installClick)="installItem($event)"
(updateClick)="updateItem($event)"
(deleteClick)="deleteInstalledItem($event)">
</tb-iot-hub-item-card>
}
</div>
}
</div>
<!-- Results -->
@if (results.length > 0) {
<div class="tb-search-card-grid">
@for (item of results; track item.id) {
<tb-iot-hub-item-card
layout="preview"
[item]="item"
[installedItem]="getInstalledItem(item)"
[installedItemsCount]="getInstalledItemsCount(item)"
[showCreator]="showCreator"
(cardClick)="openItemDetail($event)"
(creatorClick)="navigateToCreator($event)"
(installClick)="installItem($event)"
(updateClick)="updateItem($event)"
(deleteClick)="deleteInstalledItem($event)">
</tb-iot-hub-item-card>
}
</div>
}
</div>
</div>
<!-- Loading -->

4
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.scss

@ -279,21 +279,18 @@
@media #{$mat-gt-xxl} {
.tb-search-card-grid {
grid-template-columns: repeat(6, 1fr);
}
}
@media #{$mat-lt-xl} {
.tb-search-card-grid {
grid-template-columns: repeat(4, 1fr);
}
}
@media #{$mat-lt-xmd} {
.tb-search-card-grid {
grid-template-columns: repeat(3, 1fr);
}
}
@ -316,7 +313,6 @@
.tb-search-card-grid {
grid-template-columns: repeat(2, 1fr);
}
}

48
ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.html

@ -97,32 +97,30 @@
</span>
}
</span>
<ng-container>
@for (item of group.items; track item.id) {
<mat-option [value]="searchText" (click)="openItemDetail(item)">
@if (isCompactType(item.type)) {
<div class="tb-search-popup-icon-square" [style.background]="item.color || '#048ad3'">
<tb-icon class="tb-search-popup-icon-inner">{{ getCompactIcon(item) }}</tb-icon>
</div>
} @else {
<div class="tb-search-popup-thumbnail">
@if (getItemImage(item); as imgUrl) {
<img [src]="imgUrl" alt="">
} @else {
<tb-icon class="tb-search-popup-thumb-placeholder">{{ getItemTypeIcon(item.type) }}</tb-icon>
}
</div>
}
<div class="tb-search-popup-text">
<span class="tb-search-popup-name">{{ item.name }}</span>
<span class="tb-search-popup-author">
<mat-icon>person</mat-icon>
{{ item.creatorDisplayName }}
</span>
@for (item of group.items; track item.id) {
<mat-option [value]="searchText" (click)="openItemDetail(item)">
@if (isCompactType(item.type)) {
<div class="tb-search-popup-icon-square" [style.background]="item.color || '#048ad3'">
<tb-icon class="tb-search-popup-icon-inner">{{ getCompactIcon(item) }}</tb-icon>
</div>
</mat-option>
}
</ng-container>
} @else {
<div class="tb-search-popup-thumbnail">
@if (getItemImage(item); as imgUrl) {
<img [src]="imgUrl" alt="">
} @else {
<tb-icon class="tb-search-popup-thumb-placeholder">{{ getItemTypeIcon(item.type) }}</tb-icon>
}
</div>
}
<div class="tb-search-popup-text">
<span class="tb-search-popup-name">{{ item.name }}</span>
<span class="tb-search-popup-author">
<mat-icon>person</mat-icon>
{{ item.creatorDisplayName }}
</span>
</div>
</mat-option>
}
</mat-optgroup>
}
}

Loading…
Cancel
Save