Fixed updated widget: Cleared creationTime
This commit is contained in:
parent
885395f119
commit
8237cf4f7c
@ -181,8 +181,9 @@ export class WidgetService {
|
||||
public saveWidgetType(widgetInfo: WidgetInfo,
|
||||
id: WidgetTypeId,
|
||||
bundleAlias: string,
|
||||
createdTime: number,
|
||||
config?: RequestConfig): Observable<WidgetType> {
|
||||
const widgetTypeInstance = toWidgetType(widgetInfo, id, undefined, bundleAlias);
|
||||
const widgetTypeInstance = toWidgetType(widgetInfo, id, undefined, bundleAlias, createdTime);
|
||||
return this.http.post<WidgetType>('/api/widgetType', widgetTypeInstance,
|
||||
defaultHttpOptionsFromConfig(config)).pipe(
|
||||
tap((savedWidgetType) => {
|
||||
|
||||
@ -107,7 +107,7 @@ export class WidgetComponentService {
|
||||
image: this.utils.editWidgetInfo.image,
|
||||
description: this.utils.editWidgetInfo.description,
|
||||
defaultConfig: this.utils.editWidgetInfo.defaultConfig
|
||||
}, new WidgetTypeId('1'), new TenantId( NULL_UUID ), 'customWidgetBundle'
|
||||
}, new WidgetTypeId('1'), new TenantId( NULL_UUID ), 'customWidgetBundle', undefined
|
||||
);
|
||||
}
|
||||
const initSubject = new ReplaySubject();
|
||||
|
||||
@ -446,7 +446,8 @@ export function toWidgetInfo(widgetTypeEntity: WidgetType): WidgetInfo {
|
||||
};
|
||||
}
|
||||
|
||||
export function toWidgetType(widgetInfo: WidgetInfo, id: WidgetTypeId, tenantId: TenantId, bundleAlias: string): WidgetType {
|
||||
export function toWidgetType(widgetInfo: WidgetInfo, id: WidgetTypeId, tenantId: TenantId,
|
||||
bundleAlias: string, createdTime: number): WidgetType {
|
||||
const descriptor: WidgetTypeDescriptor = {
|
||||
type: widgetInfo.type,
|
||||
sizeX: widgetInfo.sizeX,
|
||||
@ -462,6 +463,7 @@ export function toWidgetType(widgetInfo: WidgetInfo, id: WidgetTypeId, tenantId:
|
||||
return {
|
||||
id,
|
||||
tenantId,
|
||||
createdTime,
|
||||
bundleAlias,
|
||||
alias: widgetInfo.alias,
|
||||
name: widgetInfo.widgetName,
|
||||
|
||||
@ -516,7 +516,8 @@ export class WidgetEditorComponent extends PageComponent implements OnInit, OnDe
|
||||
|
||||
private commitSaveWidget() {
|
||||
const id = (this.widgetType && this.widgetType.id) ? this.widgetType.id : undefined;
|
||||
this.widgetService.saveWidgetType(this.widget, id, this.widgetsBundle.alias).subscribe(
|
||||
const createdTime = (this.widgetType && this.widgetType.createdTime) ? this.widgetType.createdTime : undefined;
|
||||
this.widgetService.saveWidgetType(this.widget, id, this.widgetsBundle.alias, createdTime).subscribe(
|
||||
(widgetTypeInstance) => {
|
||||
this.setWidgetType(widgetTypeInstance);
|
||||
this.saveWidgetPending = false;
|
||||
@ -543,7 +544,7 @@ export class WidgetEditorComponent extends PageComponent implements OnInit, OnDe
|
||||
config.title = this.widget.widgetName;
|
||||
this.widget.defaultConfig = JSON.stringify(config);
|
||||
this.isDirty = false;
|
||||
this.widgetService.saveWidgetType(this.widget, undefined, saveWidgetAsData.bundleAlias).subscribe(
|
||||
this.widgetService.saveWidgetType(this.widget, undefined, saveWidgetAsData.bundleAlias, undefined).subscribe(
|
||||
(widgetTypeInstance) => {
|
||||
this.router.navigateByUrl(`/widgets-bundles/${saveWidgetAsData.bundleId}/widgetTypes/${widgetTypeInstance.id.id}`);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user