@shopbite-de/storefront 1.31.3 → 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/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/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 +3 -0
- 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/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
|
@@ -44,37 +44,40 @@ async function handleAddressUpdate() {
|
|
|
44
44
|
onMounted(() => {
|
|
45
45
|
refreshUserAddresses();
|
|
46
46
|
});
|
|
47
|
+
|
|
48
|
+
// Presets: plain text in the checkout section instead of a card (#443).
|
|
47
49
|
</script>
|
|
48
50
|
|
|
49
51
|
<template>
|
|
50
|
-
<
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
:decorative="true"
|
|
71
|
-
label="Rechnungsadresse"
|
|
72
|
-
/>
|
|
73
|
-
<AddressDetail
|
|
52
|
+
<div class="flex flex-col gap-4 font-body text-sb-ink">
|
|
53
|
+
<p>
|
|
54
|
+
<strong class="block">{{ fullName }}</strong>
|
|
55
|
+
<span class="text-sb-ink-muted">{{ user?.email }}</span>
|
|
56
|
+
</p>
|
|
57
|
+
<div class="flex flex-col gap-2 border-t border-sb-line pt-4">
|
|
58
|
+
<h3 class="text-sm font-bold">
|
|
59
|
+
{{
|
|
60
|
+
areAddressesDifferent
|
|
61
|
+
? "Lieferadresse"
|
|
62
|
+
: "Liefer- und Rechnungsadresse"
|
|
63
|
+
}}
|
|
64
|
+
</h3>
|
|
65
|
+
<AddressDetail
|
|
66
|
+
:address="userDefaultShippingAddress"
|
|
67
|
+
:with-edit-button="withEditButton"
|
|
68
|
+
@update:address="handleAddressUpdate"
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
<div
|
|
74
72
|
v-if="areAddressesDifferent"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
class="flex flex-col gap-2 border-t border-sb-line pt-4"
|
|
74
|
+
>
|
|
75
|
+
<h3 class="text-sm font-bold">Rechnungsadresse</h3>
|
|
76
|
+
<AddressDetail
|
|
77
|
+
:address="userDefaultBillingAddress"
|
|
78
|
+
:with-edit-button="withEditButton"
|
|
79
|
+
@update:address="handleAddressUpdate"
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
80
83
|
</template>
|
|
@@ -1,123 +1,117 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { ApiClientError } from "@shopware/api-client";
|
|
4
|
-
import type { FormSubmitEvent } from "@nuxt/ui";
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Login of the presets (#443), same checks and call as User/LoginForm.vue
|
|
7
|
+
* with the base components; errors show at the fields and above the form.
|
|
8
|
+
*/
|
|
9
|
+
const emit = defineEmits<{ "login-success": [email: string] }>();
|
|
8
10
|
|
|
9
|
-
const
|
|
10
|
-
defineProps<{
|
|
11
|
-
title?: string;
|
|
12
|
-
icon?: string;
|
|
13
|
-
withRegisterHint?: boolean;
|
|
14
|
-
}>(),
|
|
15
|
-
{
|
|
16
|
-
title: "",
|
|
17
|
-
icon: "",
|
|
18
|
-
withRegisterHint: false,
|
|
19
|
-
},
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
const emit = defineEmits<{
|
|
23
|
-
"login-success": [data: string];
|
|
24
|
-
}>();
|
|
25
|
-
|
|
26
|
-
const { title, icon } = toRefs(props);
|
|
27
|
-
|
|
28
|
-
if (isLoggedIn.value) {
|
|
29
|
-
navigateTo({ path: "/konto" });
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const fields = [
|
|
33
|
-
{
|
|
34
|
-
name: "email",
|
|
35
|
-
type: "text" as const,
|
|
36
|
-
label: "Email",
|
|
37
|
-
placeholder: "Email-Adresse eingeben",
|
|
38
|
-
required: true,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: "password",
|
|
42
|
-
label: "Passwort",
|
|
43
|
-
type: "password" as const,
|
|
44
|
-
placeholder: "Passwort eingeben",
|
|
45
|
-
required: true,
|
|
46
|
-
},
|
|
47
|
-
];
|
|
11
|
+
const { login } = useUser();
|
|
48
12
|
|
|
49
13
|
const schema = z.object({
|
|
50
|
-
email: z.string().email("
|
|
51
|
-
password: z.string().min(8, "
|
|
14
|
+
email: z.string().email("Bitte geben Sie eine gültige E-Mail-Adresse ein."),
|
|
15
|
+
password: z.string().min(8, "Das Passwort hat mindestens 8 Zeichen."),
|
|
52
16
|
});
|
|
53
17
|
|
|
54
|
-
|
|
18
|
+
const state = reactive({ email: "", password: "" });
|
|
19
|
+
const errors = ref<Partial<Record<"email" | "password", string>>>({});
|
|
20
|
+
const loginError = ref<string | null>(null);
|
|
21
|
+
const submitting = ref(false);
|
|
22
|
+
const alertBox = ref<HTMLElement | null>(null);
|
|
55
23
|
|
|
56
|
-
async function onSubmit(
|
|
24
|
+
async function onSubmit() {
|
|
25
|
+
loginError.value = null;
|
|
26
|
+
const result = schema.safeParse(state);
|
|
27
|
+
if (!result.success) {
|
|
28
|
+
const next: typeof errors.value = {};
|
|
29
|
+
for (const issue of result.error.issues) {
|
|
30
|
+
const key = issue.path[0] as "email" | "password";
|
|
31
|
+
next[key] ??= issue.message;
|
|
32
|
+
}
|
|
33
|
+
errors.value = next;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
errors.value = {};
|
|
37
|
+
submitting.value = true;
|
|
57
38
|
try {
|
|
58
|
-
await login({
|
|
59
|
-
|
|
60
|
-
password: payload.data.password,
|
|
61
|
-
});
|
|
62
|
-
toast.add({
|
|
63
|
-
title:
|
|
64
|
-
"Hallo " + user.value?.firstName + " " + user.value?.lastName + "!",
|
|
65
|
-
description: "Erfolgreich angemeldet.",
|
|
66
|
-
color: "success",
|
|
67
|
-
});
|
|
68
|
-
emit("login-success", payload.data.email);
|
|
39
|
+
await login({ username: state.email, password: state.password });
|
|
40
|
+
emit("login-success", state.email);
|
|
69
41
|
} catch (error) {
|
|
70
42
|
console.error("Login failed:", error);
|
|
71
|
-
let
|
|
43
|
+
let message = "Bitte überprüfen Sie Ihre Zugangsdaten.";
|
|
72
44
|
if (error instanceof ApiClientError) {
|
|
73
|
-
const
|
|
74
|
-
if (Array.isArray(
|
|
75
|
-
|
|
76
|
-
.map((
|
|
45
|
+
const details = error.details?.errors;
|
|
46
|
+
if (Array.isArray(details) && details.length > 0) {
|
|
47
|
+
message = details
|
|
48
|
+
.map((detail) => detail.detail || detail.title)
|
|
77
49
|
.filter(Boolean)
|
|
78
50
|
.join("\n");
|
|
79
51
|
}
|
|
80
52
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
53
|
+
loginError.value = message;
|
|
54
|
+
await nextTick();
|
|
55
|
+
alertBox.value?.focus();
|
|
56
|
+
} finally {
|
|
57
|
+
submitting.value = false;
|
|
86
58
|
}
|
|
87
59
|
}
|
|
88
60
|
</script>
|
|
89
61
|
|
|
90
62
|
<template>
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
:fields="fields"
|
|
96
|
-
:submit="{
|
|
97
|
-
label: 'Anmelden',
|
|
98
|
-
}"
|
|
99
|
-
@submit="onSubmit"
|
|
63
|
+
<form
|
|
64
|
+
novalidate
|
|
65
|
+
class="flex flex-col gap-4 font-body text-sb-ink"
|
|
66
|
+
@submit.prevent="onSubmit"
|
|
100
67
|
>
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
68
|
+
<div
|
|
69
|
+
v-if="loginError"
|
|
70
|
+
ref="alertBox"
|
|
71
|
+
role="alert"
|
|
72
|
+
tabindex="-1"
|
|
73
|
+
class="rounded-sb-control border-[1.5px] border-sb-danger p-4 text-sm whitespace-pre-line"
|
|
74
|
+
>
|
|
75
|
+
<strong class="block text-base">Anmeldung fehlgeschlagen</strong>
|
|
76
|
+
{{ loginError }}
|
|
77
|
+
</div>
|
|
78
|
+
<SbField
|
|
79
|
+
v-slot="{ id, describedBy, invalid }"
|
|
80
|
+
label="E-Mail"
|
|
81
|
+
:error="errors.email"
|
|
82
|
+
>
|
|
83
|
+
<SbInput
|
|
84
|
+
:id="id"
|
|
85
|
+
v-model="state.email"
|
|
86
|
+
name="email"
|
|
87
|
+
type="email"
|
|
88
|
+
autocomplete="username"
|
|
89
|
+
:aria-describedby="describedBy"
|
|
90
|
+
:invalid="invalid"
|
|
91
|
+
/>
|
|
92
|
+
</SbField>
|
|
93
|
+
<SbField
|
|
94
|
+
v-slot="{ id, describedBy, invalid }"
|
|
95
|
+
label="Passwort"
|
|
96
|
+
:error="errors.password"
|
|
97
|
+
>
|
|
98
|
+
<SbInput
|
|
99
|
+
:id="id"
|
|
100
|
+
v-model="state.password"
|
|
101
|
+
name="password"
|
|
102
|
+
type="password"
|
|
103
|
+
autocomplete="current-password"
|
|
104
|
+
:aria-describedby="describedBy"
|
|
105
|
+
:invalid="invalid"
|
|
106
|
+
/>
|
|
107
|
+
</SbField>
|
|
108
|
+
<NuxtLink
|
|
109
|
+
to="/passwort-vergessen"
|
|
110
|
+
class="inline-flex min-h-11 items-center self-start text-sm font-semibold text-sb-primary-ink underline underline-offset-4 focus-visible:outline-3 focus-visible:outline-sb-focus"
|
|
111
|
+
>Passwort vergessen?</NuxtLink
|
|
112
|
+
>
|
|
113
|
+
<SbButton type="submit" size="lg" block :loading="submitting"
|
|
114
|
+
>Anmelden</SbButton
|
|
115
|
+
>
|
|
116
|
+
</form>
|
|
123
117
|
</template>
|