mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 06:40:39 +00:00
Add Pill component for enabled/disabled status display in Workflow views
This commit is contained in:
parent
5c459eede8
commit
a98fc6f784
@ -8,6 +8,8 @@ import Navigation from "Common/UI/Utils/Navigation";
|
||||
import Label from "Common/Models/DatabaseModels/Label";
|
||||
import Workflow from "Common/Models/DatabaseModels/Workflow";
|
||||
import React, { Fragment, FunctionComponent, ReactElement } from "react";
|
||||
import Pill from "Common/UI/Components/Pill/Pill";
|
||||
import { Green500, Red500 } from "Common/Types/BrandColors";
|
||||
|
||||
const Delete: FunctionComponent<PageComponentProps> = (): ReactElement => {
|
||||
const modelId: ObjectID = Navigation.getLastParamAsObjectID(0);
|
||||
@ -109,7 +111,15 @@ const Delete: FunctionComponent<PageComponentProps> = (): ReactElement => {
|
||||
isEnabled: true,
|
||||
},
|
||||
title: "Enabled",
|
||||
fieldType: FieldType.Boolean,
|
||||
fieldType: FieldType.Element,
|
||||
getElement: (item: Workflow): ReactElement => {
|
||||
if (item.isEnabled) {
|
||||
return (
|
||||
<Pill text="Enabled" color={Green500} isMinimal={true} />
|
||||
);
|
||||
}
|
||||
return <Pill text="Disabled" color={Red500} isMinimal={true} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: {
|
||||
|
@ -17,6 +17,8 @@ import Label from "Common/Models/DatabaseModels/Label";
|
||||
import Workflow from "Common/Models/DatabaseModels/Workflow";
|
||||
import WorkflowLog from "Common/Models/DatabaseModels/WorkflowLog";
|
||||
import React, { Fragment, FunctionComponent, ReactElement } from "react";
|
||||
import Pill from "Common/UI/Components/Pill/Pill";
|
||||
import { Green500, Red500 } from "Common/Types/BrandColors";
|
||||
|
||||
const Workflows: FunctionComponent<PageComponentProps> = (): ReactElement => {
|
||||
const startDate: Date = OneUptimeDate.getSomeDaysAgo(30);
|
||||
@ -189,7 +191,15 @@ const Workflows: FunctionComponent<PageComponentProps> = (): ReactElement => {
|
||||
isEnabled: true,
|
||||
},
|
||||
title: "Enabled",
|
||||
type: FieldType.Boolean,
|
||||
type: FieldType.Element,
|
||||
getElement: (item: Workflow): ReactElement => {
|
||||
if (item.isEnabled) {
|
||||
return (
|
||||
<Pill text="Enabled" color={Green500} isMinimal={true} />
|
||||
);
|
||||
}
|
||||
return <Pill text="Disabled" color={Red500} isMinimal={true} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: {
|
||||
|
@ -22,7 +22,6 @@ import "./Jobs/IncidentStateTimeline/SendNotificationToSubscribers";
|
||||
import "./Jobs/IncomingRequestMonitor/CheckHeartbeat";
|
||||
import "./Jobs/MeteredPlan/ReportTelemetryMeteredPlan";
|
||||
|
||||
|
||||
// Monitor Owners
|
||||
import "./Jobs/MonitorOwners/SendCreatedResourceNotification";
|
||||
import "./Jobs/MonitorOwners/SendOwnerAddedNotification";
|
||||
|
Loading…
Reference in New Issue
Block a user