Skip to content
Closed
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
8 changes: 4 additions & 4 deletions web-admin/tests/alerts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test.describe.serial("Alerts", () => {

await adminPage.getByRole("button", { name: "Create alert" }).click();

const alertForm = adminPage.locator("form#create-alert-form");
const alertForm = adminPage.locator("form");

// Select "Last 6 hours" as time range
await interactWithTimeRangeMenu(alertForm, async () => {
Expand Down Expand Up @@ -159,7 +159,7 @@ test.describe.serial("Alerts", () => {
// Edit the alert
await adminPage.getByRole("button", { name: "Edit" }).click();

const alertForm = adminPage.locator("form#edit-alert-form");
const alertForm = adminPage.locator("form");

// Select "Last 24 hours" as time range
await interactWithTimeRangeMenu(alertForm, async () => {
Expand Down Expand Up @@ -291,7 +291,7 @@ test.describe.serial("Alerts", () => {

await adminPage.getByRole("button", { name: "Create alert" }).click();

const alertForm = adminPage.locator("form#create-alert-form");
const alertForm = adminPage.locator("form");

// Select "App Site Name" as split by dimension
await adminPage.getByLabel("Split by dimension", { exact: true }).click();
Expand Down Expand Up @@ -356,7 +356,7 @@ test.describe.serial("Alerts", () => {
// Edit the alert
await adminPage.getByRole("button", { name: "Edit" }).click();

const alertForm = adminPage.locator("form#edit-alert-form");
const alertForm = adminPage.locator("form");

// Go to criteria tab
await alertForm.getByRole("button", { name: "Next" }).click();
Expand Down
7 changes: 3 additions & 4 deletions web-common/src/features/alerts/AlertForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,9 @@
invalidateAll: false,
},
);
$: ({ form, errors, enhance, submit, submitting, tainted, validate } =
$: ({ form, formId, errors, enhance, submitting, submit, tainted, validate } =
superFormInstance);

$: formId = isCreateForm ? "create-alert-form" : "edit-alert-form";
$: dialogTitle = isCreateForm ? "Create Alert" : "Edit Alert";

const tabs = ["Data", "Criteria", "Delivery"];
Expand Down Expand Up @@ -290,7 +289,7 @@
<form
autocomplete="off"
class="flex flex-col gap-y-3"
id={formId}
id={$formId}
onsubmit={(e) => {
e.preventDefault();
submit(e);
Expand Down Expand Up @@ -336,7 +335,7 @@
{#if currentTabIndex !== 2}
<Button type="primary" onClick={handleNextTab}>Next</Button>
{:else}
<Button type="primary" disabled={$submitting} form={formId} submitForm>
<Button type="primary" disabled={$submitting} form={$formId} submitForm>
{isCreateForm ? "Create" : "Update"}
</Button>
{/if}
Expand Down
Loading