remove graph

This commit is contained in:
miloschwartz
2026-04-21 15:02:56 -07:00
parent 6969671fc4
commit 177ce20dda
7 changed files with 253 additions and 655 deletions

View File

@@ -1,6 +1,7 @@
"use client";
import AlertRuleGraphEditor from "@app/components/alert-rule-editor/AlertRuleGraphEditor";
import HeaderTitle from "@app/components/SettingsSectionTitle";
import { apiResponseToFormValues } from "@app/lib/alertRuleForm";
import { createApiClient, formatAxiosError } from "@app/lib/api";
import { useEnvContext } from "@app/hooks/useEnvContext";
@@ -59,9 +60,15 @@ export default function EditAlertRulePage() {
if (formValues === undefined) {
return (
<div className="min-h-[12rem] flex items-center justify-center text-muted-foreground text-sm">
{t("loading")}
</div>
<>
<HeaderTitle
title={t("alertingEditRule")}
description={t("alertingRuleCredenzaDescription")}
/>
<div className="min-h-[12rem] flex items-center justify-center text-muted-foreground text-sm">
{t("loading")}
</div>
</>
);
}
@@ -70,13 +77,19 @@ export default function EditAlertRulePage() {
}
return (
<AlertRuleGraphEditor
key={alertRuleId}
orgId={orgId}
alertRuleId={alertRuleId}
initialValues={formValues}
isNew={false}
disabled={!isPaid}
/>
<>
<HeaderTitle
title={t("alertingEditRule")}
description={t("alertingRuleCredenzaDescription")}
/>
<AlertRuleGraphEditor
key={alertRuleId}
orgId={orgId}
alertRuleId={alertRuleId}
initialValues={formValues}
isNew={false}
disabled={!isPaid}
/>
</>
);
}

View File

@@ -1,23 +1,32 @@
"use client";
import AlertRuleGraphEditor from "@app/components/alert-rule-editor/AlertRuleGraphEditor";
import HeaderTitle from "@app/components/SettingsSectionTitle";
import { defaultFormValues } from "@app/lib/alertRuleForm";
import { usePaidStatus } from "@app/hooks/usePaidStatus";
import { tierMatrix } from "@server/lib/billing/tierMatrix";
import { useParams } from "next/navigation";
import { useTranslations } from "next-intl";
export default function NewAlertRulePage() {
const params = useParams();
const orgId = params.orgId as string;
const t = useTranslations();
const { isPaidUser } = usePaidStatus();
const isPaid = isPaidUser(tierMatrix.alertingRules);
return (
<AlertRuleGraphEditor
orgId={orgId}
initialValues={defaultFormValues()}
isNew
disabled={!isPaid}
/>
<>
<HeaderTitle
title={t("alertingCreateRule")}
description={t("alertingRuleCredenzaDescription")}
/>
<AlertRuleGraphEditor
orgId={orgId}
initialValues={defaultFormValues()}
isNew
disabled={!isPaid}
/>
</>
);
}
}