From 7c3c0389dc16332d3f074387f11764a262b6f8f1 Mon Sep 17 00:00:00 2001 From: Camille TJHOA Date: Thu, 19 Sep 2024 09:21:07 +0200 Subject: [PATCH] feat(services): add show hide extra labels annotations in creation flows (#1677) * chore: add @radix-ui/react-collapsible * feat(services): add show/hide extra labels/annotations in creation flows --- .../step-general/step-general.tsx | 31 +++++++++++++++---- package.json | 1 + yarn.lock | 3 +- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/libs/pages/services/src/lib/ui/page-application-create/step-general/step-general.tsx b/libs/pages/services/src/lib/ui/page-application-create/step-general/step-general.tsx index a75084dee81..83607a339d3 100644 --- a/libs/pages/services/src/lib/ui/page-application-create/step-general/step-general.tsx +++ b/libs/pages/services/src/lib/ui/page-application-create/step-general/step-general.tsx @@ -1,5 +1,6 @@ +import * as Collapsible from '@radix-ui/react-collapsible' import { type Organization } from 'qovery-typescript-axios' -import { type FormEventHandler } from 'react' +import { type FormEventHandler, useState } from 'react' import { Controller, useFormContext } from 'react-hook-form' import { useNavigate, useParams } from 'react-router-dom' import { AnnotationSetting, LabelSetting } from '@qovery/domains/organizations/feature' @@ -22,6 +23,7 @@ export function StepGeneral(props: StepGeneralProps) { const { control, watch, formState } = useFormContext() const { organizationId = '', environmentId = '', projectId = '', slug, option } = useParams() const navigate = useNavigate() + const [openExtraAttributes, setOpenExtraAttributes] = useState(false) const watchServiceType = watch('serviceType') const watchIsPublicRepository = watch('is_public_repository') @@ -120,11 +122,28 @@ export function StepGeneral(props: StepGeneralProps) { )} -
- Extra labels/annotations - - -
+ +
+
+ Extra labels/annotations + + {openExtraAttributes ? ( + <> + Hide + + ) : ( + <> + Show + + )} + +
+ + + + +
+