Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog/8130-ga-helios-insights.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type: Changed # One of: Added, Changed, Developer Experience, Deprecated, Docs, Fixed, Removed, Security
description: GA helios insights feature
pr: 8130 # PR number
labels: [] # Optional: ["high-risk", "db-migration"]
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { skipToken } from "@reduxjs/toolkit/query";
import { Descriptions, Flex, Paragraph, Text } from "fidesui";

import { useFlags } from "~/features/common/features";
import { RouterLink } from "~/features/common/nav/RouterLink";
import {
EDIT_SYSTEM_ROUTE,
Expand All @@ -18,9 +17,6 @@ export interface MonitorDetailsWidgetProps {
}

const MonitorDetailsWidget = ({ monitorId }: MonitorDetailsWidgetProps) => {
const {
flags: { heliosInsights },
} = useFlags();
const { data: configData } = useGetMonitorConfigQuery(
{
monitor_config_id: monitorId,
Expand All @@ -35,66 +31,64 @@ const MonitorDetailsWidget = ({ monitorId }: MonitorDetailsWidgetProps) => {
);

return (
heliosInsights && (
<Flex className="w-full" gap="middle" vertical>
<Text strong>Details</Text>
<Descriptions
size="small"
items={[
{
label: "System",
children:
connectionData?.linked_systems &&
connectionData.linked_systems.length > 0 ? (
<Paragraph
ellipsis={{
rows: 1,
tooltip: { title: connectionData?.system_key },
}}
>
{connectionData?.linked_systems?.map((linkedSystem) => (
<RouterLink
key={linkedSystem.fides_key}
href={EDIT_SYSTEM_ROUTE.replace(
"[id]",
linkedSystem.fides_key,
)}
>
{" "}
{linkedSystem.name}
</RouterLink>
))}
</Paragraph>
) : (
"None"
),
span: "filled",
},
{
label: "Integration",
children: (
<Flex className="w-full" gap="middle" vertical>
<Text strong>Details</Text>
<Descriptions
size="small"
items={[
{
label: "System",
children:
connectionData?.linked_systems &&
connectionData.linked_systems.length > 0 ? (
<Paragraph
ellipsis={{
rows: 1,
tooltip: { title: connectionData?.key },
tooltip: { title: connectionData?.system_key },
}}
>
<RouterLink
href={INTEGRATION_DETAIL_ROUTE.replace(
"[id]",
connectionData?.key ?? "",
)}
>
{connectionData?.key}
</RouterLink>
{connectionData?.linked_systems?.map((linkedSystem) => (
<RouterLink
key={linkedSystem.fides_key}
href={EDIT_SYSTEM_ROUTE.replace(
"[id]",
linkedSystem.fides_key,
)}
>
{" "}
{linkedSystem.name}
</RouterLink>
))}
</Paragraph>
) : (
"None"
),
span: "filled",
},
]}
/>
</Flex>
)
span: "filled",
},
{
label: "Integration",
children: (
<Paragraph
ellipsis={{
rows: 1,
tooltip: { title: connectionData?.key },
}}
>
<RouterLink
href={INTEGRATION_DETAIL_ROUTE.replace(
"[id]",
connectionData?.key ?? "",
)}
>
{connectionData?.key}
</RouterLink>
</Paragraph>
),
span: "filled",
},
]}
/>
</Flex>
);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Button, Flex, Icons, Text, Title } from "fidesui";
import { useQueryStates } from "nuqs";

import { useFlags } from "~/features/common/features";
import { RouterLink } from "~/features/common/nav/RouterLink";
import { INTEGRATION_MANAGEMENT_ROUTE } from "~/features/common/nav/routes";
import { APIMonitorType } from "~/types/api/models/APIMonitorType";
Expand Down Expand Up @@ -31,9 +30,6 @@ const MonitorProgressWidget = ({
monitorId,
monitorType,
}: MonitorProgressWidgetProps) => {
const {
flags: { heliosInsights },
} = useFlags();
const [filters] = useQueryStates(
SearchFormQueryState(Object.values(APIMonitorType)),
);
Expand All @@ -52,38 +48,35 @@ const MonitorProgressWidget = ({
const totalMonitors = data?.total_monitors ?? 0;

return (
heliosInsights && (
<Flex className="w-full" gap="middle">
{(data && totalMonitors > 0) || !!filters.steward_key || isLoading ? (
<ProgressCard
{...buildWidgetProps({
monitor_type: monitorType,
total_monitors: totalMonitors,
...data,
})}
compact={!!monitorId}
disabled={
(!!filters.monitor_type &&
monitorType !== filters.monitor_type) ||
(!!filters.steward_key && totalMonitors <= 0)
}
/>
) : (
<div>
<Flex vertical gap="small" justify="center">
<Title level={5}>{MONITOR_TYPE_TO_LABEL[monitorType]}</Title>
<Text>{renderIcon(MONITOR_TYPE_TO_ICON[monitorType])}</Text>
<Text type="secondary">
{MONITOR_TYPE_TO_EMPTY_TEXT[monitorType]}
</Text>
<RouterLink href={INTEGRATION_MANAGEMENT_ROUTE}>
<Button type="primary">Create</Button>
</RouterLink>
</Flex>
</div>
)}
</Flex>
)
<Flex className="w-full" gap="middle">
{(data && totalMonitors > 0) || !!filters.steward_key || isLoading ? (
<ProgressCard
{...buildWidgetProps({
monitor_type: monitorType,
total_monitors: totalMonitors,
...data,
})}
compact={!!monitorId}
disabled={
(!!filters.monitor_type && monitorType !== filters.monitor_type) ||
(!!filters.steward_key && totalMonitors <= 0)
}
/>
) : (
<div>
<Flex vertical gap="small" justify="center">
<Title level={5}>{MONITOR_TYPE_TO_LABEL[monitorType]}</Title>
<Text>{renderIcon(MONITOR_TYPE_TO_ICON[monitorType])}</Text>
<Text type="secondary">
{MONITOR_TYPE_TO_EMPTY_TEXT[monitorType]}
</Text>
<RouterLink href={INTEGRATION_MANAGEMENT_ROUTE}>
<Button type="primary">Create</Button>
</RouterLink>
</Flex>
</div>
)}
</Flex>
);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import classNames from "classnames";
import { Divider, Flex } from "fidesui";

import { useFlags } from "~/features/common/features";
import { APIMonitorType } from "~/types/api/models/APIMonitorType";

import MonitorDetailsWidget from "./MonitorDetailsWidget";
Expand All @@ -19,56 +18,47 @@ const STATS_EXCLUDED_TYPES: Set<APIMonitorType> = new Set([
]);

const MonitorStats = ({ monitorId, monitorType }: MonitorStatsProps) => {
const {
flags: { heliosInsights },
} = useFlags();

if (monitorType && STATS_EXCLUDED_TYPES.has(monitorType)) {
return null;
}

return (
heliosInsights && (
<Flex className={classNames("w-full")} gap="middle">
{Object.values(monitorType ? [monitorType] : APIMonitorType)
.filter((mType) => !STATS_EXCLUDED_TYPES.has(mType))
.toReversed()
.map((mType) => (
<MonitorProgressWidget
monitorType={mType}
monitorId={monitorId}
key={mType}
/>
))
.reduce(
(prev, curr) => [
prev,
...(prev[0]
? [
<Divider
vertical
className="h-full"
key={`${curr.key}--divider`}
/>,
]
: []),
curr,
],
[] as React.ReactNode[],
)}
{monitorId && monitorType && (
<>
<Divider vertical className="h-full" />
<MonitorStatsWidget
monitorType={monitorType}
monitorId={monitorId}
/>
<Divider vertical className="h-full" />
<MonitorDetailsWidget monitorId={monitorId} />
</>
<Flex className={classNames("w-full")} gap="middle">
{Object.values(monitorType ? [monitorType] : APIMonitorType)
.filter((mType) => !STATS_EXCLUDED_TYPES.has(mType))
.toReversed()
.map((mType) => (
<MonitorProgressWidget
monitorType={mType}
monitorId={monitorId}
key={mType}
/>
))
.reduce(
(prev, curr) => [
prev,
...(prev[0]
? [
<Divider
vertical
className="h-full"
key={`${curr.key}--divider`}
/>,
]
: []),
curr,
],
[] as React.ReactNode[],
)}
</Flex>
)
{monitorId && monitorType && (
<>
<Divider vertical className="h-full" />
<MonitorStatsWidget monitorType={monitorType} monitorId={monitorId} />
<Divider vertical className="h-full" />
<MonitorDetailsWidget monitorId={monitorId} />
</>
)}
</Flex>
);
};

Expand Down
Loading
Loading