diff --git a/App/FeatureSet/Workers/Jobs/IncidentPublicNote/SendNotificationToSubscribers.ts b/App/FeatureSet/Workers/Jobs/IncidentPublicNote/SendNotificationToSubscribers.ts index c2666338c5..9464bf5d5a 100644 --- a/App/FeatureSet/Workers/Jobs/IncidentPublicNote/SendNotificationToSubscribers.ts +++ b/App/FeatureSet/Workers/Jobs/IncidentPublicNote/SendNotificationToSubscribers.ts @@ -43,6 +43,7 @@ RunCron( await IncidentPublicNoteService.findBy({ query: { isStatusPageSubscribersNotifiedOnNoteCreated: false, + shouldStatusPageSubscribersBeNotifiedOnNoteCreated: true, createdAt: QueryHelper.lessThan( OneUptimeDate.getCurrentDate() ), diff --git a/Dashboard/src/Pages/Incidents/View/PublicNote.tsx b/Dashboard/src/Pages/Incidents/View/PublicNote.tsx index 8a14db5140..748abbc71f 100644 --- a/Dashboard/src/Pages/Incidents/View/PublicNote.tsx +++ b/Dashboard/src/Pages/Incidents/View/PublicNote.tsx @@ -171,6 +171,19 @@ const PublicNote: FunctionComponent = ( description: 'This note is visible on your Status Page. This is in Markdown.', }, + { + field: { + shouldStatusPageSubscribersBeNotifiedOnNoteCreated: true, + }, + + title: 'Notify Status Page Subscribers', + stepId: 'more', + description: + 'Should status page subscribers be notified?', + fieldType: FormFieldSchemaType.Checkbox, + defaultValue: true, + required: false, + }, { field: { postedAt: true, diff --git a/Model/Models/Incident.ts b/Model/Models/Incident.ts index 2d355c0ce3..268137da23 100644 --- a/Model/Models/Incident.ts +++ b/Model/Models/Incident.ts @@ -760,10 +760,7 @@ export default class Incident extends BaseModel { Permission.CanReadProjectIncident, ], update: [ - Permission.ProjectOwner, - Permission.ProjectAdmin, - Permission.ProjectMember, - Permission.CanEditProjectIncident, + ], }) @TableColumn({ diff --git a/Model/Models/IncidentPublicNote.ts b/Model/Models/IncidentPublicNote.ts index cda4d09698..23fc8737d1 100644 --- a/Model/Models/IncidentPublicNote.ts +++ b/Model/Models/IncidentPublicNote.ts @@ -363,6 +363,34 @@ export default class IncidentPublicNote extends BaseModel { }) public isStatusPageSubscribersNotifiedOnNoteCreated?: boolean = undefined; + + @ColumnAccessControl({ + create: [ + Permission.ProjectOwner, + Permission.ProjectAdmin, + Permission.ProjectMember, + Permission.CanCreateIncidentPublicNote, + ], + read: [ + Permission.ProjectOwner, + Permission.ProjectAdmin, + Permission.ProjectMember, + Permission.CanReadIncidentPublicNote, + ], + update: [], + }) + @TableColumn({ + isDefaultValueColumn: true, + type: TableColumnType.Boolean, + title: 'Should subscribers be notified?', + description: 'Should subscribers be notified about this note?', + }) + @Column({ + type: ColumnType.Boolean, + default: true, + }) + public shouldStatusPageSubscribersBeNotifiedOnNoteCreated?: boolean = undefined; + @ColumnAccessControl({ create: [ Permission.ProjectOwner,