From 666b859cb5e92ac6f768cec108ac96a18efffe3f Mon Sep 17 00:00:00 2001 From: Craig Yu Date: Mon, 26 Aug 2024 14:52:55 -0700 Subject: [PATCH] fix: remove dev button and disable edit-save for cus and upt --- .../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 798de00f3..54fd221da 100644 --- a/frontend/src/views/Seedlot/SeedlotReview/SeedlotReviewContent.tsx +++ b/frontend/src/views/Seedlot/SeedlotReview/SeedlotReviewContent.tsx @@ -11,7 +11,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'; @@ -69,7 +68,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'; @@ -511,15 +510,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;