mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
refactor: Remove unused imports and update eslint configuration
This commit is contained in:
@@ -5,7 +5,6 @@ import DashboardNavigation from "../../Utils/Navigation";
|
||||
import ProjectUser from "../../Utils/ProjectUser";
|
||||
import IncidentElement from "./Incident";
|
||||
import BaseModel from "Common/Models/BaseModel";
|
||||
import Route from "Common/Types/API/Route";
|
||||
import { Black } from "Common/Types/BrandColors";
|
||||
import { LIMIT_PER_PROJECT } from "Common/Types/Database/LimitMax";
|
||||
import IconProp from "Common/Types/Icon/IconProp";
|
||||
@@ -37,10 +36,11 @@ import MonitorStatus from "Model/Models/MonitorStatus";
|
||||
import OnCallDutyPolicy from "Model/Models/OnCallDutyPolicy";
|
||||
import Team from "Model/Models/Team";
|
||||
import React, { FunctionComponent, ReactElement, useState } from "react";
|
||||
import RouteMap, { RouteUtil } from "../../Utils/RouteMap";
|
||||
import PageMap from "../../Utils/PageMap";
|
||||
|
||||
export interface ComponentProps {
|
||||
query?: Query<Incident> | undefined;
|
||||
viewPageRoute?: Route;
|
||||
noItemsMessage?: string | undefined;
|
||||
title?: string | undefined;
|
||||
description?: string | undefined;
|
||||
@@ -410,7 +410,9 @@ const IncidentsTable: FunctionComponent<ComponentProps> = (
|
||||
]}
|
||||
showRefreshButton={true}
|
||||
showViewIdButton={true}
|
||||
viewPageRoute={props.viewPageRoute}
|
||||
viewPageRoute={RouteUtil.populateRouteParams(
|
||||
RouteMap[PageMap.INCIDENTS]!,
|
||||
)}
|
||||
filters={[
|
||||
{
|
||||
field: {
|
||||
|
||||
@@ -3,7 +3,6 @@ import MonitoringInterval from "../../Utils/MonitorIntervalDropdownOptions";
|
||||
import MonitorTypeUtil from "../../Utils/MonitorType";
|
||||
import DashboardNavigation from "../../Utils/Navigation";
|
||||
import MonitorSteps from "../Form/Monitor/MonitorSteps";
|
||||
import Route from "Common/Types/API/Route";
|
||||
import { Black, Gray500 } from "Common/Types/BrandColors";
|
||||
import BadDataException from "Common/Types/Exception/BadDataException";
|
||||
import IconProp from "Common/Types/Icon/IconProp";
|
||||
@@ -33,10 +32,11 @@ import Label from "Model/Models/Label";
|
||||
import Monitor from "Model/Models/Monitor";
|
||||
import MonitorStatus from "Model/Models/MonitorStatus";
|
||||
import React, { FunctionComponent, ReactElement } from "react";
|
||||
import RouteMap, { RouteUtil } from "../../Utils/RouteMap";
|
||||
import PageMap from "../../Utils/PageMap";
|
||||
|
||||
export interface ComponentProps {
|
||||
query?: Query<Monitor> | undefined;
|
||||
viewPageRoute?: Route;
|
||||
noItemsMessage?: string | undefined;
|
||||
title?: string | undefined;
|
||||
description?: string | undefined;
|
||||
@@ -308,7 +308,7 @@ const MonitorsTable: FunctionComponent<ComponentProps> = (
|
||||
},
|
||||
]}
|
||||
showRefreshButton={true}
|
||||
viewPageRoute={props.viewPageRoute}
|
||||
viewPageRoute={RouteUtil.populateRouteParams(RouteMap[PageMap.MONITORS]!)}
|
||||
filters={[
|
||||
{
|
||||
title: "Name",
|
||||
|
||||
@@ -91,9 +91,6 @@ const Home: FunctionComponent<ComponentProps> = (
|
||||
|
||||
{!isLoading && !error && unresolvedIncidentStates.length > 0 && (
|
||||
<IncidentsTable
|
||||
viewPageRoute={RouteUtil.populateRouteParams(
|
||||
RouteMap[PageMap.INCIDENTS] as Route,
|
||||
)}
|
||||
query={{
|
||||
projectId: DashboardNavigation.getProjectId()?.toString(),
|
||||
currentIncidentStateId: new Includes(
|
||||
|
||||
@@ -33,9 +33,6 @@ const NotOperationalMonitors: FunctionComponent<PageComponentProps> = (
|
||||
}
|
||||
>
|
||||
<MonitorTable
|
||||
viewPageRoute={RouteUtil.populateRouteParams(
|
||||
RouteMap[PageMap.MONITORS] as Route,
|
||||
)}
|
||||
query={{
|
||||
projectId: DashboardNavigation.getProjectId()?.toString(),
|
||||
currentMonitorStatus: {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import IncidentsTable from "../../Components/Incident/IncidentsTable";
|
||||
import DashboardNavigation from "../../Utils/Navigation";
|
||||
import PageComponentProps from "../PageComponentProps";
|
||||
import Navigation from "CommonUI/src/Utils/Navigation";
|
||||
import React, { FunctionComponent, ReactElement } from "react";
|
||||
|
||||
const IncidentsPage: FunctionComponent<
|
||||
@@ -9,7 +8,6 @@ const IncidentsPage: FunctionComponent<
|
||||
> = (): ReactElement => {
|
||||
return (
|
||||
<IncidentsTable
|
||||
viewPageRoute={Navigation.getCurrentRoute()}
|
||||
query={{
|
||||
projectId: DashboardNavigation.getProjectId()?.toString(),
|
||||
}}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import IncidentsTable from "../../Components/Incident/IncidentsTable";
|
||||
import DashboardNavigation from "../../Utils/Navigation";
|
||||
import PageMap from "../../Utils/PageMap";
|
||||
import RouteMap, { RouteUtil } from "../../Utils/RouteMap";
|
||||
import PageComponentProps from "../PageComponentProps";
|
||||
import Route from "Common/Types/API/Route";
|
||||
import React, { FunctionComponent, ReactElement } from "react";
|
||||
|
||||
const IncidentsPage: FunctionComponent<
|
||||
@@ -11,9 +8,6 @@ const IncidentsPage: FunctionComponent<
|
||||
> = (): ReactElement => {
|
||||
return (
|
||||
<IncidentsTable
|
||||
viewPageRoute={RouteUtil.populateRouteParams(
|
||||
RouteMap[PageMap.INCIDENTS] as Route,
|
||||
)}
|
||||
query={{
|
||||
projectId: DashboardNavigation.getProjectId()?.toString(),
|
||||
currentIncidentState: {
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
import MonitorTable from "../../Components/Monitor/MonitorTable";
|
||||
import DashboardNavigation from "../../Utils/Navigation";
|
||||
import PageMap from "../../Utils/PageMap";
|
||||
import RouteMap, { RouteUtil } from "../../Utils/RouteMap";
|
||||
import Route from "Common/Types/API/Route";
|
||||
import React, { FunctionComponent, ReactElement } from "react";
|
||||
|
||||
const DisabledMonitors: FunctionComponent = (): ReactElement => {
|
||||
return (
|
||||
<MonitorTable
|
||||
viewPageRoute={RouteUtil.populateRouteParams(
|
||||
RouteMap[PageMap.MONITORS] as Route,
|
||||
)}
|
||||
query={{
|
||||
projectId: DashboardNavigation.getProjectId()?.toString(),
|
||||
disableActiveMonitoring: true,
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import MonitorTable from "../../Components/Monitor/MonitorTable";
|
||||
import DashboardNavigation from "../../Utils/Navigation";
|
||||
import PageMap from "../../Utils/PageMap";
|
||||
import RouteMap, { RouteUtil } from "../../Utils/RouteMap";
|
||||
import PageComponentProps from "../PageComponentProps";
|
||||
import Route from "Common/Types/API/Route";
|
||||
import URL from "Common/Types/API/URL";
|
||||
import Banner from "CommonUI/src/Components/Banner/Banner";
|
||||
import React, { Fragment, FunctionComponent, ReactElement } from "react";
|
||||
@@ -18,9 +15,6 @@ const MonitorPage: FunctionComponent<PageComponentProps> = (): ReactElement => {
|
||||
link={URL.fromString("https://youtu.be/_fQ_F4EisBQ")}
|
||||
/>
|
||||
<MonitorTable
|
||||
viewPageRoute={RouteUtil.populateRouteParams(
|
||||
RouteMap[PageMap.MONITORS] as Route,
|
||||
)}
|
||||
query={{
|
||||
projectId: DashboardNavigation.getProjectId()?.toString(),
|
||||
}}
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
import MonitorTable from "../../Components/Monitor/MonitorTable";
|
||||
import DashboardNavigation from "../../Utils/Navigation";
|
||||
import PageMap from "../../Utils/PageMap";
|
||||
import RouteMap, { RouteUtil } from "../../Utils/RouteMap";
|
||||
import Route from "Common/Types/API/Route";
|
||||
import React, { FunctionComponent, ReactElement } from "react";
|
||||
|
||||
const NotOperationalMonitors: FunctionComponent = (): ReactElement => {
|
||||
return (
|
||||
<MonitorTable
|
||||
viewPageRoute={RouteUtil.populateRouteParams(
|
||||
RouteMap[PageMap.MONITORS] as Route,
|
||||
)}
|
||||
query={{
|
||||
projectId: DashboardNavigation.getProjectId()?.toString(),
|
||||
currentMonitorStatus: {
|
||||
|
||||
@@ -15,7 +15,6 @@ const MonitorIncidents: FunctionComponent<
|
||||
<Fragment>
|
||||
<DisabledWarning monitorId={modelId} />
|
||||
<IncidentsTable
|
||||
viewPageRoute={Navigation.getCurrentRoute()}
|
||||
query={{
|
||||
projectId: DashboardNavigation.getProjectId()?.toString(),
|
||||
monitors: [modelId.toString()],
|
||||
|
||||
@@ -75,7 +75,6 @@ const MonitorIncidents: FunctionComponent<
|
||||
return (
|
||||
<Fragment>
|
||||
<IncidentsTable
|
||||
viewPageRoute={Navigation.getCurrentRoute()}
|
||||
query={{
|
||||
projectId: DashboardNavigation.getProjectId()?.toString(),
|
||||
monitors: monitorIds,
|
||||
|
||||
Reference in New Issue
Block a user