diff options
author | Anna <anna@nextcloud.com> | 2024-04-03 12:16:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 12:16:20 +0200 |
commit | 7e0b7b4300c2677dd292f099888185f5c187880b (patch) | |
tree | da3af0732a954bfa121d84524d52a63b5385b73c /src/components/AppNavigation/Settings/SettingsAddressbook.vue | |
parent | bf205cc357349867208bf55af38668df5d060ce0 (diff) | |
parent | 5d730e100c67eb40d44fb88f2be231838d782640 (diff) |
Merge pull request #3837 from nextcloud/enh/rename-delete-to-unshare-for-shared-addressbooks
enh(sharing): Rename `delete` to `unshare from me` for shared address books
Diffstat (limited to 'src/components/AppNavigation/Settings/SettingsAddressbook.vue')
-rw-r--r-- | src/components/AppNavigation/Settings/SettingsAddressbook.vue | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/components/AppNavigation/Settings/SettingsAddressbook.vue b/src/components/AppNavigation/Settings/SettingsAddressbook.vue index c972b202..1f81fd33 100644 --- a/src/components/AppNavigation/Settings/SettingsAddressbook.vue +++ b/src/components/AppNavigation/Settings/SettingsAddressbook.vue @@ -105,9 +105,16 @@ </template> </ActionInput> </template> - <!-- delete addressbook --> - <ActionButton v-if="hasMultipleAddressbooks" + <ActionButton v-if="hasMultipleAddressbooks && addressbook.owner !== principalUrl && addressbook.owner !== '/remote.php/dav/principals/system/system/'" + @click="confirmUnshare"> + <template #icon> + <IconLoading v-if="deleteAddressbookLoading" :size="20" /> + <IconDelete :size="20" /> + </template> + {{ t('contacts', 'Unshare from me') }} + </ActionButton> + <ActionButton v-else-if="hasMultipleAddressbooks && addressbook.owner !== '/remote.php/dav/principals/system/system/'" @click="confirmDeletion"> <template #icon> <IconLoading v-if="deleteAddressbookLoading" :size="20" /> @@ -116,7 +123,6 @@ {{ t('contacts', 'Delete') }} </ActionButton> </Actions> - <!-- sharing input --> <ShareAddressBook v-if="shareOpen && !addressbook.readOnly" :addressbook="addressbook" /> </li> @@ -143,6 +149,8 @@ import { showError } from '@nextcloud/dialogs' import CopyToClipboardMixin from '../../../mixins/CopyToClipboardMixin.js' +import usePrincipalsStore from '../../../store/principals.js' + export default { name: 'SettingsAddressbook', @@ -241,6 +249,10 @@ export default { groupsCount() { return this.groups.length }, + principalUrl() { + const principalsStore = usePrincipalsStore() + return principalsStore.currentUserPrincipal.principalUrl + }, }, watch: { menuOpen() { @@ -277,7 +289,6 @@ export default { this.toggleEnabledLoading = false } }, - confirmDeletion() { OC.dialogs.confirm( t('contacts', 'This will delete the address book and every contacts within it'), @@ -286,7 +297,14 @@ export default { true, ) }, - + confirmUnshare() { + OC.dialogs.confirm( + t('contacts', 'This will unshare the address book and every contacts within it'), + t('contacts', 'Unshare {addressbook}?', { addressbook: this.addressbook.displayName }), + this.deleteAddressbook, + true, + ) + }, async deleteAddressbook(confirm) { if (confirm) { // change to loading status |