Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
c9e3b613e1 | |||
f0c668c1c3 | |||
e418d2a2b7 | |||
e14a6d6329 |
@ -2,9 +2,18 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
||||
|
||||
#### [1.3.0](https://git.odit.services/lfk/selfservice/compare/1.2.7...1.3.0)
|
||||
|
||||
- feat: improve phone number registration [`e14a6d6`](https://git.odit.services/lfk/selfservice/commit/e14a6d6329d547d3086abe59d00f0d054688b6f4)
|
||||
- feat: improved Register UI [`e418d2a`](https://git.odit.services/lfk/selfservice/commit/e418d2a2b74553f614520ac8c0f0377d141daa8d)
|
||||
- feat: only show international phone number thing if + is missing [`f0c668c`](https://git.odit.services/lfk/selfservice/commit/f0c668c1c3d1a5c27d78617e5ca34ca68603ce14)
|
||||
|
||||
#### [1.2.7](https://git.odit.services/lfk/selfservice/compare/1.2.6...1.2.7)
|
||||
|
||||
> 23 March 2025
|
||||
|
||||
- refactor(ci): Switch to actions [`a862593`](https://git.odit.services/lfk/selfservice/commit/a862593c5315043577699d1a6fd50854dd1bca00)
|
||||
- 🚀Bumped version to v1.2.7 [`e1a87ed`](https://git.odit.services/lfk/selfservice/commit/e1a87eda4a0c9b9be47bcfe4ddb0e93696d037f4)
|
||||
- footer: cleanup imprint & privacy url [`0e557ef`](https://git.odit.services/lfk/selfservice/commit/0e557ef4080e997b06adcbbadf3e82f12152281b)
|
||||
- fix: footer [`422df7c`](https://git.odit.services/lfk/selfservice/commit/422df7c3f832dc29721e783dc4a86ee55e9d8ccc)
|
||||
- footer padding [`0af7352`](https://git.odit.services/lfk/selfservice/commit/0af73525bc154ba730351d7a4970e9737edaa4db)
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@odit/lfk-selfservice",
|
||||
"version": "1.2.7",
|
||||
"version": "1.3.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
@ -19,6 +19,7 @@
|
||||
"e_mail_des_sponsors": "E-Mail des Sponsors",
|
||||
"error_requesting_the_login_link": "Fehler beim Anfordern des Login-Links...",
|
||||
"first_lap": "👏 erste Runde",
|
||||
"hinweis": "Hinweis:",
|
||||
"i_accept": "Ich habe die ",
|
||||
"i_accept_end": "gelesen und akzeptiert.",
|
||||
"if_you_are_the_system_administrator_please_refer_to_the_official_product_documentation_readme_for_configuration_guidance": "Wenn Sie der Systemadministrator sind, finden Sie Konfigurationsanweisungen in der offiziellen Produktdokumentation / README.",
|
||||
@ -38,7 +39,7 @@
|
||||
"not_registered_yet": "Noch nicht registriert?",
|
||||
"organization": "Organisation",
|
||||
"ort": "Ort",
|
||||
"phone_number": "Telefonnummer (international formatiert)",
|
||||
"phone_number": "Telefonnummer",
|
||||
"please_provide_a_valid_zipcode": "Bitte geben Sie eine gültige Postleitzahl an...",
|
||||
"please_provide_valid_mail": "Bitte geben Sie eine gültige E-Mail Adresse an",
|
||||
"plz": "PLZ",
|
||||
@ -53,6 +54,7 @@
|
||||
},
|
||||
"register_now": "Jetzt registrieren!",
|
||||
"register_now_small": "Jetzt registrieren",
|
||||
"registration_local_phone_nr": "Wenn Sie eine Telefonnummer ohne Vorwahl angeben, wird Sie als deutsche Telefonnummer gewertet",
|
||||
"registration_running": "Registrierung läuft...",
|
||||
"registrationcode": "Registrierungscode",
|
||||
"registrieren": "Registrieren",
|
||||
|
@ -19,6 +19,7 @@
|
||||
"e_mail_des_sponsors": "E-Mail of the Sponsor",
|
||||
"error_requesting_the_login_link": "Error requesting the login link...",
|
||||
"first_lap": "👏 first lap",
|
||||
"hinweis": "Note:",
|
||||
"i_accept": "I have read and accepted the ",
|
||||
"i_accept_end": "",
|
||||
"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.",
|
||||
@ -38,7 +39,7 @@
|
||||
"not_registered_yet": "Not registered yet?",
|
||||
"organization": "Organization",
|
||||
"ort": "City",
|
||||
"phone_number": "Phone Number (international format)",
|
||||
"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",
|
||||
@ -53,6 +54,7 @@
|
||||
},
|
||||
"register_now": "Register now!",
|
||||
"register_now_small": "Register now",
|
||||
"registration_local_phone_nr": "If you enter a phone number without an country code, it will be treated as a German phone number",
|
||||
"registration_running": "registration is running...",
|
||||
"registrationcode": "Registration Code",
|
||||
"registrieren": "Register Now",
|
||||
|
@ -51,7 +51,7 @@
|
||||
{{ $t('buergerlauf') }}
|
||||
</p>
|
||||
<div class="mt-4">
|
||||
<label for="first_name" class="block font-medium">
|
||||
<label for="first_name" class="block font-semibold mt-2">
|
||||
{{ $t("vorname") }}
|
||||
<span class="font-bold">*</span>
|
||||
</label>
|
||||
@ -61,7 +61,6 @@
|
||||
'border-green-300': userdetails.firstname.trim(),
|
||||
}" class="
|
||||
dark:bg-gray-800
|
||||
mt-1
|
||||
block
|
||||
w-full
|
||||
shadow-sm
|
||||
@ -73,7 +72,7 @@
|
||||
p-2
|
||||
" />
|
||||
<!-- -->
|
||||
<label for="last_name" class="block font-medium">
|
||||
<label for="last_name" class="block font-semibold mt-2">
|
||||
{{ $t("nachname") }}
|
||||
<span class="font-bold">*</span>
|
||||
</label>
|
||||
@ -83,7 +82,6 @@
|
||||
'border-green-300': userdetails.lastname.trim(),
|
||||
}" class="
|
||||
dark:bg-gray-800
|
||||
mt-1
|
||||
block
|
||||
w-full
|
||||
shadow-sm
|
||||
@ -95,7 +93,7 @@
|
||||
p-2
|
||||
" />
|
||||
<!-- -->
|
||||
<label for="email_address" class="block font-medium">
|
||||
<label for="email_address" class="block font-semibold mt-2">
|
||||
{{ $t("e_mail_adress") }}
|
||||
<span class="font-bold">*</span>
|
||||
</label>
|
||||
@ -105,7 +103,6 @@
|
||||
'border-green-300': isEmail(userdetails.mail),
|
||||
}" class="
|
||||
dark:bg-gray-800
|
||||
mt-1
|
||||
block
|
||||
w-full
|
||||
shadow-sm
|
||||
@ -120,9 +117,31 @@
|
||||
{{ $t("please_provide_valid_mail") }}
|
||||
</p>
|
||||
<!-- -->
|
||||
<label for="phone" class="select-none block font-medium">{{
|
||||
<label for="phone" class="block font-semibold mt-2">{{
|
||||
$t("phone_number")
|
||||
}}</label>
|
||||
<div v-if="userdetails.phone!=='' && !userdetails.phone.includes('+')" class="bg-blue-100 border border-blue-200 text-black rounded-lg p-4 mb-1" role="alert" tabindex="-1"
|
||||
aria-labelledby="hs-actions-label">
|
||||
<div class="flex">
|
||||
<div class="shrink-0">
|
||||
<svg class="shrink-0 size-4 mt-1" xmlns="http://www.w3.org/2000/svg" width="24" height="24"
|
||||
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="10"></circle>
|
||||
<path d="M12 16v-4"></path>
|
||||
<path d="M12 8h.01"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ms-3">
|
||||
<h3 id="hs-actions-label" class="font-semibold">
|
||||
{{ $t('hinweis') }}
|
||||
</h3>
|
||||
<div class="mt-2 text-sm text-gray-800 font-medium">
|
||||
{{ $t('registration_local_phone_nr') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input v-model="userdetails.phone" name="phone" id="phone" autocomplete="off"
|
||||
:placeholder="[[$t('phone_number')]]" type="text" :class="{
|
||||
'border-red-500':
|
||||
@ -131,7 +150,6 @@
|
||||
isPhoneOkay(userdetails.phone),
|
||||
}" class="
|
||||
dark:bg-gray-800
|
||||
mt-1
|
||||
block
|
||||
w-full
|
||||
shadow-sm
|
||||
@ -160,7 +178,7 @@
|
||||
</div>
|
||||
<div v-if="provide_address === true" class="col-span-6">
|
||||
<div class="col-span-6">
|
||||
<label for="street" class="block font-medium">
|
||||
<label for="street" class="block font-semibold mt-2">
|
||||
{{ $t("strasse") }}
|
||||
<span class="font-bold">*</span>
|
||||
</label>
|
||||
@ -170,7 +188,6 @@
|
||||
'border-green-300': userdetails.address.street.trim(),
|
||||
}" class="
|
||||
dark:bg-gray-800
|
||||
mt-1
|
||||
block
|
||||
w-full
|
||||
shadow-sm
|
||||
@ -183,13 +200,12 @@
|
||||
" />
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label for="address2" class="block font-medium">{{
|
||||
<label for="address2" class="block font-semibold mt-2">{{
|
||||
$t("apartment_suite_etc")
|
||||
}}</label>
|
||||
<input v-model="userdetails.address.address2" type="text" name="address2"
|
||||
:placeholder="[[$t('apartment_suite_etc')]]" id="address2" autocomplete="street-address" class="
|
||||
dark:bg-gray-800
|
||||
mt-1
|
||||
block
|
||||
w-full
|
||||
shadow-sm
|
||||
@ -202,7 +218,7 @@
|
||||
" />
|
||||
</div>
|
||||
<div class="col-span-6 sm:col-span-6 lg:col-span-2">
|
||||
<label for="city" class="block font-medium">
|
||||
<label for="city" class="block font-semibold mt-2">
|
||||
{{ $t("ort") }}
|
||||
<span class="font-bold">*</span>
|
||||
</label>
|
||||
@ -212,7 +228,6 @@
|
||||
'border-green-300': userdetails.address.city.trim(),
|
||||
}" class="
|
||||
dark:bg-gray-800
|
||||
mt-1
|
||||
block
|
||||
w-full
|
||||
shadow-sm
|
||||
@ -225,7 +240,7 @@
|
||||
" />
|
||||
</div>
|
||||
<div class="col-span-6 sm:col-span-3 lg:col-span-2">
|
||||
<label for="postal_code" class="block font-medium">
|
||||
<label for="postal_code" class="block font-semibold mt-2">
|
||||
{{ $t("plz") }}
|
||||
<span class="font-bold">*</span>
|
||||
</label>
|
||||
@ -241,7 +256,6 @@
|
||||
),
|
||||
}" class="
|
||||
dark:bg-gray-800
|
||||
mt-1
|
||||
block
|
||||
w-full
|
||||
shadow-sm
|
||||
@ -348,17 +362,30 @@ let userdetails = ref({
|
||||
phone: "",
|
||||
address: { street: "", address2: "", city: "", zipcode: "" },
|
||||
});
|
||||
function formatPhoneNumber(phoneNumber, countryCode = "+49") {
|
||||
// Remove all non-digit characters
|
||||
const cleanedNumber = phoneNumber.replace(/\D/g, "");
|
||||
|
||||
// Check if the number starts with the country code
|
||||
if (cleanedNumber.startsWith(countryCode.replace("+", ""))) {
|
||||
return "+" + cleanedNumber; // already international
|
||||
}
|
||||
|
||||
// Check if the number starts with 0
|
||||
if (cleanedNumber.startsWith("0")) {
|
||||
return countryCode + cleanedNumber.slice(1);
|
||||
}
|
||||
|
||||
// If it doesn't start with 0 or the country code, assume it's a local number.
|
||||
// In this case, prepend the country code.
|
||||
return countryCode + cleanedNumber;
|
||||
}
|
||||
function isPhoneOkay() {
|
||||
if (userdetails.value.phone === "") {
|
||||
return true
|
||||
}
|
||||
if (userdetails.value.phone.includes(" ")) {
|
||||
return false
|
||||
}
|
||||
if (!userdetails.value.phone.includes("+")) {
|
||||
return false
|
||||
}
|
||||
if (isMobilePhone(userdetails.value.phone)) {
|
||||
const formattedNumber = formatPhoneNumber(userdetails.value.phone)
|
||||
if (isMobilePhone(formattedNumber)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@ -400,7 +427,7 @@ function login() {
|
||||
address: {},
|
||||
};
|
||||
if (userdetails.value.phone !== "") {
|
||||
postdata.phone = userdetails.value.phone
|
||||
postdata.phone = formatPhoneNumber(userdetails.value.phone)
|
||||
}
|
||||
if (provide_address.value === true) {
|
||||
postdata.address = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user