-
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.
- Dashboard edit table name and emoji make edit view and delete view usable remove hover-effects - add delete table modal - add delete view modal (was inline before) - cleanup modals structure - rename some "dashboard" to "Table" names - add routes and methods to update tables (title && emoji) - no routing after update view settings by default - fix typos Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com>
- Loading branch information
Florian Steffens
committed
Aug 4, 2023
1 parent
548624d
commit 28556f7
Showing
14 changed files
with
239 additions
and
63 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
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,58 @@ | ||
<template> | ||
<div> | ||
<DialogConfirmation :description="getTranslatedDescription" | ||
:title="t('tables', 'Confirm view deletion')" | ||
:cancel-title="t('tables', 'Cancel')" | ||
:confirm-title="t('tables', 'Delete')" | ||
confirm-class="error" | ||
:show-modal="showModal" | ||
@confirm="deleteMe" | ||
@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 { mapGetters } from 'vuex' | ||
export default { | ||
components: { | ||
DialogConfirmation, | ||
}, | ||
props: { | ||
view: { | ||
type: Object, | ||
default: null, | ||
}, | ||
showModal: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
}, | ||
computed: { | ||
...mapGetters(['activeView', 'isView']), | ||
getTranslatedDescription() { | ||
return t('tables', 'Do you really want to delete the view "{view}"?', { view: this.view?.title }) | ||
}, | ||
}, | ||
methods: { | ||
async deleteMe() { | ||
const viewId = this.view.id | ||
const activeViewId = this.activeView?.id | ||
const res = await this.$store.dispatch('removeView', { viewId: this.view.id }) | ||
if (res) { | ||
showSuccess(t('tables', 'View "{emoji}{view}" removed.', { emoji: this.view.emoji ? this.view.emoji + ' ' : '', view: this.view.title })) | ||
// if the actual view was deleted, go to startpage | ||
if (viewId === activeViewId) { | ||
await this.$router.push('/').catch(err => err) | ||
} | ||
this.$emit('cancel') | ||
} | ||
}, | ||
}, | ||
} | ||
</script> |
Oops, something went wrong.