From 722bb8777aac4a9936d4e1c0ba86a52987ed3086 Mon Sep 17 00:00:00 2001 From: Iacopo Leardini Date: Wed, 26 Jun 2024 10:51:01 +0200 Subject: [PATCH] chore: remove unused page (jotform feature) --- src/App.tsx | 8 +- src/features/AuthorizedOnlyContainer.tsx | 10 ++- .../components/FormProvider.tsx | 1 + .../formConfigurator/CufMultiselect.tsx | 78 +++++++++++++++++++ .../formConfigurator/ValuesFieldsCard.tsx | 2 +- .../functions/scrollToFormTitle.tsx | 2 +- src/pages/preselectionForms/singleSlice.ts | 4 + src/store.ts | 2 - 8 files changed, 95 insertions(+), 12 deletions(-) create mode 100644 src/pages/preselectionForms/components/formConfigurator/CufMultiselect.tsx diff --git a/src/App.tsx b/src/App.tsx index 523a30de..e34dd1a2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -14,7 +14,6 @@ import EditPreselectionForm from "src/pages/preselectionForms/edit"; import { setupStore } from "src/store"; import { PageTemplate } from "./features/PageTemplate"; import SentryWrapper from "./features/SentryWrapper"; -import Jotform from "./pages/Jotform"; import Prospect from "./pages/Prospect"; import UxDashboard from "./pages/UxDashboard"; import AgreementsList from "./pages/agreements/list"; @@ -50,17 +49,16 @@ function App() { path="/backoffice/payments" component={AdminPayments} /> - = ({ children, excludeRule, isFluid }) => { - const { isFetching, isError, isLoading } = useUserData(); + const { isError, isFetching, isLoading } = useGetUsersMeQuery({ + fields: "role", + }); if (isLoading || isFetching) return loading...; if (isError) return there was an error; if (excludeRule) @@ -23,7 +25,9 @@ export const AuthorizedOnlyContainer: React.FC<{ export const OpsUserContainer: React.FC<{ children: React.ReactNode }> = ({ children, }) => { - const { data } = useUserData(); + const { data } = useGetUsersMeQuery({ + fields: "role", + }); return ( { + const selectOptions = useMemo( + () => + options.map((option) => ({ + label: option.label, + value: option.value, + })), + [options] + ); + return ( +
+ { + if (!value || !value.length) { + return "This is a required field"; + } + }} + > + {({ + field, // { name, value, onChange, onBlur } + form, + }: FieldProps) => { + return ( + +