Browse Source

Add no data display message to entities and alarm tables

pull/5462/head
ArtemDzhereleiko 5 years ago
parent
commit
dd29490dd7
  1. 2
      ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.html
  2. 7
      ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts
  3. 2
      ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.html
  4. 7
      ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts

2
ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.html

@ -136,7 +136,7 @@
</table> </table>
<span [fxShow]="(alarmsDatasource.isEmpty() | async) && !alarmsDatasource.dataLoading" <span [fxShow]="(alarmsDatasource.isEmpty() | async) && !alarmsDatasource.dataLoading"
fxLayoutAlign="center center" fxLayoutAlign="center center"
class="no-data-found" translate>alarm.no-alarms-prompt</span> class="no-data-found">{{ noDataDisplayMessageText }}</span>
<span [fxShow]="alarmsDatasource.dataLoading" <span [fxShow]="alarmsDatasource.dataLoading"
fxLayoutAlign="center center" fxLayoutAlign="center center"
class="no-data-found">{{ 'common.loading' | translate }}</span> class="no-data-found">{{ 'common.loading' | translate }}</span>

7
ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts

@ -39,7 +39,7 @@ import {
createLabelFromDatasource, createLabelFromDatasource,
deepClone, deepClone,
hashCode, hashCode,
isDefined, isDefined, isNotEmptyStr,
isNumber, isNumber,
isObject, isObject,
isUndefined 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 { ngAfterViewInit(): void {
fromEvent(this.searchInputField.nativeElement, 'keyup') fromEvent(this.searchInputField.nativeElement, 'keyup')
.pipe( .pipe(

2
ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.html

@ -95,7 +95,7 @@
</table> </table>
<span [fxShow]="(entityDatasource.isEmpty() | async) && !entityDatasource.dataLoading" <span [fxShow]="(entityDatasource.isEmpty() | async) && !entityDatasource.dataLoading"
fxLayoutAlign="center center" fxLayoutAlign="center center"
class="no-data-found" translate>entity.no-entities-prompt</span> class="no-data-found">{{ noDataDisplayMessageText }}</span>
<span [fxShow]="entityDatasource.dataLoading" <span [fxShow]="entityDatasource.dataLoading"
fxLayoutAlign="center center" fxLayoutAlign="center center"
class="no-data-found">{{ 'common.loading' | translate }}</span> class="no-data-found">{{ 'common.loading' | translate }}</span>

7
ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts

@ -44,7 +44,7 @@ import {
createLabelFromDatasource, createLabelFromDatasource,
deepClone, deepClone,
hashCode, hashCode,
isDefined, isDefined, isNotEmptyStr,
isNumber, isNumber,
isObject, isObject,
isUndefined isUndefined
@ -211,6 +211,11 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni
this.ctx.updateWidgetParams(); 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 { ngAfterViewInit(): void {
fromEvent(this.searchInputField.nativeElement, 'keyup') fromEvent(this.searchInputField.nativeElement, 'keyup')
.pipe( .pipe(

Loading…
Cancel
Save