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.
Merge pull request #183 from ConductionNL/development
Development to main
- Loading branch information
Showing
20 changed files
with
1,217 additions
and
215 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,119 @@ | ||
<script setup> | ||
import { navigationStore, menuStore } from '../../store/store.js' | ||
</script> | ||
|
||
<template> | ||
<NcDialog name="Menu kopieren" | ||
:can-close="false"> | ||
<div v-if="success !== null || error"> | ||
<NcNoteCard v-if="success" type="success"> | ||
<p>Menu succesvol gekopieerd</p> | ||
</NcNoteCard> | ||
<NcNoteCard v-if="!success" type="error"> | ||
<p>Er is iets fout gegaan bij het kopiëren van Menu</p> | ||
</NcNoteCard> | ||
<NcNoteCard v-if="error" type="error"> | ||
<p>{{ error }}</p> | ||
</NcNoteCard> | ||
</div> | ||
|
||
<p v-if="success === null"> | ||
Wil je <b>{{ menuStore.menuItem?.name }}</b> kopiëren? | ||
</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" | ||
type="primary" | ||
@click="copyMenu()"> | ||
<template #icon> | ||
<NcLoadingIcon v-if="loading" :size="20" /> | ||
<ContentCopy v-if="!loading" :size="20" /> | ||
</template> | ||
Kopiëren | ||
</NcButton> | ||
</template> | ||
</NcDialog> | ||
</template> | ||
|
||
<script> | ||
import { NcButton, NcDialog, NcLoadingIcon, NcNoteCard } from '@nextcloud/vue' | ||
import _ from 'lodash' | ||
import Cancel from 'vue-material-design-icons/Cancel.vue' | ||
import ContentCopy from 'vue-material-design-icons/ContentCopy.vue' | ||
import { Menu } from '../../entities/index.js' | ||
export default { | ||
name: 'CopyMenuDialog', | ||
components: { | ||
NcDialog, | ||
NcButton, | ||
NcNoteCard, | ||
NcLoadingIcon, | ||
// Icons | ||
Cancel, | ||
ContentCopy, | ||
}, | ||
data() { | ||
return { | ||
loading: false, | ||
success: null, | ||
error: false, | ||
} | ||
}, | ||
methods: { | ||
copyMenu() { | ||
this.loading = true | ||
const menuClone = _.cloneDeep(menuStore.menuItem) | ||
menuClone.name = 'KOPIE: ' + menuClone.name | ||
delete menuClone.id | ||
delete menuClone.uuid | ||
const menuItem = new Menu(menuClone) | ||
menuStore.saveMenu(menuItem) | ||
.then(({ response }) => { | ||
this.loading = false | ||
this.success = response.ok | ||
navigationStore.setSelected('menus') | ||
// 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
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,2 @@ | ||
import Vue from 'vue' | ||
export const EventBus = new 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
Oops, something went wrong.