Fix formatting issues and add

OnCallDutyPolicyEscalationRuleOnCallSchedule API
endpoint
This commit is contained in:
Simon Larsen 2023-12-04 18:20:07 +00:00
parent cbd7211690
commit db92624920
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
4 changed files with 30 additions and 13 deletions

View File

@ -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,

View File

@ -119,14 +119,16 @@ const LayersPreview: FunctionComponent<ComponentProps> = (
return (
<div id={props.id}>
{props.showFieldLabel && <FieldLabelElement
required={true}
title="Layer Preview"
description={
'Here is a preview of who is on call and when. This is based on your local timezone - ' +
OneUptimeDate.getCurrentTimezoneString()
}
/>}
{props.showFieldLabel && (
<FieldLabelElement
required={true}
title="Layer Preview"
description={
'Here is a preview of who is on call and when. This is based on your local timezone - ' +
OneUptimeDate.getCurrentTimezoneString()
}
/>
)}
<Calendar
events={calendarEvents}
onRangeChange={(startEndTime: StartAndEndTime) => {

View File

@ -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<

View File

@ -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,