mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Refactor StatusPageAPI to allow subscribers to choose event types
This commit is contained in:
parent
33604bba3c
commit
2ad7face9a
@ -251,6 +251,7 @@ export default class StatusPageAPI extends BaseAPI<
|
||||
enableSmsSubscribers: true,
|
||||
isPublicStatusPage: true,
|
||||
allowSubscribersToChooseResources: true,
|
||||
allowSubscribersToChooseEventTypes: true,
|
||||
requireSsoForLogin: true,
|
||||
coverImageFile: {
|
||||
file: true,
|
||||
|
@ -43,10 +43,16 @@ const App: () => JSX.Element = () => {
|
||||
const [isPreview, setIsPreview] = useState<boolean>(false);
|
||||
const [enableEmailSubscribers, setenableEmailSubscribers] =
|
||||
useState<boolean>(true);
|
||||
const [
|
||||
|
||||
const [
|
||||
allowSubscribersToChooseResources,
|
||||
setAllowSubscribersToChooseResources,
|
||||
] = useState<boolean>(false);
|
||||
|
||||
|
||||
const [allowSubscriberToChooseEventTypes, setAllowSubscriberToChooseEventTypes] =
|
||||
useState<boolean>(false);
|
||||
|
||||
const [enableSMSSubscribers, setenableSMSSubscribers] =
|
||||
useState<boolean>(false);
|
||||
const [statusPageName, setStatusPageName] = useState<string>("");
|
||||
@ -130,7 +136,14 @@ const App: () => JSX.Element = () => {
|
||||
"statusPage.allowSubscribersToChooseResources",
|
||||
) as boolean;
|
||||
|
||||
const allowSubscribersToChooseEventTypes: boolean =
|
||||
JSONFunctions.getJSONValueInPath(
|
||||
masterpage || {},
|
||||
"statusPage.allowSubscribersToChooseEventTypes"
|
||||
) as boolean;
|
||||
|
||||
setAllowSubscribersToChooseResources(allowSubscribersToChooseResources);
|
||||
setAllowSubscriberToChooseEventTypes(allowSubscribersToChooseEventTypes);
|
||||
|
||||
setenableSMSSubscribers(enableSMSSubscribers);
|
||||
setenableEmailSubscribers(enableEmailSubscribers);
|
||||
@ -310,6 +323,9 @@ const App: () => JSX.Element = () => {
|
||||
allowSubscribersToChooseResources={
|
||||
allowSubscribersToChooseResources
|
||||
}
|
||||
allowSubscribersToChooseEventTypes={
|
||||
allowSubscriberToChooseEventTypes
|
||||
}
|
||||
onLoadComplete={() => {
|
||||
onPageLoadComplete();
|
||||
}}
|
||||
@ -330,6 +346,9 @@ const App: () => JSX.Element = () => {
|
||||
allowSubscribersToChooseResources={
|
||||
allowSubscribersToChooseResources
|
||||
}
|
||||
allowSubscribersToChooseEventTypes={
|
||||
allowSubscriberToChooseEventTypes
|
||||
}
|
||||
enableEmailSubscribers={enableEmailSubscribers}
|
||||
enableSMSSubscribers={enableSMSSubscribers}
|
||||
/>
|
||||
@ -347,6 +366,9 @@ const App: () => JSX.Element = () => {
|
||||
allowSubscribersToChooseResources={
|
||||
allowSubscribersToChooseResources
|
||||
}
|
||||
allowSubscribersToChooseEventTypes={
|
||||
allowSubscriberToChooseEventTypes
|
||||
}
|
||||
enableEmailSubscribers={enableEmailSubscribers}
|
||||
enableSMSSubscribers={enableSMSSubscribers}
|
||||
/>
|
||||
@ -378,6 +400,9 @@ const App: () => JSX.Element = () => {
|
||||
allowSubscribersToChooseResources={
|
||||
allowSubscribersToChooseResources
|
||||
}
|
||||
allowSubscribersToChooseEventTypes={
|
||||
allowSubscriberToChooseEventTypes
|
||||
}
|
||||
enableEmailSubscribers={enableEmailSubscribers}
|
||||
enableSMSSubscribers={enableSMSSubscribers}
|
||||
/>
|
||||
@ -395,6 +420,9 @@ const App: () => JSX.Element = () => {
|
||||
allowSubscribersToChooseResources={
|
||||
allowSubscribersToChooseResources
|
||||
}
|
||||
allowSubscribersToChooseEventTypes={
|
||||
allowSubscriberToChooseEventTypes
|
||||
}
|
||||
enableEmailSubscribers={enableEmailSubscribers}
|
||||
enableSMSSubscribers={enableSMSSubscribers}
|
||||
/>
|
||||
@ -408,6 +436,9 @@ const App: () => JSX.Element = () => {
|
||||
onLoadComplete={() => {
|
||||
onPageLoadComplete();
|
||||
}}
|
||||
allowSubscribersToChooseEventTypes={
|
||||
allowSubscriberToChooseEventTypes
|
||||
}
|
||||
pageRoute={RouteMap[PageMap.PREVIEW_SUBSCRIBE_SMS] as Route}
|
||||
allowSubscribersToChooseResources={
|
||||
allowSubscribersToChooseResources
|
||||
|
Loading…
Reference in New Issue
Block a user