actions parram update

This commit is contained in:
Shams mosowi
2021-03-25 21:50:31 +10:00
parent 4e1d48f269
commit ae6980a903
4 changed files with 10 additions and 41 deletions

View File

@@ -40,7 +40,7 @@
"react-dnd-html5-backend": "^11.1.3",
"react-dom": "^16.9.0",
"react-dropzone": "^10.1.8",
"react-hook-form": "^6.15.4",
"react-hook-form": "^6.15.5",
"react-image": "^4.0.3",
"react-joyride": "^2.3.0",
"react-json-view": "^1.19.1",

View File

@@ -42,11 +42,7 @@ export default function ParamsDialog({
handleClose,
}: any) {
const classes = useStyles();
const handleSubmit = (values) => {
handleRun(values);
handleClose();
};
/*
Refrence fields config
@@ -64,13 +60,10 @@ export default function ParamsDialog({
validation:{array:null,required:'needs to specific the cohort to new cohort',max:[1,'only one cohort is allowed']},
}]
*/
console.log(column.config.params);
const fields = column.config.params.map((field) => ({
...field,
validation: validationCompiler(field.validation),
validation:field.validation? validationCompiler(field.validation):null,
}));
console.log(fields);
return (
<>
<FormDialog
@@ -79,36 +72,8 @@ export default function ParamsDialog({
title={`${column.name}`}
fields={fields}
values={{}}
onSubmit={handleSubmit}
customActions={
<Grid
container
spacing={2}
justify="center"
className={classes.buttonGrid}
>
<Grid item>
<Button
size="large"
variant="outlined"
onClick={handleClose}
className={classes.button}
>
Cancel
</Button>
</Grid>
<Grid item>
<Button
size="large"
variant="contained"
type="submit"
className={classes.button}
>
Run
</Button>
</Grid>
</Grid>
}
onSubmit={handleRun}
SubmitButtonProps={{ children: 'Run' }}
/>
</>
);

View File

@@ -133,7 +133,6 @@ const useTableConfig = (tablePath?: string) => {
columnsArray
.filter((c) => c) // arrayMover has a bug creating undefined items
.forEach((column: any, index) => {
console.log({ column });
updatedColumns[column.key] = { ...column, index };
});
documentDispatch({

View File

@@ -12474,11 +12474,16 @@ react-floater@^0.7.2:
react-proptype-conditional-require "^1.0.4"
tree-changes "^0.5.1"
react-hook-form@^6.15.1, react-hook-form@^6.15.4:
react-hook-form@^6.15.1:
version "6.15.4"
resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-6.15.4.tgz#328003e1ccc096cd158899ffe7e3b33735a9b024"
integrity sha512-K+Sw33DtTMengs8OdqFJI3glzNl1wBzSefD/ksQw/hJf9CnOHQAU6qy82eOrh0IRNt2G53sjr7qnnw1JDjvx1w==
react-hook-form@^6.15.5:
version "6.15.5"
resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-6.15.5.tgz#c2578f9ce6a6df7b33015587d40cd880dc13e2db"
integrity sha512-so2jEPYKdVk1olMo+HQ9D9n1hVzaPPFO4wsjgSeZ964R7q7CHsYRbVF0PGBi83FcycA5482WHflasdwLIUVENg==
react-image@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/react-image/-/react-image-4.0.3.tgz#6fa722877660b67295298a914bff1ed87ad2cf83"