From 5fb8a4ff85e3a6b7ee1998308a22eab6e2f68390 Mon Sep 17 00:00:00 2001 From: alebinson Date: Wed, 10 Jun 2026 12:17:19 +0300 Subject: [PATCH 1/3] fix: approve enabled for inprogress job --- .../layer-details/raster/job-info.tsx | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/discrete-layer/components/layer-details/raster/job-info.tsx b/src/discrete-layer/components/layer-details/raster/job-info.tsx index b5a5fb64..58bda3d6 100644 --- a/src/discrete-layer/components/layer-details/raster/job-info.tsx +++ b/src/discrete-layer/components/layer-details/raster/job-info.tsx @@ -11,7 +11,6 @@ import { } from '../../../../common/models/job-errors-summary.raster'; import { Status } from '../../../models'; import { JobErrorsSummaryRasterJobData } from '../../job-manager/cell-renderer/job-details/job-errors-summary.raster-job-data'; -import { FINAL_STATUSES } from '../../job-manager/job.types'; import { Progress } from './progress'; import { ResolutionConflictDialog } from './resolution-conflict.dialog'; import { isJobValid, isStatusFailed, isTaskValid } from './state-machine/helpers'; @@ -34,6 +33,15 @@ const JobInfoComponent: React.FC = ({ job }) => { } const displayJob = latestJobRef.current; + if (!displayJob) { + return null; + } + + const { taskId, taskStatus, taskReason, taskPercentage, details, validationReport } = displayJob; + const errorsCount = validationReport?.errorsSummary?.errorsCount; + const thresholds = validationReport?.errorsSummary?.thresholds; + const jobStatus = details?.status as Status | undefined; + const isAlreadyApproved = !isEmpty(details?.parameters.allowedValidationErrors); const openResolutionConflictDialog = useCallback(() => { setIsResolutionConflictDialogOpen(true); @@ -43,12 +51,9 @@ const JobInfoComponent: React.FC = ({ job }) => { setIsApproved(true); }, []); - const errorsCount = displayJob?.validationReport?.errorsSummary?.errorsCount; - const thresholds = displayJob?.validationReport?.errorsSummary?.thresholds; - const jobStatus = displayJob?.details?.status as Status | undefined; - const isViewOnly = useMemo(() => { - const isStatusReadOnly = jobStatus != null && FINAL_STATUSES.includes(jobStatus); + const isStatusReadOnly = + jobStatus != null && (jobStatus !== Status.Suspended || isAlreadyApproved); if (!errorsCount) { return isStatusReadOnly; } @@ -64,12 +69,6 @@ const JobInfoComponent: React.FC = ({ job }) => { return isStatusReadOnly || hasOtherErrors; }, [errorsCount, thresholds, jobStatus]); - if (!displayJob) { - return null; - } - - const { taskId, taskStatus, taskReason, taskPercentage, details, validationReport } = displayJob; - const errorsSummary = validationReport?.errorsSummary; const jobReason = details?.reason as string | undefined; @@ -115,7 +114,7 @@ const JobInfoComponent: React.FC = ({ job }) => { key: 'resolution', action: openResolutionConflictDialog, isEnabled: taskStatus === Status.Completed, - isApproved: isApproved || !isEmpty(details?.parameters.allowedValidationErrors), + isApproved: isApproved || isAlreadyApproved, } )} From f9e9f249b5a95eecb51f9da93f6fade453f34ce8 Mon Sep 17 00:00:00 2001 From: alebinson Date: Wed, 10 Jun 2026 12:32:31 +0300 Subject: [PATCH 2/3] chore: revert cause eslint --- .../layer-details/raster/job-info.tsx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/discrete-layer/components/layer-details/raster/job-info.tsx b/src/discrete-layer/components/layer-details/raster/job-info.tsx index 58bda3d6..f2252342 100644 --- a/src/discrete-layer/components/layer-details/raster/job-info.tsx +++ b/src/discrete-layer/components/layer-details/raster/job-info.tsx @@ -33,15 +33,6 @@ const JobInfoComponent: React.FC = ({ job }) => { } const displayJob = latestJobRef.current; - if (!displayJob) { - return null; - } - - const { taskId, taskStatus, taskReason, taskPercentage, details, validationReport } = displayJob; - const errorsCount = validationReport?.errorsSummary?.errorsCount; - const thresholds = validationReport?.errorsSummary?.thresholds; - const jobStatus = details?.status as Status | undefined; - const isAlreadyApproved = !isEmpty(details?.parameters.allowedValidationErrors); const openResolutionConflictDialog = useCallback(() => { setIsResolutionConflictDialogOpen(true); @@ -51,6 +42,11 @@ const JobInfoComponent: React.FC = ({ job }) => { setIsApproved(true); }, []); + const errorsCount = displayJob?.validationReport?.errorsSummary?.errorsCount; + const thresholds = displayJob?.validationReport?.errorsSummary?.thresholds; + const jobStatus = displayJob?.details?.status as Status | undefined; + const isAlreadyApproved = !isEmpty(displayJob?.details?.parameters.allowedValidationErrors); + const isViewOnly = useMemo(() => { const isStatusReadOnly = jobStatus != null && (jobStatus !== Status.Suspended || isAlreadyApproved); @@ -67,7 +63,13 @@ const JobInfoComponent: React.FC = ({ job }) => { return false; }); return isStatusReadOnly || hasOtherErrors; - }, [errorsCount, thresholds, jobStatus]); + }, [errorsCount, thresholds, jobStatus, isAlreadyApproved]); + + if (!displayJob) { + return null; + } + + const { taskId, taskStatus, taskReason, taskPercentage, details, validationReport } = displayJob; const errorsSummary = validationReport?.errorsSummary; const jobReason = details?.reason as string | undefined; From 381d4cbc1d184379db67b40afb0e01a2f9bccee2 Mon Sep 17 00:00:00 2001 From: alebinson Date: Wed, 10 Jun 2026 13:25:29 +0300 Subject: [PATCH 3/3] chore: pr comments --- .../components/layer-details/raster/job-info.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/discrete-layer/components/layer-details/raster/job-info.tsx b/src/discrete-layer/components/layer-details/raster/job-info.tsx index f2252342..8e03bf99 100644 --- a/src/discrete-layer/components/layer-details/raster/job-info.tsx +++ b/src/discrete-layer/components/layer-details/raster/job-info.tsx @@ -48,8 +48,7 @@ const JobInfoComponent: React.FC = ({ job }) => { const isAlreadyApproved = !isEmpty(displayJob?.details?.parameters.allowedValidationErrors); const isViewOnly = useMemo(() => { - const isStatusReadOnly = - jobStatus != null && (jobStatus !== Status.Suspended || isAlreadyApproved); + const isStatusReadOnly = jobStatus != null && jobStatus !== Status.Suspended; if (!errorsCount) { return isStatusReadOnly; } @@ -62,7 +61,7 @@ const JobInfoComponent: React.FC = ({ job }) => { } return false; }); - return isStatusReadOnly || hasOtherErrors; + return isStatusReadOnly || hasOtherErrors || isAlreadyApproved; }, [errorsCount, thresholds, jobStatus, isAlreadyApproved]); if (!displayJob) {