mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Refactor Dashboard model to include DashboardViewConfig
This commit is contained in:
parent
4f03f448e8
commit
16fad55f9f
@ -41,7 +41,6 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
create: true,
|
||||
delete: false,
|
||||
update: false,
|
||||
read: true,
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "CallLog",
|
||||
|
@ -21,6 +21,7 @@ import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
||||
import { Column, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne } from "typeorm";
|
||||
import AccessControlColumn from "../../Types/Database/AccessControlColumn";
|
||||
import Label from "./Label";
|
||||
import DashboardViewConfig from "../../Types/Dashboard/DashboardViewConfig";
|
||||
|
||||
@AccessControlColumn("labels")
|
||||
@EnableDocumentation()
|
||||
@ -384,4 +385,35 @@ export default class Dashboard extends BaseModel {
|
||||
})
|
||||
public labels?: Array<Label> = undefined;
|
||||
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.CreateDashboard,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadDashboard,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.EditDashboard,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
required: true,
|
||||
type: TableColumnType.JSON,
|
||||
title: "Dashboard View Config",
|
||||
description: "Configuration of Dashboard View",
|
||||
})
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: ColumnType.JSON,
|
||||
})
|
||||
public dashboardViewConfig?: DashboardViewConfig = undefined;
|
||||
|
||||
}
|
||||
|
@ -42,7 +42,6 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
create: true,
|
||||
delete: false,
|
||||
update: false,
|
||||
read: true,
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "EmailLog",
|
||||
|
@ -41,7 +41,6 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
create: true,
|
||||
delete: false,
|
||||
update: false,
|
||||
read: true,
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "SmsLog",
|
||||
|
3
Common/Types/Dashboard/DashboardViewConfig.ts
Normal file
3
Common/Types/Dashboard/DashboardViewConfig.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export default interface DashboardViewConfig {
|
||||
_type: "DashboardViewConfig"
|
||||
}
|
Loading…
Reference in New Issue
Block a user