Merge branch 'dashboard' into dev
This commit is contained in:
commit
5c0d352fcc
4 changed files with 6 additions and 5 deletions
|
|
@ -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 = () => {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 = {}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue