Merge branch '21394-docker-tag-push'
[arvados.git] / services / workbench2 / src / views-components / dialog-copy / dialog-collection-partial-copy-to-separate-collections.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import React from "react";
6 import { memoize } from "lodash/fp";
7 import { FormDialog } from 'components/form-dialog/form-dialog';
8 import { CollectionProjectPickerField } from 'views-components/form-fields/collection-form-fields';
9 import { WithDialogProps } from 'store/dialog/with-dialog';
10 import { InjectedFormProps } from 'redux-form';
11 import { CollectionPartialCopyToSeparateCollectionsFormData } from 'store/collections/collection-partial-copy-actions';
12 import { PickerIdProp } from "store/tree-picker/picker-id";
13
14 type DialogCollectionPartialCopyProps = WithDialogProps<string> & InjectedFormProps<CollectionPartialCopyToSeparateCollectionsFormData>;
15
16 export const DialogCollectionPartialCopyToSeparateCollection = (props: DialogCollectionPartialCopyProps & PickerIdProp) =>
17     <FormDialog
18         dialogTitle='Copy to separate collections'
19         formFields={CollectionPartialCopyFields(props.pickerId)}
20         submitLabel='Create collections'
21         {...props}
22     />;
23
24 const CollectionPartialCopyFields = memoize(
25     (pickerId: string) =>
26         () =>
27             <>
28                 <CollectionProjectPickerField {...{ pickerId }} />
29             </>);