-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1071 from nextcloud/backport/1026/stable0.7
[stable0.7] enh: Delete Application and its shares
- Loading branch information
Showing
12 changed files
with
231 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<template> | ||
<div> | ||
<DialogConfirmation :description="getTranslatedDescription" | ||
:title="t('tables', 'Confirm application deletion')" | ||
:cancel-title="t('tables', 'Cancel')" | ||
:confirm-title="t('tables', 'Delete')" | ||
confirm-class="error" | ||
:show-modal="showModal" | ||
@confirm="deleteContext" | ||
@cancel="$emit('cancel')" /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import DialogConfirmation from '../../shared/modals/DialogConfirmation.vue' | ||
import { showSuccess } from '@nextcloud/dialogs' | ||
import '@nextcloud/dialogs/dist/index.css' | ||
import { mapState } from 'vuex' | ||
export default { | ||
components: { | ||
DialogConfirmation, | ||
}, | ||
props: { | ||
context: { | ||
type: Object, | ||
default: null, | ||
}, | ||
showModal: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
}, | ||
computed: { | ||
...mapState(['activeContextId']), | ||
getTranslatedDescription() { | ||
return t('tables', 'Do you really want to delete the application "{context}"? This will also delete the shares and unshare the resources that are connected to this application.', { context: this.context?.name }) | ||
}, | ||
}, | ||
methods: { | ||
async deleteContext() { | ||
const res = await this.$store.dispatch('removeContext', { context: this.context, receivers: this.context.sharing }) | ||
if (res) { | ||
showSuccess(t('tables', 'Application "{context}" removed.', { context: this.context.name })) | ||
// if the active context was deleted, go to startpage | ||
if (this.context.id === this.activeContextId) { | ||
await this.$router.push('/').catch(err => err) | ||
} | ||
this.$emit('cancel') | ||
} | ||
}, | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.