diff --git a/Accounts/src/Utils/Login.ts b/Accounts/src/Utils/Login.ts index 062ebd1ac5..12732ef80c 100644 --- a/Accounts/src/Utils/Login.ts +++ b/Accounts/src/Utils/Login.ts @@ -7,7 +7,7 @@ import { DASHBOARD_URL } from 'CommonUI/src/Config'; import { JSONObject } from 'Common/Types/JSON'; import User from 'Model/Models/User'; import JSONFunctions from 'Common/Types/JSONFunctions'; -import Analytics from "CommonUI/src/Utils/Analytics" +import Analytics from 'CommonUI/src/Utils/Analytics'; export default abstract class LoginUtil { public static login(value: JSONObject): void { diff --git a/Common/Utils/Analytics.ts b/Common/Utils/Analytics.ts index 4eb5e12499..99369ea972 100644 --- a/Common/Utils/Analytics.ts +++ b/Common/Utils/Analytics.ts @@ -3,8 +3,6 @@ import { JSONObject } from '../Types/JSON'; import posthog from 'posthog-js'; export default class Analytics { - - private _isInitialized: boolean = false; public get isInitialized(): boolean { return this._isInitialized; @@ -28,7 +26,6 @@ export default class Analytics { } public capture(eventName: string, data?: JSONObject): void { - if (!this.isInitialized) { return; } diff --git a/CommonUI/src/Components/Forms/BasicForm.tsx b/CommonUI/src/Components/Forms/BasicForm.tsx index d80a897a95..9143afd8fa 100644 --- a/CommonUI/src/Components/Forms/BasicForm.tsx +++ b/CommonUI/src/Components/Forms/BasicForm.tsx @@ -983,7 +983,7 @@ const BasicForm: Function = ( } } - UiAnalytics.capture("FORM SUBMIT: " + props.name); + UiAnalytics.capture('FORM SUBMIT: ' + props.name); props.onSubmit(values); setSubmitting(false); diff --git a/CommonUI/src/Components/ModelTable/ModelTable.tsx b/CommonUI/src/Components/ModelTable/ModelTable.tsx index a340c354c0..2ec16aadad 100644 --- a/CommonUI/src/Components/ModelTable/ModelTable.tsx +++ b/CommonUI/src/Components/ModelTable/ModelTable.tsx @@ -1174,11 +1174,15 @@ const ModelTable: Function = ( }` : `Edit ${props.singularName || model.singularName}` } - name={modalType === ModalType.Create - ? `${props.name} > ${props.createVerb || 'Create'} New ${ - props.singularName || model.singularName - }` - : `${props.name} > Edit ${props.singularName || model.singularName}` } + name={ + modalType === ModalType.Create + ? `${props.name} > ${ + props.createVerb || 'Create' + } New ${props.singularName || model.singularName}` + : `${props.name} > Edit ${ + props.singularName || model.singularName + }` + } initialValues={ modalType === ModalType.Create ? props.createInitialValues diff --git a/CommonUI/src/Components/Page/Page.tsx b/CommonUI/src/Components/Page/Page.tsx index 5aaa463150..96c8e91fe3 100644 --- a/CommonUI/src/Components/Page/Page.tsx +++ b/CommonUI/src/Components/Page/Page.tsx @@ -13,10 +13,17 @@ export interface ComponentProps { const Page: FunctionComponent = ( props: ComponentProps ): ReactElement => { - useEffect(() => { if (props.breadcrumbLinks && props.breadcrumbLinks.length > 0) { - Analytics.capture("Page View: " + props.breadcrumbLinks.map((link) => link.title).join(" > ").toString() || ''); + Analytics.capture( + 'Page View: ' + + props.breadcrumbLinks + .map((link: Link) => { + return link.title; + }) + .join(' > ') + .toString() || '' + ); } }, [props.breadcrumbLinks]); diff --git a/CommonUI/src/Utils/Analytics.ts b/CommonUI/src/Utils/Analytics.ts index ba3219dd44..4e79271fe7 100644 --- a/CommonUI/src/Utils/Analytics.ts +++ b/CommonUI/src/Utils/Analytics.ts @@ -1,6 +1,6 @@ -import Analytics from "Common/Utils/Analytics"; -import { AnalyticsHost, AnalyticsKey } from "../Config"; +import Analytics from 'Common/Utils/Analytics'; +import { AnalyticsHost, AnalyticsKey } from '../Config'; -const UiAnalytics = new Analytics(AnalyticsHost, AnalyticsKey); +const UiAnalytics: Analytics = new Analytics(AnalyticsHost, AnalyticsKey); -export default UiAnalytics; \ No newline at end of file +export default UiAnalytics; diff --git a/Dashboard/src/Components/Incident/IncidentsTable.tsx b/Dashboard/src/Components/Incident/IncidentsTable.tsx index 496af83b14..f96f1f7ceb 100644 --- a/Dashboard/src/Components/Incident/IncidentsTable.tsx +++ b/Dashboard/src/Components/Incident/IncidentsTable.tsx @@ -35,7 +35,6 @@ const IncidentsTable: FunctionComponent = ( ): ReactElement => { return ( - name="Incidents" modelType={Incident} id="incidents-table" @@ -187,14 +186,14 @@ const IncidentsTable: FunctionComponent = ( color={ ( item[ - 'currentIncidentState' + 'currentIncidentState' ] as JSONObject )['color'] as Color } text={ ( item[ - 'currentIncidentState' + 'currentIncidentState' ] as JSONObject )['name'] as string } @@ -230,14 +229,14 @@ const IncidentsTable: FunctionComponent = ( color={ ( item[ - 'incidentSeverity' + 'incidentSeverity' ] as JSONObject )['color'] as Color } text={ ( item[ - 'incidentSeverity' + 'incidentSeverity' ] as JSONObject )['name'] as string } diff --git a/Dashboard/src/Pages/Monitor/View/Index.tsx b/Dashboard/src/Pages/Monitor/View/Index.tsx index f256e1bbc7..0a1708ed22 100644 --- a/Dashboard/src/Pages/Monitor/View/Index.tsx +++ b/Dashboard/src/Pages/Monitor/View/Index.tsx @@ -122,7 +122,7 @@ const MonitorView: FunctionComponent = ( > {/* Monitor View */} = ( > {/* ScheduledMaintenance View */} = ( > {/* API Key View */} = ( modelType={ScheduledMaintenanceState} id="ScheduledMaintenance-state-table" - name="Settings > Sceduled Maintenance State" isDeleteable={true} isEditable={true} diff --git a/Dashboard/src/Pages/Settings/TeamView.tsx b/Dashboard/src/Pages/Settings/TeamView.tsx index 955b2fdf95..4fe3c1d090 100644 --- a/Dashboard/src/Pages/Settings/TeamView.tsx +++ b/Dashboard/src/Pages/Settings/TeamView.tsx @@ -216,7 +216,6 @@ const TeamView: FunctionComponent = ( modelType={TeamPermission} id="table-team-permission" - isDeleteable={true} isEditable={true} isCreateable={true} diff --git a/Dashboard/src/Pages/StatusPages/View/Branding.tsx b/Dashboard/src/Pages/StatusPages/View/Branding.tsx index 6bcbdb64c4..26abf64ab8 100644 --- a/Dashboard/src/Pages/StatusPages/View/Branding.tsx +++ b/Dashboard/src/Pages/StatusPages/View/Branding.tsx @@ -58,7 +58,7 @@ const StatusPageDelete: FunctionComponent = ( > - name="Statusn Page > Branding > Title and Description" + name="Statusn Page > Branding > Title and Description" cardProps={{ title: 'Title and Description', description: 'This will also be used for SEO.', @@ -113,7 +113,7 @@ const StatusPageDelete: FunctionComponent = ( /> - name="Statusn Page > Branding > Favicon" + name="Statusn Page > Branding > Favicon" cardProps={{ title: 'Favicon', description: 'Favicon will be used for SEO.', @@ -154,7 +154,7 @@ const StatusPageDelete: FunctionComponent = ( /> - name="Statusn Page > Branding > Colors" + name="Statusn Page > Branding > Colors" cardProps={{ title: 'Page Colors', description: diff --git a/Dashboard/src/Pages/StatusPages/View/CustomHtmlCss.tsx b/Dashboard/src/Pages/StatusPages/View/CustomHtmlCss.tsx index d19f66810b..3a191e0702 100644 --- a/Dashboard/src/Pages/StatusPages/View/CustomHtmlCss.tsx +++ b/Dashboard/src/Pages/StatusPages/View/CustomHtmlCss.tsx @@ -59,7 +59,7 @@ const StatusPageDelete: FunctionComponent = ( {/* StatusPage View */} - name="Statusn Page > Branding > Header HTML" + name="Statusn Page > Branding > Header HTML" cardProps={{ title: 'Header HTML', description: @@ -99,7 +99,7 @@ const StatusPageDelete: FunctionComponent = ( {/* StatusPage View */} - name="Statusn Page > Branding > Footer HTML" + name="Statusn Page > Branding > Footer HTML" cardProps={{ title: 'Footer HTML', description: @@ -139,7 +139,7 @@ const StatusPageDelete: FunctionComponent = ( {/* StatusPage View */} - name="Statusn Page > Branding > Custom CSS" + name="Statusn Page > Branding > Custom CSS" cardProps={{ title: 'Custom CSS', description: @@ -179,7 +179,7 @@ const StatusPageDelete: FunctionComponent = ( {/* StatusPage View */} - name="Statusn Page > Branding > Custom JavaScript" + name="Statusn Page > Branding > Custom JavaScript" cardProps={{ title: 'Custom JavaScript', description: diff --git a/Dashboard/src/Pages/StatusPages/View/FooterStyle.tsx b/Dashboard/src/Pages/StatusPages/View/FooterStyle.tsx index 6fe7be8c9b..0155460696 100644 --- a/Dashboard/src/Pages/StatusPages/View/FooterStyle.tsx +++ b/Dashboard/src/Pages/StatusPages/View/FooterStyle.tsx @@ -65,7 +65,7 @@ const StatusPageDelete: FunctionComponent = ( - name="Statusn Page > Branding > Copyright" + name="Statusn Page > Branding > Copyright" cardProps={{ title: 'Copyright Info', description: 'Copyright info for your status page', @@ -177,7 +177,7 @@ const StatusPageDelete: FunctionComponent = ( /> - name="Statusn Page > Branding > Footer Colors" + name="Statusn Page > Branding > Footer Colors" cardProps={{ title: 'Footer Colors', description: @@ -233,7 +233,7 @@ const StatusPageDelete: FunctionComponent = ( /> - name="Statusn Page > Branding > Advanced Footer Settings" + name="Statusn Page > Branding > Advanced Footer Settings" cardProps={{ title: 'Advanced Footer Settings', description: diff --git a/Dashboard/src/Pages/StatusPages/View/HeaderStyle.tsx b/Dashboard/src/Pages/StatusPages/View/HeaderStyle.tsx index 1ef3a3ee4e..67615aae86 100644 --- a/Dashboard/src/Pages/StatusPages/View/HeaderStyle.tsx +++ b/Dashboard/src/Pages/StatusPages/View/HeaderStyle.tsx @@ -65,7 +65,7 @@ const StatusPageDelete: FunctionComponent = ( - name="Statusn Page > Branding > Header Style" + name="Statusn Page > Branding > Header Style" cardProps={{ title: 'Logo, Cover and Favicon', description: 'These will show up on your status page.', @@ -200,7 +200,7 @@ const StatusPageDelete: FunctionComponent = ( /> - name="Statusn Page > Branding > Header Colors" + name="Statusn Page > Branding > Header Colors" cardProps={{ title: 'Header Colors', description: @@ -256,7 +256,7 @@ const StatusPageDelete: FunctionComponent = ( /> - name="Statusn Page > Branding > Cover Image Colors" + name="Statusn Page > Branding > Cover Image Colors" cardProps={{ title: 'Cover Image Colors', description: @@ -295,7 +295,7 @@ const StatusPageDelete: FunctionComponent = ( /> - name="Statusn Page > Branding > Advanced Header Settings" + name="Statusn Page > Branding > Advanced Header Settings" cardProps={{ title: 'Advanced Header Settings', description: diff --git a/Dashboard/src/Pages/StatusPages/View/Index.tsx b/Dashboard/src/Pages/StatusPages/View/Index.tsx index 857d30b36e..4a43e68ea6 100644 --- a/Dashboard/src/Pages/StatusPages/View/Index.tsx +++ b/Dashboard/src/Pages/StatusPages/View/Index.tsx @@ -57,7 +57,7 @@ const StatusPageView: FunctionComponent = ( {/* StatusPage View */} = ( - name="Statusn Page > Branding > Nav Bar Menu Colors" + name="Statusn Page > Branding > Nav Bar Menu Colors" cardProps={{ title: 'Navigation Menu Colors', description: