forked from OpenCatalogi/opencatalogi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11d4e46
commit 54e63a6
Showing
4 changed files
with
189 additions
and
11 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
115 changes: 115 additions & 0 deletions
115
src/dialogs/publicationTheme/DeletePublicationThemeDialog.vue
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,115 @@ | ||
<script setup> | ||
import { navigationStore, publicationStore, themeStore } from '../../store/store.js' | ||
</script> | ||
|
||
<template> | ||
<NcDialog name="Publicatie thema verwijderen" | ||
:can-close="false"> | ||
<div v-if="success !== null || error"> | ||
<NcNoteCard v-if="success" type="success"> | ||
<p>Publicatie thema succesvol verwijderd</p> | ||
</NcNoteCard> | ||
<NcNoteCard v-if="!success" type="error"> | ||
<p>Er is iets fout gegaan bij het verwijderen van Publicatie thema</p> | ||
</NcNoteCard> | ||
<NcNoteCard v-if="error" type="error"> | ||
<p>{{ error }}</p> | ||
</NcNoteCard> | ||
</div> | ||
<p v-if="success === null"> | ||
Wil je <b>{{ themeStore.themeItem.title }}</b> definitief verwijderen? Deze actie kan niet ongedaan worden gemaakt. | ||
</p> | ||
<template #actions> | ||
<NcButton :disabled="loading" icon="" @click="navigationStore.setDialog(false)"> | ||
<template #icon> | ||
<Cancel :size="20" /> | ||
</template> | ||
{{ success !== null ? 'Sluiten' : 'Annuleer' }} | ||
</NcButton> | ||
<NcButton | ||
v-if="success === null" | ||
:disabled="loading" | ||
icon="Delete" | ||
type="error" | ||
@click="DeleteTheme()"> | ||
<template #icon> | ||
<NcLoadingIcon v-if="loading" :size="20" /> | ||
<Delete v-if="!loading" :size="20" /> | ||
</template> | ||
Verwijderen | ||
</NcButton> | ||
</template> | ||
</NcDialog> | ||
</template> | ||
|
||
<script> | ||
import { NcButton, NcDialog, NcNoteCard, NcLoadingIcon } from '@nextcloud/vue' | ||
import Cancel from 'vue-material-design-icons/Cancel.vue' | ||
import Delete from 'vue-material-design-icons/Delete.vue' | ||
import { Publication } from '../../entities/index.js' | ||
export default { | ||
name: 'DeletePublicationThemeDialog', | ||
components: { | ||
NcDialog, | ||
NcButton, | ||
NcNoteCard, | ||
NcLoadingIcon, | ||
// Icons | ||
Cancel, | ||
Delete, | ||
}, | ||
data() { | ||
return { | ||
loading: false, | ||
success: null, | ||
error: false, | ||
} | ||
}, | ||
methods: { | ||
DeleteTheme() { | ||
this.loading = true | ||
const publicationClone = { ...publicationStore.publicationItem } | ||
publicationClone.themes = publicationClone.themes.filter(themeId => themeId !== themeStore.themeItem.id) | ||
const publicationItem = new Publication({ | ||
...publicationClone, | ||
}) | ||
publicationStore.editPublication(publicationItem) | ||
.then(({ response }) => { | ||
this.loading = false | ||
this.success = response.ok | ||
// Wait for the user to read the feedback then close the model | ||
setTimeout(() => { | ||
navigationStore.setDialog(false) | ||
}, 2000) | ||
}) | ||
.catch((err) => { | ||
this.error = err | ||
this.loading = false | ||
}) | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style> | ||
.modal__content { | ||
margin: var(--OC-margin-50); | ||
text-align: center; | ||
} | ||
.zaakDetailsContainer { | ||
margin-block-start: var(--OC-margin-20); | ||
margin-inline-start: var(--OC-margin-20); | ||
margin-inline-end: var(--OC-margin-20); | ||
} | ||
.success { | ||
color: green; | ||
} | ||
</style> |
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