change(ui): dashboard list show created by

This commit is contained in:
Shekar Siri 2024-07-01 17:28:03 +02:00
parent 04754504ce
commit 31efd79d5a
3 changed files with 5 additions and 5 deletions

View file

@ -42,9 +42,9 @@ function DashboardList({ siteId }: { siteId: string }) {
},
{
title: 'Owner',
dataIndex: 'ownerEmail',
dataIndex: 'owner',
width: '16.67%',
sorter: (a, b) => a.ownerEmail.localeCompare(b.ownerEmail),
sorter: (a, b) => a.owner.localeCompare(b.owner),
sortDirections: ['ascend', 'descend'],
},
{

View file

@ -17,7 +17,7 @@ export default class Dashboard {
currentWidget: Widget = new Widget()
config: any = {}
createdAt: number = new Date().getTime()
ownerEmail: string = ""
owner: string = ""
constructor() {
makeAutoObservable(this)
@ -66,7 +66,7 @@ export default class Dashboard {
this.isPublic = json.isPublic
this.key = json.dashboardId
this.createdAt = DateTime.fromMillis(new Date(json.createdAt).getTime())
this.ownerEmail = json.ownerEmail
this.owner = json.ownerName
if (json.widgets) {
const smallWidgets: any[] = json.widgets.filter(wi => wi.config.col === 1)
const otherWidgets: any[] = json.widgets.filter(wi => wi.config.col !== 1)

View file

@ -155,7 +155,7 @@ export default class Widget {
? json.series.map((series: any) => new FilterSeries().fromJson(series))
: [new FilterSeries()];
this.dashboards = json.dashboards || [];
this.owner = json.ownerEmail;
this.owner = json.ownerName;
this.lastModified =
json.editedAt || json.createdAt
? DateTime.fromMillis(json.editedAt || json.createdAt)