import { loadDetailsPanel } from "store/details-panel/details-panel-action";
import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
import { favoritePanelActions, loadFavoritePanel } from "store/favorite-panel/favorite-panel-action";
-import {
- getProjectPanelCurrentUuid,
- openProjectPanel,
- projectPanelActions,
- setIsProjectPanelTrashed,
-} from "store/project-panel/project-panel-action";
+import { getProjectPanelCurrentUuid, setIsProjectPanelTrashed } from "store/project-panel/project-panel-action";
+import { projectPanelActions } from "store/project-panel/project-panel-action-bind";
import {
activateSidePanelTreeItem,
initSidePanelTree,
import { AdminMenuIcon } from "components/icon/icon";
import { userProfileGroupsColumns } from "views/user-profile-panel/user-profile-panel-root";
import { selectedToArray, selectedToKindSet } from "components/multiselect-toolbar/MultiselectToolbar";
+import { multiselectActions } from "store/multiselect/multiselect-actions";
export const WORKBENCH_LOADING_SCREEN = "workbenchLoadingScreen";
kind: SnackbarKind.ERROR,
})
);
- // }
}
}
if (sourceUuid) await dispatch<any>(loadSidePanelTreeProjects(sourceUuid));
.filter(resource => resource.kind === ResourceKind.COLLECTION);
for (const collection of collectionsToCopy) {
- await copySingleCollection(collection as CollectionCopyResource);
+ await copySingleCollection({ ...collection, ownerUuid: data.ownerUuid } as CollectionCopyResource);
}
async function copySingleCollection(copyToProject: CollectionCopyResource) {
- const newName = data.isSingle ? data.name : `Copy of: ${copyToProject.name}`;
+ const newName = data.isSingle || collectionsToCopy.length === 1 ? data.name : `Copy of: ${copyToProject.name}`;
try {
const collection = await dispatch<any>(
- collectionCopyActions.copyCollection({ ...copyToProject, name: newName, isSingle: data.isSingle })
+ collectionCopyActions.copyCollection({
+ ...copyToProject,
+ name: newName,
+ isSingle: collectionsToCopy.length === 1 ? true : data.isSingle,
+ })
);
if (copyToProject && collection) {
await dispatch<any>(reloadProjectMatchingUuid([copyToProject.uuid]));
link: collection.ownerUuid,
})
);
+ dispatch<any>(multiselectActions.deselectOne(copyToProject.uuid));
}
} catch (e) {
dispatch(
);
}
}
+ dispatch(projectPanelActions.REQUEST_ITEMS());
};
export const moveCollection =
const finishLoadingProject = (project: GroupContentsResource | string) => async (dispatch: Dispatch<any>) => {
const uuid = typeof project === "string" ? project : project.uuid;
- dispatch(openProjectPanel(uuid));
dispatch(loadDetailsPanel(uuid));
if (typeof project !== "string") {
dispatch(updateResources([project]));