diff --git a/Accounts/Dockerfile.tpl b/Accounts/Dockerfile.tpl index f45bc26b74..e8039a43bb 100755 --- a/Accounts/Dockerfile.tpl +++ b/Accounts/Dockerfile.tpl @@ -73,6 +73,7 @@ EXPOSE 3003 {{ if eq .Env.ENVIRONMENT "development" }} +RUN printenv > /usr/src/app/.env #Run the app CMD [ "npm", "run", "dev" ] {{ else }} diff --git a/Accounts/webpack.config.js b/Accounts/webpack.config.js index c9791362f8..48e40d0f42 100644 --- a/Accounts/webpack.config.js +++ b/Accounts/webpack.config.js @@ -38,9 +38,7 @@ module.exports = { new webpack.DefinePlugin({ 'process': { 'env': { - ...readEnvFile('../Common/.env'), - ...readEnvFile('../CommonUI/.env'), - ...readEnvFile('./.env') + ...readEnvFile('/usr/src/app/.env') } } }), diff --git a/Common/Types/NotificationSetting/NotificationSettingEventType.ts b/Common/Types/NotificationSetting/NotificationSettingEventType.ts index 261a7277f6..70627728a8 100644 --- a/Common/Types/NotificationSetting/NotificationSettingEventType.ts +++ b/Common/Types/NotificationSetting/NotificationSettingEventType.ts @@ -1,26 +1,26 @@ enum NotificationSettingEventType { // Incident - SEND_INCIDENT_CREATED_OWNER_NOTIFICATION = "Send Incident Created Owner Notification", - SEND_INCIDENT_NOTE_POSTED_OWNER_NOTIFICATION = "Send Incident Note Posted Owner Notification", - SEND_INCIDENT_STATE_CHANGED_OWNER_NOTIFICATION = "Send Incident State Changed Owner Notification", - SEND_INCIDENT_OWNER_ADDED_NOTIFICATION = "Send Incident Owner Added Notification", + SEND_INCIDENT_CREATED_OWNER_NOTIFICATION = "Send incident created notification when I am the owner", + SEND_INCIDENT_NOTE_POSTED_OWNER_NOTIFICATION = "Send incident note posted notification when I am the owner", + SEND_INCIDENT_STATE_CHANGED_OWNER_NOTIFICATION = "Send incident state changed notification when I am the owner", + SEND_INCIDENT_OWNER_ADDED_NOTIFICATION = "Send notification when I am added as a owner to the incident", // Monitors - SEND_MONITOR_OWNER_ADDED_NOTIFICATION = "Send Monitor Owner Added Notification", - SEND_MONITOR_CREATED_OWNER_NOTIFICATION = "Send Monitor Created Owner Notification", - SEND_MONITOR_STATUS_CHANGED_OWNER_NOTIFICATION = "Send Monitor Status Changed Owner Notification", + SEND_MONITOR_OWNER_ADDED_NOTIFICATION = "Send notification when I am added as a owner to the monitor", + SEND_MONITOR_CREATED_OWNER_NOTIFICATION = "Send monitor created notification when I am the owner", + SEND_MONITOR_STATUS_CHANGED_OWNER_NOTIFICATION = "Send monitor status changed notification when I am the owner", // Scheduled Maintenance - SEND_SCHEDULED_MAINTENANCE_CREATED_OWNER_NOTIFICATION = "Send Scheduled Maintenance Created Owner Notification", - SEND_SCHEDULED_MAINTENANCE_NOTE_POSTED_OWNER_NOTIFICATION = "Send Scheduled Maintenance Note Posted Owner Notification", - SEND_SCHEDULED_MAINTENANCE_OWNER_ADDED_NOTIFICATION = "Send Scheduled Maintenance Owner Added Notification", - SEND_SCHEDULED_MAINTENANCE_STATE_CHANGED_OWNER_NOTIFICATION = "Send Scheduled Maintenance State Changed Owner Notification", + SEND_SCHEDULED_MAINTENANCE_CREATED_OWNER_NOTIFICATION = "Send scheduled maintenance created notification when I am the owner", + SEND_SCHEDULED_MAINTENANCE_NOTE_POSTED_OWNER_NOTIFICATION = "Send scheduled maintenance note posted notification when I am the owner", + SEND_SCHEDULED_MAINTENANCE_OWNER_ADDED_NOTIFICATION = "Send notification when I am added as a owner to the scheduled maintenance", + SEND_SCHEDULED_MAINTENANCE_STATE_CHANGED_OWNER_NOTIFICATION = "Send scheduled maintenance state changed notification when I am the owner", // Status Page - SEND_STATUS_PAGE_ANNOUNCEMENT_CREATED_OWNER_NOTIFICATION = "Send Status Page Announcement Created Owner Notification", - SEND_STATUS_PAGE_CREATED_OWNER_NOTIFICATION = "Send Status Page Created Owner Notification", - SEND_STATUS_PAGE_OWNER_ADDED_NOTIFICATION = "Send Status Page Owner Added Notification", + SEND_STATUS_PAGE_ANNOUNCEMENT_CREATED_OWNER_NOTIFICATION = "Send status page announcement created notification when I am the owner", + SEND_STATUS_PAGE_CREATED_OWNER_NOTIFICATION = "Send status page created notification when I am the owner", + SEND_STATUS_PAGE_OWNER_ADDED_NOTIFICATION = "Send notification when I am added as a owner to the status page", } export default NotificationSettingEventType; diff --git a/CommonUI/src/Utils/Dropdown.ts b/CommonUI/src/Utils/Dropdown.ts index 3a7d7a944c..265ac59963 100644 --- a/CommonUI/src/Utils/Dropdown.ts +++ b/CommonUI/src/Utils/Dropdown.ts @@ -11,4 +11,15 @@ export default class DropdownUtil { }; }); } + + public static getDropdownOptionsFromArray( + arr: Array + ): Array { + return arr.map((item: string) => { + return { + label: item, + value: item, + }; + }); + } } diff --git a/Dashboard/Dockerfile.tpl b/Dashboard/Dockerfile.tpl index 981124f622..eb8ea97aff 100755 --- a/Dashboard/Dockerfile.tpl +++ b/Dashboard/Dockerfile.tpl @@ -70,6 +70,7 @@ EXPOSE 3009 {{ if eq .Env.ENVIRONMENT "development" }} #Run the app +RUN printenv > /usr/src/app/.env CMD [ "npm", "run", "dev" ] {{ else }} # Copy app source diff --git a/Dashboard/src/App.tsx b/Dashboard/src/App.tsx index 0e9c00210f..6807e30c3c 100644 --- a/Dashboard/src/App.tsx +++ b/Dashboard/src/App.tsx @@ -156,6 +156,7 @@ import UserSettingsNotificationMethods from './Pages/UserSettings/NotificationMe import UserSettingsNotificationRules from './Pages/UserSettings/OnCallRules'; import UserSettingsNotificationLogs from './Pages/UserSettings/NotificationLogs'; import UserSettingsNotificationLogsTimeline from './Pages/UserSettings/NotificationLogsTimeline'; +import UserSettingsNotiifcationSetting from './Pages/UserSettings/NotificationSettings'; const App: FunctionComponent = () => { Navigation.setNavigateHook(useNavigate()); @@ -373,7 +374,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.HOME_NOT_OPERATIONAL_MONITORS + PageMap.HOME_NOT_OPERATIONAL_MONITORS ] as Route } /> @@ -393,8 +394,8 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap - .HOME_ONGOING_SCHEDULED_MAINTENANCE_EVENTS + PageMap + .HOME_ONGOING_SCHEDULED_MAINTENANCE_EVENTS ] as Route } /> @@ -422,7 +423,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.MONITORS_INOPERATIONAL + PageMap.MONITORS_INOPERATIONAL ] as Route } /> @@ -505,7 +506,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.MONITOR_VIEW_STATUS_TIMELINE + PageMap.MONITOR_VIEW_STATUS_TIMELINE ] as Route } /> @@ -537,7 +538,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.MONITOR_VIEW_INCIDENTS + PageMap.MONITOR_VIEW_INCIDENTS ] as Route } /> @@ -555,7 +556,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.MONITOR_VIEW_CUSTOM_FIELDS + PageMap.MONITOR_VIEW_CUSTOM_FIELDS ] as Route } /> @@ -735,7 +736,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_DELETE + PageMap.STATUS_PAGE_VIEW_DELETE ] as Route } /> @@ -753,7 +754,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_BRANDING + PageMap.STATUS_PAGE_VIEW_BRANDING ] as Route } /> @@ -771,7 +772,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_CUSTOM_HTML_CSS + PageMap.STATUS_PAGE_VIEW_CUSTOM_HTML_CSS ] as Route } /> @@ -789,7 +790,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_ADVANCED_OPTIONS + PageMap.STATUS_PAGE_VIEW_ADVANCED_OPTIONS ] as Route } /> @@ -807,7 +808,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_CUSTOM_FIELDS + PageMap.STATUS_PAGE_VIEW_CUSTOM_FIELDS ] as Route } /> @@ -824,7 +825,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_OWNERS + PageMap.STATUS_PAGE_VIEW_OWNERS ] as Route } /> @@ -856,7 +857,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_EMAIL_SUBSCRIBERS + PageMap.STATUS_PAGE_VIEW_EMAIL_SUBSCRIBERS ] as Route } /> @@ -874,8 +875,8 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap - .STATUS_PAGE_VIEW_AUTHENTICATION_SETTINGS + PageMap + .STATUS_PAGE_VIEW_AUTHENTICATION_SETTINGS ] as Route } /> @@ -893,7 +894,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_CUSTOM_SMTP + PageMap.STATUS_PAGE_VIEW_CUSTOM_SMTP ] as Route } /> @@ -911,7 +912,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_SETTINGS + PageMap.STATUS_PAGE_VIEW_SETTINGS ] as Route } /> @@ -929,7 +930,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_PRIVATE_USERS + PageMap.STATUS_PAGE_VIEW_PRIVATE_USERS ] as Route } /> @@ -947,7 +948,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_SMS_SUBSCRIBERS + PageMap.STATUS_PAGE_VIEW_SMS_SUBSCRIBERS ] as Route } /> @@ -965,7 +966,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_HEADER_STYLE + PageMap.STATUS_PAGE_VIEW_HEADER_STYLE ] as Route } /> @@ -983,7 +984,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_FOOTER_STYLE + PageMap.STATUS_PAGE_VIEW_FOOTER_STYLE ] as Route } /> @@ -1001,7 +1002,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_NAVBAR_STYLE + PageMap.STATUS_PAGE_VIEW_NAVBAR_STYLE ] as Route } /> @@ -1019,7 +1020,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_WEBHOOK_SUBSCRIBERS + PageMap.STATUS_PAGE_VIEW_WEBHOOK_SUBSCRIBERS ] as Route } /> @@ -1037,7 +1038,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_EMBEDDED + PageMap.STATUS_PAGE_VIEW_EMBEDDED ] as Route } /> @@ -1055,7 +1056,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_RESOURCES + PageMap.STATUS_PAGE_VIEW_RESOURCES ] as Route } /> @@ -1073,7 +1074,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_DOMAINS + PageMap.STATUS_PAGE_VIEW_DOMAINS ] as Route } /> @@ -1090,7 +1091,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_GROUPS + PageMap.STATUS_PAGE_VIEW_GROUPS ] as Route } /> @@ -1108,7 +1109,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.STATUS_PAGE_VIEW_ANNOUNCEMENTS + PageMap.STATUS_PAGE_VIEW_ANNOUNCEMENTS ] as Route } /> @@ -1176,7 +1177,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.INCIDENT_VIEW_STATE_TIMELINE + PageMap.INCIDENT_VIEW_STATE_TIMELINE ] as Route } /> @@ -1193,7 +1194,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.INCIDENT_INTERNAL_NOTE + PageMap.INCIDENT_INTERNAL_NOTE ] as Route } /> @@ -1211,7 +1212,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.INCIDENT_VIEW_CUSTOM_FIELDS + PageMap.INCIDENT_VIEW_CUSTOM_FIELDS ] as Route } /> @@ -1229,8 +1230,8 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap - .ON_CALL_DUTY_POLICY_VIEW_CUSTOM_FIELDS + PageMap + .ON_CALL_DUTY_POLICY_VIEW_CUSTOM_FIELDS ] as Route } /> @@ -1278,7 +1279,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SCHEDULED_MAINTENANCE_EVENTS + PageMap.SCHEDULED_MAINTENANCE_EVENTS ] as Route } /> @@ -1296,7 +1297,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.ONGOING_SCHEDULED_MAINTENANCE_EVENTS + PageMap.ONGOING_SCHEDULED_MAINTENANCE_EVENTS ] as Route } /> @@ -1314,7 +1315,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SCHEDULED_MAINTENANCE_VIEW + PageMap.SCHEDULED_MAINTENANCE_VIEW ] as Route } /> @@ -1332,8 +1333,8 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap - .SCHEDULED_MAINTENANCE_VIEW_CUSTOM_FIELDS + PageMap + .SCHEDULED_MAINTENANCE_VIEW_CUSTOM_FIELDS ] as Route } /> @@ -1351,7 +1352,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SCHEDULED_MAINTENANCE_VIEW_DELETE + PageMap.SCHEDULED_MAINTENANCE_VIEW_DELETE ] as Route } /> @@ -1369,7 +1370,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SCHEDULED_MAINTENANCE_VIEW_OWNERS + PageMap.SCHEDULED_MAINTENANCE_VIEW_OWNERS ] as Route } /> @@ -1387,8 +1388,8 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap - .SCHEDULED_MAINTENANCE_VIEW_STATE_TIMELINE + PageMap + .SCHEDULED_MAINTENANCE_VIEW_STATE_TIMELINE ] as Route } /> @@ -1406,7 +1407,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SCHEDULED_MAINTENANCE_INTERNAL_NOTE + PageMap.SCHEDULED_MAINTENANCE_INTERNAL_NOTE ] as Route } /> @@ -1424,7 +1425,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SCHEDULED_MAINTENANCE_PUBLIC_NOTE + PageMap.SCHEDULED_MAINTENANCE_PUBLIC_NOTE ] as Route } /> @@ -1524,7 +1525,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SETTINGS_MONITORS_STATUS + PageMap.SETTINGS_MONITORS_STATUS ] as Route } /> @@ -1542,7 +1543,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SETTINGS_INCIDENTS_STATE + PageMap.SETTINGS_INCIDENTS_STATE ] as Route } /> @@ -1560,7 +1561,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SETTINGS_SCHEDULED_MAINTENANCE_STATE + PageMap.SETTINGS_SCHEDULED_MAINTENANCE_STATE ] as Route } /> @@ -1588,7 +1589,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SETTINGS_INCIDENTS_SEVERITY + PageMap.SETTINGS_INCIDENTS_SEVERITY ] as Route } /> @@ -1658,7 +1659,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SETTINGS_MONITOR_CUSTOM_FIELDS + PageMap.SETTINGS_MONITOR_CUSTOM_FIELDS ] as Route } /> @@ -1676,7 +1677,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SETTINGS_STATUS_PAGE_CUSTOM_FIELDS + PageMap.SETTINGS_STATUS_PAGE_CUSTOM_FIELDS ] as Route } /> @@ -1694,8 +1695,8 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap - .SETTINGS_SCHEDULED_MAINTENANCE_CUSTOM_FIELDS + PageMap + .SETTINGS_SCHEDULED_MAINTENANCE_CUSTOM_FIELDS ] as Route } /> @@ -1713,7 +1714,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SETTINGS_INCIDENT_CUSTOM_FIELDS + PageMap.SETTINGS_INCIDENT_CUSTOM_FIELDS ] as Route } /> @@ -1731,8 +1732,8 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap - .SETTINGS_ON_CALL_DUTY_POLICY_CUSTOM_FIELDS + PageMap + .SETTINGS_ON_CALL_DUTY_POLICY_CUSTOM_FIELDS ] as Route } /> @@ -1762,7 +1763,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.SETTINGS_BILLING_INVOICES + PageMap.SETTINGS_BILLING_INVOICES ] as Route } /> @@ -1842,7 +1843,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.ON_CALL_DUTY_EXECUTION_LOGS + PageMap.ON_CALL_DUTY_EXECUTION_LOGS ] as Route } /> @@ -1860,7 +1861,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.ON_CALL_DUTY_EXECUTION_LOGS_TIMELINE + PageMap.ON_CALL_DUTY_EXECUTION_LOGS_TIMELINE ] as Route } /> @@ -1893,7 +1894,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.ON_CALL_DUTY_POLICY_VIEW + PageMap.ON_CALL_DUTY_POLICY_VIEW ] as Route } /> @@ -1911,7 +1912,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.ON_CALL_DUTY_POLICY_VIEW_DELETE + PageMap.ON_CALL_DUTY_POLICY_VIEW_DELETE ] as Route } /> @@ -1929,7 +1930,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.ON_CALL_DUTY_POLICY_VIEW_ESCALATION + PageMap.ON_CALL_DUTY_POLICY_VIEW_ESCALATION ] as Route } /> @@ -1947,8 +1948,8 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap - .ON_CALL_DUTY_POLICY_VIEW_EXECUTION_LOGS + PageMap + .ON_CALL_DUTY_POLICY_VIEW_EXECUTION_LOGS ] as Route } /> @@ -1966,8 +1967,8 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap - .ON_CALL_DUTY_POLICY_VIEW_EXECUTION_LOG_VIEW + PageMap + .ON_CALL_DUTY_POLICY_VIEW_EXECUTION_LOG_VIEW ] as Route } /> @@ -2079,7 +2080,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.USER_SETTINGS_NOTIFICATION_LOGS + PageMap.USER_SETTINGS_NOTIFICATION_LOGS ] as Route } /> @@ -2097,14 +2098,35 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap - .USER_SETTINGS_NOTIFICATION_LOGS_TIMELINE + PageMap + .USER_SETTINGS_NOTIFICATION_LOGS_TIMELINE ] as Route } /> } /> + + } + /> + + + { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.USER_SETTINGS_NOTIFICATION_METHODS + PageMap.USER_SETTINGS_NOTIFICATION_METHODS ] as Route } /> @@ -2134,7 +2156,7 @@ const App: FunctionComponent = () => { {...commonPageProps} pageRoute={ RouteMap[ - PageMap.USER_SETTINGS_ON_CALL_RULES + PageMap.USER_SETTINGS_ON_CALL_RULES ] as Route } /> diff --git a/Dashboard/src/Pages/UserSettings/NotificationRules.tsx b/Dashboard/src/Pages/UserSettings/NotificationRules.tsx deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Dashboard/src/Pages/UserSettings/NotificationSettings.tsx b/Dashboard/src/Pages/UserSettings/NotificationSettings.tsx new file mode 100644 index 0000000000..ef2585f51f --- /dev/null +++ b/Dashboard/src/Pages/UserSettings/NotificationSettings.tsx @@ -0,0 +1,219 @@ +import Route from 'Common/Types/API/Route'; +import Page from 'CommonUI/src/Components/Page/Page'; +import React, { + FunctionComponent, + ReactElement, +} from 'react'; +import PageMap from '../../Utils/PageMap'; +import RouteMap, { RouteUtil } from '../../Utils/RouteMap'; +import PageComponentProps from '../PageComponentProps'; +import DashboardSideMenu from './SideMenu'; +import DashboardNavigation from '../../Utils/Navigation'; +import ModelTable from 'CommonUI/src/Components/ModelTable/ModelTable'; +import User from 'CommonUI/src/Utils/User'; +import UserNotificationSetting from 'Model/Models/UserNotificationSetting'; +import IconProp from 'Common/Types/Icon/IconProp'; +import FormFieldSchemaType from 'CommonUI/src/Components/Forms/Types/FormFieldSchemaType'; +import FieldType from 'CommonUI/src/Components/Types/FieldType'; +import NotificationSettingEventType from 'Common/Types/NotificationSetting/NotificationSettingEventType'; +import DropdownUtil from 'CommonUI/src/Utils/Dropdown'; + + +const Settings: FunctionComponent = ( + _props: PageComponentProps +): ReactElement => { + + + + const getModelTable: Function = (options: { + eventOptions: Array; + title: string; + description: string; + }): ReactElement => { + return ( + + modelType={UserNotificationSetting} + query={{ + projectId: DashboardNavigation.getProjectId()?.toString(), + userId: User.getUserId().toString(), + eventType: options.eventOptions, + }} + onBeforeCreate={( + model: UserNotificationSetting + ): UserNotificationSetting => { + model.projectId = DashboardNavigation.getProjectId()!; + model.userId = User.getUserId(); + return model; + }} + createVerb={'Add'} + id="notification-settings" + name={`User Settings > Notification Rules > ${options.title + }`} + isDeleteable={true} + isEditable={true} + isCreateable={true} + cardProps={{ + icon: IconProp.AdjustmentVertical, + title: options.title, + description: options.description, + }} + noItemsMessage={ + 'No notification settings found. Please add one to receive notifications.' + } + formFields={[ + { + field: { + eventType: true, + }, + title: 'Event Type', + description: 'Select the event type.', + fieldType: FormFieldSchemaType.Dropdown, + required: true, + placeholder: 'Select an event type', + dropdownOptions: DropdownUtil.getDropdownOptionsFromArray(options.eventOptions), + }, + { + field: { + alertByEmail: true, + }, + title: 'Alert By Email', + description: 'Select if you want to be alerted by email.', + fieldType: FormFieldSchemaType.Toggle, + required: false, + }, + { + field: { + alertBySMS: true, + }, + title: 'Alert By SMS', + description: 'Select if you want to be alerted by SMS.', + fieldType: FormFieldSchemaType.Toggle, + required: false, + }, + { + field: { + alertByEmail: true, + }, + title: 'Alert By Call', + description: 'Select if you want to be alerted by call.', + fieldType: FormFieldSchemaType.Toggle, + required: false, + }, + ]} + showRefreshButton={true} + showFilterButton={false} + selectMoreFields={{ + userEmail: { + email: true, + }, + userSms: { + phone: true, + }, + }} + columns={[ + { + field: { + eventType: true, + }, + title: 'Event Type', + type: FieldType.Text, + isFilterable: true, + }, + { + field: { + alertByEmail: true, + }, + title: 'Email Alerts', + type: FieldType.Boolean, + }, + { + field: { + alertBySMS: true, + }, + title: 'SMS Alerts', + type: FieldType.Boolean, + }, + { + field: { + alertByCall: true, + }, + title: 'Call Alerts', + type: FieldType.Boolean, + }, + ]} + /> + ); + }; + + return ( + } + > +
+ {getModelTable({ + eventOptions: [NotificationSettingEventType.SEND_INCIDENT_NOTE_POSTED_OWNER_NOTIFICATION, NotificationSettingEventType.SEND_INCIDENT_OWNER_ADDED_NOTIFICATION, NotificationSettingEventType.SEND_INCIDENT_CREATED_OWNER_NOTIFICATION, NotificationSettingEventType.SEND_INCIDENT_STATE_CHANGED_OWNER_NOTIFICATION], + title: + 'Incident Notifications', + description: + 'Here are the list of notification methods we will use when an event happens on an incident.', + })} +
+ +
+ {getModelTable({ + eventOptions: [NotificationSettingEventType.SEND_MONITOR_OWNER_ADDED_NOTIFICATION, NotificationSettingEventType.SEND_MONITOR_CREATED_OWNER_NOTIFICATION, NotificationSettingEventType.SEND_MONITOR_STATUS_CHANGED_OWNER_NOTIFICATION, NotificationSettingEventType.SEND_INCIDENT_STATE_CHANGED_OWNER_NOTIFICATION], + title: + 'Monitor Notifications', + description: + 'Here are the list of notification methods we will use when an event happens on a monitor.', + })} +
+ + +
+ {getModelTable({ + eventOptions: [NotificationSettingEventType.SEND_STATUS_PAGE_CREATED_OWNER_NOTIFICATION, NotificationSettingEventType.SEND_STATUS_PAGE_OWNER_ADDED_NOTIFICATION, NotificationSettingEventType.SEND_INCIDENT_CREATED_OWNER_NOTIFICATION], + title: + 'Status Page Notifications', + description: + 'Here are the list of notification methods we will use when an event happens on a status page.', + })} +
+ + +
+ {getModelTable({ + eventOptions: [NotificationSettingEventType.SEND_SCHEDULED_MAINTENANCE_NOTE_POSTED_OWNER_NOTIFICATION, NotificationSettingEventType.SEND_SCHEDULED_MAINTENANCE_OWNER_ADDED_NOTIFICATION, NotificationSettingEventType.SEND_SCHEDULED_MAINTENANCE_CREATED_OWNER_NOTIFICATION, NotificationSettingEventType.SEND_SCHEDULED_MAINTENANCE_STATE_CHANGED_OWNER_NOTIFICATION], + title: + 'Scheduled Maintenance Notifications', + description: + 'Here are the list of notification methods we will use when an event happens on an incident.', + })} +
+ +
+ ); +}; + +export default Settings; diff --git a/Dashboard/src/Pages/UserSettings/SideMenu.tsx b/Dashboard/src/Pages/UserSettings/SideMenu.tsx index c9da61cef6..236a64e720 100644 --- a/Dashboard/src/Pages/UserSettings/SideMenu.tsx +++ b/Dashboard/src/Pages/UserSettings/SideMenu.tsx @@ -10,6 +10,7 @@ import Link from 'Common/Types/Link'; import Navigation from 'CommonUI/src/Utils/Navigation'; const DashboardSideMenu: FunctionComponent = (): ReactElement => { + let subItemMenuLink: Link | undefined = undefined; if ( @@ -37,6 +38,17 @@ const DashboardSideMenu: FunctionComponent = (): ReactElement => { }} icon={IconProp.Bell} /> + = { `/dashboard/${RouteParams.ProjectID}/user-settings/notification-methods` ), + [PageMap.USER_SETTINGS_NOTIFICATION_SETTINGS]: new Route( + `/dashboard/${RouteParams.ProjectID}/user-settings/notification-settings` + ), + + [PageMap.USER_SETTINGS_NOTIFICATION_METHODS]: new Route( `/dashboard/${RouteParams.ProjectID}/settings/notification-methods` ), diff --git a/Dashboard/webpack.config.js b/Dashboard/webpack.config.js index d550007b83..a7aae7b218 100644 --- a/Dashboard/webpack.config.js +++ b/Dashboard/webpack.config.js @@ -38,9 +38,7 @@ module.exports = { new webpack.DefinePlugin({ 'process': { 'env': { - ...readEnvFile('../Common/.env'), - ...readEnvFile('../CommonUI/.env'), - ...readEnvFile('./.env') + ...readEnvFile('/usr/src/app/.env') } } }), diff --git a/StatusPage/Dockerfile.tpl b/StatusPage/Dockerfile.tpl index 0b551156df..df30181942 100755 --- a/StatusPage/Dockerfile.tpl +++ b/StatusPage/Dockerfile.tpl @@ -71,6 +71,7 @@ EXPOSE 3105 EXPOSE 3106 {{ if eq .Env.ENVIRONMENT "development" }} +RUN printenv > /usr/src/app/.env #Run the app CMD [ "npm", "run", "dev" ] {{ else }} diff --git a/StatusPage/src/Pages/Overview/Overview.tsx b/StatusPage/src/Pages/Overview/Overview.tsx index 3a8cbc2e61..a156ec5fa3 100644 --- a/StatusPage/src/Pages/Overview/Overview.tsx +++ b/StatusPage/src/Pages/Overview/Overview.tsx @@ -550,6 +550,7 @@ const Overview: FunctionComponent = ( (announcement: StatusPageAnnouncement, i: number) => { return ( = ( (incidentGroup: IncidentGroup, i: number) => { return ( = ( return ( logs.txt", "build": "docker compose build -f docker-compose.dev.yml $npm_config_services", - "force-build": "export $(grep -v '^#' config.env | xargs) && docker compose -f docker-compose.dev.yml build --no-cache $npm_config_services", + "force-build": "export $(grep -v '^#' config.env | xargs) && npm run prerun && docker compose -f docker-compose.dev.yml build --no-cache $npm_config_services", "force-build-dev": "npm run config-to-dev && npm run force-build", "kill": "npm run stop", "prod": "npm run config-to-prod && export $(grep -v '^#' config.env | xargs) && docker compose up -f docker-compose.yml -d",