1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from "react";
6 import { memoize } from "lodash/fp";
7 import { FormDialog } from '~/components/form-dialog/form-dialog';
8 import { WithDialogProps } from '~/store/dialog/with-dialog';
9 import { InjectedFormProps } from 'redux-form';
10 import { CollectionPartialCopyToSelectedCollectionFormData } from '~/store/collections/collection-partial-copy-actions';
11 import { PickerIdProp } from "~/store/tree-picker/picker-id";
12 import { CollectionPickerField } from '~/views-components/form-fields/collection-form-fields';
14 type DialogCollectionPartialCopyProps = WithDialogProps<string> & InjectedFormProps<CollectionPartialCopyToSelectedCollectionFormData>;
16 export const DialogCollectionPartialCopyToSelectedCollection = (props: DialogCollectionPartialCopyProps & PickerIdProp) =>
18 dialogTitle='Choose collection'
19 formFields={CollectionPartialCopyFields(props.pickerId)}
20 submitLabel='Copy files'
24 export const CollectionPartialCopyFields = memoize(
28 <CollectionPickerField {...{ pickerId }}/>