From 14369480ea23e8b0af8548596a6bf3d331de13e5 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 14:04:29 +0100 Subject: [PATCH 1/7] basic lap/ scans ui ref #11 --- src/components/Profile.vue | 33 +++++++++--------- src/locales/en.json | 71 +++++++++++++++++++------------------- 2 files changed, 53 insertions(+), 51 deletions(-) diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 7d60dcf..7a3fb7a 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -121,7 +121,10 @@
- +
@@ -135,24 +138,15 @@ - - - - - - - - - - - - - - - + + +
400m0min 57s
400m1min 15s
1km2min 50s
1km3min 00s
s.distances.time
+
+ {{ $t('no_laps_scans_were_recorded_yet') }} +
@@ -181,6 +175,7 @@ const state = reactive({ firstname: "", middlename: "", lastname: "", + scans: [] }) let activetab = ref("profile"); const toast = useToast(); @@ -195,4 +190,10 @@ axios.get(`${config.baseurl}api/runners/me/${token}`) }).catch((error) => { toast.error("An error occured while loading your profile data"); }) +axios.get(`${config.baseurl}api/runners/me/${token}/scans`) + .then(({ data }) => { + state.scans = data; + }).catch((error) => { + toast.error("An error occured while loading your profile data"); + }) \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index 7ce8dba..e134b50 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1,36 +1,37 @@ { - "already_have_an_account": "Already have an account?", - "apartment_suite_etc": "Apartment, suite, etc.", - "configuration_error": "Configuration error", - "distance": "Distance", - "download_certificate": "Download certificate", - "e_mail_adress": "mail address", - "go_to_login": "Go To Login", - "if_you_are_the_system_administrator_please_refer_to_the_official_product_documentation_readme_for_configuration_guidance": "If you are the system administrator, please refer to the official product documentation/ README for configuration guidance.", - "imprint": "Imprint", - "lap_time": "Lap time", - "lap_times": "Lap times", - "main_page_text": "Here you can register for the Lauf Für Kaya! or manage your runner profile.", - "mittelname": "Middlename", - "nachname": "Lastname", - "ort": "City", - "phone_number": "Phone Number", - "please_provide_a_valid_zipcode": "Please provide a valid zipcode...", - "please_provide_valid_mail": "Please provide a valid mail address.", - "plz": "zipcode", - "privacy_policy": "Privacy Policy", - "profile": "Profile", - "provide_address": "Provide a postal address?", - "register": { - "register_now": "Register now for Lauf für Kaya! 2021." - }, - "register_now": "Register now!", - "registrieren": "Register Now", - "save_changes": "Save changes", - "sponsoring": "Sponsoring", - "strasse": "Street/ Block", - "the_system_is_not_properly_configured_please_contact_the_system_administrator_for_help": "The system is not properly configured. Please contact the system administrator for help.", - "this_is_not_a_valid_international_phone_number": "This is not a valid international phone number", - "view_my_data": "View my data", - "vorname": "Firstname" -} \ No newline at end of file + "already_have_an_account": "Already have an account?", + "apartment_suite_etc": "Apartment, suite, etc.", + "configuration_error": "Configuration error", + "distance": "Distance", + "download_certificate": "Download certificate", + "e_mail_adress": "mail address", + "go_to_login": "Go To Login", + "if_you_are_the_system_administrator_please_refer_to_the_official_product_documentation_readme_for_configuration_guidance": "If you are the system administrator, please refer to the official product documentation/ README for configuration guidance.", + "imprint": "Imprint", + "lap_time": "Lap time", + "lap_times": "Lap times", + "main_page_text": "Here you can register for the Lauf Für Kaya! or manage your runner profile.", + "mittelname": "Middlename", + "nachname": "Lastname", + "ort": "City", + "phone_number": "Phone Number", + "please_provide_a_valid_zipcode": "Please provide a valid zipcode...", + "please_provide_valid_mail": "Please provide a valid mail address.", + "plz": "zipcode", + "privacy_policy": "Privacy Policy", + "profile": "Profile", + "provide_address": "Provide a postal address?", + "register": { + "register_now": "Register now for Lauf für Kaya! 2021." + }, + "register_now": "Register now!", + "registrieren": "Register Now", + "save_changes": "Save changes", + "sponsoring": "Sponsoring", + "strasse": "Street/ Block", + "the_system_is_not_properly_configured_please_contact_the_system_administrator_for_help": "The system is not properly configured. Please contact the system administrator for help.", + "this_is_not_a_valid_international_phone_number": "This is not a valid international phone number", + "view_my_data": "View my data", + "vorname": "Firstname", + "no_laps_scans_were_recorded_yet": "No laps/ scans were recorded yet..." +} -- 2.47.2 From 49c3507a71a6ca212b0b8ade2b1945ea90db96bc Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 14:04:40 +0100 Subject: [PATCH 2/7] added empty state for scans ref #11 --- src/assets/empty_laps.svg | 1 + src/components/Profile.vue | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 src/assets/empty_laps.svg diff --git a/src/assets/empty_laps.svg b/src/assets/empty_laps.svg new file mode 100644 index 0000000..17ed002 --- /dev/null +++ b/src/assets/empty_laps.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 7a3fb7a..cc1bdea 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -145,6 +145,11 @@
+ {{ $t('no_laps_scans_were_recorded_yet') }}
-- 2.47.2 From 4fb9aee25586cc873f7e276fd44e41458b633b70 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 14:04:56 +0100 Subject: [PATCH 3/7] =?UTF-8?q?re-order=20language=20files=20=F0=9F=98=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #11 --- src/locales/en.json | 72 ++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index e134b50..f1be63e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1,37 +1,37 @@ { - "already_have_an_account": "Already have an account?", - "apartment_suite_etc": "Apartment, suite, etc.", - "configuration_error": "Configuration error", - "distance": "Distance", - "download_certificate": "Download certificate", - "e_mail_adress": "mail address", - "go_to_login": "Go To Login", - "if_you_are_the_system_administrator_please_refer_to_the_official_product_documentation_readme_for_configuration_guidance": "If you are the system administrator, please refer to the official product documentation/ README for configuration guidance.", - "imprint": "Imprint", - "lap_time": "Lap time", - "lap_times": "Lap times", - "main_page_text": "Here you can register for the Lauf Für Kaya! or manage your runner profile.", - "mittelname": "Middlename", - "nachname": "Lastname", - "ort": "City", - "phone_number": "Phone Number", - "please_provide_a_valid_zipcode": "Please provide a valid zipcode...", - "please_provide_valid_mail": "Please provide a valid mail address.", - "plz": "zipcode", - "privacy_policy": "Privacy Policy", - "profile": "Profile", - "provide_address": "Provide a postal address?", - "register": { - "register_now": "Register now for Lauf für Kaya! 2021." - }, - "register_now": "Register now!", - "registrieren": "Register Now", - "save_changes": "Save changes", - "sponsoring": "Sponsoring", - "strasse": "Street/ Block", - "the_system_is_not_properly_configured_please_contact_the_system_administrator_for_help": "The system is not properly configured. Please contact the system administrator for help.", - "this_is_not_a_valid_international_phone_number": "This is not a valid international phone number", - "view_my_data": "View my data", - "vorname": "Firstname", - "no_laps_scans_were_recorded_yet": "No laps/ scans were recorded yet..." -} + "already_have_an_account": "Already have an account?", + "apartment_suite_etc": "Apartment, suite, etc.", + "configuration_error": "Configuration error", + "distance": "Distance", + "download_certificate": "Download certificate", + "e_mail_adress": "mail address", + "go_to_login": "Go To Login", + "if_you_are_the_system_administrator_please_refer_to_the_official_product_documentation_readme_for_configuration_guidance": "If you are the system administrator, please refer to the official product documentation/ README for configuration guidance.", + "imprint": "Imprint", + "lap_time": "Lap time", + "lap_times": "Lap times", + "main_page_text": "Here you can register for the Lauf Für Kaya! or manage your runner profile.", + "mittelname": "Middlename", + "nachname": "Lastname", + "no_laps_scans_were_recorded_yet": "No laps/ scans were recorded yet...", + "ort": "City", + "phone_number": "Phone Number", + "please_provide_a_valid_zipcode": "Please provide a valid zipcode...", + "please_provide_valid_mail": "Please provide a valid mail address.", + "plz": "zipcode", + "privacy_policy": "Privacy Policy", + "profile": "Profile", + "provide_address": "Provide a postal address?", + "register": { + "register_now": "Register now for Lauf für Kaya! 2021." + }, + "register_now": "Register now!", + "registrieren": "Register Now", + "save_changes": "Save changes", + "sponsoring": "Sponsoring", + "strasse": "Street/ Block", + "the_system_is_not_properly_configured_please_contact_the_system_administrator_for_help": "The system is not properly configured. Please contact the system administrator for help.", + "this_is_not_a_valid_international_phone_number": "This is not a valid international phone number", + "view_my_data": "View my data", + "vorname": "Firstname" +} \ No newline at end of file -- 2.47.2 From cb3dc13c8acfeea3fad9ba9d5f9f6eade3e2310d Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 14:05:28 +0100 Subject: [PATCH 4/7] center empty state image ref #11 --- src/components/Profile.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Profile.vue b/src/components/Profile.vue index cc1bdea..2d24e08 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -147,7 +147,7 @@
{{ $t('no_laps_scans_were_recorded_yet') }} -- 2.47.2 From 69db350461231123796bc24a2452e6af47a7c83f Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 14:06:11 +0100 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=8C=8E=20added=20missing=20translatio?= =?UTF-8?q?ns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #11 --- src/locales/de.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/locales/de.json b/src/locales/de.json index f71699c..0dd38e4 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -13,6 +13,7 @@ "main_page_text": "Hier können Sie sich für den Lauf Für Kaya! registrieren oder ihr Läuferprofil verwalten.", "mittelname": "Mittelname", "nachname": "Nachname", + "no_laps_scans_were_recorded_yet": "Es wurden noch keine Runden / Scans aufgezeichnet ...", "ort": "Ort", "phone_number": "Telefonnummer", "please_provide_a_valid_zipcode": "Bitte geben Sie eine gültige Postleitzahl an...", -- 2.47.2 From c8d462100a660e8edfd3bc46bd0c8abbd002f661 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 14:08:06 +0100 Subject: [PATCH 6/7] use api response object properly ref #11 --- src/components/Profile.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 2d24e08..8f566f8 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -139,8 +139,12 @@ - s.distance - s.time + + m + + + s + @@ -198,6 +202,7 @@ axios.get(`${config.baseurl}api/runners/me/${token}`) axios.get(`${config.baseurl}api/runners/me/${token}/scans`) .then(({ data }) => { state.scans = data; + // TODO: filter for valid=true scans only }).catch((error) => { toast.error("An error occured while loading your profile data"); }) -- 2.47.2 From ff1f43e235ba318008b9c408853231c809760304 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 14:22:03 +0100 Subject: [PATCH 7/7] format lap times + only display valid scans ref #11 --- src/components/Profile.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 8f566f8..2263b06 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -142,9 +142,7 @@ m - - s - + @@ -201,8 +199,12 @@ axios.get(`${config.baseurl}api/runners/me/${token}`) }) axios.get(`${config.baseurl}api/runners/me/${token}/scans`) .then(({ data }) => { + data.map(function(s) { + s.lapTime = Math.floor(s.lapTime / 60) + 'min ' + (Math.floor(s.lapTime % 60) + "").padStart(2, "0") + "s" + return s; + }) + data.filter(s => s.valid === true); state.scans = data; - // TODO: filter for valid=true scans only }).catch((error) => { toast.error("An error occured while loading your profile data"); }) -- 2.47.2