Merge branch 'dashboard' into dev

This commit is contained in:
Shekar Siri 2022-04-15 14:48:06 +02:00
commit 5c0d352fcc
4 changed files with 6 additions and 5 deletions

View file

@ -22,7 +22,9 @@ function DashboardModal(props) {
const loading = useObserver(() => dashboardStore.isSaving);
const onSave = () => {
dashboardStore.save(dashboard).then(hideModal)
dashboardStore.save(dashboard).then(hideModal).then(() => {
dashboardStore.fetch(dashboard.dashboardId)
})
}
const handleCreateNew = () => {

View file

@ -95,7 +95,6 @@ export default class Dashboard implements IDashboard {
this.name = json.name
this.isPublic = json.isPublic
this.isPinned = json.isPinned
// this.config = json.config
this.widgets = json.widgets ? json.widgets.map(w => new Widget().fromJson(w)).sort((a, b) => a.position - b.position) : []
})
return this

View file

@ -36,7 +36,8 @@ export default class FilterItem {
}
fromJson(json, mainFilterKey = '') {
let _filter = filtersMap[json.type]
console.log('fromJson', json.type)
let _filter = filtersMap[json.type] || {}
if (mainFilterKey) {
const mainFilter = filtersMap[mainFilterKey];
const subFilterMap = {}

View file

@ -139,8 +139,7 @@ export default class Widget implements IWidget {
this.series = json.series ? json.series.map((series: any) => new FilterSeries().fromJson(series)) : [],
this.dashboards = json.dashboards
this.owner = json.ownerEmail
// this.lastModified = json.editedAt || json.createdAt ? DateTime.fromMillis(json.editedAt || json.createdAt) : null
this.lastModified = DateTime.fromMillis(1649319074)
this.lastModified = json.editedAt || json.createdAt ? DateTime.fromMillis(json.editedAt || json.createdAt) : null
this.config = json.config
this.position = json.config.position
this.predefinedKey = json.predefinedKey