Browse Source

title case only for default label

pull/12004/head
mpetrov 2 years ago
parent
commit
d1ef183f8d
  1. 4
      ui-ngx/src/app/core/services/dashboard-utils.service.ts
  2. 3
      ui-ngx/src/app/modules/home/components/dashboard-page/states/default-state-controller.component.ts

4
ui-ngx/src/app/core/services/dashboard-utils.service.ts

@ -95,10 +95,10 @@ export class DashboardUtilsService {
}
if (isUndefined(dashboard.configuration.states)) {
dashboard.configuration.states = {
Default: this.createDefaultState(dashboard.title, true)
default: this.createDefaultState(dashboard.title, true)
};
const mainLayout = dashboard.configuration.states.Default.layouts.main;
const mainLayout = dashboard.configuration.states.default.layouts.main;
for (const id of Object.keys(dashboard.configuration.widgets)) {
const widget = dashboard.configuration.widgets[id];
mainLayout.widgets[id] = {

3
ui-ngx/src/app/modules/home/components/dashboard-page/states/default-state-controller.component.ts

@ -187,7 +187,8 @@ export class DefaultStateControllerComponent extends StateControllerComponent im
}
public getStateName(id: string, state: DashboardState): string {
return this.utils.customTranslation(state.name, id);
const name = this.utils.customTranslation(state.name, id);
return name === this.stateControllerId() ? name.charAt(0).toUpperCase() + name.slice(1) : name;
}
public getCurrentStateName(): string {

Loading…
Cancel
Save