From db926249207adcd282da2f05a47d6a5303be4d42 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Mon, 4 Dec 2023 18:20:07 +0000 Subject: [PATCH] Fix formatting issues and add OnCallDutyPolicyEscalationRuleOnCallSchedule API endpoint --- Common/Types/Permission.ts | 3 --- .../OnCallScheduleLayer/LayersPreview.tsx | 18 ++++++++++-------- DashboardAPI/Index.ts | 16 ++++++++++++++++ ...llDutyPolicyEscalationRuleOnCallSchedule.ts | 6 ++++-- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/Common/Types/Permission.ts b/Common/Types/Permission.ts index 65eed126dc..7a2bd6d5f8 100644 --- a/Common/Types/Permission.ts +++ b/Common/Types/Permission.ts @@ -405,7 +405,6 @@ enum Permission { CanDeleteProjectOnCallDutyPolicyEscalationRuleOnCallSchedule = 'CanDeleteProjectOnCallDutyPolicyEscalationRuleOnCallSchedule', CanReadProjectOnCallDutyPolicyEscalationRuleOnCallSchedule = 'CanReadProjectOnCallDutyPolicyEscalationRuleOnCallSchedule', - CanCreateProjectOnCallDutyPolicyEscalationRuleTeam = 'CanCreateProjectOnCallDutyPolicyEscalationRuleTeam', CanEditProjectOnCallDutyPolicyEscalationRuleTeam = 'CanEditProjectOnCallDutyPolicyEscalationRuleTeam', CanDeleteProjectOnCallDutyPolicyEscalationRuleTeam = 'CanDeleteProjectOnCallDutyPolicyEscalationRuleTeam', @@ -1692,7 +1691,6 @@ export class PermissionHelper { isAccessControlPermission: true, }, - { permission: Permission.CanCreateProjectOnCallDutyPolicyEscalationRuleOnCallSchedule, @@ -1730,7 +1728,6 @@ export class PermissionHelper { isAccessControlPermission: true, }, - { permission: Permission.CanCreateProjectOnCallDutyPolicyEscalationRuleUser, diff --git a/Dashboard/src/Components/OnCallPolicy/OnCallScheduleLayer/LayersPreview.tsx b/Dashboard/src/Components/OnCallPolicy/OnCallScheduleLayer/LayersPreview.tsx index cf00b0416a..608ee81168 100644 --- a/Dashboard/src/Components/OnCallPolicy/OnCallScheduleLayer/LayersPreview.tsx +++ b/Dashboard/src/Components/OnCallPolicy/OnCallScheduleLayer/LayersPreview.tsx @@ -119,14 +119,16 @@ const LayersPreview: FunctionComponent = ( return (
- {props.showFieldLabel && } + {props.showFieldLabel && ( + + )} { diff --git a/DashboardAPI/Index.ts b/DashboardAPI/Index.ts index e9c987529c..214cf94d27 100755 --- a/DashboardAPI/Index.ts +++ b/DashboardAPI/Index.ts @@ -379,6 +379,11 @@ import OnCallDutyPolicyEscalationRuleTeamService, { Service as OnCallDutyPolicyEscalationRuleTeamServiceType, } from 'CommonServer/Services/OnCallDutyPolicyEscalationRuleTeamService'; +import OnCallDutyPolicyEscalationRuleOnCallSchedule from 'Model/Models/OnCallDutyPolicyEscalationRuleOnCallSchedule'; +import OnCallDutyPolicyEscalationRuleOnCallScheduleService, { + Service as OnCallDutyPolicyEscalationRuleOnCallScheduleServiceType, +} from 'CommonServer/Services/OnCallDutyPolicyEscalationRuleOnCallScheduleService'; + import OnCallDutyPolicyEscalationRuleUser from 'Model/Models/OnCallDutyPolicyEscalationRuleUser'; import OnCallDutyPolicyEscalationRuleUserService, { Service as OnCallDutyPolicyEscalationRuleUserServiceType, @@ -1045,6 +1050,17 @@ app.use( ).getRouter() ); +app.use( + `/${APP_NAME.toLocaleLowerCase()}`, + new BaseAPI< + OnCallDutyPolicyEscalationRuleOnCallSchedule, + OnCallDutyPolicyEscalationRuleOnCallScheduleServiceType + >( + OnCallDutyPolicyEscalationRuleOnCallSchedule, + OnCallDutyPolicyEscalationRuleOnCallScheduleService + ).getRouter() +); + app.use( `/${APP_NAME.toLocaleLowerCase()}`, new BaseAPI< diff --git a/Model/Models/OnCallDutyPolicyEscalationRuleOnCallSchedule.ts b/Model/Models/OnCallDutyPolicyEscalationRuleOnCallSchedule.ts index 78fdcabe1f..4fd9069ad6 100644 --- a/Model/Models/OnCallDutyPolicyEscalationRuleOnCallSchedule.ts +++ b/Model/Models/OnCallDutyPolicyEscalationRuleOnCallSchedule.ts @@ -216,7 +216,8 @@ export default class OnCallDutyPolicyEscalationRuleSchedule extends BaseModel { type: TableColumnType.Entity, modelType: OnCallDutyPolicySchedule, title: 'On Call Policy Schedule', - description: 'Relation to On Call Policy Schedule who is in this escalation rule.', + description: + 'Relation to On Call Policy Schedule who is in this escalation rule.', }) @ManyToOne( (_type: string) => { @@ -250,7 +251,8 @@ export default class OnCallDutyPolicyEscalationRuleSchedule extends BaseModel { @TableColumn({ type: TableColumnType.ObjectID, title: 'On Call Duty Policy Schedule ID', - description: 'ID of the on call schedule which is in this escalation rule.', + description: + 'ID of the on call schedule which is in this escalation rule.', }) @Column({ type: ColumnType.ObjectID,