adds removeFromCollectionHelper

This commit is contained in:
abhinav-grd 2021-09-28 13:44:45 +05:30
parent 29d02afba8
commit 5796a2a746
3 changed files with 13 additions and 1 deletions

View file

@ -24,6 +24,7 @@ interface Props {
setDialogMessage: SetDialogMessage;
setCollectionSelectorAttributes: SetCollectionSelectorAttributes;
deleteFileHelper: () => void;
removeFromCollectionHelper: () => void;
count: number;
clearSelection: () => void;
archiveFilesHelper: () => void;
@ -58,6 +59,7 @@ const SelectedFileOptions = ({
addToCollectionHelper,
moveToCollectionHelper,
showCreateCollectionModal,
removeFromCollectionHelper,
setDialogMessage,
setCollectionSelectorAttributes,
deleteFileHelper,
@ -94,7 +96,7 @@ const SelectedFileOptions = ({
content: constants.CONFIRM_REMOVE_MESSAGE,
staticBackdrop: true,
proceed: {
action: deleteFileHelper,
action: removeFromCollectionHelper,
text: constants.REMOVE,
variant: 'danger',
},

View file

@ -73,6 +73,7 @@ import {
COLLECTION_OPS_TYPE,
isSharedCollection,
handleCollectionOps,
getSelectedCollection,
} from 'utils/collection';
import { logError } from 'utils/sentry';
@ -595,6 +596,14 @@ export default function Gallery() {
setCollectionSelectorAttributes
}
deleteFileHelper={deleteFileHelper}
removeFromCollectionHelper={() =>
collectionOpsHelper(COLLECTION_OPS_TYPE.REMOVE)(
getSelectedCollection(
activeCollection,
collections
)
)
}
count={selected.count}
clearSelection={clearSelection}
activeCollection={activeCollection}

View file

@ -39,6 +39,7 @@ export async function handleCollectionOps(
);
break;
case COLLECTION_OPS_TYPE.REMOVE:
// todo add remove logic
break;
default:
throw Error(CustomError.INVALID_COLLECTION_OPERATION);