Skip to content

Commit

Permalink
Merge pull request #1570 from nextcloud/enh/move-photos-to-different-…
Browse files Browse the repository at this point in the history
…face
  • Loading branch information
marcelklehr authored Jan 4, 2023
2 parents 1c748c3 + dfd7f3b commit 9a331f2
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 9 deletions.
4 changes: 2 additions & 2 deletions js/photos-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-main.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-public.js.map

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions src/views/FaceContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@
<Star slot="icon" />
{{ t('photos', 'Remove from favorites') }}
</NcActionButton>
<NcActionButton :close-after-click="true"
@click="showMoveModal = true">
<template #icon>
<AccountSwitch />
</template>
{{ n('photos', 'Move photo to a different person', 'Move photos to a different person', selectedFileIds.length) }}
</NcActionButton>
<NcActionButton :close-after-click="true"
@click="handleRemoveFilesFromFace(selectedFileIds)">
<template #icon>
Expand Down Expand Up @@ -160,6 +167,11 @@
@close="showMergeModal = false">
<FaceMergeForm :first-face="faceName" @select="handleMerge($event)" />
</NcModal>
<NcModal v-if="showMoveModal"
:title="t('photos', 'Merge person')"
@close="showMoveModal = false">
<FaceMergeForm :first-face="faceName" @select="handleMove($event, selectedFileIds)" />
</NcModal>
</div>
</template>

Expand All @@ -173,6 +185,7 @@ import Download from 'vue-material-design-icons/Download'
import Send from 'vue-material-design-icons/Send'
import Merge from 'vue-material-design-icons/Merge'
import ArrowLeft from 'vue-material-design-icons/ArrowLeft'
import AccountSwitch from 'vue-material-design-icons/AccountSwitch'
import AccountBoxMultipleOutline from 'vue-material-design-icons/AccountBoxMultipleOutline'
import { NcActions, NcActionButton, NcModal, NcEmptyContent, NcButton, NcLoadingIcon } from '@nextcloud/vue'
Expand Down Expand Up @@ -207,6 +220,7 @@ export default {
NcActionButton,
NcModal,
NcButton,
AccountSwitch,
},
directives: {
Expand All @@ -230,6 +244,7 @@ export default {
data() {
return {
showMoveModal: false,
showMergeModal: false,
showRenameModal: false,
loadingCount: 0,
Expand Down Expand Up @@ -348,6 +363,18 @@ export default {
}
},
async handleMove(faceName, fileIds) {
try {
this.loadingCount++
await this.moveFilesToFace({ oldFace: this.faceName, faceName, fileIdsToMove: fileIds })
this.showMoveModal = false
} catch (error) {
logger.error(error)
} finally {
this.loadingCount--
}
},
async favoriteSelection() {
try {
this.loadingCount++
Expand Down

0 comments on commit 9a331f2

Please sign in to comment.