From 1c92b2073a38bdc96e552bb1de2ebc1b5b1f0d72 Mon Sep 17 00:00:00 2001 From: Harm Manders Date: Fri, 26 Apr 2024 15:43:59 +0200 Subject: [PATCH 01/24] clone encounter --- src/views/UserContent/Encounters/index.vue | 73 +++++++++++++++++++++- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/src/views/UserContent/Encounters/index.vue b/src/views/UserContent/Encounters/index.vue index c4836f95..16e07ff6 100644 --- a/src/views/UserContent/Encounters/index.vue +++ b/src/views/UserContent/Encounters/index.vue @@ -142,15 +142,19 @@ Edit Delete + + + Clone + - +
@@ -206,7 +210,10 @@ View - + Unfinish @@ -307,6 +314,39 @@
+ + + +
+ + +
+ +
+ +
+
+
+
@@ -326,6 +366,12 @@ export default { finished_fetched: false, newEncounter: "", add: false, + clone: false, + cloneEncounterData: { + name: undefined, + key: undefined, + ogEncounter: undefined, + }, currentPage: 1, search: undefined, columns: [ @@ -395,6 +441,7 @@ export default { methods: { ...mapActions("encounters", [ "get_campaign_encounters", + "get_encounter", "add_encounter", "delete_encounter", "delete_finished_encounters", @@ -464,6 +511,26 @@ export default { ); } }, + async dialogCloneEncounter(key) { + this.clone = true; + this.cloneEncounterData.key = key; + this.cloneEncounterData.ogEncounter = await this.get_encounter({ + uid: this.user.uid, + campaignId: this.campaignId, + id: key, + }); + this.cloneEncounterData.name = this.cloneEncounterData.ogEncounter.name; + }, + async cloneEncounter() { + const encounter = this.cloneEncounterData.ogEncounter; + encounter.name = this.cloneEncounterData.name; + const new_id = await this.add_encounter({ + campaignId: this.campaignId, + encounter, + }); + await this.reset_encounter({ campaignId: this.campaignId, id: new_id }); + this.clone = false; + }, async deleteFinishedEncounters() { this.$snotify.error( "Are you sure you want to delete all finished encounters?", From b52ba511e24184415779c268e21d59e025c31a8a Mon Sep 17 00:00:00 2001 From: Harm Manders Date: Fri, 26 Apr 2024 15:44:12 +0200 Subject: [PATCH 02/24] fix broken player view in finish encounter --- src/components/campaign/Players.vue | 38 ++++++++++++++++++----------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/src/components/campaign/Players.vue b/src/components/campaign/Players.vue index 6423a1a5..343e6bac 100644 --- a/src/components/campaign/Players.vue +++ b/src/components/campaign/Players.vue @@ -35,7 +35,13 @@ Manage Players