@shopbite-de/storefront 1.31.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yaml +54 -0
- package/.nuxtrc +1 -1
- package/CLAUDE.md +23 -8
- package/app/app.vue +10 -6
- package/app/assets/css/main.css +100 -61
- package/app/components/AddToWishlist.vue +15 -25
- package/app/components/Address/Card.vue +6 -11
- package/app/components/Address/Detail.vue +23 -23
- package/app/components/Address/Fields.vue +175 -73
- package/app/components/Address/Form.vue +107 -106
- package/app/components/Cart/Bar.vue +6 -9
- package/app/components/Cart/Item.vue +48 -63
- package/app/components/Cart/QuickView.vue +38 -25
- package/app/components/Cart/Upsell.vue +24 -62
- package/app/components/Category/Breadcrumb.vue +29 -3
- package/app/components/Category/FilterGroup.vue +20 -41
- package/app/components/Category/Listing.vue +100 -130
- package/app/components/Category/SearchInput.vue +22 -19
- package/app/components/Checkout/DeliveryTimeSelect.vue +55 -77
- package/app/components/Checkout/LoginOrRegister.vue +28 -29
- package/app/components/Checkout/PaymentAndDelivery.vue +114 -86
- package/app/components/Checkout/Summary.vue +90 -60
- package/app/components/Checkout/VoucherInput.vue +40 -27
- package/app/components/Contact/Form.vue +164 -192
- package/app/components/DemoBanner.vue +5 -5
- package/app/components/Footer/StoreStatus.vue +2 -2
- package/app/components/Footer.vue +125 -57
- package/app/components/Header.vue +283 -18
- package/app/components/Home/Categories.vue +116 -0
- package/app/components/Home/Facts.vue +71 -0
- package/app/components/Home/Faq.vue +34 -16
- package/app/components/Home/Hero.vue +172 -0
- package/app/components/Home/Highlights.vue +29 -37
- package/app/components/Home/Restaurant.vue +102 -0
- package/app/components/Menu/BonCard.vue +180 -0
- package/app/components/Menu/CartPanel.vue +24 -0
- package/app/components/Menu/CategoryIndex.vue +54 -0
- package/app/components/Menu/OrderMode.vue +20 -0
- package/app/components/Menu/SectionHeader.vue +38 -0
- package/app/components/Navigation/MobileTop.vue +23 -15
- package/app/components/Order/Confirmation.vue +119 -0
- package/app/components/Order/Detail.vue +80 -88
- package/app/components/Product/CardSkeleton.vue +8 -12
- package/app/components/Product/Configurator.vue +8 -16
- package/app/components/Product/CrossSelling.vue +75 -83
- package/app/components/Product/DeselectIngredient.vue +17 -22
- package/app/components/Product/Detail.vue +35 -27
- package/app/components/Product/QuickView.vue +80 -51
- package/app/components/SalesChannelSwitch.vue +14 -28
- package/app/components/Sb/Button.vue +70 -0
- package/app/components/Sb/Checkbox.vue +73 -0
- package/app/components/Sb/Chip.vue +51 -0
- package/app/components/Sb/ChoiceGroup.vue +82 -0
- package/app/components/Sb/ConfirmDialog.vue +60 -0
- package/app/components/Sb/Field.vue +77 -0
- package/app/components/Sb/Icon.vue +66 -0
- package/app/components/Sb/IconButton.vue +55 -0
- package/app/components/Sb/Input.vue +23 -0
- package/app/components/Sb/SegmentedControl.vue +34 -0
- package/app/components/Sb/Select.vue +49 -0
- package/app/components/Sb/Sheet.vue +83 -0
- package/app/components/Sb/Stars.vue +60 -0
- package/app/components/Sb/StatusPill.vue +38 -0
- package/app/components/Sb/Stepper.vue +72 -0
- package/app/components/User/AccountHeader.vue +16 -0
- package/app/components/User/AuthPanel.vue +41 -0
- package/app/components/User/Detail.vue +32 -29
- package/app/components/User/LoginForm.vue +92 -98
- package/app/components/User/RegistrationForm.vue +285 -249
- package/app/components/Wishlist.vue +55 -155
- package/app/composables/useCartMutations.ts +9 -27
- package/app/composables/useCheckoutMethodGuard.ts +2 -24
- package/app/composables/useContactForm.ts +66 -0
- package/app/composables/useHomeMenuCategories.ts +41 -0
- package/app/composables/useNavigation.ts +10 -2
- package/app/composables/useOrderMode.ts +65 -0
- package/app/composables/useRegistrationForm.ts +161 -0
- package/app/composables/useRestaurantSchema.ts +1 -1
- package/app/composables/useShareLink.ts +3 -13
- package/app/composables/useSortingSelection.ts +13 -0
- package/app/composables/useThemePreset.ts +15 -0
- package/app/composables/useVoucherCode.ts +7 -16
- package/app/composables/useWishlistActions.ts +0 -51
- package/app/error.vue +31 -9
- package/app/layouts/account.vue +45 -50
- package/app/layouts/default.vue +2 -3
- package/app/layouts/listing.vue +3 -5
- package/app/pages/[...all].vue +8 -4
- package/app/pages/account/recover/password/index.vue +113 -80
- package/app/pages/anmelden.vue +11 -10
- package/app/pages/bestellung/[id]/erfolg.vue +1 -15
- package/app/pages/bestellung/[id]/fehler.vue +63 -51
- package/app/pages/bestellung/[id]/index.vue +3 -85
- package/app/pages/bestellung/kasse.vue +29 -0
- package/app/pages/bestellung.vue +8 -60
- package/app/pages/index.vue +12 -52
- package/app/pages/kontakt.vue +27 -7
- package/app/pages/konto/adressen.vue +106 -102
- package/app/pages/konto/bestellung/[id].vue +9 -43
- package/app/pages/konto/bestellungen.vue +55 -33
- package/app/pages/konto/index.vue +47 -62
- package/app/pages/konto/profil.vue +162 -100
- package/app/pages/maintenance.vue +8 -6
- package/app/pages/merkliste.vue +7 -8
- package/app/pages/passwort-vergessen.vue +92 -75
- package/app/pages/registrierung/bestaetigen.vue +20 -48
- package/app/pages/registrierung/index.vue +16 -7
- package/app/pages/suche.vue +94 -95
- package/app/plugins/theme-preset.ts +9 -0
- package/app/utils/highlight.ts +25 -0
- package/app/utils/product.ts +9 -0
- package/app/validation/registrationSchema.ts +1 -1
- package/docs/notes/2026-10-07-issue-434-property-group-projection.md +27 -0
- package/docs/notes/2026-10-07-listing-payload.md +38 -0
- package/docs/notes/2026-10-07-nuxt-4.6-inline-error-rendering.md +31 -0
- package/modules/theme.ts +115 -0
- package/nuxt.config.ts +27 -15
- package/package.json +6 -8
- package/playwright.config.ts +11 -0
- package/server/api/listing/[categoryId].get.ts +10 -11
- package/server/api/product/[productId].get.ts +4 -2
- package/server/api/product/variant.get.ts +1 -2
- package/server/api/search.get.ts +7 -12
- package/shared/theme/presets.ts +303 -0
- package/test/a11y/presets.test.ts +225 -0
- package/test/nuxt/AccountPagesPreset.test.ts +191 -0
- package/test/nuxt/AuthPagesPreset.test.ts +87 -0
- package/test/nuxt/CartCheckoutPreset.test.ts +154 -0
- package/test/nuxt/CartItem.test.ts +18 -3
- package/test/nuxt/CartUpsell.test.ts +1 -2
- package/test/nuxt/CheckoutFormsPreset.test.ts +120 -0
- package/test/nuxt/CheckoutOnePage.test.ts +115 -0
- package/test/nuxt/CheckoutSummary.test.ts +6 -6
- package/test/nuxt/CheckoutVoucherInput.test.ts +20 -32
- package/test/nuxt/ContactFormPreset.test.ts +115 -0
- package/test/nuxt/FooterStoreStatus.test.ts +2 -2
- package/test/nuxt/HeaderFooterPreset.test.ts +134 -0
- package/test/nuxt/HomeFaq.test.ts +3 -2
- package/test/nuxt/MenuBonCard.test.ts +122 -0
- package/test/nuxt/OrderPagesPreset.test.ts +132 -0
- package/test/nuxt/PaymentAndDelivery.test.ts +0 -4
- package/test/nuxt/ProductCrossSelling.test.ts +2 -1
- package/test/nuxt/ProductDeselectIngredient.test.ts +5 -3
- package/test/nuxt/ProductSheetPreset.test.ts +105 -0
- package/test/nuxt/RegisterConfirmPage.test.ts +0 -8
- package/test/nuxt/RegistrationForm.test.ts +89 -270
- package/test/nuxt/SbBaseComponents.test.ts +170 -0
- package/test/nuxt/SbStars.test.ts +25 -0
- package/test/nuxt/useCartMutations.test.ts +3 -17
- package/test/nuxt/useCartUpsell.test.ts +1 -1
- package/test/nuxt/useCheckoutMethodGuard.test.ts +0 -27
- package/test/nuxt/useShareLink.test.ts +1 -9
- package/test/nuxt/useWishlistActions.test.ts +3 -26
- package/test/unit/highlight.spec.ts +31 -0
- package/test/unit/product.spec.ts +12 -0
- package/test/unit/themePresets.spec.ts +61 -0
- package/app/app.config.ts +0 -19
- package/app/components/AnimatedSection.vue +0 -74
- package/app/components/BottomNavi.vue +0 -70
- package/app/components/Category/Header.vue +0 -48
- package/app/components/Checkout/PaymentMethod.vue +0 -30
- package/app/components/Checkout/ShippingMethod.vue +0 -30
- package/app/components/Cta.vue +0 -30
- package/app/components/Feature/Card.vue +0 -121
- package/app/components/Features.vue +0 -42
- package/app/components/Footer/Contact.vue +0 -82
- package/app/components/Header/Body.vue +0 -82
- package/app/components/Header/Right.vue +0 -187
- package/app/components/Header/Title.vue +0 -10
- package/app/components/Hero.vue +0 -233
- package/app/components/Home/MenuCategories.vue +0 -148
- package/app/components/ImageGallery.vue +0 -63
- package/app/components/Loading.vue +0 -29
- package/app/components/Navigation/DesktopLeft.vue +0 -39
- package/app/components/Product/Card.vue +0 -177
- package/app/components/Product/CardCompact.vue +0 -72
- package/app/components/Product/CardDietBadges.vue +0 -43
- package/app/components/Product/CardIngredients.vue +0 -35
- package/app/components/Product/CardKitchen.vue +0 -34
- package/app/components/Product/Category.vue +0 -160
- package/app/components/Product/SearchBar.vue +0 -95
- package/app/components/PublicAnnouncement.vue +0 -17
- package/app/pages/bestellung/bestaetigen.vue +0 -16
- package/app/pages/bestellung/warenkorb.vue +0 -49
- package/app/pages/bestellung/zahlung-versand.vue +0 -25
- package/test/nuxt/AddressFields.test.ts +0 -222
- package/test/nuxt/AnimatedSection.test.ts +0 -67
- package/test/nuxt/ContactForm.test.ts +0 -207
- package/test/nuxt/FooterContact.test.ts +0 -102
- package/test/nuxt/HeaderRight.test.ts +0 -142
- package/test/nuxt/Hero.test.ts +0 -126
- package/test/nuxt/HomeMenuCategories.test.ts +0 -94
- package/test/nuxt/LoginForm.test.ts +0 -159
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useUser } from "@shopware/composables";
|
|
3
|
-
import type { FormSubmitEvent } from "@nuxt/ui";
|
|
4
3
|
import * as z from "zod";
|
|
5
4
|
|
|
6
5
|
definePageMeta({
|
|
@@ -15,16 +14,8 @@ const { apiClient } = useShopwareContext();
|
|
|
15
14
|
const loading = ref(true);
|
|
16
15
|
const { user, refreshUser, updatePersonalInfo, updateEmail, logout } =
|
|
17
16
|
useUser();
|
|
18
|
-
const toast = useToast();
|
|
19
17
|
const open = ref(false);
|
|
20
18
|
|
|
21
|
-
const schema = z.object({
|
|
22
|
-
email: z.string().email("Keine gültige Emailadresse"),
|
|
23
|
-
firstName: z.string().min(1),
|
|
24
|
-
lastName: z.string().min(1),
|
|
25
|
-
});
|
|
26
|
-
type Schema = z.output<typeof schema>;
|
|
27
|
-
|
|
28
19
|
function initializeFormState() {
|
|
29
20
|
return reactive({
|
|
30
21
|
email: user.value?.email,
|
|
@@ -52,117 +43,188 @@ async function handlePersonalInfoUpdate(firstName: string, lastName: string) {
|
|
|
52
43
|
});
|
|
53
44
|
}
|
|
54
45
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
function showErrorMessage(title: string, description: string) {
|
|
63
|
-
toast.add({
|
|
64
|
-
title,
|
|
65
|
-
description,
|
|
66
|
-
icon: "i-lucide-x",
|
|
67
|
-
color: "error" as const,
|
|
46
|
+
onMounted(async () => {
|
|
47
|
+
await refreshUser();
|
|
48
|
+
Object.assign(state, {
|
|
49
|
+
email: user.value?.email,
|
|
50
|
+
firstName: user.value?.firstName,
|
|
51
|
+
lastName: user.value?.lastName,
|
|
68
52
|
});
|
|
69
|
-
|
|
53
|
+
loading.value = false;
|
|
54
|
+
});
|
|
70
55
|
|
|
71
|
-
|
|
56
|
+
// Validation, result and errors in the page (#445).
|
|
57
|
+
const schema = z.object({
|
|
58
|
+
firstName: z.string().min(1, "Bitte geben Sie Ihren Vornamen an."),
|
|
59
|
+
lastName: z.string().min(1, "Bitte geben Sie Ihren Nachnamen an."),
|
|
60
|
+
email: z.string().email("Bitte geben Sie eine gültige E-Mail-Adresse ein."),
|
|
61
|
+
});
|
|
62
|
+
type Schema = z.output<typeof schema>;
|
|
63
|
+
const errors = ref<Partial<Record<keyof Schema, string>>>({});
|
|
64
|
+
const saveResult = ref<"saved" | "failed" | null>(null);
|
|
65
|
+
const saving = ref(false);
|
|
66
|
+
const deleting = ref(false);
|
|
67
|
+
const deleteFailed = ref(false);
|
|
68
|
+
const resultBox = ref<HTMLElement | null>(null);
|
|
69
|
+
const form = ref<HTMLFormElement | null>(null);
|
|
70
|
+
|
|
71
|
+
async function onSubmit() {
|
|
72
|
+
saveResult.value = null;
|
|
73
|
+
const parsed = schema.safeParse(state);
|
|
74
|
+
if (!parsed.success) {
|
|
75
|
+
const next: typeof errors.value = {};
|
|
76
|
+
for (const issue of parsed.error.issues) {
|
|
77
|
+
const key = issue.path[0] as keyof Schema;
|
|
78
|
+
next[key] ??= issue.message;
|
|
79
|
+
}
|
|
80
|
+
errors.value = next;
|
|
81
|
+
await nextTick();
|
|
82
|
+
form.value?.querySelector<HTMLElement>('[aria-invalid="true"]')?.focus();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
errors.value = {};
|
|
86
|
+
saving.value = true;
|
|
72
87
|
try {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
await handleEmailUpdate(eventData.email);
|
|
77
|
-
await handlePersonalInfoUpdate(eventData.firstName, eventData.lastName);
|
|
88
|
+
await handleEmailUpdate(parsed.data.email);
|
|
89
|
+
await handlePersonalInfoUpdate(parsed.data.firstName, parsed.data.lastName);
|
|
78
90
|
await refreshUser();
|
|
79
|
-
|
|
80
|
-
showSuccessMessage("Erfolgreich gespeichert");
|
|
91
|
+
saveResult.value = "saved";
|
|
81
92
|
} catch (error) {
|
|
82
93
|
console.error("Profile update error:", error);
|
|
83
|
-
|
|
94
|
+
saveResult.value = "failed";
|
|
84
95
|
} finally {
|
|
85
|
-
|
|
96
|
+
saving.value = false;
|
|
86
97
|
}
|
|
98
|
+
await nextTick();
|
|
99
|
+
resultBox.value?.focus();
|
|
87
100
|
}
|
|
88
101
|
|
|
89
|
-
async function
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
title: "Tschüss!",
|
|
93
|
-
icon: "i-lucide-check",
|
|
94
|
-
color: "success" as const,
|
|
95
|
-
});
|
|
96
|
-
await logout();
|
|
97
|
-
navigateTo("/");
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
async function onDeleteProfile() {
|
|
102
|
+
async function onDelete() {
|
|
103
|
+
deleting.value = true;
|
|
104
|
+
deleteFailed.value = false;
|
|
101
105
|
try {
|
|
102
|
-
await
|
|
106
|
+
await apiClient.invoke("deleteCustomer delete /account/customer");
|
|
107
|
+
await logout();
|
|
108
|
+
open.value = false;
|
|
109
|
+
navigateTo("/");
|
|
103
110
|
} catch (error) {
|
|
104
111
|
console.error("Customer delete error:", error);
|
|
105
|
-
|
|
112
|
+
deleteFailed.value = true;
|
|
113
|
+
} finally {
|
|
114
|
+
deleting.value = false;
|
|
106
115
|
}
|
|
107
116
|
}
|
|
108
|
-
|
|
109
|
-
onMounted(async () => {
|
|
110
|
-
await refreshUser();
|
|
111
|
-
loading.value = false;
|
|
112
|
-
});
|
|
113
117
|
</script>
|
|
114
118
|
|
|
115
119
|
<template>
|
|
116
|
-
<
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
@submit="onSubmit"
|
|
128
|
-
@error="(error) => console.log('Form validation error:', error)"
|
|
120
|
+
<div class="font-body text-sb-ink">
|
|
121
|
+
<UserAccountHeader title="Profil" />
|
|
122
|
+
<p v-if="loading" role="status" class="text-sb-ink-muted">
|
|
123
|
+
Profil wird geladen …
|
|
124
|
+
</p>
|
|
125
|
+
<template v-else>
|
|
126
|
+
<form
|
|
127
|
+
ref="form"
|
|
128
|
+
novalidate
|
|
129
|
+
class="flex max-w-xl flex-col gap-4 rounded-sb-card border border-sb-line bg-sb-surface p-6"
|
|
130
|
+
@submit.prevent="onSubmit"
|
|
129
131
|
>
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
132
|
+
<div
|
|
133
|
+
v-if="saveResult"
|
|
134
|
+
ref="resultBox"
|
|
135
|
+
:role="saveResult === 'saved' ? 'status' : 'alert'"
|
|
136
|
+
tabindex="-1"
|
|
137
|
+
:class="[
|
|
138
|
+
'rounded-sb-control p-4 text-sm',
|
|
139
|
+
saveResult === 'saved'
|
|
140
|
+
? 'bg-sb-primary-tint text-sb-primary-ink'
|
|
141
|
+
: 'border-[1.5px] border-sb-danger',
|
|
142
|
+
]"
|
|
143
|
+
>
|
|
144
|
+
<template v-if="saveResult === 'saved'"
|
|
145
|
+
>Ihre Änderungen sind gespeichert.</template
|
|
146
|
+
>
|
|
147
|
+
<template v-else>
|
|
148
|
+
<strong class="block">Speichern fehlgeschlagen.</strong>
|
|
149
|
+
Bitte versuchen Sie es später noch einmal.
|
|
150
|
+
</template>
|
|
142
151
|
</div>
|
|
143
|
-
|
|
144
|
-
|
|
152
|
+
<SbField
|
|
153
|
+
v-slot="{ id, describedBy, invalid }"
|
|
154
|
+
label="Vorname"
|
|
155
|
+
:error="errors.firstName"
|
|
156
|
+
>
|
|
157
|
+
<SbInput
|
|
158
|
+
:id="id"
|
|
159
|
+
v-model="state.firstName"
|
|
160
|
+
name="firstName"
|
|
161
|
+
autocomplete="given-name"
|
|
162
|
+
:aria-describedby="describedBy"
|
|
163
|
+
:invalid="invalid"
|
|
164
|
+
/>
|
|
165
|
+
</SbField>
|
|
166
|
+
<SbField
|
|
167
|
+
v-slot="{ id, describedBy, invalid }"
|
|
168
|
+
label="Nachname"
|
|
169
|
+
:error="errors.lastName"
|
|
170
|
+
>
|
|
171
|
+
<SbInput
|
|
172
|
+
:id="id"
|
|
173
|
+
v-model="state.lastName"
|
|
174
|
+
name="lastName"
|
|
175
|
+
autocomplete="family-name"
|
|
176
|
+
:aria-describedby="describedBy"
|
|
177
|
+
:invalid="invalid"
|
|
178
|
+
/>
|
|
179
|
+
</SbField>
|
|
180
|
+
<SbField
|
|
181
|
+
v-slot="{ id, describedBy, invalid }"
|
|
182
|
+
label="E-Mail"
|
|
183
|
+
:error="errors.email"
|
|
184
|
+
>
|
|
185
|
+
<SbInput
|
|
186
|
+
:id="id"
|
|
187
|
+
v-model="state.email"
|
|
188
|
+
name="email"
|
|
189
|
+
type="email"
|
|
190
|
+
autocomplete="email"
|
|
191
|
+
:aria-describedby="describedBy"
|
|
192
|
+
:invalid="invalid"
|
|
193
|
+
/>
|
|
194
|
+
</SbField>
|
|
195
|
+
<SbButton type="submit" size="lg" :loading="saving" class="self-start"
|
|
196
|
+
>Speichern</SbButton
|
|
197
|
+
>
|
|
198
|
+
</form>
|
|
199
|
+
<section
|
|
200
|
+
aria-labelledby="konto-loeschen"
|
|
201
|
+
class="mt-10 flex max-w-xl flex-col items-start gap-3 border-t border-sb-line pt-6"
|
|
202
|
+
>
|
|
203
|
+
<h2 id="konto-loeschen" class="font-display text-xl">
|
|
204
|
+
Kundenkonto löschen
|
|
205
|
+
</h2>
|
|
206
|
+
<p class="text-sb-ink-muted">
|
|
207
|
+
Löscht Ihr Kundenkonto mit Adressen und Merkliste. Bestellungen
|
|
208
|
+
bleiben für die gesetzliche Aufbewahrung gespeichert.
|
|
209
|
+
</p>
|
|
210
|
+
<SbButton variant="secondary" @click="open = true"
|
|
211
|
+
>Konto löschen</SbButton
|
|
212
|
+
>
|
|
213
|
+
</section>
|
|
214
|
+
<SbConfirmDialog
|
|
215
|
+
v-if="open"
|
|
145
216
|
v-model:open="open"
|
|
146
|
-
title="
|
|
147
|
-
description="
|
|
148
|
-
|
|
217
|
+
title="Kundenkonto löschen?"
|
|
218
|
+
description="Das lässt sich nicht rückgängig machen. Sie werden danach abgemeldet."
|
|
219
|
+
confirm-label="Endgültig löschen"
|
|
220
|
+
:loading="deleting"
|
|
221
|
+
@confirm="onDelete"
|
|
149
222
|
>
|
|
150
|
-
<
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
<UButton
|
|
158
|
-
label="Abbrechen"
|
|
159
|
-
color="neutral"
|
|
160
|
-
variant="outline"
|
|
161
|
-
@click="close"
|
|
162
|
-
/>
|
|
163
|
-
<UButton label="Löschen" color="error" @click="onDeleteProfile" />
|
|
164
|
-
</template>
|
|
165
|
-
</UModal>
|
|
166
|
-
</UPageBody>
|
|
167
|
-
</UContainer>
|
|
223
|
+
<p v-if="deleteFailed" role="alert" class="text-sm font-semibold">
|
|
224
|
+
Das Konto konnte nicht gelöscht werden. Bitte versuchen Sie es später
|
|
225
|
+
noch einmal.
|
|
226
|
+
</p>
|
|
227
|
+
</SbConfirmDialog>
|
|
228
|
+
</template>
|
|
229
|
+
</div>
|
|
168
230
|
</template>
|
|
@@ -5,12 +5,14 @@ useSeoMeta({
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<template>
|
|
8
|
-
<div
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
<div
|
|
9
|
+
class="flex min-h-[60vh] items-center justify-center p-6 font-body text-sb-ink"
|
|
10
|
+
>
|
|
11
|
+
<div class="flex max-w-xl flex-col gap-3 text-center">
|
|
12
|
+
<h1 class="font-display text-4xl leading-tight">Gleich wieder da</h1>
|
|
13
|
+
<p class="text-lg text-sb-ink-muted">
|
|
14
|
+
Der Shop ist vorübergehend nicht erreichbar. Bitte versuchen Sie es in
|
|
15
|
+
ein paar Minuten noch einmal.
|
|
14
16
|
</p>
|
|
15
17
|
</div>
|
|
16
18
|
</div>
|
package/app/pages/merkliste.vue
CHANGED
|
@@ -5,13 +5,12 @@ useSeoMeta({
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
description="Verwalte deine Lieblingsprodukte."
|
|
12
|
-
icon="i-lucide-heart"
|
|
8
|
+
<div class="mx-auto w-full max-w-3xl px-4 pt-8 pb-16 sm:px-6 sm:pt-12">
|
|
9
|
+
<h1
|
|
10
|
+
class="mb-6 font-display text-4xl leading-tight text-sb-ink sm:text-5xl"
|
|
13
11
|
>
|
|
14
|
-
|
|
15
|
-
</
|
|
16
|
-
|
|
12
|
+
Merkliste
|
|
13
|
+
</h1>
|
|
14
|
+
<Wishlist :show-menu-button="true" />
|
|
15
|
+
</div>
|
|
17
16
|
</template>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import type { FormSubmitEvent } from "@nuxt/ui";
|
|
4
3
|
|
|
5
4
|
useHead({
|
|
6
5
|
title: "Passwort vergessen",
|
|
@@ -10,95 +9,113 @@ useHead({
|
|
|
10
9
|
],
|
|
11
10
|
});
|
|
12
11
|
|
|
13
|
-
// Constants
|
|
14
|
-
const SUCCESS_TOAST_CONFIG = {
|
|
15
|
-
title: "Erfolgreich abgesendet!",
|
|
16
|
-
description: "Bitte überprüfen Sie Ihre Postfach.",
|
|
17
|
-
icon: "i-lucide-check",
|
|
18
|
-
color: "success" as const,
|
|
19
|
-
duration: 0,
|
|
20
|
-
close: true,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const ERROR_TOAST_CONFIG = {
|
|
24
|
-
title: "Fehler beim Senden",
|
|
25
|
-
icon: "i-lucide-x",
|
|
26
|
-
description: "Bitte versuchen Sie es später erneut.",
|
|
27
|
-
color: "error" as const,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
12
|
const { apiClient } = useShopwareContext();
|
|
31
|
-
const toast = useToast();
|
|
32
13
|
|
|
33
14
|
const schema = z.object({
|
|
34
15
|
email: z.string().email("Ungültige E-Mail-Adresse"),
|
|
35
16
|
});
|
|
36
17
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
placeholder: "Email-Adresse eingeben",
|
|
45
|
-
required: true,
|
|
46
|
-
},
|
|
47
|
-
];
|
|
48
|
-
|
|
49
|
-
// Extract toast creation functions
|
|
50
|
-
function showSuccessToast(): void {
|
|
51
|
-
toast.add(SUCCESS_TOAST_CONFIG);
|
|
18
|
+
async function sendRecoveryMail(email: string) {
|
|
19
|
+
await apiClient.invoke("sendRecoveryMail post /account/recovery-password", {
|
|
20
|
+
body: {
|
|
21
|
+
email,
|
|
22
|
+
storefrontUrl: useRuntimeConfig().public.storeUrl,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
52
25
|
}
|
|
53
26
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
27
|
+
// Errors and the result show in the form (#445).
|
|
28
|
+
const email = ref("");
|
|
29
|
+
const emailError = ref<string>();
|
|
30
|
+
const result = ref<"sent" | "failed" | null>(null);
|
|
31
|
+
const sending = ref(false);
|
|
32
|
+
const resultBox = ref<HTMLElement | null>(null);
|
|
57
33
|
|
|
58
|
-
async function
|
|
34
|
+
async function onSubmit() {
|
|
35
|
+
result.value = null;
|
|
36
|
+
const parsed = schema.safeParse({ email: email.value });
|
|
37
|
+
if (!parsed.success) {
|
|
38
|
+
emailError.value = "Bitte geben Sie eine gültige E-Mail-Adresse ein.";
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
emailError.value = undefined;
|
|
42
|
+
sending.value = true;
|
|
59
43
|
try {
|
|
60
|
-
await
|
|
61
|
-
|
|
62
|
-
email: payload.data.email,
|
|
63
|
-
storefrontUrl: useRuntimeConfig().public.storeUrl,
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
showSuccessToast();
|
|
44
|
+
await sendRecoveryMail(parsed.data.email);
|
|
45
|
+
result.value = "sent";
|
|
67
46
|
} catch (error) {
|
|
68
|
-
showErrorToast();
|
|
69
47
|
console.error("Password recovery error:", error);
|
|
48
|
+
result.value = "failed";
|
|
49
|
+
} finally {
|
|
50
|
+
sending.value = false;
|
|
70
51
|
}
|
|
52
|
+
await nextTick();
|
|
53
|
+
resultBox.value?.focus();
|
|
71
54
|
}
|
|
72
55
|
</script>
|
|
73
56
|
<template>
|
|
74
|
-
<
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
57
|
+
<UserAuthPanel title="Passwort vergessen">
|
|
58
|
+
<template #intro>
|
|
59
|
+
<p>
|
|
60
|
+
Geben Sie die E-Mail-Adresse Ihres Kundenkontos ein. Gibt es dazu ein
|
|
61
|
+
Konto, bekommen Sie in den nächsten Minuten eine E-Mail mit einem Link
|
|
62
|
+
für ein neues Passwort.
|
|
63
|
+
</p>
|
|
64
|
+
</template>
|
|
65
|
+
<div
|
|
66
|
+
v-if="result === 'sent'"
|
|
67
|
+
ref="resultBox"
|
|
68
|
+
role="status"
|
|
69
|
+
tabindex="-1"
|
|
70
|
+
class="flex flex-col gap-2"
|
|
71
|
+
>
|
|
72
|
+
<strong>E-Mail ist unterwegs</strong>
|
|
73
|
+
<p>
|
|
74
|
+
Bitte schauen Sie in Ihr Postfach, auch in den Spam-Ordner. Der Link ist
|
|
75
|
+
nur begrenzt gültig.
|
|
76
|
+
</p>
|
|
77
|
+
</div>
|
|
78
|
+
<form
|
|
79
|
+
v-else
|
|
80
|
+
novalidate
|
|
81
|
+
class="flex flex-col gap-4"
|
|
82
|
+
@submit.prevent="onSubmit"
|
|
84
83
|
>
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
</
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
84
|
+
<div
|
|
85
|
+
v-if="result === 'failed'"
|
|
86
|
+
ref="resultBox"
|
|
87
|
+
role="alert"
|
|
88
|
+
tabindex="-1"
|
|
89
|
+
class="rounded-sb-control border-[1.5px] border-sb-danger p-4 text-sm"
|
|
90
|
+
>
|
|
91
|
+
<strong class="block">Die E-Mail konnte nicht gesendet werden.</strong>
|
|
92
|
+
Bitte versuchen Sie es später noch einmal.
|
|
93
|
+
</div>
|
|
94
|
+
<SbField
|
|
95
|
+
v-slot="{ id, describedBy, invalid }"
|
|
96
|
+
label="E-Mail"
|
|
97
|
+
:error="emailError"
|
|
98
|
+
>
|
|
99
|
+
<SbInput
|
|
100
|
+
:id="id"
|
|
101
|
+
v-model="email"
|
|
102
|
+
name="email"
|
|
103
|
+
type="email"
|
|
104
|
+
autocomplete="email"
|
|
105
|
+
:aria-describedby="describedBy"
|
|
106
|
+
:invalid="invalid"
|
|
107
|
+
/>
|
|
108
|
+
</SbField>
|
|
109
|
+
<SbButton type="submit" size="lg" block :loading="sending"
|
|
110
|
+
>Link senden</SbButton
|
|
111
|
+
>
|
|
112
|
+
</form>
|
|
113
|
+
<template #footer>
|
|
114
|
+
<NuxtLink
|
|
115
|
+
to="/anmelden"
|
|
116
|
+
class="font-semibold text-sb-primary-ink underline underline-offset-4"
|
|
117
|
+
>Zurück zur Anmeldung</NuxtLink
|
|
118
|
+
>
|
|
119
|
+
</template>
|
|
120
|
+
</UserAuthPanel>
|
|
104
121
|
</template>
|
|
@@ -6,7 +6,6 @@ useSeoMeta({
|
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
const route = useRoute();
|
|
9
|
-
const toast = useToast();
|
|
10
9
|
|
|
11
10
|
const { apiClient } = useShopwareContext();
|
|
12
11
|
const { refreshSessionContext } = useSessionContext();
|
|
@@ -17,19 +16,15 @@ type ConfirmError = "invalid" | "already-confirmed";
|
|
|
17
16
|
|
|
18
17
|
const error = ref<ConfirmError | null>(null);
|
|
19
18
|
|
|
20
|
-
const
|
|
21
|
-
ConfirmError,
|
|
22
|
-
{ title: string; description: string }
|
|
23
|
-
> = {
|
|
19
|
+
const messages: Record<ConfirmError, { title: string; description: string }> = {
|
|
24
20
|
invalid: {
|
|
25
21
|
title: "Bestätigung fehlgeschlagen",
|
|
26
22
|
description:
|
|
27
|
-
"Der Bestätigungslink ist ungültig oder unvollständig. Bitte
|
|
23
|
+
"Der Bestätigungslink ist ungültig oder unvollständig. Bitte öffnen Sie den Link aus der E-Mail noch einmal oder schreiben Sie uns.",
|
|
28
24
|
},
|
|
29
25
|
"already-confirmed": {
|
|
30
26
|
title: "Konto bereits bestätigt",
|
|
31
|
-
description:
|
|
32
|
-
"Dein Konto ist schon bestätigt. Du kannst dich jetzt anmelden.",
|
|
27
|
+
description: "Ihr Konto ist schon bestätigt. Sie können sich anmelden.",
|
|
33
28
|
},
|
|
34
29
|
};
|
|
35
30
|
|
|
@@ -67,11 +62,6 @@ async function confirmRegistration() {
|
|
|
67
62
|
await refreshSessionContext();
|
|
68
63
|
refreshCart();
|
|
69
64
|
mergeWishlistProducts();
|
|
70
|
-
toast.add({
|
|
71
|
-
title: "Bestätigung erfolgreich!",
|
|
72
|
-
description: "Willkommen, dein Konto ist jetzt aktiv.",
|
|
73
|
-
color: "success",
|
|
74
|
-
});
|
|
75
65
|
await navigateTo({ path: "/konto" });
|
|
76
66
|
}
|
|
77
67
|
|
|
@@ -81,41 +71,23 @@ confirmRegistration();
|
|
|
81
71
|
</script>
|
|
82
72
|
|
|
83
73
|
<template>
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
74
|
+
<UserAuthPanel title="Registrierung bestätigen">
|
|
75
|
+
<p v-if="!error" role="status">Registrierung wird bestätigt …</p>
|
|
76
|
+
<div
|
|
77
|
+
v-else
|
|
78
|
+
:role="error === 'invalid' ? 'alert' : 'status'"
|
|
79
|
+
class="flex flex-col items-start gap-4"
|
|
80
|
+
>
|
|
81
|
+
<p>
|
|
82
|
+
<strong class="block">{{ messages[error].title }}</strong>
|
|
83
|
+
{{ messages[error].description }}
|
|
84
|
+
</p>
|
|
85
|
+
<div class="flex flex-wrap gap-3">
|
|
86
|
+
<SbButton to="/anmelden">Zur Anmeldung</SbButton>
|
|
87
|
+
<SbButton v-if="error === 'invalid'" variant="secondary" to="/kontakt"
|
|
88
|
+
>Kontakt</SbButton
|
|
89
|
+
>
|
|
93
90
|
</div>
|
|
94
|
-
<UAlert
|
|
95
|
-
v-else
|
|
96
|
-
:color="error === 'already-confirmed' ? 'info' : 'error'"
|
|
97
|
-
variant="subtle"
|
|
98
|
-
:icon="
|
|
99
|
-
error === 'already-confirmed'
|
|
100
|
-
? 'i-lucide-circle-check'
|
|
101
|
-
: 'i-lucide-circle-alert'
|
|
102
|
-
"
|
|
103
|
-
:title="errorMessages[error].title"
|
|
104
|
-
:description="errorMessages[error].description"
|
|
105
|
-
:actions="[
|
|
106
|
-
{ label: 'Zur Anmeldung', to: '/anmelden', color: 'neutral' },
|
|
107
|
-
...(error === 'invalid'
|
|
108
|
-
? [
|
|
109
|
-
{
|
|
110
|
-
label: 'Kontakt',
|
|
111
|
-
to: '/kontakt',
|
|
112
|
-
color: 'neutral' as const,
|
|
113
|
-
variant: 'outline' as const,
|
|
114
|
-
},
|
|
115
|
-
]
|
|
116
|
-
: []),
|
|
117
|
-
]"
|
|
118
|
-
/>
|
|
119
91
|
</div>
|
|
120
|
-
</
|
|
92
|
+
</UserAuthPanel>
|
|
121
93
|
</template>
|
|
@@ -33,15 +33,24 @@ function onRegistrationSuccess(
|
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
35
|
<template>
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
<UserAuthPanel title="Registrieren" wide>
|
|
37
|
+
<template #intro>
|
|
38
|
+
<p>
|
|
39
|
+
Mit einem Kundenkonto bestellen Sie schneller, Ihre Adressen sind
|
|
40
|
+
gespeichert.
|
|
41
|
+
</p>
|
|
42
|
+
</template>
|
|
42
43
|
<UserRegistrationForm
|
|
43
44
|
:allow-guest="false"
|
|
44
45
|
@registration-success="onRegistrationSuccess"
|
|
45
46
|
/>
|
|
46
|
-
|
|
47
|
+
<template #footer>
|
|
48
|
+
Schon registriert?
|
|
49
|
+
<NuxtLink
|
|
50
|
+
to="/anmelden"
|
|
51
|
+
class="font-semibold text-sb-primary-ink underline underline-offset-4"
|
|
52
|
+
>Anmelden</NuxtLink
|
|
53
|
+
>
|
|
54
|
+
</template>
|
|
55
|
+
</UserAuthPanel>
|
|
47
56
|
</template>
|