Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 02166c7

Browse files
committedMar 5, 2025·
fix(merge):Revert "chore(merge): Merge branch 'master' into feat/account/restyle"
This reverts commit 865730f, reversing changes made to 4f864c8.
1 parent 865730f commit 02166c7

30 files changed

+7113
-3557
lines changed
 

‎src/app/components/_/AppLink.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ const emit = defineEmits<{
4141
// computations
4242
const classes = computed(() => {
4343
return [
44-
'rounded',
45-
...(props.isColored ? ['text-accent-strong dark:text-link-bright'] : []),
44+
'rounded-sm',
45+
...(props.isColored ? ['text-link-dark dark:text-link-bright'] : []),
4646
...(props.isDisabled ? ['disabled'] : []),
4747
...(props.isUnderlined ? ['underline'] : []),
4848
].join(' ')

‎src/app/components/button/ButtonColored.vue

+11-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33
:aria-label="ariaLabel"
44
class="justify-center rounded-md px-4 py-2 font-medium"
55
:class="
6-
variant === 'primary'
7-
? 'bg-accent-fancy from-blue-500 to-blue-600 text-text-bright hover:bg-accent-strong dark:from-blue-300 dark:to-blue-400 dark:text-text-dark'
8-
: 'bg-accent-weak text-accent-strong hover:bg-accent-mid dark:border dark:border-gray-600 dark:bg-inherit dark:text-text-bright dark:hover:bg-black/30'
6+
[
7+
...(isPrimary
8+
? [
9+
'text-text-bright dark:text-text-dark bg-gradient-to-tr from-blue-500 to-blue-600 dark:from-blue-300 dark:to-blue-400',
10+
]
11+
: [
12+
'text-text-dark dark:text-text-bright border border-gray-300 hover:bg-black/5 dark:border-gray-600 dark:hover:bg-black/30',
13+
]),
14+
].join(' ')
915
"
1016
:disabled="disabled"
1117
:to="props.to"
@@ -29,15 +35,14 @@ export interface Props {
2935
ariaLabel: string
3036
disabled?: boolean
3137
isExternal?: boolean
32-
variant?: 'primary' | 'accent'
38+
isPrimary?: boolean
3339
to?: RouteLocationRaw
3440
type?: 'button' | 'reset' | 'submit'
3541
}
36-
3742
const props = withDefaults(defineProps<Props>(), {
3843
disabled: false,
3944
isExternal: undefined,
40-
variant: 'primary', // default variant
45+
isPrimary: true,
4146
to: undefined,
4247
type: 'button',
4348
})

‎src/app/components/button/ButtonConfirm.vue

-27
This file was deleted.

‎src/app/components/footer/Footer.vue

-33
This file was deleted.

‎src/app/components/form/Form.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
<div class="flex flex-col">
1313
<div class="flex min-h-0 flex-col gap-6">
1414
<slot />
15-
<div class="flex flex-col justify-between">
15+
<div class="flex flex-col items-center justify-between">
1616
<ButtonColored
1717
:aria-label="submitName || t('submit')"
18-
:is-primary="false"
1918
:class="{
2019
'animate-shake': $error,
2120
}"
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
<template>
22
<div class="flex flex-col items-center gap-4">
3+
<ButtonColored
4+
:is-primary="false"
5+
:aria-label="t('register')"
6+
:to="localePath('session-create')"
7+
>
8+
{{ t('signIn') }}
9+
<template #prefix>
10+
<IHeroiconsArrowLeft />
11+
</template>
12+
</ButtonColored>
313
<Form
414
:errors="api.errors"
515
:errors-pg-ids="{
@@ -10,7 +20,7 @@
1020
form-class="w-full"
1121
:is-form-sent="isFormSent"
1222
:submit-name="t('register')"
13-
@submit.prevent="handleSubmit"
23+
@submit.prevent="submit"
1424
>
1525
<FormInputUsername
1626
:form-input="v$.username"
@@ -37,86 +47,45 @@
3747
</FormInputStateInfo>
3848
</template>
3949
</Form>
40-
41-
<AppLink
42-
:to="localePath('session-create')"
43-
:is-underlined="true"
44-
:is-colored="true"
45-
>
46-
{{ t('alreadyHaveAnAccount') }}
47-
</AppLink>
48-
49-
<!-- Modals -->
50-
<ModalPrivacyPolicy
51-
v-model="privacyModalOpen"
52-
@open-general-terms="openGeneralTerms"
53-
/>
54-
55-
<ModalGeneralTerms v-model="generalTermsModalOpen" @accepted="submit" />
5650
</div>
5751
</template>
5852

5953
<script setup lang="ts">
6054
import { useVuelidate } from '@vuelidate/core'
61-
import { useCreateLegalTermAcceptanceMutation } from '~~/gql/documents/mutations/account/accountLegalTermAcceptance'
6255
import { useAccountRegistrationMutation } from '~~/gql/documents/mutations/account/accountRegistration'
6356
6457
const { locale, t } = useI18n()
6558
const localePath = useLocalePath()
6659
const fireAlert = useFireAlert()
6760
const store = useMaevsiStore()
6861
69-
const privacyModalOpen = ref(false)
70-
const generalTermsModalOpen = ref(false)
71-
62+
// api data
7263
const accountRegistrationMutation = useAccountRegistrationMutation()
7364
const api = getApiData([accountRegistrationMutation])
7465
66+
// data
7567
const form = reactive({
7668
captcha: ref<string>(),
7769
emailAddress: ref<string>(),
7870
password: ref<string>(),
7971
username: ref<string>(),
8072
})
81-
8273
const isFormSent = ref(false)
8374
84-
// Methods
85-
const submit = async (termId: string) => {
75+
// methods
76+
const submit = async () => {
77+
if (!(await isFormValid({ v$, isFormSent }))) return
78+
8679
store.turnstileToken = form.captcha
8780
88-
const accountResult = await accountRegistrationMutation.executeMutation({
81+
const result = await accountRegistrationMutation.executeMutation({
8982
emailAddress: form.emailAddress || '',
9083
language: locale.value,
9184
password: form.password || '',
9285
username: form.username || '',
9386
})
9487
95-
if (accountResult.error) {
96-
return
97-
}
98-
99-
const accountUuid = accountResult.data?.accountRegistration?.uuid
100-
if (!accountUuid) {
101-
console.error('No account UUID received')
102-
return
103-
}
104-
105-
const legalTermAcceptanceMutation = useCreateLegalTermAcceptanceMutation()
106-
107-
const acceptanceResult = await legalTermAcceptanceMutation.executeMutation({
108-
input: {
109-
legalTermAcceptance: {
110-
accountId: accountUuid,
111-
legalTermId: termId,
112-
},
113-
},
114-
})
115-
116-
if (acceptanceResult.error) {
117-
console.error('Legal term acceptance error:', acceptanceResult.error)
118-
return
119-
}
88+
if (result.error || !result.data) return
12089
12190
await fireAlert({
12291
level: 'success',
@@ -125,16 +94,6 @@ const submit = async (termId: string) => {
12594
})
12695
}
12796
128-
const handleSubmit = async () => {
129-
if (!(await isFormValid({ v$, isFormSent }))) return
130-
131-
privacyModalOpen.value = true
132-
}
133-
134-
const openGeneralTerms = () => {
135-
generalTermsModalOpen.value = true
136-
}
137-
13897
// vuelidate
13998
const rules = {
14099
captcha: VALIDATION_CAPTCHA(),
@@ -145,7 +104,6 @@ const rules = {
145104
password: VALIDATION_PASSWORD(),
146105
emailAddress: VALIDATION_EMAIL_ADDRESS({ isRequired: true }),
147106
}
148-
149107
const v$ = useVuelidate(rules, form)
150108
</script>
151109

@@ -157,13 +115,13 @@ de:
157115
register: Registrieren
158116
registrationSuccessBody: Verifiziere deinen Account über den Link in der E-Mail, die du in Kürze erhalten wirst.
159117
registrationSuccessTitle: Verifizierungs-E-Mail gesendet.
160-
alreadyHaveAnAccount: 'Du hast bereits ein Konto? Anmelden'
118+
signIn: Stattdessen anmelden
161119
en:
162120
accountDeletionNotice: "You'll be able to delete your account at any time."
163121
postgres22023: Your password is too short! Think of a longer one.
164122
postgres23505: This username or email address is already in use! Think of a new name or try signing in instead.
165-
register: Sign Up
123+
register: Register
166124
registrationSuccessBody: Verify your account using the verification link sent to you by email.
167125
registrationSuccessTitle: Verification email sent.
168-
alreadyHaveAnAccount: Already have an account? Log in
126+
signIn: Sign in instead
169127
</i18n>

‎src/app/components/form/account/FormAccountSignIn.vue

+14-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
<template>
22
<div class="flex flex-col items-center gap-4">
3+
<ButtonColored
4+
:is-primary="false"
5+
:aria-label="t('register')"
6+
:to="localePath('account-create')"
7+
>
8+
{{ t('register') }}
9+
<template #prefix>
10+
<IHeroiconsArrowRight />
11+
</template>
12+
</ButtonColored>
313
<Form
414
:errors="api.errors"
515
:errors-pg-ids="{
@@ -46,21 +56,7 @@
4656
</ButtonColored>
4757
</template>
4858
</Form>
49-
<div class="flex w-full flex-col justify-between">
50-
<ButtonColored
51-
variant="accent"
52-
:aria-label="t('register')"
53-
:to="localePath('account-create')"
54-
class="w-full"
55-
>
56-
{{ t('register') }}
57-
</ButtonColored>
58-
</div>
59-
<AppLink
60-
:to="localePath('account-password-reset-request')"
61-
:is-underlined="true"
62-
:is-colored="true"
63-
>
59+
<AppLink :to="localePath('account-password-reset-request')">
6460
{{ t('passwordReset') }}
6561
</AppLink>
6662
</div>
@@ -144,14 +140,14 @@ de:
144140
passwordReset: Passwort zurücksetzen
145141
postgres55000: Deine E-Mail-Adresse ist noch nicht verifiziert! Schau in dein E-Mail-Postfach, ggf. auch in den Spam-Ordner, oder kontaktiere den Support.
146142
postgresP0002: Anmeldung fehlgeschlagen! Hast du dich schon registriert? Überprüfe deine Eingaben auf Schreibfehler oder kontaktiere den Support.
147-
register: Konto erstellen
143+
register: Stattdessen registrieren
148144
signIn: Anmelden
149145
en:
150146
contactSupport: Contact support
151147
jwtStoreFail: Failed to store the authentication data!
152-
passwordReset: I forgot my password
148+
passwordReset: Reset password
153149
postgres55000: Your email address has not been verified yet! Check your email inbox, including the spam folder if necessary, or contact support.
154150
postgresP0002: Login failed! Have you registered yet? Check your input for spelling mistakes or contact support.
155-
register: Create an account
151+
register: Register instead
156152
signIn: Sign in
157153
</i18n>

0 commit comments

Comments
 (0)
Please sign in to comment.