From ee4f4cf4b2068e72aa9f1d3eade2fe80661c1a9c Mon Sep 17 00:00:00 2001 From: Glen Germaine Date: Mon, 20 Jun 2022 11:28:53 +1200 Subject: [PATCH 1/6] Added "Clear all Entries" function --- public/src/components/server_config/entrylist.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public/src/components/server_config/entrylist.vue b/public/src/components/server_config/entrylist.vue index 89473859..9c733594 100644 --- a/public/src/components/server_config/entrylist.vue +++ b/public/src/components/server_config/entrylist.vue @@ -6,6 +6,7 @@ v-on:remove="removeEntry"> + @@ -44,7 +45,6 @@ export default { }); this.entryIndex++; } - this.forceEntryList = data.forceEntryList; }, getData() { @@ -98,7 +98,13 @@ export default { break; } } + }, + clearEntries(){ + while(this.entries.length > 0) { + this.entries.splice(this.entries[this.entries.length - 1], 1); + } } + } } @@ -108,7 +114,8 @@ export default { "en": { "title": "Entry List", "forceentrylist_label": "Force Entry List", - "add_entry_button": "Add Entry" + "add_entry_button": "Add Entry", + "clear_entries_button": "Clear all Entries" } } From ef9f6f7d12b587940d71fb5fcadc621725b3be7b Mon Sep 17 00:00:00 2001 From: Glen Germaine Date: Mon, 20 Jun 2022 11:31:42 +1200 Subject: [PATCH 2/6] Added "Clear all Sessions" function --- public/src/components/server_config/event.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/src/components/server_config/event.vue b/public/src/components/server_config/event.vue index 1a12de36..475c4fd1 100644 --- a/public/src/components/server_config/event.vue +++ b/public/src/components/server_config/event.vue @@ -28,6 +28,7 @@ + @@ -173,6 +174,11 @@ export default { } } }, + clearSessions() { + while(this.sessions.length > 0) { + this.sessions.splice(this.sessions[this.sessions.length - 1], 1); + } + }, toFloat(value) { if(typeof value === "string") { return parseFloat(value.replace(",", ".")); @@ -202,7 +208,8 @@ export default { "isFixedConditionQualification_label": "Is Fixed Weather Conditions in Qualification", "add_session_button": "Add session", "add_sessions_q_r_button": "Add sessions (Q/R)", - "add_sessions_p_q_r_button": "Add sessions (P/Q/R)" + "add_sessions_p_q_r_button": "Add sessions (P/Q/R)", + "clear_sessions_button": "Clear all Sessions" } } From a7d79a80f92cde08db20e41c2cde3e29a574ed34 Mon Sep 17 00:00:00 2001 From: Glen Germaine Date: Fri, 1 Jul 2022 15:32:43 +1200 Subject: [PATCH 3/6] Added "Clear all BOP" functionality --- public/src/components/server_config/bop.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/src/components/server_config/bop.vue b/public/src/components/server_config/bop.vue index cdf5778e..fa5688df 100644 --- a/public/src/components/server_config/bop.vue +++ b/public/src/components/server_config/bop.vue @@ -5,6 +5,7 @@ :entry="entry" v-on:remove="removeEntry"> + @@ -91,6 +92,11 @@ export default { } return value; + }, + clearEntries(){ + while(this.entries.length > 0) { + this.entries.splice(this.entries[this.entries.length - 1], 1); + } } } } @@ -104,7 +110,8 @@ export default { "carModel_label": "Car Model #", "ballast_label": "Ballast: 0 to 100kg max.", "restrictor_label": "Motor Restrictor: 0 to 20% max.", - "add_entry_button": "Add BOP" + "add_entry_button": "Add BOP", + "clear_entries_button": "Clear all BOP" } } From f28a7aea1f3c750062b5eb992a53bc4da0926d69 Mon Sep 17 00:00:00 2001 From: Glen Germaine Date: Sat, 2 Jul 2022 12:17:33 +1200 Subject: [PATCH 4/6] Add confirmation dialog to all "Clear entries" functions --- public/src/components/server_config/bop.vue | 4 ++++ public/src/components/server_config/entrylist.vue | 4 ++++ public/src/components/server_config/event.vue | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/public/src/components/server_config/bop.vue b/public/src/components/server_config/bop.vue index fa5688df..86db54a4 100644 --- a/public/src/components/server_config/bop.vue +++ b/public/src/components/server_config/bop.vue @@ -94,6 +94,9 @@ export default { return value; }, clearEntries(){ + if (!window.confirm(this.$t("confirm_clear_entries"))) { + return; + } while(this.entries.length > 0) { this.entries.splice(this.entries[this.entries.length - 1], 1); } @@ -112,6 +115,7 @@ export default { "restrictor_label": "Motor Restrictor: 0 to 20% max.", "add_entry_button": "Add BOP", "clear_entries_button": "Clear all BOP" + "confirm_clear_entries": "Do you really want to remove all BOP?", } } diff --git a/public/src/components/server_config/entrylist.vue b/public/src/components/server_config/entrylist.vue index 9c733594..af97a5e4 100644 --- a/public/src/components/server_config/entrylist.vue +++ b/public/src/components/server_config/entrylist.vue @@ -100,6 +100,9 @@ export default { } }, clearEntries(){ + if (!window.confirm(this.$t("confirm_clear_entries"))) { + return; + } while(this.entries.length > 0) { this.entries.splice(this.entries[this.entries.length - 1], 1); } @@ -116,6 +119,7 @@ export default { "forceentrylist_label": "Force Entry List", "add_entry_button": "Add Entry", "clear_entries_button": "Clear all Entries" + "confirm_clear_entries": "Do you really want to remove all entries?", } } diff --git a/public/src/components/server_config/event.vue b/public/src/components/server_config/event.vue index 475c4fd1..80eb6155 100644 --- a/public/src/components/server_config/event.vue +++ b/public/src/components/server_config/event.vue @@ -175,6 +175,9 @@ export default { } }, clearSessions() { + if (!window.confirm(this.$t("confirm_clear_sessions"))) { + return; + } while(this.sessions.length > 0) { this.sessions.splice(this.sessions[this.sessions.length - 1], 1); } @@ -210,6 +213,7 @@ export default { "add_sessions_q_r_button": "Add sessions (Q/R)", "add_sessions_p_q_r_button": "Add sessions (P/Q/R)", "clear_sessions_button": "Clear all Sessions" + "confirm_clear_sessions": "Do you really want to remove all sessions?", } } From d8eb8a2a08650604b3cc3282f6898f46b9017685 Mon Sep 17 00:00:00 2001 From: Glen Germaine Date: Sat, 2 Jul 2022 15:41:47 +1200 Subject: [PATCH 5/6] Syntax corrections to previous Commit --- public/src/components/server_config/bop.vue | 4 ++-- public/src/components/server_config/entrylist.vue | 4 ++-- public/src/components/server_config/event.vue | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/src/components/server_config/bop.vue b/public/src/components/server_config/bop.vue index 86db54a4..d41fc772 100644 --- a/public/src/components/server_config/bop.vue +++ b/public/src/components/server_config/bop.vue @@ -114,8 +114,8 @@ export default { "ballast_label": "Ballast: 0 to 100kg max.", "restrictor_label": "Motor Restrictor: 0 to 20% max.", "add_entry_button": "Add BOP", - "clear_entries_button": "Clear all BOP" - "confirm_clear_entries": "Do you really want to remove all BOP?", + "clear_entries_button": "Clear all BOP", + "confirm_clear_entries": "Do you really want to remove all BOP?" } } diff --git a/public/src/components/server_config/entrylist.vue b/public/src/components/server_config/entrylist.vue index af97a5e4..7fc70399 100644 --- a/public/src/components/server_config/entrylist.vue +++ b/public/src/components/server_config/entrylist.vue @@ -118,8 +118,8 @@ export default { "title": "Entry List", "forceentrylist_label": "Force Entry List", "add_entry_button": "Add Entry", - "clear_entries_button": "Clear all Entries" - "confirm_clear_entries": "Do you really want to remove all entries?", + "clear_entries_button": "Clear all Entries", + "confirm_clear_entries": "Do you really want to remove all entries?" } } diff --git a/public/src/components/server_config/event.vue b/public/src/components/server_config/event.vue index 80eb6155..9de7dcac 100644 --- a/public/src/components/server_config/event.vue +++ b/public/src/components/server_config/event.vue @@ -212,8 +212,8 @@ export default { "add_session_button": "Add session", "add_sessions_q_r_button": "Add sessions (Q/R)", "add_sessions_p_q_r_button": "Add sessions (P/Q/R)", - "clear_sessions_button": "Clear all Sessions" - "confirm_clear_sessions": "Do you really want to remove all sessions?", + "clear_sessions_button": "Clear all Sessions", + "confirm_clear_sessions": "Do you really want to remove all sessions?" } } From 0e62cd9d9b9c411e65cf005fc1167651a0b0b117 Mon Sep 17 00:00:00 2001 From: Glen Germaine Date: Mon, 4 Jul 2022 10:15:20 +1200 Subject: [PATCH 6/6] Tabs to Spaces --- public/src/components/server_config/bop.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/src/components/server_config/bop.vue b/public/src/components/server_config/bop.vue index d41fc772..3b9ed066 100644 --- a/public/src/components/server_config/bop.vue +++ b/public/src/components/server_config/bop.vue @@ -112,8 +112,8 @@ export default { "track_label": "Track", "carModel_label": "Car Model #", "ballast_label": "Ballast: 0 to 100kg max.", - "restrictor_label": "Motor Restrictor: 0 to 20% max.", - "add_entry_button": "Add BOP", + "restrictor_label": "Motor Restrictor: 0 to 20% max.", + "add_entry_button": "Add BOP", "clear_entries_button": "Clear all BOP", "confirm_clear_entries": "Do you really want to remove all BOP?" }