diff --git a/Common/Server/API/StatusPageAPI.ts b/Common/Server/API/StatusPageAPI.ts index e0b7367f47..5d20c8dadd 100644 --- a/Common/Server/API/StatusPageAPI.ts +++ b/Common/Server/API/StatusPageAPI.ts @@ -251,6 +251,7 @@ export default class StatusPageAPI extends BaseAPI< enableSmsSubscribers: true, isPublicStatusPage: true, allowSubscribersToChooseResources: true, + allowSubscribersToChooseEventTypes: true, requireSsoForLogin: true, coverImageFile: { file: true, diff --git a/StatusPage/src/App.tsx b/StatusPage/src/App.tsx index f198c421fb..dbff862252 100644 --- a/StatusPage/src/App.tsx +++ b/StatusPage/src/App.tsx @@ -43,10 +43,16 @@ const App: () => JSX.Element = () => { const [isPreview, setIsPreview] = useState(false); const [enableEmailSubscribers, setenableEmailSubscribers] = useState(true); - const [ + + const [ allowSubscribersToChooseResources, setAllowSubscribersToChooseResources, ] = useState(false); + + + const [allowSubscriberToChooseEventTypes, setAllowSubscriberToChooseEventTypes] = + useState(false); + const [enableSMSSubscribers, setenableSMSSubscribers] = useState(false); const [statusPageName, setStatusPageName] = useState(""); @@ -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