From 26350969bf2cd00bfe4e4cc9021c1a19dede66b3 Mon Sep 17 00:00:00 2001 From: Sophie Stadler Date: Mon, 23 Oct 2023 10:11:41 -0400 Subject: [PATCH] Save patch trigger aliases with new success status --- .../tabs/PatchAliasesTab/getFormSchema.tsx | 5 ++--- .../tabs/PatchAliasesTab/transformers.ts | 11 ++++++----- src/types/patch.ts | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/pages/projectSettings/tabs/PatchAliasesTab/getFormSchema.tsx b/src/pages/projectSettings/tabs/PatchAliasesTab/getFormSchema.tsx index 6875ded191..7fd47f1b32 100644 --- a/src/pages/projectSettings/tabs/PatchAliasesTab/getFormSchema.tsx +++ b/src/pages/projectSettings/tabs/PatchAliasesTab/getFormSchema.tsx @@ -74,9 +74,8 @@ export const getFormSchema = ( }, { type: "string" as "string", - title: - PatchTriggerAliasStatus[PatchStatus.LegacySucceeded], - enum: [PatchStatus.LegacySucceeded], + title: PatchTriggerAliasStatus[PatchStatus.Success], + enum: [PatchStatus.Success], }, { type: "string" as "string", diff --git a/src/pages/projectSettings/tabs/PatchAliasesTab/transformers.ts b/src/pages/projectSettings/tabs/PatchAliasesTab/transformers.ts index 37ed4e8e3d..a5ff7d530d 100644 --- a/src/pages/projectSettings/tabs/PatchAliasesTab/transformers.ts +++ b/src/pages/projectSettings/tabs/PatchAliasesTab/transformers.ts @@ -1,4 +1,6 @@ import { ProjectSettingsTabRoutes } from "constants/routes"; + +import { PatchStatus } from "types/patch"; import { FormToGqlFunction, GqlToFormFunction } from "../types"; import { alias as aliasUtils, ProjectType } from "../utils"; import { TaskSpecifier } from "./types"; @@ -7,12 +9,11 @@ const { sortAliases, transformAliases } = aliasUtils; type Tab = ProjectSettingsTabRoutes.PatchAliases; -// Ensure that the front end can ingest patch trigger alias status filters that use either "success" or "succeeded". -// For now, use "succeeded" for either. -// TODO EVG-20704: Save patch trigger aliases with "success" instead of "succeeded". +// Ensure that the front end can ingest patch trigger alias status filters that use either "success" or "succeeded" and convert them to "success". +// TODO EVG-20032: Remove conversion. const migrateSuccessStatus = (status: string) => { - if (status === "success") { - return "succeeded"; + if (status === PatchStatus.LegacySucceeded) { + return PatchStatus.Success; } return status ?? ""; }; diff --git a/src/types/patch.ts b/src/types/patch.ts index c353e19014..43764d2686 100644 --- a/src/types/patch.ts +++ b/src/types/patch.ts @@ -11,6 +11,7 @@ export enum PatchStatus { Created = "created", Failed = "failed", Started = "started", + // TODO EVG-20032: Remove legacy status LegacySucceeded = "succeeded", Success = "success", Aborted = "aborted",