X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/219d452e647c01754bf71b91086b15cc9f00027a..20063f6f7bb9ad7c6a9a0b49b3c5ba4b0abc532e:/src/views-components/dialog-update/dialog-collection-update.tsx diff --git a/src/views-components/dialog-update/dialog-collection-update.tsx b/src/views-components/dialog-update/dialog-collection-update.tsx index 08eee418bd..cce64d27ac 100644 --- a/src/views-components/dialog-update/dialog-collection-update.tsx +++ b/src/views-components/dialog-update/dialog-collection-update.tsx @@ -2,130 +2,29 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; -import { reduxForm, Field } from 'redux-form'; -import { compose } from 'redux'; -import { ArvadosTheme } from '../../common/custom-theme'; -import { Dialog, DialogActions, DialogContent, DialogTitle, TextField, StyleRulesCallback, withStyles, WithStyles, Button, CircularProgress } from '../../../node_modules/@material-ui/core'; -import { COLLECTION_NAME_VALIDATION, COLLECTION_DESCRIPTION_VALIDATION } from '../../validators/create-collection/create-collection-validator'; -import { COLLECTION_FORM_NAME } from '../../store/collections/updator/collection-updator-action'; - -type CssRules = 'content' | 'actions' | 'textField' | 'buttonWrapper' | 'saveButton' | 'circularProgress'; - -const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ - content: { - display: 'flex', - flexDirection: 'column' - }, - actions: { - margin: 0, - padding: `${theme.spacing.unit}px ${theme.spacing.unit * 3 - theme.spacing.unit / 2}px - ${theme.spacing.unit * 3}px ${theme.spacing.unit * 3}px` - }, - textField: { - marginBottom: theme.spacing.unit * 3 - }, - buttonWrapper: { - position: 'relative' - }, - saveButton: { - boxShadow: 'none' - }, - circularProgress: { - position: 'absolute', - top: 0, - bottom: 0, - left: 0, - right: 0, - margin: 'auto' - } -}); - -interface DialogCollectionDataProps { - open: boolean; - handleSubmit: any; - submitting: boolean; - invalid: boolean; - pristine: boolean; -} - -interface DialogCollectionAction { - handleClose: () => void; - onSubmit: (data: { name: string, description: string }) => void; -} - -type DialogCollectionProps = DialogCollectionDataProps & DialogCollectionAction & WithStyles; - -interface TextFieldProps { - label: string; - floatinglabeltext: string; - className?: string; - input?: string; - meta?: any; -} - -export const DialogCollectionUpdate = compose( - reduxForm({ form: COLLECTION_FORM_NAME }), - withStyles(styles))( - - class DialogCollectionUpdate extends React.Component { - - render() { - const { classes, open, handleClose, handleSubmit, onSubmit, submitting, invalid, pristine } = this.props; - return ( - - -
onSubmit(data))}> - Edit Collection - - - - - - -
- - {submitting && } -
-
-
-
- ); - } - - renderTextField = ({ input, label, meta: { touched, error }, ...custom }: TextFieldProps) => ( - - ) - } - ); \ No newline at end of file +import React from 'react'; +import { InjectedFormProps } from 'redux-form'; +import { WithDialogProps } from 'store/dialog/with-dialog'; +import { CollectionUpdateFormDialogData } from 'store/collections/collection-update-actions'; +import { FormDialog } from 'components/form-dialog/form-dialog'; +import { + CollectionNameField, + CollectionDescriptionField, + CollectionStorageClassesField +} from 'views-components/form-fields/collection-form-fields'; + +type DialogCollectionProps = WithDialogProps<{}> & InjectedFormProps; + +export const DialogCollectionUpdate = (props: DialogCollectionProps) => + ; + +const CollectionEditFields = () => + + + +;