From f8ceec492d720ced359da9001088bf691cb8c28f Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 13:21:43 +0100 Subject: [PATCH 01/14] =?UTF-8?q?=E2=9C=A8=20Profile=20-=20basic=20parsing?= =?UTF-8?q?=20for=20hash=20based=20query=20params?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #10 --- src/components/Profile.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 0f883f1..9af3209 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -175,7 +175,7 @@ \ No newline at end of file From ac9f1ba2aca43d38d67604a4f6e77c5b29a670af Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 13:30:05 +0100 Subject: [PATCH 02/14] routing import fix ref #10 --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index bd77f66..188d3ff 100644 --- a/src/main.js +++ b/src/main.js @@ -26,7 +26,7 @@ const Home = import('./components/Home.vue'); const Imprint = import('./components/Imprint.vue'); const Privacy = import('./components/Privacy.vue'); const Register = import('./components/Register.vue'); -const Profile = import('./components/Profile.vue'); +const Profile = () => import('./components/Profile.vue'); // let routes = [ { path: '/', component: EnvError } ]; if (typeof config !== 'undefined') { From 0929f2bbc7037106bc6c9a4c948f51c59148a10b Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 13:30:23 +0100 Subject: [PATCH 03/14] Profile - fetch user profile data from api ref #10 --- src/components/Profile.vue | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 9af3209..9ee3205 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -80,6 +80,7 @@ class="w-full dark:bg-gray-800 rounded border border-gray-700 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-900 text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out" type="text" :placeholder="[[$t('vorname')]]" + v-model="state.firstname" />
@@ -89,6 +90,7 @@ class="w-full dark:bg-gray-800 rounded border border-gray-700 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-900 text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out" type="text" :placeholder="[[$t('mittelname')]]" + v-model="state.middlename" />
@@ -98,6 +100,7 @@ type="text" class="w-full dark:bg-gray-800 rounded border border-gray-700 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-900 text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out" :placeholder="[[$t('nachname')]]" + v-model="state.lastname" />
@@ -107,6 +110,7 @@ type="email" class="w-full dark:bg-gray-800 rounded border border-gray-700 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-900 text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out" :placeholder="[[$t('e_mail_adress')]]" + v-model="state.email" />
@@ -116,6 +120,7 @@ type="tel" class="w-full dark:bg-gray-800 rounded border border-gray-700 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-900 text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out" :placeholder="[[$t('phone_number')]]" + v-model="state.phone" />
@@ -176,13 +181,30 @@ \ No newline at end of file From b30277b617c1329702cb538b7e98d98929ca2346 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 13:46:25 +0100 Subject: [PATCH 04/14] display user name in Profile title ref #10 --- src/components/Profile.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 9ee3205..ccf280d 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -5,7 +5,10 @@
-

Max Mustermann

+

Musterfirma > PR

From 8205c11bd9a38c49608b0641dd89df22f492efd0 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 13:49:56 +0100 Subject: [PATCH 05/14] Profile - remove form styling. data is not editable yet ref #10 --- src/components/Profile.vue | 63 +++++++++++++++----------------------- 1 file changed, 24 insertions(+), 39 deletions(-) diff --git a/src/components/Profile.vue b/src/components/Profile.vue index ccf280d..7d60dcf 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -77,53 +77,38 @@
-
{{ $t('vorname') }}
- {{ $t('vorname') }}
+

-
{{ $t('mittelname') }}
- {{ $t('mittelname') }}
+

-
{{ $t('nachname') }}
- {{ $t('nachname') }}
+

-
{{ $t('e_mail_adress') }}
- {{ $t('e_mail_adress') }}
+

-
{{ $t('phone_number') }}
- {{ $t('phone_number') }}
+

@@ -183,12 +168,12 @@ \ 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..." +} From 49c3507a71a6ca212b0b8ade2b1945ea90db96bc Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 14:04:40 +0100 Subject: [PATCH 07/14] 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') }}
From 4fb9aee25586cc873f7e276fd44e41458b633b70 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 14:04:56 +0100 Subject: [PATCH 08/14] =?UTF-8?q?re-order=20language=20files=20?= =?UTF-8?q?=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 From cb3dc13c8acfeea3fad9ba9d5f9f6eade3e2310d Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 14:05:28 +0100 Subject: [PATCH 09/14] 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') }} From 69db350461231123796bc24a2452e6af47a7c83f Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 14:06:11 +0100 Subject: [PATCH 10/14] =?UTF-8?q?=F0=9F=8C=8E=20added=20missing=20translat?= =?UTF-8?q?ions?= 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...", From c8d462100a660e8edfd3bc46bd0c8abbd002f661 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 14:08:06 +0100 Subject: [PATCH 11/14] 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"); }) From ff1f43e235ba318008b9c408853231c809760304 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 7 Mar 2021 14:22:03 +0100 Subject: [PATCH 12/14] 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"); }) From 641e7a0d8ff75ce5756d11f39b583f55731b821c Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Tue, 9 Mar 2021 17:27:48 +0100 Subject: [PATCH 13/14] Profile - display group ref #10 --- src/components/Profile.vue | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 7d60dcf..2dc30c7 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -9,7 +9,7 @@ class="text-3xl font-bold whitespace-nowrap" v-text="(state.firstname || '') + ' ' + (state.middlename || '') + ' ' + (state.lastname || '')" >

-

Musterfirma > PR

+

{{ state.group }}

-
+
@@ -116,7 +116,7 @@
-
+
@@ -158,7 +158,7 @@
-
+
coming soon...
@@ -181,8 +181,9 @@ const state = reactive({ firstname: "", middlename: "", lastname: "", + group: "", + activetab: "profile", }) -let activetab = ref("profile"); const toast = useToast(); const token = location.hash.substr(1).split('&')[0].split('=')[1]; axios.get(`${config.baseurl}api/runners/me/${token}`) @@ -192,6 +193,7 @@ axios.get(`${config.baseurl}api/runners/me/${token}`) state.firstname = data.firstname; state.middlename = data.middlename; state.lastname = data.lastname; + state.group = data.group; }).catch((error) => { toast.error("An error occured while loading your profile data"); }) From 56daa7c501e3f59e988f1912ed397e43d6311572 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Tue, 9 Mar 2021 17:39:20 +0100 Subject: [PATCH 14/14] fix fallback component routing for invalid env config ref #10 --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 188d3ff..0611093 100644 --- a/src/main.js +++ b/src/main.js @@ -28,7 +28,7 @@ const Privacy = import('./components/Privacy.vue'); const Register = import('./components/Register.vue'); const Profile = () => import('./components/Profile.vue'); // -let routes = [ { path: '/', component: EnvError } ]; +let routes = [ { path: '/:pathMatch(.*)*', component: EnvError } ]; if (typeof config !== 'undefined') { if (config.baseurl && config.documentserver_key) { routes = [