From 24bd2bdd0a311960fcc20445ebb6e7b26bbe5bf6 Mon Sep 17 00:00:00 2001 From: bton Date: Sat, 2 Nov 2024 01:13:21 +0100 Subject: [PATCH] state button has the state pre selected --- web/src/views/Ticket.vue | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/web/src/views/Ticket.vue b/web/src/views/Ticket.vue index 560811f..2872185 100644 --- a/web/src/views/Ticket.vue +++ b/web/src/views/Ticket.vue @@ -15,23 +15,25 @@ Delete
-
- -
@@ -71,11 +73,20 @@ export default { name: 'Ticket', components: {AsyncLoader, ClipboardButton, Timeline}, data() { - return { - shipping_voucher_type: null + return { + selected_state: null, + Selected_assignee: null, + shipping_voucher_type: null, } }, - computed: { + watch: { + ticket(val) { + if (this.selected_state == null){ + this.selected_state = val.state; + } + } + }, + computed: { ...mapState(['tickets', 'state_options', 'users']), ...mapGetters(['availableShippingVoucherTypes']), ticket() { @@ -87,7 +98,7 @@ export default { const domain = document.location.hostname; return `ticket+${this.ticket.uuid}@${domain}`; } - }, + }, methods: { ...mapActions(['deleteItem', 'markItemReturned', 'sendMail', 'updateTicketPartial', 'postComment']), ...mapActions(['loadTickets', 'fetchTicketStates', 'loadUsers', 'scheduleAfterInit']), @@ -105,15 +116,17 @@ export default { }) }, changeTicketStatus(ticket) { - this.updateTicketPartial({ + ticket.state = this.selected_state; + this.updateTicketPartial({ id: ticket.id, - state: ticket.state + state: this.selected_state, }) }, assignTicket(ticket) { - this.updateTicketPartial({ + ticket.assigned_to = this.selected_assignee; + this.updateTicketPartial({ id: ticket.id, - assigned_to: ticket.assigned_to + assigned_to: this.selected_assignee }) }, },