Browse Source

feat(iot-hub): hide changelog section for initial releases

The IoT Hub backend sends the literal string 'Initial release' as the
changelog payload for every newly-published item. That text tells the
user nothing they don't already see from the v 1.0.0 chip in the meta
bar — just informational noise. Hide the Changelog heading + body when
the trimmed changelog equals 'Initial release'.

Both the inner section guard and the outer container guard use the new
shouldShowChangelog() helper so an item with empty readme + initial
release changelog doesn't leave an empty wrapper.
pull/15539/head
Andrii Shvaika 3 months ago
parent
commit
00726d9ece
  1. 4
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.html
  2. 5
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.ts

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

@ -294,12 +294,12 @@
}
<!-- Readme / Changelog -->
@if (readmeContent || item.changelog) {
@if (readmeContent || shouldShowChangelog()) {
<div class="dlg-readme">
@if (readmeContent) {
<tb-markdown [data]="readmeContent"></tb-markdown>
}
@if (item.changelog) {
@if (shouldShowChangelog()) {
<h3>{{ 'iot-hub.changelog' | translate }}</h3>
<tb-markdown [data]="item.changelog"></tb-markdown>
}

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

@ -162,7 +162,10 @@ export class TbIotHubItemDetailDialogComponent extends DialogComponent<TbIotHubI
return this.installedItem != null;
}
shouldShowChangelog(): boolean {
const changelog = this.item.changelog?.trim();
return !!changelog && changelog !== 'Initial release';
}
hasUpdate(): boolean {
return this.installedItem != null

Loading…
Cancel
Save