From 1371338c6479122f9c8f790f9488ff543c5a09e4 Mon Sep 17 00:00:00 2001 From: Craig Yu Date: Wed, 28 Aug 2024 09:56:57 -0700 Subject: [PATCH] fix: remove dev button and disable edit-save for cus and upt (#1557) --- .../SeedlotReview/SeedlotReviewContent.tsx | 31 ++++++++++++------- .../views/Seedlot/SeedlotReview/constants.tsx | 2 ++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/frontend/src/views/Seedlot/SeedlotReview/SeedlotReviewContent.tsx b/frontend/src/views/Seedlot/SeedlotReview/SeedlotReviewContent.tsx index 5fe732524..05ad27019 100644 --- a/frontend/src/views/Seedlot/SeedlotReview/SeedlotReviewContent.tsx +++ b/frontend/src/views/Seedlot/SeedlotReview/SeedlotReviewContent.tsx @@ -12,7 +12,6 @@ import { Edit, Save, Pending, Checkmark, Warning } from '@carbon/icons-react'; import { Beforeunload } from 'react-beforeunload'; -import { DateTime as luxon } from 'luxon'; import { getSeedlotById, putAClassSeedlotProgress } from '../../../api-service/seedlotAPI'; import { THREE_HALF_HOURS, THREE_HOURS } from '../../../config/TimeUnits'; @@ -70,7 +69,7 @@ import { validateGeneticWorth } from './utils'; import { GenWorthValType } from './definitions'; -import { SaveStatusModalText } from './constants'; +import { IS_DEV_FEATURE_ENABLED, SaveStatusModalText } from './constants'; import { completeProgressConfig, emptyOwnershipStep, initialProgressConfig } from '../ContextContainerClassA/constants'; import { AllStepData } from '../ContextContainerClassA/definitions'; @@ -512,15 +511,23 @@ const SeedlotReviewContent = () => { || isFetchingData } /> - + + { + // Seedlots that have 'CUS' or 'UPT' as source should not be edited. + seedlotData?.seedlotSource.seedlotSourceCode === 'TPT' + ? ( + + ) + : null + } { { // this and its related code such as createDraftForPendMutation // needs to be deleted in the future - (luxon.local().setZone('America/Vancouver').toISODate() ?? '' < '2024-08-17') + IS_DEV_FEATURE_ENABLED ? ( diff --git a/frontend/src/views/Seedlot/SeedlotReview/constants.tsx b/frontend/src/views/Seedlot/SeedlotReview/constants.tsx index 958cd97ca..b424ecd87 100644 --- a/frontend/src/views/Seedlot/SeedlotReview/constants.tsx +++ b/frontend/src/views/Seedlot/SeedlotReview/constants.tsx @@ -128,3 +128,5 @@ export const SaveStatusModalText = { ) }; + +export const IS_DEV_FEATURE_ENABLED = false;