From 767d34f8b74664ed484819bebdb5f4bc93c39916 Mon Sep 17 00:00:00 2001 From: bton Date: Sat, 2 Nov 2024 01:13:21 +0100 Subject: [PATCH 01/20] state button has the state pre selected --- web/src/views/Ticket.vue | 44 ++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/web/src/views/Ticket.vue b/web/src/views/Ticket.vue index e92fb8e..cf1ce88 100644 --- a/web/src/views/Ticket.vue +++ b/web/src/views/Ticket.vue @@ -14,18 +14,25 @@ Delete
- -
- + -
@@ -64,7 +71,19 @@ export default { components: {ClipboardButton, Timeline}, data() { return { - shipping_voucher_type: null + selected_state: null, + selected_assignee: null, + shipping_voucher_type: null, + } + }, + watch: { + ticket(val) { + if (this.selected_state == null) { + this.selected_state = val.state; + } + if (this.selected_assignee == null) { + this.selected_assignee = val.assigned_to + } } }, computed: { @@ -83,7 +102,7 @@ export default { methods: { ...mapActions(['deleteItem', 'markItemReturned', 'sendMail', 'updateTicketPartial', 'postComment']), ...mapActions(['loadTickets', 'fetchTicketStates', 'loadUsers', 'scheduleAfterInit']), - ...mapActions(['claimShippingVoucher']), + ...mapActions(['claimShippingVoucher', 'fetchShippingVouchers']), handleMail(mail) { this.sendMail({ id: this.ticket.id, @@ -97,20 +116,23 @@ export default { }) }, changeTicketStatus(ticket) { + ticket.state = this.selected_state; this.updateTicketPartial({ id: ticket.id, - state: ticket.state + state: this.selected_state, }) }, - assigTicket(ticket) { + assignTicket(ticket) { + ticket.assigned_to = this.selected_assignee; this.updateTicketPartial({ id: ticket.id, - assigned_to: ticket.assigned_to + assigned_to: this.selected_assignee }) }, }, mounted() { - this.scheduleAfterInit(() => [this.fetchTicketStates(), this.loadTickets(), this.loadUsers()]); + this.scheduleAfterInit(() => [this.fetchTicketStates(), this.loadTickets(), this.loadUsers(), + this.fetchShippingVouchers()]); } }; -- 2.39.5 From 3a8fa8cdcf77a4df9f4a43cd117c155b323e6c02 Mon Sep 17 00:00:00 2001 From: jedi Date: Tue, 5 Nov 2024 23:25:44 +0100 Subject: [PATCH 02/20] show an animation to signify that the page is still loading --- web/src/components/AsyncLoader.vue | 133 +++++++++++++++++++++++++++++ web/src/views/Items.vue | 128 ++++++++++++++------------- web/src/views/Ticket.vue | 111 ++++++++++++------------ web/src/views/Tickets.vue | 95 +++++++++++---------- 4 files changed, 306 insertions(+), 161 deletions(-) create mode 100644 web/src/components/AsyncLoader.vue diff --git a/web/src/components/AsyncLoader.vue b/web/src/components/AsyncLoader.vue new file mode 100644 index 0000000..00bf841 --- /dev/null +++ b/web/src/components/AsyncLoader.vue @@ -0,0 +1,133 @@ + + + + + \ No newline at end of file diff --git a/web/src/views/Items.vue b/web/src/views/Items.vue index 9d127f0..5abcf5d 100644 --- a/web/src/views/Items.vue +++ b/web/src/views/Items.vue @@ -1,77 +1,82 @@ diff --git a/web/src/components/inputs/AsyncButton.vue b/web/src/components/inputs/AsyncButton.vue new file mode 100644 index 0000000..a3c1712 --- /dev/null +++ b/web/src/components/inputs/AsyncButton.vue @@ -0,0 +1,47 @@ + + + + + \ No newline at end of file -- 2.39.5 From 55cef1128eaa59c79122fccc3f3ce63fed42f3e4 Mon Sep 17 00:00:00 2001 From: jedi Date: Tue, 5 Nov 2024 23:36:05 +0100 Subject: [PATCH 04/20] extract the search box into its own component --- web/src/components/Navbar.vue | 17 ++++------ web/src/components/inputs/SearchBox.vue | 43 +++++++++++++++++++++++++ web/src/store.js | 13 ++++++-- 3 files changed, 59 insertions(+), 14 deletions(-) create mode 100644 web/src/components/inputs/SearchBox.vue diff --git a/web/src/components/Navbar.vue b/web/src/components/Navbar.vue index fb0736b..686f324 100644 --- a/web/src/components/Navbar.vue +++ b/web/src/components/Navbar.vue @@ -29,16 +29,7 @@ -
- -
+