-
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
dcd2de4
commit 146cb67
Showing
14 changed files
with
1,331 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<script setup> | ||
import { abilityStore, navigationStore } from '../../store/store.js' | ||
</script> | ||
|
||
<template> | ||
<NcDialog v-if="navigationStore.dialog === 'deleteAbility'" | ||
name="Vaardigheid verwijderen" | ||
size="normal" | ||
:can-close="false"> | ||
|
||
<p v-if="!success"> | ||
Wil je <b>{{ abilityStore.abilityItem.name }}</b> definitief verwijderen? Deze actie kan niet ongedaan worden gemaakt. | ||
</p> | ||
|
||
<NcNoteCard v-if="success" type="success"> | ||
<p>Vaardigheid succesvol verwijderd</p> | ||
</NcNoteCard> | ||
<NcNoteCard v-if="error" type="error"> | ||
<p>{{ error }}</p> | ||
</NcNoteCard> | ||
|
||
<template #actions> | ||
<NcButton | ||
@click="navigationStore.setDialog(false)"> | ||
<template #icon> | ||
<Cancel :size="20" /> | ||
</template> | ||
{{ success ? 'Sluiten' : 'Annuleer' }} | ||
</NcButton> | ||
<NcButton | ||
v-if="!success" | ||
:disabled="loading" | ||
type="error" | ||
@click="deleteAbility()"> | ||
<template #icon> | ||
<NcLoadingIcon v-if="loading" :size="20" /> | ||
<TrashCanOutline v-if="!loading" :size="20" /> | ||
</template> | ||
Verwijderen | ||
</NcButton> | ||
</template> | ||
</NcDialog> | ||
|
||
</template> | ||
|
||
<script> | ||
import { | ||
NcButton, | ||
NcDialog, | ||
NcTextField, | ||
NcTextArea, | ||
NcSelect, | ||
NcLoadingIcon, | ||
NcNoteCard, | ||
} from '@nextcloud/vue' | ||
import Cancel from 'vue-material-design-icons/Cancel.vue' | ||
import TrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue' | ||
export default { | ||
name: 'DeleteAbility', | ||
components: { | ||
NcDialog, | ||
NcTextField, | ||
NcTextArea, | ||
NcButton, | ||
NcSelect, | ||
NcLoadingIcon, | ||
NcNoteCard, | ||
// Icons | ||
TrashCanOutline, | ||
Cancel, | ||
}, | ||
data() { | ||
return { | ||
success: false, | ||
loading: false, | ||
error: false, | ||
} | ||
}, | ||
methods: { | ||
async deleteAbility() { | ||
this.loading = true | ||
try { | ||
await abilityStore.deleteAbility() | ||
// Close modal or show success message | ||
this.success = true | ||
this.loading = false | ||
this.error = false | ||
setTimeout(() => { | ||
this.success = false | ||
navigationStore.setDialog(false) | ||
}, 2000) | ||
} catch (error) { | ||
this.loading = false | ||
this.success = false | ||
this.error = error.message || 'Er is een fout opgetreden bij het verwijderen van de vaardigheid' | ||
} | ||
} | ||
}, | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<script setup> | ||
import { characterStore, conditionStore, navigationStore } from '../../store/store.js' | ||
import { onMounted } from 'vue' | ||
</script> | ||
|
||
<template> | ||
<NcDialog v-if="navigationStore.modal === 'addConditionToCharacter'" | ||
name="Conditie toevoegen aan karakter" | ||
size="normal" | ||
:can-close="false"> | ||
|
||
<NcNoteCard v-if="success" type="success"> | ||
<p>Conditie succesvol toegevoegd aan karakter</p> | ||
</NcNoteCard> | ||
<NcNoteCard v-if="error" type="error"> | ||
<p>{{ error }}</p> | ||
</NcNoteCard> | ||
|
||
<div v-if="!success" class="formContainer"> | ||
<p>Let op: Het toevoegen van een conditie aan een karakter kan invloed hebben op de eigenschappen en vaardigheden van het karakter. Dit is een asynchroon proces, dus het kan even duren voordat de wijzigingen zichtbaar worden.</p> | ||
|
||
<NcSelect | ||
:disabled="loading" | ||
label="Conditie *" | ||
inputLabel="Conditie *" | ||
:options="conditionStore.conditions" | ||
:value.sync="selectedCondition" | ||
option-label="name" | ||
option-value="id" | ||
required | ||
/> | ||
</div> | ||
|
||
<template #actions> | ||
<NcButton @click="navigationStore.setModal(false)"> | ||
<template #icon><Cancel :size="20" /></template> | ||
{{ success ? 'Sluiten' : 'Annuleer' }} | ||
</NcButton> | ||
<NcButton @click="openLink('https://conduction.gitbook.io/opencatalogi-nextcloud/gebruikers/publicaties', '_blank')"> | ||
<template #icon><Help :size="20" /></template> | ||
Help | ||
</NcButton> | ||
<NcButton v-if="!success" :disabled="loading" type="primary" @click="addConditionToCharacter()"> | ||
<template #icon> | ||
<NcLoadingIcon v-if="loading" :size="20" /> | ||
<Plus v-if="!loading" :size="20" /> | ||
</template> | ||
Toevoegen | ||
</NcButton> | ||
</template> | ||
</NcDialog> | ||
</template> | ||
|
||
<script> | ||
import { | ||
NcButton, | ||
NcDialog, | ||
NcSelect, | ||
NcLoadingIcon, | ||
NcNoteCard, | ||
} from '@nextcloud/vue' | ||
import Cancel from 'vue-material-design-icons/Cancel.vue' | ||
import Plus from 'vue-material-design-icons/Plus.vue' | ||
import Help from 'vue-material-design-icons/Help.vue' | ||
export default { | ||
name: 'AddConditionToCharacter', | ||
components: { | ||
NcDialog, | ||
NcButton, | ||
NcSelect, | ||
NcLoadingIcon, | ||
NcNoteCard, | ||
// Icons | ||
Cancel, | ||
Plus, | ||
Help, | ||
}, | ||
data() { | ||
return { | ||
success: false, | ||
loading: false, | ||
error: false, | ||
selectedCondition: null, | ||
} | ||
}, | ||
mounted(){ | ||
conditionStore.refreshConditionList() | ||
}, | ||
methods: { | ||
async addConditionToCharacter() { | ||
this.loading = true | ||
try { | ||
if (!characterStore.characterItem.conditions) { | ||
characterStore.characterItem.conditions = [] | ||
} | ||
characterStore.characterItem.conditions.push(this.selectedCondition) | ||
await characterStore.saveCharacter() | ||
this.success = true | ||
this.loading = false | ||
this.error = false | ||
setTimeout(() => { | ||
this.success = false | ||
navigationStore.setModal(false) | ||
}, 2000) | ||
} catch (error) { | ||
this.loading = false | ||
this.success = false | ||
this.error = error.message || 'Er is een fout opgetreden bij het toevoegen van de conditie aan het karakter' | ||
} | ||
} | ||
}, | ||
} | ||
</script> |
Oops, something went wrong.