From e241f16a1c4ab993863d71b35726404dd6e40811 Mon Sep 17 00:00:00 2001 From: Alex Jennings Date: Mon, 10 Nov 2025 10:31:51 +0000 Subject: [PATCH] WIP export template --- .../exporttemplate/ExportTemplateDialog.jsx | 43 +++ .../exporttemplate/ExportTemplateForm.jsx | 331 ++++++++++++++++++ src/containers/ExportTemplateList.jsx | 84 +++++ src/formactions/exporttemplate.js | 33 ++ 4 files changed, 491 insertions(+) create mode 100644 src/components/exporttemplate/ExportTemplateDialog.jsx create mode 100644 src/components/exporttemplate/ExportTemplateForm.jsx create mode 100644 src/containers/ExportTemplateList.jsx create mode 100644 src/formactions/exporttemplate.js diff --git a/src/components/exporttemplate/ExportTemplateDialog.jsx b/src/components/exporttemplate/ExportTemplateDialog.jsx new file mode 100644 index 0000000..ca442a8 --- /dev/null +++ b/src/components/exporttemplate/ExportTemplateDialog.jsx @@ -0,0 +1,43 @@ +import Dialog from '@material-ui/core/Dialog'; +import DialogTitle from '@material-ui/core/DialogTitle'; +import { compose } from 'redux'; + +import * as formActions from '../../formactions/exporttemplate'; +import withUI from '../../hoc/withUI'; +import DialogContent from '../ui/DialogContent'; +import WizardForm from '../ui/WizardForm'; + +import ExportTemplateForm from './ExportTemplateForm'; + +function ExportTemplateDialog({ templateName, open, onClose, onSuccess, openSnackBar, onFail }) { + const onSubmitSuccess = (response, dispatch, props) => { + const { locationName } = response; + const messageContent = `Export Location ${locationName} Created`; + openSnackBar({ messageContent }); + onClose(); + if (onSuccess) onSuccess(response, dispatch, props); + }; + const onSubmitFail = (error, dispatch, props) => { + const messageContent = 'Error Creating Export Template'; + openSnackBar({ messageContent, messageColor: 'secondary' }); + if (onFail) onSuccess(error, dispatch, props); + }; + return ( + + New Export Template + + + + + ); +} + +export default compose(withUI)(ExportTemplateDialog); diff --git a/src/components/exporttemplate/ExportTemplateForm.jsx b/src/components/exporttemplate/ExportTemplateForm.jsx new file mode 100644 index 0000000..93e3c5b --- /dev/null +++ b/src/components/exporttemplate/ExportTemplateForm.jsx @@ -0,0 +1,331 @@ +import FormControlLabel from '@material-ui/core/FormControlLabel'; +import Typography from '@material-ui/core/Typography'; +import { reduxForm } from 'redux-form'; + +import { required } from '../../utils/FieldValidation'; +import { TextField } from '../form'; +import { loadShapeTagOptions } from '../shapetag/ShapeTagSelect'; +import BoolCheckbox from '../ui/BoolCheckbox'; +import ChipInput from '../ui/ChipInput'; +import CodeField from '../ui/CodeField'; +import Field from '../ui/Field'; +import FieldArray from '../ui/FieldArray'; +import FormSection from '../ui/FormSection'; +import { StatefulAsyncSelect } from '../ui/Select'; + +const ExportTemplateArchiveType = ['ZIP', 'TAR'].map((value) => ({ value, label: value })); +const ExportTemplateCompressType = ['GZ', 'BZIP2'].map((value) => ({ value, label: value })); + +function ExportTemplateArchive() { + return ( + <> + + + + + ); +} + +function ExportTemplateCollection() { + return ( + <> + + + + ); +} + +function ExportTemplateItem() { + return ( + <> + + + + ); +} + +function ExportTemplateComponent() { + return ; +} + +function ExportTemplateComponentFile() { + return ; +} + +function ExportTemplateCompress() { + return ( + <> + + + + + ); +} + +function ExportTemplateDummy() { + return ; +} + +function ExportTemplateExternal() { + return ( + <> + + + + ); +} + +function ExportTemplateFolder() { + return ; +} + +function ExportTemplateTextContent() { + return ( + <> + + } + label="scripttags" + /> + + ); +} + +function ExportTemplateIterate() { + return ( + <> + + + + + ); +} + +function ExportTemplateLibrary() { + return ( + <> + + + + ); +} + +function ExportTemplateSequence() { + return ( + <> + + + } + label="generate" + /> + + + ); +} + +function ExportTemplateShape() { + return ( + <> + + } + label="generate" + /> + + ); +} + +function ExportTemplateText() { + return ( + <> + + + + + + + + ); +} + +function ExportTemplateChoiceGroup() { + return ( + <> + + + + + + + + + + + + + + + + + + ); +} + +function ExportTemplateType() { + return ( + <> + + + + + + + + + + ); +} + +function ExportTemplateForm({ templateName, error, handleSubmit }) { + return ( +
+ {error && {error}} + {!templateName && ( + + )} + + +