From ede23369f93a33c320119314ca54f4aa4eff2c1b Mon Sep 17 00:00:00 2001 From: xsalonx Date: Thu, 11 Apr 2024 16:48:03 +0200 Subject: [PATCH] refactor --- .../views/QcFlags/Create/qcFlagCreationComponent.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/public/views/QcFlags/Create/qcFlagCreationComponent.js b/lib/public/views/QcFlags/Create/qcFlagCreationComponent.js index a3da42748f..796d399027 100644 --- a/lib/public/views/QcFlags/Create/qcFlagCreationComponent.js +++ b/lib/public/views/QcFlags/Create/qcFlagCreationComponent.js @@ -53,6 +53,10 @@ export const qcFlagCreationComponenet = (creationModel) => { ), ]; const { timeRangeModel, useTimeBasedQcFlag, canSendTimeBasedQcFlag } = creationModel; + const optionalTimeInputs = useTimeBasedQcFlag + ? timeRangeInput(timeRangeModel, { seconds: true, min: run.startTime, max: run.endTime }) + : null; + const leftPanel = creationModel.run.match({ Success: (run) => [ h('.flex-row.g3', [ @@ -88,9 +92,7 @@ export const qcFlagCreationComponenet = (creationModel) => { ]) : null, ]), canSendTimeBasedQcFlag - ? useTimeBasedQcFlag - ? timeRangeInput(timeRangeModel, { seconds: true, min: run.startTime, max: run.endTime }) - : null + ? optionalTimeInputs : h('.alert', 'Can send run-based QC flag only as start or stop of run is missing'), ], Other: () => null,