Add no data display message to entities and alarm tables
This commit is contained in:
parent
9c38756eb3
commit
dd29490dd7
@ -136,7 +136,7 @@
|
||||
</table>
|
||||
<span [fxShow]="(alarmsDatasource.isEmpty() | async) && !alarmsDatasource.dataLoading"
|
||||
fxLayoutAlign="center center"
|
||||
class="no-data-found" translate>alarm.no-alarms-prompt</span>
|
||||
class="no-data-found">{{ noDataDisplayMessageText }}</span>
|
||||
<span [fxShow]="alarmsDatasource.dataLoading"
|
||||
fxLayoutAlign="center center"
|
||||
class="no-data-found">{{ 'common.loading' | translate }}</span>
|
||||
|
||||
@ -39,7 +39,7 @@ import {
|
||||
createLabelFromDatasource,
|
||||
deepClone,
|
||||
hashCode,
|
||||
isDefined,
|
||||
isDefined, isNotEmptyStr,
|
||||
isNumber,
|
||||
isObject,
|
||||
isUndefined
|
||||
@ -265,6 +265,11 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
|
||||
}
|
||||
}
|
||||
|
||||
get noDataDisplayMessageText() {
|
||||
const noDataDisplayMessage = isNotEmptyStr(this.ctx.widgetConfig.noDataDisplayMessage) ? this.ctx.widgetConfig.noDataDisplayMessage : '{i18n:alarm.no-alarms-prompt}';
|
||||
return this.utils.customTranslation(noDataDisplayMessage, noDataDisplayMessage);
|
||||
}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
fromEvent(this.searchInputField.nativeElement, 'keyup')
|
||||
.pipe(
|
||||
|
||||
@ -95,7 +95,7 @@
|
||||
</table>
|
||||
<span [fxShow]="(entityDatasource.isEmpty() | async) && !entityDatasource.dataLoading"
|
||||
fxLayoutAlign="center center"
|
||||
class="no-data-found" translate>entity.no-entities-prompt</span>
|
||||
class="no-data-found">{{ noDataDisplayMessageText }}</span>
|
||||
<span [fxShow]="entityDatasource.dataLoading"
|
||||
fxLayoutAlign="center center"
|
||||
class="no-data-found">{{ 'common.loading' | translate }}</span>
|
||||
|
||||
@ -44,7 +44,7 @@ import {
|
||||
createLabelFromDatasource,
|
||||
deepClone,
|
||||
hashCode,
|
||||
isDefined,
|
||||
isDefined, isNotEmptyStr,
|
||||
isNumber,
|
||||
isObject,
|
||||
isUndefined
|
||||
@ -211,6 +211,11 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni
|
||||
this.ctx.updateWidgetParams();
|
||||
}
|
||||
|
||||
get noDataDisplayMessageText() {
|
||||
const noDataDisplayMessage = isNotEmptyStr(this.ctx.widgetConfig.noDataDisplayMessage) ? this.ctx.widgetConfig.noDataDisplayMessage : '{i18n:entity.no-entities-prompt}';
|
||||
return this.utils.customTranslation(noDataDisplayMessage, noDataDisplayMessage);
|
||||
}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
fromEvent(this.searchInputField.nativeElement, 'keyup')
|
||||
.pipe(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user