(data: MoveToFormDialogData, isSecondaryMove = false) =>
async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
const checkedList = getState().multiselect.checkedList;
- const uuidsToMove: string[] = data.isSingle ? [data.uuid] : selectedToArray(checkedList);
+ const uuidsToMove: string[] = data.fromContextMenu ? [data.uuid] : selectedToArray(checkedList);
//if no items in checkedlist default to normal context menu behavior
if (!isSecondaryMove && !uuidsToMove.length) uuidsToMove.push(data.uuid);
export const copyCollection = (data: CopyFormDialogData) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
const checkedList = getState().multiselect.checkedList;
- const uuidsToCopy: string[] = data.isSingle ? [data.uuid] : selectedToArray(checkedList);
+ const uuidsToCopy: string[] = data.fromContextMenu ? [data.uuid] : selectedToArray(checkedList);
//if no items in checkedlist && no items passed in, default to normal context menu behavior
if (!uuidsToCopy.length) uuidsToCopy.push(data.uuid);
}
async function copySingleCollection(copyToProject: CollectionCopyResource) {
- const newName = data.isSingle || collectionsToCopy.length === 1 ? data.name : `Copy of: ${copyToProject.name}`;
+ const newName = data.fromContextMenu || collectionsToCopy.length === 1 ? data.name : `Copy of: ${copyToProject.name}`;
try {
const collection = await dispatch<any>(
collectionCopyActions.copyCollection({
...copyToProject,
name: newName,
- isSingle: collectionsToCopy.length === 1 ? true : data.isSingle,
+ fromContextMenu: collectionsToCopy.length === 1 ? true : data.fromContextMenu,
})
);
if (copyToProject && collection) {
(data: MoveToFormDialogData, isSecondaryMove = false) =>
async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
const checkedList = getState().multiselect.checkedList;
- const uuidsToMove: string[] = data.isSingle ? [data.uuid] : selectedToArray(checkedList);
+ const uuidsToMove: string[] = data.fromContextMenu ? [data.uuid] : selectedToArray(checkedList);
//if no items in checkedlist && no items passed in, default to normal context menu behavior
if (!isSecondaryMove && !uuidsToMove.length) uuidsToMove.push(data.uuid);
(data: MoveToFormDialogData, isSecondaryMove = false) =>
async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
const checkedList = getState().multiselect.checkedList;
- const uuidsToMove: string[] = data.isSingle ? [data.uuid] : selectedToArray(checkedList);
+ const uuidsToMove: string[] = data.fromContextMenu ? [data.uuid] : selectedToArray(checkedList);
//if no items in checkedlist && no items passed in, default to normal context menu behavior
if (!isSecondaryMove && !uuidsToMove.length) uuidsToMove.push(data.uuid);
type GroupContentsHandler = UnionOf<typeof groupContentsHandlers>;
-type CollectionCopyResource = Resource & { name: string; isSingle: boolean };
+type CollectionCopyResource = Resource & { name: string; fromContextMenu: boolean };
type MoveableResource = Resource & { name: string };