mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 15:24:55 +00:00
Add notification feature for status page subscribers
This commit is contained in:
parent
144795d412
commit
5367953ab0
@ -43,6 +43,7 @@ RunCron(
|
||||
await IncidentPublicNoteService.findBy({
|
||||
query: {
|
||||
isStatusPageSubscribersNotifiedOnNoteCreated: false,
|
||||
shouldStatusPageSubscribersBeNotifiedOnNoteCreated: true,
|
||||
createdAt: QueryHelper.lessThan(
|
||||
OneUptimeDate.getCurrentDate()
|
||||
),
|
||||
|
@ -171,6 +171,19 @@ const PublicNote: FunctionComponent<PageComponentProps> = (
|
||||
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,
|
||||
|
@ -760,10 +760,7 @@ export default class Incident extends BaseModel {
|
||||
Permission.CanReadProjectIncident,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CanEditProjectIncident,
|
||||
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user