mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
fix subscriber
This commit is contained in:
@@ -15,6 +15,8 @@ import FieldType from 'CommonUI/src/Components/Types/FieldType';
|
||||
import ModelTable from 'CommonUI/src/Components/ModelTable/ModelTable';
|
||||
import NotNull from 'Common/Types/Database/NotNull';
|
||||
import StatusPagePreviewLink from './StatusPagePreviewLink';
|
||||
import { JSONObject } from 'Common/Types/JSON';
|
||||
import Pill from 'CommonUI/src/Components/Pill/Pill';
|
||||
// import NotNull from 'Common/Types/Database/NotNull';
|
||||
|
||||
const StatusPageDelete: FunctionComponent<PageComponentProps> = (
|
||||
@@ -119,6 +121,40 @@ const StatusPageDelete: FunctionComponent<PageComponentProps> = (
|
||||
title: 'Email',
|
||||
type: FieldType.Email,
|
||||
},
|
||||
{
|
||||
field: {
|
||||
isUnsubscribed: true,
|
||||
},
|
||||
title: 'Status',
|
||||
type: FieldType.Text,
|
||||
getElement: (item: JSONObject): ReactElement => {
|
||||
if (item['isUnsubscribed']) {
|
||||
return (
|
||||
<Pill
|
||||
color={
|
||||
Red
|
||||
}
|
||||
text={
|
||||
"Unsubscribed"
|
||||
}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<Pill
|
||||
color={
|
||||
Green
|
||||
}
|
||||
text={
|
||||
"Subscribed"
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return <></>;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: {
|
||||
createdAt: true,
|
||||
|
||||
@@ -256,4 +256,17 @@ export default class StatusPageSubscriber extends BaseModel {
|
||||
)
|
||||
@JoinColumn({ name: 'deletedByUserId' })
|
||||
public deletedByUser?: User = undefined;
|
||||
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({ isDefaultValueColumn: true, type: TableColumnType.Boolean })
|
||||
@Column({
|
||||
type: ColumnType.Boolean,
|
||||
default: false,
|
||||
})
|
||||
public isUnsubscribed?: boolean = undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user