mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
feat: implement modal for template selection in Dashboards and update service to handle default dashboard config
This commit is contained in:
@@ -55,9 +55,15 @@ export class Service extends DatabaseService<Model> {
|
||||
}
|
||||
}
|
||||
|
||||
// make sure dashboard config is empty.
|
||||
createBy.data.dashboardViewConfig =
|
||||
DashboardViewConfigUtil.createDefaultDashboardViewConfig();
|
||||
// use default empty config only if no template config was provided.
|
||||
if (
|
||||
!createBy.data.dashboardViewConfig ||
|
||||
!createBy.data.dashboardViewConfig.components ||
|
||||
createBy.data.dashboardViewConfig.components.length === 0
|
||||
) {
|
||||
createBy.data.dashboardViewConfig =
|
||||
DashboardViewConfigUtil.createDefaultDashboardViewConfig();
|
||||
}
|
||||
|
||||
return Promise.resolve({ createBy, carryForward: null });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user