From c755817ae6bd9532492f382ea52a871fa25cc04a Mon Sep 17 00:00:00 2001 From: shamsmosowi Date: Fri, 12 Nov 2021 23:27:34 +1100 Subject: [PATCH] remove yup --- package.json | 3 +- .../fields/Action/FormDialog/Dialog.tsx | 39 ------------------- 2 files changed, 1 insertion(+), 41 deletions(-) diff --git a/package.json b/package.json index 31dde2ab..c1caa907 100644 --- a/package.json +++ b/package.json @@ -69,8 +69,7 @@ "use-algolia": "^1.4.1", "use-debounce": "^3.3.0", "use-persisted-state": "^0.3.3", - "yarn": "^1.22.10", - "yup": "^0.32.9" + "yarn": "^1.22.10" }, "scripts": { "upstream": "git fetch upstream;git merge upstream/main;git commit -m'merge upstream';git push", diff --git a/src/components/fields/Action/FormDialog/Dialog.tsx b/src/components/fields/Action/FormDialog/Dialog.tsx index 3c734322..7d2a54be 100644 --- a/src/components/fields/Action/FormDialog/Dialog.tsx +++ b/src/components/fields/Action/FormDialog/Dialog.tsx @@ -1,50 +1,11 @@ -import * as yup from "yup"; - import { FormDialog } from "@rowy/form-builder"; - -const yupReducer = (validationConfig) => (acc, currKey) => { - if (validationConfig[currKey] !== null) { - const args = Array.isArray(validationConfig[currKey]) - ? validationConfig[currKey] - : [validationConfig[currKey]]; - return acc[currKey](...args); - } else return acc[currKey](); -}; -const yupOrderKeys = (acc, currKey) => { - if (["string", "array"].includes(currKey)) return [currKey, ...acc]; - else return [...acc, currKey]; -}; - -// const validationCompiler = (validation) => -// Object.keys(validation) -// .reduce(yupOrderKeys, []) -// .reduce(yupReducer(validation), yup); - export default function ParamsDialog({ column, handleRun, open, handleClose, }: any) { - /* - Refrence fields config - const _fields = [{ - type: 'text', - name: "newCohort", - label: "New Cohort", - validation:{string:null,required:'needs to specific the cohort to new cohort'}, - }, - { - type: 'multiSelect', - name: "newCohortSelect", - label: "New Cohort", - options: ['SYD1','SYD3'], - validation:{array:null,required:'needs to specific the cohort to new cohort',max:[1,'only one cohort is allowed']}, - }] -*/ - if (!open) return null; - return (