mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
fix lint,
This commit is contained in:
parent
6ff058fd37
commit
aea93f0ba3
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -983,7 +983,7 @@ const BasicForm: Function = <T extends Object>(
|
||||
}
|
||||
}
|
||||
|
||||
UiAnalytics.capture("FORM SUBMIT: " + props.name);
|
||||
UiAnalytics.capture('FORM SUBMIT: ' + props.name);
|
||||
|
||||
props.onSubmit(values);
|
||||
setSubmitting(false);
|
||||
|
@ -1174,11 +1174,15 @@ const ModelTable: Function = <TBaseModel extends BaseModel>(
|
||||
}`
|
||||
: `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
|
||||
|
@ -13,10 +13,17 @@ export interface ComponentProps {
|
||||
const Page: FunctionComponent<ComponentProps> = (
|
||||
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]);
|
||||
|
||||
|
@ -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;
|
||||
export default UiAnalytics;
|
||||
|
@ -35,7 +35,6 @@ const IncidentsTable: FunctionComponent<ComponentProps> = (
|
||||
): ReactElement => {
|
||||
return (
|
||||
<ModelTable<Incident>
|
||||
|
||||
name="Incidents"
|
||||
modelType={Incident}
|
||||
id="incidents-table"
|
||||
@ -187,14 +186,14 @@ const IncidentsTable: FunctionComponent<ComponentProps> = (
|
||||
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<ComponentProps> = (
|
||||
color={
|
||||
(
|
||||
item[
|
||||
'incidentSeverity'
|
||||
'incidentSeverity'
|
||||
] as JSONObject
|
||||
)['color'] as Color
|
||||
}
|
||||
text={
|
||||
(
|
||||
item[
|
||||
'incidentSeverity'
|
||||
'incidentSeverity'
|
||||
] as JSONObject
|
||||
)['name'] as string
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ const MonitorView: FunctionComponent<PageComponentProps> = (
|
||||
>
|
||||
{/* Monitor View */}
|
||||
<CardModelDetail
|
||||
name="Monitor Details"
|
||||
name="Monitor Details"
|
||||
cardProps={{
|
||||
title: 'Monitor Details',
|
||||
description: "Here's more details for this monitor.",
|
||||
|
@ -67,7 +67,7 @@ const ScheduledMaintenanceView: FunctionComponent<PageComponentProps> = (
|
||||
>
|
||||
{/* ScheduledMaintenance View */}
|
||||
<CardModelDetail
|
||||
name='Scheduled Maintenance Details'
|
||||
name="Scheduled Maintenance Details"
|
||||
cardProps={{
|
||||
title: 'Scheduled Maintenance Details',
|
||||
description: "Here's more details for this event.",
|
||||
|
@ -56,7 +56,7 @@ const APIKeyView: FunctionComponent<PageComponentProps> = (
|
||||
>
|
||||
{/* API Key View */}
|
||||
<CardModelDetail
|
||||
name='API Key Details'
|
||||
name="API Key Details"
|
||||
cardProps={{
|
||||
title: 'API Key Details',
|
||||
description: "Here's more details on this API Key.",
|
||||
|
@ -45,7 +45,6 @@ const ScheduledMaintenancesPage: FunctionComponent<PageComponentProps> = (
|
||||
<ModelTable<ScheduledMaintenanceState>
|
||||
modelType={ScheduledMaintenanceState}
|
||||
id="ScheduledMaintenance-state-table"
|
||||
|
||||
name="Settings > Sceduled Maintenance State"
|
||||
isDeleteable={true}
|
||||
isEditable={true}
|
||||
|
@ -216,7 +216,6 @@ const TeamView: FunctionComponent<PageComponentProps> = (
|
||||
<ModelTable<TeamPermission>
|
||||
modelType={TeamPermission}
|
||||
id="table-team-permission"
|
||||
|
||||
isDeleteable={true}
|
||||
isEditable={true}
|
||||
isCreateable={true}
|
||||
|
@ -58,7 +58,7 @@ const StatusPageDelete: FunctionComponent<PageComponentProps> = (
|
||||
>
|
||||
<StatusPagePreviewLink modelId={modelId} />
|
||||
<CardModelDetail<StatusPage>
|
||||
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<PageComponentProps> = (
|
||||
/>
|
||||
|
||||
<CardModelDetail<StatusPage>
|
||||
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<PageComponentProps> = (
|
||||
/>
|
||||
|
||||
<CardModelDetail<StatusPage>
|
||||
name="Statusn Page > Branding > Colors"
|
||||
name="Statusn Page > Branding > Colors"
|
||||
cardProps={{
|
||||
title: 'Page Colors',
|
||||
description:
|
||||
|
@ -59,7 +59,7 @@ const StatusPageDelete: FunctionComponent<PageComponentProps> = (
|
||||
<StatusPagePreviewLink modelId={modelId} />
|
||||
{/* StatusPage View */}
|
||||
<CardModelDetail<StatusPage>
|
||||
name="Statusn Page > Branding > Header HTML"
|
||||
name="Statusn Page > Branding > Header HTML"
|
||||
cardProps={{
|
||||
title: 'Header HTML',
|
||||
description:
|
||||
@ -99,7 +99,7 @@ const StatusPageDelete: FunctionComponent<PageComponentProps> = (
|
||||
|
||||
{/* StatusPage View */}
|
||||
<CardModelDetail<StatusPage>
|
||||
name="Statusn Page > Branding > Footer HTML"
|
||||
name="Statusn Page > Branding > Footer HTML"
|
||||
cardProps={{
|
||||
title: 'Footer HTML',
|
||||
description:
|
||||
@ -139,7 +139,7 @@ const StatusPageDelete: FunctionComponent<PageComponentProps> = (
|
||||
|
||||
{/* StatusPage View */}
|
||||
<CardModelDetail<StatusPage>
|
||||
name="Statusn Page > Branding > Custom CSS"
|
||||
name="Statusn Page > Branding > Custom CSS"
|
||||
cardProps={{
|
||||
title: 'Custom CSS',
|
||||
description:
|
||||
@ -179,7 +179,7 @@ const StatusPageDelete: FunctionComponent<PageComponentProps> = (
|
||||
|
||||
{/* StatusPage View */}
|
||||
<CardModelDetail<StatusPage>
|
||||
name="Statusn Page > Branding > Custom JavaScript"
|
||||
name="Statusn Page > Branding > Custom JavaScript"
|
||||
cardProps={{
|
||||
title: 'Custom JavaScript',
|
||||
description:
|
||||
|
@ -65,7 +65,7 @@ const StatusPageDelete: FunctionComponent<PageComponentProps> = (
|
||||
<StatusPagePreviewLink modelId={modelId} />
|
||||
|
||||
<CardModelDetail<StatusPage>
|
||||
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<PageComponentProps> = (
|
||||
/>
|
||||
|
||||
<CardModelDetail<StatusPage>
|
||||
name="Statusn Page > Branding > Footer Colors"
|
||||
name="Statusn Page > Branding > Footer Colors"
|
||||
cardProps={{
|
||||
title: 'Footer Colors',
|
||||
description:
|
||||
@ -233,7 +233,7 @@ const StatusPageDelete: FunctionComponent<PageComponentProps> = (
|
||||
/>
|
||||
|
||||
<CardModelDetail<StatusPage>
|
||||
name="Statusn Page > Branding > Advanced Footer Settings"
|
||||
name="Statusn Page > Branding > Advanced Footer Settings"
|
||||
cardProps={{
|
||||
title: 'Advanced Footer Settings',
|
||||
description:
|
||||
|
@ -65,7 +65,7 @@ const StatusPageDelete: FunctionComponent<PageComponentProps> = (
|
||||
<StatusPagePreviewLink modelId={modelId} />
|
||||
|
||||
<CardModelDetail<StatusPage>
|
||||
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<PageComponentProps> = (
|
||||
/>
|
||||
|
||||
<CardModelDetail<StatusPage>
|
||||
name="Statusn Page > Branding > Header Colors"
|
||||
name="Statusn Page > Branding > Header Colors"
|
||||
cardProps={{
|
||||
title: 'Header Colors',
|
||||
description:
|
||||
@ -256,7 +256,7 @@ const StatusPageDelete: FunctionComponent<PageComponentProps> = (
|
||||
/>
|
||||
|
||||
<CardModelDetail<StatusPage>
|
||||
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<PageComponentProps> = (
|
||||
/>
|
||||
|
||||
<CardModelDetail<StatusPage>
|
||||
name="Statusn Page > Branding > Advanced Header Settings"
|
||||
name="Statusn Page > Branding > Advanced Header Settings"
|
||||
cardProps={{
|
||||
title: 'Advanced Header Settings',
|
||||
description:
|
||||
|
@ -57,7 +57,7 @@ const StatusPageView: FunctionComponent<PageComponentProps> = (
|
||||
|
||||
{/* StatusPage View */}
|
||||
<CardModelDetail
|
||||
name="Statusn Page > Status Page Details"
|
||||
name="Statusn Page > Status Page Details"
|
||||
cardProps={{
|
||||
title: 'Status Page Details',
|
||||
description: "Here's more details for this status page.",
|
||||
|
@ -61,7 +61,7 @@ const StatusPageDelete: FunctionComponent<PageComponentProps> = (
|
||||
<StatusPagePreviewLink modelId={modelId} />
|
||||
|
||||
<CardModelDetail<StatusPage>
|
||||
name="Statusn Page > Branding > Nav Bar Menu Colors"
|
||||
name="Statusn Page > Branding > Nav Bar Menu Colors"
|
||||
cardProps={{
|
||||
title: 'Navigation Menu Colors',
|
||||
description:
|
||||
|
Loading…
Reference in New Issue
Block a user