adds removeFromCollectionHelper
This commit is contained in:
parent
29d02afba8
commit
5796a2a746
|
@ -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',
|
||||
},
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue