Implemented Keep photos collection action
This commit is contained in:
parent
bb2b78d6ff
commit
b8faf0d22d
|
@ -40,6 +40,7 @@ export enum CollectionActions {
|
||||||
UNARCHIVE,
|
UNARCHIVE,
|
||||||
CONFIRM_DELETE,
|
CONFIRM_DELETE,
|
||||||
DELETE,
|
DELETE,
|
||||||
|
KEEP_PHOTOS,
|
||||||
SHOW_SHARE_DIALOG,
|
SHOW_SHARE_DIALOG,
|
||||||
CONFIRM_EMPTY_TRASH,
|
CONFIRM_EMPTY_TRASH,
|
||||||
EMPTY_TRASH,
|
EMPTY_TRASH,
|
||||||
|
@ -90,6 +91,9 @@ const CollectionOptions = (props: CollectionOptionsProps) => {
|
||||||
case CollectionActions.DELETE:
|
case CollectionActions.DELETE:
|
||||||
callback = deleteCollection;
|
callback = deleteCollection;
|
||||||
break;
|
break;
|
||||||
|
case CollectionActions.KEEP_PHOTOS:
|
||||||
|
callback = keepPhotos;
|
||||||
|
break;
|
||||||
case CollectionActions.SHOW_SHARE_DIALOG:
|
case CollectionActions.SHOW_SHARE_DIALOG:
|
||||||
callback = showCollectionShareModal;
|
callback = showCollectionShareModal;
|
||||||
break;
|
break;
|
||||||
|
@ -138,7 +142,12 @@ const CollectionOptions = (props: CollectionOptionsProps) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteCollection = async () => {
|
const deleteCollection = async () => {
|
||||||
await CollectionAPI.deleteCollection(activeCollection.id);
|
await CollectionAPI.deleteCollection(activeCollection.id, false);
|
||||||
|
redirectToAll();
|
||||||
|
};
|
||||||
|
|
||||||
|
const keepPhotos = async () => {
|
||||||
|
await CollectionAPI.deleteCollection(activeCollection.id, true);
|
||||||
redirectToAll();
|
redirectToAll();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -177,7 +186,7 @@ const CollectionOptions = (props: CollectionOptionsProps) => {
|
||||||
const confirmDeleteCollection = () => {
|
const confirmDeleteCollection = () => {
|
||||||
setDialogMessage({
|
setDialogMessage({
|
||||||
title: constants.DELETE_COLLECTION_TITLE,
|
title: constants.DELETE_COLLECTION_TITLE,
|
||||||
content: constants.DELETE_COLLECTION_MESSAGE,
|
content: constants.DELETE_COLLECTION_MESSAGE(),
|
||||||
proceed: {
|
proceed: {
|
||||||
text: constants.DELETE_COLLECTION,
|
text: constants.DELETE_COLLECTION,
|
||||||
action: handleCollectionAction(CollectionActions.DELETE),
|
action: handleCollectionAction(CollectionActions.DELETE),
|
||||||
|
|
|
@ -368,8 +368,14 @@ const englishConstants = {
|
||||||
DELETE_COLLECTION_TITLE: 'Delete album?',
|
DELETE_COLLECTION_TITLE: 'Delete album?',
|
||||||
DELETE_COLLECTION: 'Delete album',
|
DELETE_COLLECTION: 'Delete album',
|
||||||
DELETE_COLLECTION_FAILED: 'Album deletion failed, please try again',
|
DELETE_COLLECTION_FAILED: 'Album deletion failed, please try again',
|
||||||
DELETE_COLLECTION_MESSAGE:
|
DELETE_COLLECTION_MESSAGE: () => (
|
||||||
'Files that are unique to this album will be moved to trash, and this album would be deleted.',
|
<p>
|
||||||
|
Also delete the photos (and videos) present in this album from
|
||||||
|
<strong> all </strong> other albums they are part of?
|
||||||
|
</p>
|
||||||
|
),
|
||||||
|
DELETE_PHOTOS: 'Delete photos',
|
||||||
|
KEEP_PHOTOS: 'Keep photos',
|
||||||
SHARE: 'Share',
|
SHARE: 'Share',
|
||||||
SHARE_COLLECTION: 'Share album',
|
SHARE_COLLECTION: 'Share album',
|
||||||
SHARE_WITH_PEOPLE: 'Share with your loved ones',
|
SHARE_WITH_PEOPLE: 'Share with your loved ones',
|
||||||
|
|
Loading…
Reference in a new issue