diff --git a/package.json b/package.json index 1ed90cd673..37717c31de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spruce", - "version": "3.0.165", + "version": "3.0.166", "private": true, "scripts": { "bootstrap-logkeeper": "./scripts/bootstrap-logkeeper.sh", 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.test.ts b/src/pages/projectSettings/tabs/PatchAliasesTab/transformers.test.ts index e4ad713bfc..41e67026ec 100644 --- a/src/pages/projectSettings/tabs/PatchAliasesTab/transformers.test.ts +++ b/src/pages/projectSettings/tabs/PatchAliasesTab/transformers.test.ts @@ -82,7 +82,7 @@ const repoForm: PatchAliasesFormState = { { alias: "alias1", childProjectIdentifier: "spruce", - status: "succeeded", + status: "success", displayTitle: "alias1", parentAsModule: "", isGithubTriggerAlias: true, @@ -124,7 +124,7 @@ const repoResult: Pick<RepoSettingsInput, "projectRef" | "aliases"> = { variantRegex: ".*", }, ], - status: "succeeded", + status: "success", parentAsModule: "", }, ], diff --git a/src/pages/projectSettings/tabs/PatchAliasesTab/transformers.ts b/src/pages/projectSettings/tabs/PatchAliasesTab/transformers.ts index 37ed4e8e3d..c4f26e7791 100644 --- a/src/pages/projectSettings/tabs/PatchAliasesTab/transformers.ts +++ b/src/pages/projectSettings/tabs/PatchAliasesTab/transformers.ts @@ -1,4 +1,5 @@ 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 +8,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",