files: File[];
}
-export const COLLECTION_CREATE_FORM_NAME = "collectionCreateDialog";
+export const COLLECTION_CREATE_FORM_NAME = "collectionCreateFormName";
-export const openCreateModal = () =>
+export const openCollectionCreateDialog = () =>
(dispatch: Dispatch) => {
dispatch(dialogActions.OPEN_DIALOG({ id: COLLECTION_CREATE_FORM_NAME, data: {} }));
};
dispatch(projectPanelActions.REQUEST_ITEMS());
dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_CREATE_FORM_NAME }));
dispatch(reset(COLLECTION_CREATE_FORM_NAME));
- // return newCollection;
} catch (e) {
const error = getCommonResourceServiceError(e);
if (error === CommonResourceServiceError.UNIQUE_VIOLATION) {
description: string;
}
-export const COLLECTION_UPDATE_FORM_NAME = 'collectionUpdateDialog';
+export const COLLECTION_UPDATE_FORM_NAME = 'collectionUpdateFormName';
-export const openUpdateModal = (resource: ContextMenuResource) =>
+export const openCollectionUpdateDialog = (resource: ContextMenuResource) =>
(dispatch: Dispatch) => {
dispatch(initialize(COLLECTION_UPDATE_FORM_NAME, resource));
dispatch(dialogActions.OPEN_DIALOG({ id: COLLECTION_UPDATE_FORM_NAME, data: {} }));
import { ToggleFavoriteAction } from "../actions/favorite-action";
import { toggleFavorite } from "~/store/favorites/favorites-actions";
import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, ProvenanceGraphIcon, AdvancedIcon, RemoveIcon } from "~/components/icon/icon";
-import { openUpdateModal } from "~/store/collections/collection-update-actions";
+import { openCollectionUpdateDialog } from "~/store/collections/collection-update-actions";
import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
import { openMoveCollectionDialog } from '~/store/move-collection-dialog/move-collection-dialog';
import { openProjectCopyDialog } from "~/store/project-copy-project-dialog/project-copy-project-dialog";
icon: RenameIcon,
name: "Edit collection",
execute: (dispatch, resource) => {
- dispatch<any>(openUpdateModal(resource));
+ dispatch<any>(openCollectionUpdateDialog(resource));
}
},
{
import { ToggleFavoriteAction } from "../actions/favorite-action";
import { toggleFavorite } from "~/store/favorites/favorites-actions";
import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, RemoveIcon } from "~/components/icon/icon";
-import { openUpdateModal } from "~/store/collections/collection-update-actions";
+import { openCollectionUpdateDialog } from "~/store/collections/collection-update-actions";
import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
import { openMoveCollectionDialog } from '~/store/move-collection-dialog/move-collection-dialog';
import { openProjectCopyDialog } from '~/store/project-copy-project-dialog/project-copy-project-dialog';
icon: RenameIcon,
name: "Edit collection",
execute: (dispatch, resource) => {
- dispatch<any>(openUpdateModal(resource));
+ dispatch<any>(openCollectionUpdateDialog(resource));
}
},
{
import { ContextMenuActionSet } from "../context-menu-action-set";
import { projectActions } from "~/store/project/project-action";
import { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create";
-import { COLLECTION_CREATE_FORM_NAME, openCreateModal } from '~/store/collections/collection-create-actions';
+import { COLLECTION_CREATE_FORM_NAME, openCollectionCreateDialog } from '~/store/collections/collection-create-actions';
import { NewProjectIcon, CollectionIcon } from "~/components/icon/icon";
export const rootProjectActionSet: ContextMenuActionSet = [[
name: "New Collection",
execute: (dispatch, resource) => {
dispatch(reset(COLLECTION_CREATE_FORM_NAME));
- dispatch<any>(openCreateModal());
+ dispatch<any>(openCollectionCreateDialog());
}
}
]];
import { InjectedFormProps } from 'redux-form';
import { WithDialogProps } from '~/store/dialog/with-dialog';
import { CollectionCreateFormDialogData } from '~/store/collections/collection-create-actions';
+import { collectionUploaderActions, UploadFile } from "~/store/collections/uploader/collection-uploader-actions";
import { FormDialog } from '~/components/form-dialog/form-dialog';
import { CollectionNameField, CollectionDescriptionField } from '~/views-components/collection-form-fields/collection-form-fields';
+import { FileUpload } from '~/components/file-upload/file-upload';
+
+// interface DialogCollectionDataProps {
+// open: boolean;
+// handleSubmit: any;
+// submitting: boolean;
+// invalid: boolean;
+// pristine: boolean;
+// files: UploadFile[];
+// }
type DialogCollectionProps = WithDialogProps<{}> & InjectedFormProps<CollectionCreateFormDialogData>;
<CollectionNameField />
<CollectionDescriptionField />
{/* <FileUpload
- files={files}
+ files={this.props.files}
disabled={busy}
onDrop={files => this.props.dispatch(collectionUploaderActions.SET_UPLOAD_FILES(files))} /> */}
</span>;
\ No newline at end of file
reduxForm<CollectionCreateFormDialogData>({
form: COLLECTION_CREATE_FORM_NAME,
onSubmit: (data, dispatch) => {
- console.log('onSubmit: ', data);
dispatch(addCollection(data));
}
})
-)(DialogCollectionCreate);
\ No newline at end of file
+)(DialogCollectionCreate);
+
+// onSubmit: (data: { name: string, description: string }, files: UploadFile[]) => void;
\ No newline at end of file
import { CollectionPanel } from '../collection-panel/collection-panel';
import { loadCollection, loadCollectionTags } from '~/store/collection-panel/collection-panel-action';
import { getCollectionUrl } from '~/models/collection';
-import { COLLECTION_CREATE_FORM_NAME, openCreateModal } from '~/store/collections/collection-create-actions';
+import { COLLECTION_CREATE_FORM_NAME, openCollectionCreateDialog } from '~/store/collections/collection-create-actions';
import { CreateCollectionDialog } from '~/views-components/dialog-forms/create-collection-dialog';
import { UpdateCollectionDialog } from '~/views-components/dialog-forms/update-collection-dialog';
import { UpdateProjectDialog } from '~/views-components/update-project-dialog/update-project-dialog';
+import { ProjectPanel } from "~/views/project-panel/project-panel";
import { AuthService } from "~/services/auth-service/auth-service";
import { RenameFileDialog } from '~/views-components/rename-file-dialog/rename-file-dialog';
import { FileRemoveDialog } from '~/views-components/file-remove-dialog/file-remove-dialog';
handleCollectionCreationDialogOpen = (itemUuid: string) => {
this.props.dispatch(reset(COLLECTION_CREATE_FORM_NAME));
- this.props.dispatch<any>(openCreateModal());
+ this.props.dispatch<any>(openCollectionCreateDialog());
}
openContextMenu = (event: React.MouseEvent<HTMLElement>, resource: { name: string; uuid: string; description?: string; kind: ContextMenuKind; }) => {