From db8d3867190d0b34fadf3ce22255df684aedbadd Mon Sep 17 00:00:00 2001 From: Celia Amador Date: Tue, 9 Jun 2026 13:17:17 +0200 Subject: [PATCH 1/2] EDM-4070: Handle non-editable image promotions Made-with: Cursor Assisted-by: OpenAI Codex --- libs/i18n/locales/en/translation.json | 8 ++ .../ImageBuildDetailsTab.tsx | 105 ++++++++------ .../ImagePromotion/ImagePromotionForm.tsx | 131 +++++++++--------- .../ImagePromotionFormatsField.tsx | 64 +++++++++ .../ImagePromotion/ImagePromotionModal.tsx | 121 ++++++++++++---- .../src/components/ImagePromotion/utils.ts | 67 ++++++++- 6 files changed, 361 insertions(+), 135 deletions(-) create mode 100644 libs/ui-components/src/components/ImagePromotion/ImagePromotionFormatsField.tsx diff --git a/libs/i18n/locales/en/translation.json b/libs/i18n/locales/en/translation.json index bf792953d..7894ca373 100644 --- a/libs/i18n/locales/en/translation.json +++ b/libs/i18n/locales/en/translation.json @@ -209,6 +209,7 @@ "Alias devices using a custom template. Add a number using": "Alias devices using a custom template. Add a number using", "All {{ resumedCount }} devices resumed successfully": "All {{ resumedCount }} devices resumed successfully", "All application workloads are healthy": "All application workloads are healthy", + "All export formats from this image build are already included in this promotion": "All export formats from this image build are already included in this promotion", "All good!": "All good!", "All images are stored under the same repository path in this registry.": "All images are stored under the same repository path in this registry.", "All levels": "All levels", @@ -988,6 +989,7 @@ "Exporting...": "Exporting...", "External organization name": "External organization name", "Failed": "Failed", + "Failed image promotions cannot be edited. Create a new image promotion to retry.": "Failed image promotions cannot be edited. Create a new image promotion to retry.", "Failed to cancel image build": "Failed to cancel image build", "Failed to connect to device": "Failed to connect to device", "Failed to connect to device terminal": "Failed to connect to device terminal", @@ -1203,8 +1205,11 @@ "Image output reference URL": "Image output reference URL", "Image output tag": "Image output tag", "Image placement": "Image placement", + "Image promotion cannot be edited while publishing is in progress": "Image promotion cannot be edited while publishing is in progress", "Image Promotion name": "Image Promotion name", "Image promotions": "Image promotions", + "Image promotions for canceled image builds cannot be edited. Create a new image promotion to retry.": "Image promotions for canceled image builds cannot be edited. Create a new image promotion to retry.", + "Image promotions for failed image builds cannot be edited. Create a new image promotion to retry.": "Image promotions for failed image builds cannot be edited. Create a new image promotion to retry.", "Image reference": "Image reference", "Image reference is required for this volume type": "Image reference is required for this volume type", "Image reference URL": "Image reference URL", @@ -1465,6 +1470,7 @@ "No fleet eligible for catalog deployment is available": "No fleet eligible for catalog deployment is available", "No fleets currently match the selected labels.": "No fleets currently match the selected labels.", "No fleets yet": "No fleets yet", + "No formats selected": "No formats selected", "No Git repositories found": "No Git repositories found", "No GPUs found": "No GPUs found", "No image promotions yet": "No image promotions yet", @@ -2403,6 +2409,7 @@ "View fleet": "View fleet", "View fleet configurations": "View fleet configurations", "View fleet details": "View fleet details", + "View image promotion": "View image promotion", "View in repository": "View in repository", "View logs": "View logs", "View more": "View more", @@ -2506,6 +2513,7 @@ "You do not have permissions to list devices": "You do not have permissions to list devices", "You do not have permissions to list fleets": "You do not have permissions to list fleets", "You do not have permissions to promote builds to the catalog": "You do not have permissions to promote builds to the catalog", + "You do not have permissions to update image promotions": "You do not have permissions to update image promotions", "You don't have access to this section.": "You don't have access to this section.", "You don't have permissions to create catalogs": "You don't have permissions to create catalogs", "You don't have permissions to create image builds": "You don't have permissions to create image builds", diff --git a/libs/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsTab.tsx b/libs/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsTab.tsx index 35ed05a5d..9f8c22cfd 100644 --- a/libs/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsTab.tsx +++ b/libs/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsTab.tsx @@ -20,10 +20,13 @@ import { StackItem, } from '@patternfly/react-core'; import { type TFunction, Trans } from 'react-i18next'; +import { ActionsColumn, type IAction, Tbody, Td, Tr } from '@patternfly/react-table'; import { InfoCircleIcon } from '@patternfly/react-icons/dist/js/icons/info-circle-icon'; import { BindingType, type ImagePromotion } from '@flightctl/types/imagebuilder'; import ImagePromotionModal from '../../ImagePromotion/ImagePromotionModal'; +import { getAvailableExportFormats, getPromotionEditDisabledReason } from '../../ImagePromotion/utils'; +import { getDisabledTooltipProps } from '../../../utils/tooltip'; import ImagePromotionStatus from '../../ImagePromotion/ImagePromotionStatus'; import { getDateDisplay } from '../../../utils/dates'; import { getExportFormatLabel, getImageReference } from '../../../utils/imageBuilds'; @@ -37,7 +40,6 @@ import { ImageBuildStatusDisplay } from '../ImageBuildAndExportStatus'; import ImageUrl from '../ImageUrl'; import { getErrorMessage } from '../../../utils/error'; import Table from '../../Table/Table'; -import { ActionsColumn, type IAction, Tbody, Td, Tr } from '@patternfly/react-table'; import TablePagination from '../../Table/TablePagination'; import { getResourceId } from '../../../utils/resource'; import DeleteImagePromotionModal from '../../ImagePromotion/DeleteImagePromotionModal'; @@ -52,38 +54,53 @@ const detailsPermissions = [ { kind: RESOURCE.IMAGE_PROMOTION, verb: VERB.DELETE }, ]; +type PromotionAction = 'view' | 'edit' | 'delete'; + +type PromotionActionState = { + id: string; + action: PromotionAction; +}; + const ImagePromotionRow = ({ imagePromotion, - onDeleteClick, - onEditClick, + editDisabledReason, + onActionClick, canEditPromotions, canDeletePromotions, }: { imagePromotion: ImagePromotion; - onDeleteClick: VoidFunction; - onEditClick: VoidFunction; + editDisabledReason?: string; + onActionClick: (action: PromotionAction) => void; canEditPromotions: boolean; canDeletePromotions: boolean; }) => { const { t } = useTranslation(); - const regularActions: IAction[] = canEditPromotions - ? [ - { - title: t('Edit image promotion'), - onClick: onEditClick, - }, - ] - : []; - const dangerActions: IAction[] = canDeletePromotions - ? [ - { - title: t('Delete image promotion'), - onClick: onDeleteClick, - }, - ] - : []; - const actions = buildAllDropdownActions(regularActions, dangerActions); + const actions: IAction[] = [ + { + title: t('View image promotion'), + onClick: () => onActionClick('view'), + }, + ]; + if (canEditPromotions) { + actions.push({ + title: t('Edit image promotion'), + onClick: () => onActionClick('edit'), + ...getDisabledTooltipProps(editDisabledReason), + }); + } + + const allActions = buildAllDropdownActions( + actions, + canDeletePromotions + ? [ + { + title: t('Delete image promotion'), + onClick: () => onActionClick('delete'), + }, + ] + : [], + ); return ( @@ -94,11 +111,9 @@ const ImagePromotionRow = ({ - {!!actions.length && ( - - - - )} + + + ); }; @@ -131,8 +146,9 @@ const ImagePromotionsCard = ({ const { error, isLoading, isUpdating, pagination, imagePromotions, refetchPromotions } = useImagePromotionsContext(); - const [promotionToDeleteId, setPromotionToDeleteId] = React.useState(); - const [promotionToEditId, setPromotionToEditId] = React.useState(); + const [promotionAction, setPromotionAction] = React.useState(); + + const availableFormats = getAvailableExportFormats(imageBuild); let content: React.ReactNode; if (error) { @@ -154,8 +170,8 @@ const ImagePromotionsCard = ({ setPromotionToEditId(promotion.metadata.name)} - onDeleteClick={() => setPromotionToDeleteId(promotion.metadata.name)} + editDisabledReason={getPromotionEditDisabledReason(promotion, availableFormats, canEditPromotions, t)} + onActionClick={(action) => setPromotionAction({ id: promotion.metadata.name as string, action })} canEditPromotions={canEditPromotions} canDeletePromotions={canDeletePromotions} /> @@ -167,30 +183,41 @@ const ImagePromotionsCard = ({ ); } - const promotionToDelete = imagePromotions.find((p) => p.metadata.name === promotionToDeleteId); - const promotionToEdit = imagePromotions.find((p) => p.metadata.name === promotionToEditId); + const activePromotion = promotionAction + ? imagePromotions.find((p) => p.metadata.name === promotionAction.id) + : undefined; + + const closePromotionAction = () => setPromotionAction(undefined); return ( {t('Image promotions')} {content} - {promotionToDelete && ( + {activePromotion && promotionAction?.action === 'delete' && ( { if (hasDeleted) { refetchPromotions(); } - setPromotionToDeleteId(undefined); + closePromotionAction(); }} /> )} - {promotionToEdit && ( + {activePromotion && promotionAction?.action === 'view' && ( + + )} + {activePromotion && promotionAction?.action === 'edit' && ( { - setPromotionToEditId(undefined); + closePromotionAction(); if (updated) { refetchPromotions(); } diff --git a/libs/ui-components/src/components/ImagePromotion/ImagePromotionForm.tsx b/libs/ui-components/src/components/ImagePromotion/ImagePromotionForm.tsx index a5034842c..1ee4eacb5 100644 --- a/libs/ui-components/src/components/ImagePromotion/ImagePromotionForm.tsx +++ b/libs/ui-components/src/components/ImagePromotion/ImagePromotionForm.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Alert, Button, FormGroup, FormSection, Spinner, Stack, StackItem } from '@patternfly/react-core'; +import { Alert, FormGroup, FormSection, Spinner } from '@patternfly/react-core'; import { useFormikContext } from 'formik'; import { type CatalogItem, type CatalogList } from '@flightctl/types/alpha'; @@ -15,8 +15,8 @@ import NameField from '../form/NameField'; import { getDnsSubdomainValidations } from '../form/validations'; import { useCatalogItems } from '../Catalog/useCatalogItems'; import { getErrorMessage } from '../../utils/error'; -import { getExportFormatLabel } from '../../utils/imageBuilds'; -import { type ImagePromotionFormValues } from './types'; +import type { ImagePromotionFormValues } from './types'; +import ImagePromotionFormatsField from './ImagePromotionFormatsField'; const NewItemForm = ({ isDisabled }: { isDisabled?: boolean }) => { const { t } = useTranslation(); @@ -114,16 +114,64 @@ const ExistingItemForm = ({ catalogItems, isDisabled }: { catalogItems: CatalogI ); }; -const ImagePromotionForm = ({ +type ImagePromotionFormProps = { + isEdit?: boolean; + canAmendExportFormats?: boolean; + availableFormats?: ExportFormatType[]; +}; + +// Content can be used when the catalog references cannot be resolved (e.g. user does not have permissions to view catalog/catalogItems) +export const ImagePromotionFormContent = ({ isEdit, + canAmendExportFormats = true, availableFormats, + catalogs, + catalogItems, }: { - isEdit?: boolean; - availableFormats?: ExportFormatType[]; -}) => { + catalogs: Record; + catalogItems: CatalogItem[]; +} & ImagePromotionFormProps) => { + const { t } = useTranslation(); + const { values } = useFormikContext(); + + return ( + + + + + + + + + + + {values.type === 'new' && } + {values.type === 'existing' && } + + ); +}; + +const ImagePromotionForm = ({ isEdit, canAmendExportFormats = true, availableFormats }: ImagePromotionFormProps) => { const { t } = useTranslation(); - const { values, setFieldValue } = useFormikContext(); + const { values } = useFormikContext(); const [catalogList, catalogsLoading, catalogsErr] = useFetchPeriodically({ endpoint: 'catalogs', @@ -179,67 +227,14 @@ const ImagePromotionForm = ({ ); } - const hasExports = availableFormats?.length || values.exportFormats.length; - - const extraFormats = availableFormats?.filter((f) => !values.exportFormats.includes(f)); - return ( - - - - {hasExports ? ( - - {values.exportFormats.map((format) => getExportFormatLabel(t, format)).join(', ')} - {extraFormats?.map((f) => { - const isIncluded = values.additionalExportFormats?.includes(f); - const exportLabel = getExportFormatLabel(t, f); - return ( - - - - ); - })} - - ) : ( - t('No additional formats') - )} - - - - - - - - - {values.type === 'new' && } - {values.type === 'existing' && } - + ); }; diff --git a/libs/ui-components/src/components/ImagePromotion/ImagePromotionFormatsField.tsx b/libs/ui-components/src/components/ImagePromotion/ImagePromotionFormatsField.tsx new file mode 100644 index 000000000..04e57a9bb --- /dev/null +++ b/libs/ui-components/src/components/ImagePromotion/ImagePromotionFormatsField.tsx @@ -0,0 +1,64 @@ +import * as React from 'react'; +import { Button, FormGroup, Stack, StackItem } from '@patternfly/react-core'; +import { useFormikContext } from 'formik'; + +import type { ExportFormatType } from '@flightctl/types/imagebuilder'; +import type { ImagePromotionFormValues } from './types'; +import { useTranslation } from '../../hooks/useTranslation'; +import { getExportFormatLabel } from '../../utils/imageBuilds'; + +type ImagePromotionFormatsFieldProps = { + isEdit?: boolean; + canAmendExportFormats: boolean; + availableFormats?: ExportFormatType[]; +}; + +const ImagePromotionFormatsField = ({ + isEdit, + canAmendExportFormats, + availableFormats, +}: ImagePromotionFormatsFieldProps) => { + const { t } = useTranslation(); + const { values, setFieldValue } = useFormikContext(); + + const hasExports = availableFormats?.length || values.exportFormats.length; + const extraFormats = availableFormats?.filter((f) => !values.exportFormats.includes(f)) || []; + const emptyFormatsMessage = isEdit ? t('No additional formats') : t('No formats selected'); + + return ( + + {hasExports ? ( + + {values.exportFormats.map((format) => getExportFormatLabel(t, format)).join(', ')} + {extraFormats?.map((f) => { + const isIncluded = values.additionalExportFormats?.includes(f); + const exportLabel = getExportFormatLabel(t, f); + return ( + + + + ); + })} + + ) : ( + emptyFormatsMessage + )} + + ); +}; + +export default ImagePromotionFormatsField; diff --git a/libs/ui-components/src/components/ImagePromotion/ImagePromotionModal.tsx b/libs/ui-components/src/components/ImagePromotion/ImagePromotionModal.tsx index 1617ddb43..e1660a386 100644 --- a/libs/ui-components/src/components/ImagePromotion/ImagePromotionModal.tsx +++ b/libs/ui-components/src/components/ImagePromotion/ImagePromotionModal.tsx @@ -3,25 +3,26 @@ import FlightCtlModal from '@flightctl/ui-components/src/components/common/Fligh import { Formik } from 'formik'; import * as React from 'react'; -import ImagePromotionForm from './ImagePromotionForm'; +import ImagePromotionForm, { ImagePromotionFormContent } from './ImagePromotionForm'; import { type ImagePromotionFormValues } from './types'; -import { defaultInitialValues, getEditInitialValues, getInitialValues } from './utils'; +import { + canPromotionBeEdited, + defaultInitialValues, + getAvailableExportFormats, + getEditInitialValues, + getImagePromotionValidationSchema, + getInitialValues, +} from './utils'; import { useTranslation } from '../../hooks/useTranslation'; import { useFetch } from '../../hooks/useFetch'; import { useFetchPeriodically } from '../../hooks/useFetchPeriodically'; import { useCatalogItemsLookup } from '../Catalog/useCatalogItemsLookup'; -import { - type ExportFormatType, - type ImageExport, - type ImagePromotion, - type ImagePromotionList, -} from '@flightctl/types/imagebuilder'; +import { type ImagePromotion, type ImagePromotionList } from '@flightctl/types/imagebuilder'; import { type PatchRequest } from '@flightctl/types'; +import { type ImageBuildWithExports } from '../../types/extraTypes'; import { getErrorMessage } from '../../utils/error'; -import { getImagePromotionValidationSchema } from './utils'; import { RESOURCE, VERB } from '../../types/rbac'; import { usePermissionsContext } from '../common/PermissionsContext'; -import { type ImageBuildWithExports } from '../../types/extraTypes'; import { getImagePromotion } from '../ImageBuilds/NewVersionImageBuildWizard/utils'; const NEW_VERSION_FROM_ANNOTATION = 'flightctl.io/new-version-from'; @@ -47,11 +48,44 @@ const LoadingModal = ({ onClose }: { onClose: VoidFunction }) => { ); }; +const ImagePromotionViewModal = ({ + promotion, + onClose, +}: { + promotion: ImagePromotion; + onClose: (updated?: boolean) => void; +}) => { + const { t } = useTranslation(); + const formats = promotion.spec.source.exportFormats || []; + return ( + onClose()} variant="small"> + + + initialValues={getEditInitialValues(promotion)} onSubmit={() => {}}> + + + + + + + + ); +}; + type ImagePromotionFormContainerProps = { onClose: (updated?: boolean) => void; imageBuild: ImageBuildWithExports; parentPromotion: ImagePromotion | undefined; imagePromotion?: ImagePromotion; + canBeEdited: boolean; }; const ImagePromotionFormContainer = ({ @@ -59,12 +93,14 @@ const ImagePromotionFormContainer = ({ imageBuild, parentPromotion, imagePromotion, + canBeEdited, }: ImagePromotionFormContainerProps) => { const { t } = useTranslation(); const { post, patch } = useFetch(); const [error, setError] = React.useState(); const isEdit = !!imagePromotion; + const availableFormats = getAvailableExportFormats(imageBuild); const target = parentPromotion?.spec.target; const hasCatalogParams = target?.catalogName && target?.catalogItemName; @@ -83,12 +119,12 @@ const ImagePromotionFormContainer = ({ const catalogItem = hasCatalogParams ? getItem(target.catalogName, target.catalogItemName) : undefined; initialValues = { ...getInitialValues(catalogItem), - exportFormats: imageBuild.imageExports.filter(Boolean).map((ie) => (ie as ImageExport).spec.format), + exportFormats: getAvailableExportFormats(imageBuild), }; } else { initialValues = { ...defaultInitialValues, - exportFormats: imageBuild.imageExports.filter(Boolean).map((ie) => (ie as ImageExport).spec.format), + exportFormats: getAvailableExportFormats(imageBuild), }; } @@ -131,11 +167,16 @@ const ImagePromotionFormContainer = ({ > {({ isValid, isSubmitting, dirty, submitForm }) => ( onClose()} variant="small"> - + e?.spec.format as ExportFormatType)} + canAmendExportFormats={!isEdit || canBeEdited} + availableFormats={availableFormats} /> {!!error && ( - + {(!isEdit || canBeEdited) && ( + + )} @@ -169,7 +212,7 @@ const ImagePromotionFormContainer = ({ const promotionPermissions = [{ kind: RESOURCE.IMAGE_PROMOTION, verb: VERB.LIST }]; -const ImagePromotionModal = ({ +const ImagePromotionEditorModal = ({ onClose, imageBuild, imagePromotion, @@ -209,15 +252,41 @@ const ImagePromotionModal = ({ } const parentPromotion = !isEdit ? getLatestPromotion(promotionList?.items || []) : undefined; - return ( ); }; +const ImagePromotionModal = ({ + onClose, + imageBuild, + imagePromotion, + readOnly, +}: { + onClose: (updated?: boolean) => void; + imageBuild: ImageBuildWithExports; + imagePromotion?: ImagePromotion; + readOnly?: boolean; +}) => { + // Do not change modes once the modal opens, otherwise the user could lose unsaved changes + const [isViewOnly] = React.useState(() => { + if (!imagePromotion) { + return false; + } + return !!readOnly || !canPromotionBeEdited(imagePromotion, getAvailableExportFormats(imageBuild)); + }); + + if (imagePromotion && isViewOnly) { + return ; + } + + return ; +}; + export default ImagePromotionModal; diff --git a/libs/ui-components/src/components/ImagePromotion/utils.ts b/libs/ui-components/src/components/ImagePromotion/utils.ts index c9384aefd..19a319056 100644 --- a/libs/ui-components/src/components/ImagePromotion/utils.ts +++ b/libs/ui-components/src/components/ImagePromotion/utils.ts @@ -1,12 +1,18 @@ import { type TFunction } from 'react-i18next'; import * as Yup from 'yup'; +import semver from 'semver'; + import { ExistingCatalogItemTarget, + type ExportFormatType, + type ImageExport, type ImagePromotion, + ImagePromotionConditionReason, + ImagePromotionConditionType, type NewCatalogItemTarget, } from '@flightctl/types/imagebuilder'; -import { type CatalogItem } from '@flightctl/types/alpha'; -import semver from 'semver'; +import type { CatalogItem } from '@flightctl/types/alpha'; +import type { ImageBuildWithExports } from '../../types/extraTypes'; import { type ImagePromotionFormValues } from './types'; import { validKubernetesDnsSubdomain } from '../form/validations'; @@ -17,6 +23,63 @@ import { optionalSemverRange, } from '../Catalog/AddCatalogItemWizard/utils'; +const NON_EDITABLE_PROMOTION_REASONS = new Set([ + ImagePromotionConditionReason.ImagePromotionConditionReasonFailed, + ImagePromotionConditionReason.ImagePromotionConditionReasonBuildFailed, + ImagePromotionConditionReason.ImagePromotionConditionReasonBuildCanceled, + ImagePromotionConditionReason.ImagePromotionConditionReasonPublishing, +]); + +export const getAvailableExportFormats = (imageBuild: ImageBuildWithExports): ExportFormatType[] => + imageBuild.imageExports + .filter((imageExport): imageExport is ImageExport => !!imageExport) + .map((imageExport) => imageExport.spec.format); + +const getImagePromotionReadyReason = (promotion: ImagePromotion): ImagePromotionConditionReason | undefined => { + const readyCondition = promotion.status?.conditions?.find( + (c) => c.type === ImagePromotionConditionType.ImagePromotionConditionTypeReady, + ); + return readyCondition?.reason as ImagePromotionConditionReason | undefined; +}; + +// Currently only true if additional export formats can be appended to the promotion. +export const canPromotionBeEdited = (promotion: ImagePromotion, availableFormats: ExportFormatType[]): boolean => { + const reason = getImagePromotionReadyReason(promotion); + if (reason && NON_EDITABLE_PROMOTION_REASONS.has(reason)) { + return false; + } + const currentFormats = promotion.spec.source.exportFormats || []; + return availableFormats.some((format) => !currentFormats.includes(format)); +}; + +export const getPromotionEditDisabledReason = ( + promotion: ImagePromotion, + availableFormats: ExportFormatType[], + canEdit: boolean, + t: TFunction, +): string | undefined => { + if (!canEdit) { + return t('You do not have permissions to update image promotions'); + } + if (canPromotionBeEdited(promotion, availableFormats)) { + return undefined; + } + + const reason = getImagePromotionReadyReason(promotion); + switch (reason) { + case ImagePromotionConditionReason.ImagePromotionConditionReasonPublishing: + return t('Image promotion cannot be edited while publishing is in progress'); + case ImagePromotionConditionReason.ImagePromotionConditionReasonFailed: + return t('Failed image promotions cannot be edited. Create a new image promotion to retry.'); + case ImagePromotionConditionReason.ImagePromotionConditionReasonBuildFailed: + return t('Image promotions for failed image builds cannot be edited. Create a new image promotion to retry.'); + case ImagePromotionConditionReason.ImagePromotionConditionReasonBuildCanceled: + return t('Image promotions for canceled image builds cannot be edited. Create a new image promotion to retry.'); + default: + return t('All export formats from this image build are already included in this promotion'); + } +}; + export const getEditInitialValues = (imagePromotion: ImagePromotion): ImagePromotionFormValues => { const target = imagePromotion.spec.target; const isExisting = target.type === ExistingCatalogItemTarget.type.EXISTING_CATALOG_ITEM; From b422981e952378860fa98ffd595e08639508877a Mon Sep 17 00:00:00 2001 From: Celia Amador Date: Mon, 16 Nov 2026 09:58:10 +0100 Subject: [PATCH 2/2] Prevent edition while artifacts are being built Assisted-by: OpenAI Codex --- libs/ui-components/src/components/ImagePromotion/utils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/ui-components/src/components/ImagePromotion/utils.ts b/libs/ui-components/src/components/ImagePromotion/utils.ts index 19a319056..5049a7b4c 100644 --- a/libs/ui-components/src/components/ImagePromotion/utils.ts +++ b/libs/ui-components/src/components/ImagePromotion/utils.ts @@ -28,6 +28,7 @@ const NON_EDITABLE_PROMOTION_REASONS = new Set([ ImagePromotionConditionReason.ImagePromotionConditionReasonBuildFailed, ImagePromotionConditionReason.ImagePromotionConditionReasonBuildCanceled, ImagePromotionConditionReason.ImagePromotionConditionReasonPublishing, + ImagePromotionConditionReason.ImagePromotionConditionReasonWaitingForArtifacts, ]); export const getAvailableExportFormats = (imageBuild: ImageBuildWithExports): ExportFormatType[] =>