make env work in development.

This commit is contained in:
Simon Larsen 2023-07-21 12:09:46 +01:00
parent 316ef6ff53
commit 6939ee1f0d
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
16 changed files with 365 additions and 95 deletions

View File

@ -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 }}

View File

@ -38,9 +38,7 @@ module.exports = {
new webpack.DefinePlugin({
'process': {
'env': {
...readEnvFile('../Common/.env'),
...readEnvFile('../CommonUI/.env'),
...readEnvFile('./.env')
...readEnvFile('/usr/src/app/.env')
}
}
}),

View File

@ -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;

View File

@ -11,4 +11,15 @@ export default class DropdownUtil {
};
});
}
public static getDropdownOptionsFromArray(
arr: Array<string>
): Array<DropdownOption> {
return arr.map((item: string) => {
return {
label: item,
value: item,
};
});
}
}

View File

@ -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

View File

@ -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
}
/>
}
/>
<PageRoute
path={
RouteMap[
PageMap.USER_SETTINGS_NOTIFICATION_SETTINGS
]?.toString() || ''
}
element={
<UserSettingsNotiifcationSetting
{...commonPageProps}
pageRoute={
RouteMap[
PageMap
.USER_SETTINGS_NOTIFICATION_SETTINGS
] as Route
}
/>
}
/>
<PageRoute
path={
RouteMap[
@ -2116,7 +2138,7 @@ const App: FunctionComponent = () => {
{...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
}
/>

View File

@ -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<PageComponentProps> = (
_props: PageComponentProps
): ReactElement => {
const getModelTable: Function = (options: {
eventOptions: Array<NotificationSettingEventType>;
title: string;
description: string;
}): ReactElement => {
return (
<ModelTable<UserNotificationSetting>
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 (
<Page
title={'User Settings'}
breadcrumbLinks={[
{
title: 'Project',
to: RouteUtil.populateRouteParams(
RouteMap[PageMap.HOME] as Route
),
},
{
title: 'User Settings',
to: RouteUtil.populateRouteParams(
RouteMap[PageMap.USER_SETTINGS] as Route
),
},
{
title: 'Notification Settings',
to: RouteUtil.populateRouteParams(
RouteMap[PageMap.USER_SETTINGS_NOTIFICATION_SETTINGS] as Route
),
},
]}
sideMenu={<DashboardSideMenu />}
>
<div>
{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.',
})}
</div>
<div>
{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.',
})}
</div>
<div>
{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.',
})}
</div>
<div>
{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.',
})}
</div>
</Page>
);
};
export default Settings;

View File

@ -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}
/>
<SideMenuItem
link={{
title: 'Notification Settings',
to: RouteUtil.populateRouteParams(
RouteMap[
PageMap.USER_SETTINGS_NOTIFICATION_SETTINGS
] as Route
),
}}
icon={IconProp.Settings}
/>
<SideMenuItem
link={{
title: 'On-Call Rules',

View File

@ -95,6 +95,7 @@ enum PageMap {
USER_SETTINGS_ON_CALL_RULES = 'USER_SETTINGS_ON_CALL_RULES',
USER_SETTINGS_NOTIFICATION_LOGS = 'USER_SETTINGS_NOTIFICATION_LOGS',
USER_SETTINGS_NOTIFICATION_LOGS_TIMELINE = 'USER_SETTINGS_NOTIFICATION_LOGS_TIMELINE',
USER_SETTINGS_NOTIFICATION_SETTINGS = 'USER_SETTINGS_NOTIFICATION_SETTINGS',
// Settings Routes
SETTINGS = 'SETTINGS',

View File

@ -319,6 +319,11 @@ const RouteMap: Dictionary<Route> = {
`/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`
),

View File

@ -38,9 +38,7 @@ module.exports = {
new webpack.DefinePlugin({
'process': {
'env': {
...readEnvFile('../Common/.env'),
...readEnvFile('../CommonUI/.env'),
...readEnvFile('./.env')
...readEnvFile('/usr/src/app/.env')
}
}
}),

View File

@ -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 }}

View File

@ -550,6 +550,7 @@ const Overview: FunctionComponent<PageComponentProps> = (
(announcement: StatusPageAnnouncement, i: number) => {
return (
<EventItem
isDetailItem={false}
key={i}
{...getAnnouncementEventItem(
announcement,
@ -567,6 +568,7 @@ const Overview: FunctionComponent<PageComponentProps> = (
(incidentGroup: IncidentGroup, i: number) => {
return (
<EventItem
isDetailItem={false}
key={i}
{...getIncidentEventItem(
incidentGroup.incident,
@ -591,6 +593,7 @@ const Overview: FunctionComponent<PageComponentProps> = (
return (
<EventItem
key={i}
isDetailItem={false}
{...getScheduledEventEventItem(
scheduledEventGroup.scheduledMaintenance,
scheduledEventGroup.publicNotes,

View File

@ -38,9 +38,7 @@ module.exports = {
new webpack.DefinePlugin({
'process': {
'env': {
...readEnvFile('../Common/.env'),
...readEnvFile('../CommonUI/.env'),
...readEnvFile('./.env')
...readEnvFile('/usr/src/app/.env')
}
}
}),

View File

@ -50,7 +50,7 @@
"logs": "export $(grep -v '^#' config.env | xargs) && docker compose logs --tail=100 -f $npm_config_services",
"write-logs": "export $(grep -v '^#' config.env | xargs) && docker compose logs -f $npm_config_services > 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",