Skip to content
Merged
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
10 changes: 5 additions & 5 deletions src/discrete-layer/components/layer-details/raster/job-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -46,9 +45,10 @@ const JobInfoComponent: React.FC<JobInfoProps> = ({ job }) => {
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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets take it out to utils


const isViewOnly = useMemo(() => {
const isStatusReadOnly = jobStatus != null && FINAL_STATUSES.includes(jobStatus);
const isStatusReadOnly = jobStatus != null && jobStatus !== Status.Suspended;
if (!errorsCount) {
return isStatusReadOnly;
}
Expand All @@ -61,8 +61,8 @@ const JobInfoComponent: React.FC<JobInfoProps> = ({ job }) => {
}
return false;
});
return isStatusReadOnly || hasOtherErrors;
}, [errorsCount, thresholds, jobStatus]);
return isStatusReadOnly || hasOtherErrors || isAlreadyApproved;
}, [errorsCount, thresholds, jobStatus, isAlreadyApproved]);

if (!displayJob) {
return null;
Expand Down Expand Up @@ -115,7 +115,7 @@ const JobInfoComponent: React.FC<JobInfoProps> = ({ job }) => {
key: 'resolution',
action: openResolutionConflictDialog,
isEnabled: taskStatus === Status.Completed,
isApproved: isApproved || !isEmpty(details?.parameters.allowedValidationErrors),
isApproved: isApproved || isAlreadyApproved,
}
)}
</Box>
Expand Down
Loading