From 72800777df26eb5f2ec485d6d7a4d989d15aa859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Barrenechea=20S=C3=A1nchez?= Date: Wed, 18 May 2022 12:55:14 +0200 Subject: [PATCH 1/2] Scenario: cloning --- app/components/scenarios/item/component.tsx | 13 +++++++ .../scenarios/item/settings/component.tsx | 22 +++++------ app/hooks/scenarios/index.ts | 8 ++-- app/hooks/scenarios/types.ts | 2 +- .../projects/show/scenarios/component.tsx | 4 +- .../scenarios/edit/status/actions/done.tsx | 39 ++++++++++++++++++- app/layout/scenarios/edit/status/constants.ts | 4 ++ 7 files changed, 70 insertions(+), 22 deletions(-) diff --git a/app/components/scenarios/item/component.tsx b/app/components/scenarios/item/component.tsx index 12d170cbeb..f1608b6cfd 100644 --- a/app/components/scenarios/item/component.tsx +++ b/app/components/scenarios/item/component.tsx @@ -60,6 +60,14 @@ const SCENARIO_STATES = { text: 'Fail Features', styles: 'text-red-500', }, + 'clone-running': { + text: 'Running cloning', + styles: 'text-white', + }, + 'clone-failure': { + text: 'Fail cloning scenario', + styles: 'text-red-500', + }, draft: { text: 'Edited', styles: 'text-gray-400', @@ -112,6 +120,7 @@ export const Item: React.FC = ({ const geofeatureStratification = jobs.find((j) => j.kind === 'geofeatureStratification'); const specification = jobs.find((j) => j.kind === 'specification'); const calibration = jobs.find((j) => j.kind === 'calibration'); + const clone = jobs.find((j) => j.kind === 'clone'); const run = jobs.find((j) => j.kind === 'run'); // PROTECTED AREAS @@ -153,6 +162,10 @@ export const Item: React.FC = ({ if (runStatus === 'failure') return 'run-failure'; if (runStatus === 'done') return 'run-done'; + // CLONE + if (clone && clone.status === 'running') return 'clone-running'; + if (clone && clone.status === 'failure') return 'clone-failure'; + if (ranAtLeastOnce) return 'run-done'; return 'draft'; diff --git a/app/components/scenarios/item/settings/component.tsx b/app/components/scenarios/item/settings/component.tsx index 0eee1f25de..a3e0e2970b 100644 --- a/app/components/scenarios/item/settings/component.tsx +++ b/app/components/scenarios/item/settings/component.tsx @@ -4,8 +4,6 @@ import { useRouter } from 'next/router'; import { useCanEditProject } from 'hooks/permissions'; -import ComingSoon from 'layout/help/coming-soon'; - import Button from 'components/button'; export interface ItemSettingsProps { @@ -29,17 +27,15 @@ export const Item: React.FC = ({ {children}
- - - +