Merge pull request #9593 from ArtemDzhereleiko/AD/bug-fix/widget-style/convert-camel-case
Convert widget style to camel case
This commit is contained in:
commit
303e8678ea
@ -817,3 +817,7 @@ export const getOS = (): string => {
|
|||||||
export const camelCase = (str: string): string => {
|
export const camelCase = (str: string): string => {
|
||||||
return _.camelCase(str);
|
return _.camelCase(str);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const convertKeysToCamelCase = (obj: Record<string, any>): Record<string, any> => {
|
||||||
|
return _.mapKeys(obj, (value, key) => _.camelCase(key));
|
||||||
|
};
|
||||||
|
|||||||
@ -27,7 +27,15 @@ import { WidgetLayout, WidgetLayouts } from '@app/shared/models/dashboard.models
|
|||||||
import { IDashboardWidget, WidgetAction, WidgetContext, WidgetHeaderAction } from './widget-component.models';
|
import { IDashboardWidget, WidgetAction, WidgetContext, WidgetHeaderAction } from './widget-component.models';
|
||||||
import { Timewindow } from '@shared/models/time/time.models';
|
import { Timewindow } from '@shared/models/time/time.models';
|
||||||
import { Observable, of, Subject } from 'rxjs';
|
import { Observable, of, Subject } from 'rxjs';
|
||||||
import { formattedDataFormDatasourceData, guid, isDefined, isEqual, isUndefined } from '@app/core/utils';
|
import {
|
||||||
|
convertKeysToCamelCase,
|
||||||
|
formattedDataFormDatasourceData,
|
||||||
|
guid,
|
||||||
|
isDefined,
|
||||||
|
isEmpty,
|
||||||
|
isEqual,
|
||||||
|
isUndefined
|
||||||
|
} from '@app/core/utils';
|
||||||
import { IterableDiffer, KeyValueDiffer } from '@angular/core';
|
import { IterableDiffer, KeyValueDiffer } from '@angular/core';
|
||||||
import { IAliasController, IStateController } from '@app/core/api/widget-api.models';
|
import { IAliasController, IStateController } from '@app/core/api/widget-api.models';
|
||||||
import { enumerable } from '@shared/decorators/enumerable';
|
import { enumerable } from '@shared/decorators/enumerable';
|
||||||
@ -479,9 +487,9 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget {
|
|||||||
backgroundColor: this.backgroundColor,
|
backgroundColor: this.backgroundColor,
|
||||||
padding: this.padding,
|
padding: this.padding,
|
||||||
margin: this.margin,
|
margin: this.margin,
|
||||||
borderRadius: this.borderRadius || 'unset' };
|
borderRadius: this.borderRadius };
|
||||||
if (this.widget.config.widgetStyle) {
|
if (!isEmpty(this.widget.config.widgetStyle)) {
|
||||||
this.style = {...this.style, ...this.widget.config.widgetStyle};
|
this.style = {...this.style, ...convertKeysToCamelCase(this.widget.config.widgetStyle)};
|
||||||
}
|
}
|
||||||
|
|
||||||
this.showWidgetTitlePanel = this.widgetContext.hideTitlePanel ? false :
|
this.showWidgetTitlePanel = this.widgetContext.hideTitlePanel ? false :
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user