From bd00f034110c96281b137cf073bd48cec731d5e4 Mon Sep 17 00:00:00 2001 From: jedi Date: Tue, 5 Nov 2024 23:32:53 +0100 Subject: [PATCH 01/37] use an 'AsyncButton' that waits for completion of an async onClick handler for mail replies and comments in tickets --- web/src/components/Timeline.vue | 11 +++--- web/src/components/inputs/AsyncButton.vue | 47 +++++++++++++++++++++++ 2 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 web/src/components/inputs/AsyncButton.vue diff --git a/web/src/components/Timeline.vue b/web/src/components/Timeline.vue index 97c8463..2cf8b97 100644 --- a/web/src/components/Timeline.vue +++ b/web/src/components/Timeline.vue @@ -40,10 +40,10 @@
- +
@@ -58,10 +58,10 @@
- +
@@ -77,11 +77,12 @@ import {mapActions, mapGetters} from "vuex"; import TimelineAssignment from "@/components/TimelineAssignment.vue"; import TimelineRelatedItem from "@/components/TimelineRelatedItem.vue"; import TimelineShippingVoucher from "@/components/TimelineShippingVoucher.vue"; +import AsyncButton from "@/components/inputs/AsyncButton.vue"; export default { name: 'Timeline', components: { - TimelineShippingVoucher, + TimelineShippingVoucher, AsyncButton, TimelineRelatedItem, TimelineAssignment, TimelineStateChange, TimelineComment, TimelineMail }, props: { 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 From f94e2d8191152c6b11efd0592c5bef64305e9840 Mon Sep 17 00:00:00 2001 From: jedi Date: Tue, 5 Nov 2024 23:36:05 +0100 Subject: [PATCH 02/37] 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 @@ -
- -
+
@@ -115,6 +116,9 @@ export default { computed: { ...mapState(['events']), ...mapGetters(['getEventSlug', 'getActiveView', "checkPermission", "hasPermissions", "layout", "route"]), + selectableEvents() { + return [{slug: 'all'}, ...this.events, {slug: 'none'}]; + } }, methods: { ...mapActions(['changeEvent', 'changeView']), diff --git a/web/src/store.js b/web/src/store.js index 53d01b6..3140a99 100644 --- a/web/src/store.js +++ b/web/src/store.js @@ -21,7 +21,7 @@ const store = createStore({ state_options: [], shippingVouchers: [], - lastEvent: '37C3', + lastEvent: 'all', lastUsed: {}, searchQuery: '', remember: false, @@ -358,7 +358,8 @@ const store = createStore({ async searchEventItems({commit, getters, state}, query) { const encoded_query = base64.encode(utf8.encode(query)); - const {data, success} = await http.get(`/2/${getters.getEventSlug}/items/${encoded_query}/`, state.user.token); + const {data, success} = await http.get(`/2/${getters.getEventSlug}/items/${encoded_query}/`, + state.user.token); if (data && success) commit('replaceLoadedItems', data); }, @@ -410,7 +411,8 @@ const store = createStore({ async searchEventTickets({commit, getters, state}, query) { const encoded_query = base64.encode(utf8.encode(query)); - const {data, success} = await http.get(`/2/${getters.getEventSlug}/tickets/${encoded_query}/`, state.user.token); + const {data, success} = await http.get(`/2/${getters.getEventSlug}/tickets/${encoded_query}/`, + state.user.token); if (data && success) commit('replaceTickets', data); }, From 450562f534e7af226fb10a12b43afd009ecd0487 Mon Sep 17 00:00:00 2001 From: jedi Date: Sun, 17 Nov 2024 00:16:54 +0100 Subject: [PATCH 22/37] show tickets filtered by active event --- core/core/settings.py | 2 + core/tickets/serializers.py | 2 - web/src/components/Navbar.vue | 17 +- web/src/store.js | 288 ++++++++++++++++------------------ web/src/utils.js | 10 +- web/src/views/Items.vue | 10 +- web/src/views/Ticket.vue | 25 +-- web/src/views/Tickets.vue | 19 ++- 8 files changed, 175 insertions(+), 198 deletions(-) diff --git a/core/core/settings.py b/core/core/settings.py index 2d4a818..6796112 100644 --- a/core/core/settings.py +++ b/core/core/settings.py @@ -15,9 +15,11 @@ import sys import dotenv from pathlib import Path + def truthy_str(s): return s.lower() in ['true', '1', 't', 'y', 'yes', 'yeah', 'yup', 'certainly', 'sure', 'positive', 'uh-huh', 'πŸ‘'] + # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent diff --git a/core/tickets/serializers.py b/core/tickets/serializers.py index f5b7ef6..9f14e7e 100644 --- a/core/tickets/serializers.py +++ b/core/tickets/serializers.py @@ -55,8 +55,6 @@ class IssueSerializer(serializers.ModelSerializer): ret = super().to_internal_value(data) if 'state' in data: ret['state'] = data['state'] -# if 'assigned_to' in data: -# ret['assigned_to'] = data['assigned_to'] return ret def validate(self, attrs): diff --git a/web/src/components/Navbar.vue b/web/src/components/Navbar.vue index eb7504b..ccfb0f0 100644 --- a/web/src/components/Navbar.vue +++ b/web/src/components/Navbar.vue @@ -49,12 +49,12 @@
@@ -65,19 +65,6 @@