@revenexx/cover 0.22.0 → 0.23.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/app/api/categories.ts +1 -0
- package/app/api/offers.ts +1 -0
- package/app/app.config.ts +13 -0
- package/app/components/OgImage/CoverPage.takumi.vue +37 -0
- package/app/components/RevenexxForm.vue +21 -6
- package/app/components/account/approvals/AccountPendingApprovals.vue +19 -1
- package/app/components/account/approvals/AccountPendingOrderDetail.vue +3 -0
- package/app/components/account/carts/AccountCartsTable.vue +11 -1
- package/app/components/account/orderlists/AccountOrderListDetail.vue +32 -3
- package/app/components/account/organization/AccountOrganization.vue +1 -1
- package/app/components/auth/AuthForgotPasswordPanel.vue +7 -2
- package/app/components/auth/AuthLoginPanel.vue +23 -8
- package/app/components/auth/AuthRegisterTeaser.vue +1 -1
- package/app/components/cart/position/CartPosition.vue +11 -4
- package/app/components/cart/quickadd/CartQuickAdd.vue +4 -2
- package/app/components/cart/recommend/CartRecommendCard.vue +1 -0
- package/app/components/cart/switcher/CartSwitcher.vue +1 -0
- package/app/components/cart/view/CartListHeader.vue +5 -0
- package/app/components/cart/view/CartSummaryPanel.vue +20 -8
- package/app/components/cart/view/CartView.vue +4 -2
- package/app/components/checkout/onepage/CheckoutGate.vue +4 -2
- package/app/components/checkout/onepage/CheckoutGuestDetailsSection.vue +2 -1
- package/app/components/checkout/onepage/CheckoutPaymentSection.vue +1 -1
- package/app/components/checkout/onepage/CheckoutSummarySection.vue +8 -0
- package/app/components/checkout/return/CheckoutPaymentReturn.vue +7 -0
- package/app/components/layout/footer/Footer.vue +21 -4
- package/app/components/layout/header/AppBar.vue +5 -2
- package/app/components/layout/header/LocaleSwitcher.vue +7 -9
- package/app/components/layout/header/MobileMenu.vue +4 -1
- package/app/components/product/detail/ProductDetailAddToCart.vue +17 -11
- package/app/components/product/detail/ProductDetailImageGallery.vue +101 -8
- package/app/components/product/detail/ProductDetailVariantRow.vue +84 -4
- package/app/components/product/detail/ProductDetailVariants.vue +75 -11
- package/app/components/product/detail/ProductDetailView.vue +64 -69
- package/app/components/punchout/action/PunchoutTransferAction.vue +4 -3
- package/app/composables/useAuthStore.ts +21 -4
- package/app/composables/useCategories.ts +24 -0
- package/app/composables/useCategoryAnswer.ts +30 -0
- package/app/composables/useCategorySeo.ts +62 -0
- package/app/composables/useDefaultUiLanguage.ts +14 -0
- package/app/composables/useOgImageReady.ts +16 -0
- package/app/composables/useProductAnswer.ts +121 -0
- package/app/composables/useProductLocales.ts +21 -10
- package/app/composables/useProductSeo.ts +145 -0
- package/app/composables/usePunchoutVisit.ts +36 -1
- package/app/composables/useRouteSubject.ts +23 -3
- package/app/composables/useSeoContext.ts +164 -0
- package/app/composables/useSeoHead.ts +189 -0
- package/app/composables/useSeoRules.ts +23 -0
- package/app/interfaces/punchout.ts +11 -0
- package/app/interfaces/seo.ts +48 -0
- package/app/layouts/default.vue +2 -8
- package/app/layouts/focus.vue +3 -1
- package/app/middleware/punchout-exits.global.ts +25 -0
- package/app/payments/psp/novalnet.ts +25 -3
- package/app/payments/psp/novalnetStyle.ts +186 -0
- package/app/plugins/punchout-links.client.ts +46 -0
- package/app/shared/categoryTree.ts +7 -0
- package/app/shared/locale.ts +8 -0
- package/app/shared/productLocales.ts +62 -1
- package/app/shared/punchoutExits.ts +156 -0
- package/app/shared/seoRules.ts +297 -0
- package/app/shared/structuredData.ts +104 -0
- package/i18n/locales/de/account.json +4 -0
- package/i18n/locales/de/common.json +6 -0
- package/i18n/locales/de/pages.json +109 -0
- package/i18n/locales/de/punchout.json +3 -0
- package/i18n/locales/en/account.json +4 -0
- package/i18n/locales/en/common.json +6 -0
- package/i18n/locales/en/pages.json +109 -0
- package/i18n/locales/en/punchout.json +3 -0
- package/nuxt.config.ts +140 -1
- package/package.json +10 -3
- package/server/api/auth/otp.post.ts +4 -8
- package/server/api/auth/otp.put.ts +20 -11
- package/server/api/categories/[slug]/exists.get.ts +28 -0
- package/server/api/offers/guest.get.ts +53 -0
- package/server/api/orders/index.post.ts +18 -11
- package/server/api/payment/methods.post.ts +2 -33
- package/server/api/product/[id]/locales.get.ts +9 -3
- package/server/data/product-detail.json +0 -20
- package/server/dev/errorHandler.ts +9 -5
- package/server/dev/typesense/autoSeed.ts +63 -0
- package/server/dev/typesense/seed.ts +4 -43
- package/server/dev/typesense/seedProducts.ts +87 -0
- package/server/interfaces/category.ts +5 -0
- package/server/interfaces/product.ts +13 -6
- package/server/interfaces/punchout.ts +20 -1
- package/server/middleware/missing-media.ts +2 -2
- package/server/middleware/punchout-exits.ts +45 -0
- package/server/middleware/punchout-visit-csp.ts +35 -0
- package/server/plugins/previewHostNoindex.ts +21 -0
- package/server/plugins/punchout-cookies.ts +48 -0
- package/server/plugins/seoSiteConfig.ts +62 -0
- package/server/routes/punchout/start.get.ts +7 -0
- package/server/routes/robots.txt.ts +21 -0
- package/server/services/ApiCategoryService.ts +6 -0
- package/server/services/ApiProductService.ts +2 -2
- package/server/services/LocalFileCategoryService.ts +6 -0
- package/server/utils/liveCatalog.ts +83 -18
- package/server/utils/livePrices.ts +12 -3
- package/server/utils/locale.ts +3 -8
- package/server/utils/offerService.ts +8 -3
- package/server/utils/paymentOptions.ts +49 -0
- package/server/utils/promotionsService.ts +25 -0
- package/server/utils/punchoutFrame.ts +131 -0
- package/server/utils/punchoutOrder.ts +40 -0
- package/server/utils/punchoutVisit.ts +41 -8
- package/server/utils/revenexxSdk.ts +7 -1
- package/server/utils/seoRequestHost.ts +21 -0
- package/server/utils/storefrontMessages.ts +5 -5
- package/server/utils/storefrontSeoRules.ts +298 -0
- package/server/middleware/punchout-hand-back-csp.ts +0 -17
package/app/api/categories.ts
CHANGED
package/app/api/offers.ts
CHANGED
package/app/app.config.ts
CHANGED
|
@@ -50,6 +50,10 @@ export default defineAppConfig({
|
|
|
50
50
|
// through transpose and merged over the theme's locale files. Mock reads
|
|
51
51
|
// nothing, so the demo shows the theme's texts; a theme switches it to "api".
|
|
52
52
|
translationsService: "mock",
|
|
53
|
+
// The domain's SEO rules from the seo service (PE-1235): canonical, robots,
|
|
54
|
+
// hreflang, title patterns. Mock reads nothing and applies the service's
|
|
55
|
+
// defaults for the host; a theme switches it to "api".
|
|
56
|
+
seoService: "mock",
|
|
53
57
|
// The marketing apps (RAD-293): the newsletter confirmation and preference
|
|
54
58
|
// centre (marketing-consents), the review form (reviews), the loyalty page
|
|
55
59
|
// and perk hint (loyalty), audiences for personalised content and campaign
|
|
@@ -171,5 +175,14 @@ export default defineAppConfig({
|
|
|
171
175
|
// the write itself; the shop reads it and offers accordingly.
|
|
172
176
|
ui: {
|
|
173
177
|
icons: nuxtUiIcons(DEFAULT_ICON_WEIGHT),
|
|
178
|
+
// Breadcrumb links are 20 px tall text. Below lg each gets an invisible
|
|
179
|
+
// 44 px tap area (PO-23 touch-target rule); the row itself keeps its
|
|
180
|
+
// height, so nothing moves. Desktop is pointer-driven and stays as is.
|
|
181
|
+
breadcrumb: {
|
|
182
|
+
slots: {
|
|
183
|
+
link: "relative max-lg:after:absolute max-lg:after:inset-x-0 "
|
|
184
|
+
+ "max-lg:after:top-[calc((100%_-_2.75rem)/2)] max-lg:after:bottom-[calc((100%_-_2.75rem)/2)]",
|
|
185
|
+
},
|
|
186
|
+
},
|
|
174
187
|
},
|
|
175
188
|
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* The link preview card of a page without a picture of its own (PE-1237):
|
|
4
|
+
* the site's name and what kind of page it is. nuxt-og-image renders it to a
|
|
5
|
+
* PNG with Takumi; `components/OgImage/` and the `.takumi` suffix are the
|
|
6
|
+
* module's convention. Every value comes in through the props, which are part
|
|
7
|
+
* of the image URL — so a cached image can never be another tenant's.
|
|
8
|
+
*/
|
|
9
|
+
const { site = "Cover", label = "" } = defineProps<{ site?: string; label?: string }>();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div
|
|
14
|
+
class="w-full h-full flex flex-col justify-between bg-white"
|
|
15
|
+
style="padding: 80px; color: #0f172a;"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
class="flex"
|
|
19
|
+
style="width: 120px; height: 8px; background: #0f172a;"
|
|
20
|
+
/>
|
|
21
|
+
<div class="flex flex-col">
|
|
22
|
+
<div
|
|
23
|
+
class="flex font-bold"
|
|
24
|
+
style="font-size: 76px; line-height: 1.1;"
|
|
25
|
+
>
|
|
26
|
+
{{ site }}
|
|
27
|
+
</div>
|
|
28
|
+
<div
|
|
29
|
+
v-if="label"
|
|
30
|
+
class="flex"
|
|
31
|
+
style="font-size: 40px; margin-top: 24px; color: #475569;"
|
|
32
|
+
>
|
|
33
|
+
{{ label }}
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
@@ -4,6 +4,7 @@ import type { FormKitSchemaDefinition } from "@formkit/core";
|
|
|
4
4
|
import { getNode } from "@formkit/core";
|
|
5
5
|
|
|
6
6
|
import { formsApi } from "../api/forms";
|
|
7
|
+
import { REQUIRED_MARK, REQUIRED_MARK_LEADING } from "../config/forms";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Renders a form built in the Cockpit (the `forms` app) by its slug, using the
|
|
@@ -148,12 +149,6 @@ function validationRules(node: Record<string, unknown>): string[] {
|
|
|
148
149
|
return typeof rules === "string" ? rules.split("|").map(rule => rule.trim()) : [];
|
|
149
150
|
}
|
|
150
151
|
|
|
151
|
-
// A red asterisk after the label (or a radio group's legend) of a field the
|
|
152
|
-
// visitor cannot leave out — before it on a checkbox, whose label is a whole
|
|
153
|
-
// sentence. Pseudo-content, so the label text stays the authored one.
|
|
154
|
-
const REQUIRED_MARK = "after:content-['*'] after:ml-0.5 after:text-error";
|
|
155
|
-
const REQUIRED_MARK_LEADING = "before:content-['*'] before:mr-0.5 before:text-error";
|
|
156
|
-
|
|
157
152
|
/**
|
|
158
153
|
* The value a field holds right now — the live form once it exists, before that
|
|
159
154
|
* (and during SSR) the pre-fill or the schema's own default.
|
|
@@ -267,6 +262,21 @@ const activeStepValid = computed(() => {
|
|
|
267
262
|
});
|
|
268
263
|
});
|
|
269
264
|
|
|
265
|
+
/**
|
|
266
|
+
* The top of the form. A new step or the thank-you card replaces the one the
|
|
267
|
+
* visitor scrolled through, so after "Weiter", "Zurück" or submit the page would
|
|
268
|
+
* otherwise stay where the old card's buttons were — on a phone often below the
|
|
269
|
+
* start of the new card. Scrolls only when the top is out of view above.
|
|
270
|
+
*/
|
|
271
|
+
const top = ref<HTMLElement | null>(null);
|
|
272
|
+
watch([stepIndex, submitted], async () => {
|
|
273
|
+
await nextTick();
|
|
274
|
+
const el = top.value;
|
|
275
|
+
if (!el || el.getBoundingClientRect().top >= 0) return;
|
|
276
|
+
const reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
277
|
+
el.scrollIntoView({ block: "start", behavior: reduce ? "auto" : "smooth" });
|
|
278
|
+
});
|
|
279
|
+
|
|
270
280
|
function next() {
|
|
271
281
|
if (activeStepValid.value && !isLastStep.value) stepIndex.value += 1;
|
|
272
282
|
}
|
|
@@ -315,6 +325,11 @@ async function onSubmit(values: Record<string, unknown>) {
|
|
|
315
325
|
</script>
|
|
316
326
|
|
|
317
327
|
<template>
|
|
328
|
+
<div
|
|
329
|
+
ref="top"
|
|
330
|
+
class="scroll-mt-[calc(var(--ui-header-height,0px)+1rem)]"
|
|
331
|
+
aria-hidden="true"
|
|
332
|
+
/>
|
|
318
333
|
<div
|
|
319
334
|
v-if="pending"
|
|
320
335
|
class="flex justify-center py-8"
|
|
@@ -109,7 +109,7 @@ async function submitDecline(): Promise<void> {
|
|
|
109
109
|
<p class="text-sm font-medium text-highlighted">
|
|
110
110
|
<NuxtLink
|
|
111
111
|
:to="localePath(`/account/approvals/orders/${approval.id}`)"
|
|
112
|
-
class="hover:underline"
|
|
112
|
+
class="hover:underline max-lg:inline-flex max-lg:min-h-11 max-lg:items-center max-lg:-my-3"
|
|
113
113
|
>
|
|
114
114
|
{{ t('approvals.queue.order', { number: approval.id }) }}
|
|
115
115
|
</NuxtLink>
|
|
@@ -150,13 +150,27 @@ async function submitDecline(): Promise<void> {
|
|
|
150
150
|
size="sm"
|
|
151
151
|
color="neutral"
|
|
152
152
|
variant="ghost"
|
|
153
|
+
class="max-lg:min-h-11"
|
|
153
154
|
:to="localePath(`/account/approvals/orders/${approval.id}`)"
|
|
154
155
|
:label="t('approvals.queue.review')"
|
|
155
156
|
/>
|
|
157
|
+
<!-- Requests have no page of their own. The invisible twin keeps
|
|
158
|
+
their figure in line with the orders' from md up, where the row
|
|
159
|
+
is one line; below md the buttons wrap onto their own line. -->
|
|
160
|
+
<UButton
|
|
161
|
+
v-else
|
|
162
|
+
size="sm"
|
|
163
|
+
variant="ghost"
|
|
164
|
+
class="invisible hidden md:inline-flex"
|
|
165
|
+
aria-hidden="true"
|
|
166
|
+
tabindex="-1"
|
|
167
|
+
:label="t('approvals.queue.review')"
|
|
168
|
+
/>
|
|
156
169
|
<UButton
|
|
157
170
|
size="sm"
|
|
158
171
|
color="neutral"
|
|
159
172
|
variant="outline"
|
|
173
|
+
class="max-lg:min-h-11"
|
|
160
174
|
:disabled="deciding === approval.id"
|
|
161
175
|
:label="t('approvals.queue.decline')"
|
|
162
176
|
@click="declineFor = approval"
|
|
@@ -164,6 +178,7 @@ async function submitDecline(): Promise<void> {
|
|
|
164
178
|
<UButton
|
|
165
179
|
size="sm"
|
|
166
180
|
color="primary"
|
|
181
|
+
class="max-lg:min-h-11"
|
|
167
182
|
:loading="deciding === approval.id"
|
|
168
183
|
:label="t('approvals.queue.approve')"
|
|
169
184
|
@click="approve(approval)"
|
|
@@ -177,6 +192,7 @@ async function submitDecline(): Promise<void> {
|
|
|
177
192
|
<UModal
|
|
178
193
|
:open="declineFor !== null"
|
|
179
194
|
:title="declineFor?.kind === 'order' ? t('approvals.queue.declineOrderTitle') : t('approvals.queue.declineTitle')"
|
|
195
|
+
:close="{ class: 'max-lg:size-11 max-lg:justify-center' }"
|
|
180
196
|
@update:open="(open: boolean) => { if (!open) declineFor = null; }"
|
|
181
197
|
>
|
|
182
198
|
<template #body>
|
|
@@ -203,11 +219,13 @@ async function submitDecline(): Promise<void> {
|
|
|
203
219
|
<UButton
|
|
204
220
|
color="neutral"
|
|
205
221
|
variant="ghost"
|
|
222
|
+
class="max-lg:min-h-11"
|
|
206
223
|
:label="t('cart.item.cancel')"
|
|
207
224
|
@click="declineFor = null"
|
|
208
225
|
/>
|
|
209
226
|
<UButton
|
|
210
227
|
color="error"
|
|
228
|
+
class="max-lg:min-h-11"
|
|
211
229
|
:disabled="reasonMissing"
|
|
212
230
|
:label="t('approvals.queue.decline')"
|
|
213
231
|
@click="submitDecline"
|
|
@@ -115,6 +115,7 @@ async function settle(decision: "approve" | "decline"): Promise<void> {
|
|
|
115
115
|
<UModal
|
|
116
116
|
v-model:open="rejectOpen"
|
|
117
117
|
:title="t('approvals.queue.declineOrderTitle')"
|
|
118
|
+
:close="{ class: 'max-lg:size-11 max-lg:justify-center' }"
|
|
118
119
|
>
|
|
119
120
|
<template #body>
|
|
120
121
|
<div class="space-y-4">
|
|
@@ -139,11 +140,13 @@ async function settle(decision: "approve" | "decline"): Promise<void> {
|
|
|
139
140
|
<UButton
|
|
140
141
|
color="neutral"
|
|
141
142
|
variant="ghost"
|
|
143
|
+
class="max-lg:min-h-11"
|
|
142
144
|
:label="t('cart.item.cancel')"
|
|
143
145
|
@click="rejectOpen = false"
|
|
144
146
|
/>
|
|
145
147
|
<UButton
|
|
146
148
|
color="error"
|
|
149
|
+
class="max-lg:min-h-11"
|
|
147
150
|
:disabled="!rejectReason.trim()"
|
|
148
151
|
:loading="deciding === orderNumber"
|
|
149
152
|
:label="t('approvals.queue.decline')"
|
|
@@ -17,7 +17,17 @@ const cart = useCartStore();
|
|
|
17
17
|
const { settings } = useB2BContext();
|
|
18
18
|
const { isPunchout } = usePunchoutVisit();
|
|
19
19
|
const { formatCurrency } = useCartSummaryFormatting();
|
|
20
|
-
const { tableUi } = useDataTable();
|
|
20
|
+
const { tableUi: baseTableUi } = useDataTable();
|
|
21
|
+
/**
|
|
22
|
+
* At the narrowest desktop width (1024 px, beside the account nav) six columns
|
|
23
|
+
* with 16 px cell padding were 20 px wider than the room and "Zuletzt
|
|
24
|
+
* geändert" broke onto two lines. Tighter padding up to xl, headers on one line.
|
|
25
|
+
*/
|
|
26
|
+
const tableUi = {
|
|
27
|
+
...baseTableUi,
|
|
28
|
+
th: `${baseTableUi.th} whitespace-nowrap lg:max-xl:px-3`,
|
|
29
|
+
td: `${baseTableUi.td} lg:max-xl:px-3`,
|
|
30
|
+
};
|
|
21
31
|
|
|
22
32
|
// A punchout visit has exactly one cart, the one handed back (RAD-109).
|
|
23
33
|
const enabled = computed(() => settings.value?.cart.multipleCarts === true && !isPunchout.value);
|
|
@@ -227,8 +227,19 @@ async function addToCart(): Promise<void> {
|
|
|
227
227
|
{{ formatCurrency(listValue) }}
|
|
228
228
|
</p>
|
|
229
229
|
</div>
|
|
230
|
+
<!-- Who owns the list is known only once the user is resolved in the
|
|
231
|
+
browser; until then a placeholder, not the read-only view that
|
|
232
|
+
would then switch to the owner's. -->
|
|
230
233
|
<div
|
|
231
|
-
v-if="
|
|
234
|
+
v-if="!authStore.resolved"
|
|
235
|
+
class="flex items-center gap-2 ms-auto"
|
|
236
|
+
aria-hidden="true"
|
|
237
|
+
>
|
|
238
|
+
<USkeleton class="h-8 w-28 max-lg:h-11" />
|
|
239
|
+
<USkeleton class="h-8 w-24 max-lg:h-11" />
|
|
240
|
+
</div>
|
|
241
|
+
<div
|
|
242
|
+
v-else-if="isOwner"
|
|
232
243
|
class="flex items-center gap-2 ms-auto"
|
|
233
244
|
>
|
|
234
245
|
<UButton
|
|
@@ -269,7 +280,18 @@ async function addToCart(): Promise<void> {
|
|
|
269
280
|
<h2 class="px-4 sm:px-5 py-3 text-sm font-semibold text-highlighted bg-elevated/60 border-b border-(--ui-border)">
|
|
270
281
|
{{ t('orderLists.columns.positions') }} ({{ list.positions.length }})
|
|
271
282
|
</h2>
|
|
272
|
-
|
|
283
|
+
<!-- A new list starts empty; say where its articles come from. -->
|
|
284
|
+
<UiFeedbackEmptyState
|
|
285
|
+
v-if="!list.positions.length"
|
|
286
|
+
class="px-4 sm:px-5"
|
|
287
|
+
:icon="icon('empty')"
|
|
288
|
+
:title="t('orderLists.noPositions.title')"
|
|
289
|
+
:description="t('orderLists.noPositions.description')"
|
|
290
|
+
/>
|
|
291
|
+
<ul
|
|
292
|
+
v-else
|
|
293
|
+
class="divide-y divide-(--ui-border) px-4 sm:px-5"
|
|
294
|
+
>
|
|
273
295
|
<li
|
|
274
296
|
v-for="(position, index) in list.positions"
|
|
275
297
|
:key="`${list.id}-${index}`"
|
|
@@ -309,7 +331,14 @@ async function addToCart(): Promise<void> {
|
|
|
309
331
|
</p>
|
|
310
332
|
</div>
|
|
311
333
|
<div
|
|
312
|
-
v-if="
|
|
334
|
+
v-if="!authStore.resolved"
|
|
335
|
+
class="flex items-center shrink-0 max-md:basis-full max-md:justify-end"
|
|
336
|
+
aria-hidden="true"
|
|
337
|
+
>
|
|
338
|
+
<USkeleton class="h-6 w-28 max-lg:h-11 max-lg:w-36" />
|
|
339
|
+
</div>
|
|
340
|
+
<div
|
|
341
|
+
v-else-if="mayEditPositions"
|
|
313
342
|
class="flex items-center gap-1 shrink-0 max-lg:gap-0 max-md:basis-full max-md:justify-end"
|
|
314
343
|
>
|
|
315
344
|
<UButton
|
|
@@ -32,7 +32,11 @@ async function onSubmit(): Promise<void> {
|
|
|
32
32
|
</script>
|
|
33
33
|
|
|
34
34
|
<template>
|
|
35
|
-
|
|
35
|
+
<!-- Sized like AuthLoginPanel: 44 px fields and buttons below lg. -->
|
|
36
|
+
<div
|
|
37
|
+
class="w-full bg-(--ui-bg) border border-(--ui-border) rounded-xl p-6 space-y-6
|
|
38
|
+
max-lg:[&_input:not([type=checkbox]):not([type=radio])]:min-h-11"
|
|
39
|
+
>
|
|
36
40
|
<h2 class="text-xl font-semibold text-highlighted">
|
|
37
41
|
{{ t('auth.forgotPassword.title') }}
|
|
38
42
|
</h2>
|
|
@@ -70,6 +74,7 @@ async function onSubmit(): Promise<void> {
|
|
|
70
74
|
color="primary"
|
|
71
75
|
variant="solid"
|
|
72
76
|
block
|
|
77
|
+
class="max-lg:min-h-11"
|
|
73
78
|
:loading="loading"
|
|
74
79
|
:label="t('auth.forgotPassword.submit')"
|
|
75
80
|
/>
|
|
@@ -77,7 +82,7 @@ async function onSubmit(): Promise<void> {
|
|
|
77
82
|
<div class="text-center">
|
|
78
83
|
<NuxtLink
|
|
79
84
|
:to="localePath('/login')"
|
|
80
|
-
class="text-sm text-primary hover:underline"
|
|
85
|
+
class="text-sm text-primary hover:underline max-lg:inline-flex max-lg:min-h-11 max-lg:items-center"
|
|
81
86
|
>
|
|
82
87
|
{{ t('auth.forgotPassword.backToLogin') }}
|
|
83
88
|
</NuxtLink>
|
|
@@ -47,8 +47,12 @@ const identifierIsEmail = computed(() => identifierField.value.type === "email")
|
|
|
47
47
|
/** Which mailed way the buyer is in the middle of, and how far. */
|
|
48
48
|
const mailedKind = ref<"magic-link" | "otp" | null>(null);
|
|
49
49
|
const mailSent = ref(false);
|
|
50
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* What the code's confirmation names: the address the code was asked for, and
|
|
52
|
+
* the id an older customers app still answers. The address alone is enough.
|
|
53
|
+
*/
|
|
51
54
|
const otpUserId = ref<string | null>(null);
|
|
55
|
+
const otpEmail = ref<string>("");
|
|
52
56
|
const otpCode = ref("");
|
|
53
57
|
|
|
54
58
|
/**
|
|
@@ -65,6 +69,7 @@ async function requestMail(kind: "magic-link" | "otp"): Promise<void> {
|
|
|
65
69
|
}
|
|
66
70
|
mailedKind.value = kind;
|
|
67
71
|
try {
|
|
72
|
+
otpEmail.value = mailAddress.value;
|
|
68
73
|
otpUserId.value = await auth.requestSignInMail(kind, mailAddress.value);
|
|
69
74
|
mailSent.value = true;
|
|
70
75
|
}
|
|
@@ -74,15 +79,14 @@ async function requestMail(kind: "magic-link" | "otp"): Promise<void> {
|
|
|
74
79
|
}
|
|
75
80
|
|
|
76
81
|
async function confirmCode(): Promise<void> {
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
if (!otpCode.value.trim() || !otpUserId.value) {
|
|
82
|
+
// An address nobody holds is refused by the customers app in the words a
|
|
83
|
+
// wrong code gets, so the form never reveals which of the two happened.
|
|
84
|
+
if (!otpCode.value.trim() || !otpEmail.value) {
|
|
81
85
|
auth.error = "auth.login.mailed.codeRejected";
|
|
82
86
|
return;
|
|
83
87
|
}
|
|
84
88
|
try {
|
|
85
|
-
await auth.confirmSignInMail("otp", { userId: otpUserId.value, secret: otpCode.value.trim() });
|
|
89
|
+
await auth.confirmSignInMail("otp", { email: otpEmail.value, userId: otpUserId.value, secret: otpCode.value.trim() });
|
|
86
90
|
emit("success");
|
|
87
91
|
}
|
|
88
92
|
catch {
|
|
@@ -94,6 +98,7 @@ function startOver(): void {
|
|
|
94
98
|
mailedKind.value = null;
|
|
95
99
|
mailSent.value = false;
|
|
96
100
|
otpUserId.value = null;
|
|
101
|
+
otpEmail.value = "";
|
|
97
102
|
otpCode.value = "";
|
|
98
103
|
}
|
|
99
104
|
|
|
@@ -144,7 +149,12 @@ async function onSubmit(): Promise<void> {
|
|
|
144
149
|
</script>
|
|
145
150
|
|
|
146
151
|
<template>
|
|
147
|
-
|
|
152
|
+
<!-- Fields and buttons grow to 44 px below lg: this panel is also the
|
|
153
|
+
checkout login gate, where the touch-target rule applies (PO-23). -->
|
|
154
|
+
<div
|
|
155
|
+
class="bg-(--ui-bg) border border-(--ui-border) rounded-xl p-6 space-y-6
|
|
156
|
+
max-lg:[&_input:not([type=checkbox]):not([type=radio])]:min-h-11"
|
|
157
|
+
>
|
|
148
158
|
<h2 class="text-xl font-semibold text-highlighted">
|
|
149
159
|
{{ t('auth.login.existingCustomer') }}
|
|
150
160
|
</h2>
|
|
@@ -183,6 +193,7 @@ async function onSubmit(): Promise<void> {
|
|
|
183
193
|
v-if="magicLinkOffered"
|
|
184
194
|
color="neutral"
|
|
185
195
|
:variant="passwordOffered ? 'outline' : 'solid'"
|
|
196
|
+
class="max-lg:min-h-11"
|
|
186
197
|
:disabled="!mailAddress || loading"
|
|
187
198
|
:label="t('auth.login.mailed.requestLink')"
|
|
188
199
|
@click="requestMail('magic-link')"
|
|
@@ -191,6 +202,7 @@ async function onSubmit(): Promise<void> {
|
|
|
191
202
|
v-if="otpOffered"
|
|
192
203
|
color="neutral"
|
|
193
204
|
:variant="passwordOffered ? 'outline' : 'solid'"
|
|
205
|
+
class="max-lg:min-h-11"
|
|
194
206
|
:disabled="!mailAddress || loading"
|
|
195
207
|
:label="t('auth.login.mailed.requestCode')"
|
|
196
208
|
@click="requestMail('otp')"
|
|
@@ -219,6 +231,7 @@ async function onSubmit(): Promise<void> {
|
|
|
219
231
|
/>
|
|
220
232
|
<UButton
|
|
221
233
|
color="primary"
|
|
234
|
+
class="max-lg:min-h-11"
|
|
222
235
|
:disabled="!otpCode.trim() || loading"
|
|
223
236
|
:label="t('auth.login.mailed.confirmCode')"
|
|
224
237
|
@click="confirmCode"
|
|
@@ -228,6 +241,7 @@ async function onSubmit(): Promise<void> {
|
|
|
228
241
|
color="neutral"
|
|
229
242
|
variant="ghost"
|
|
230
243
|
size="xs"
|
|
244
|
+
class="max-lg:min-h-11"
|
|
231
245
|
:label="t('auth.login.mailed.startOver')"
|
|
232
246
|
@click="startOver"
|
|
233
247
|
/>
|
|
@@ -282,6 +296,7 @@ async function onSubmit(): Promise<void> {
|
|
|
282
296
|
color="primary"
|
|
283
297
|
variant="solid"
|
|
284
298
|
block
|
|
299
|
+
class="max-lg:min-h-11"
|
|
285
300
|
:loading="loading"
|
|
286
301
|
:label="t('auth.login.submit')"
|
|
287
302
|
/>
|
|
@@ -289,7 +304,7 @@ async function onSubmit(): Promise<void> {
|
|
|
289
304
|
<div class="text-center">
|
|
290
305
|
<NuxtLink
|
|
291
306
|
:to="localePath('/forgot-password')"
|
|
292
|
-
class="text-sm text-primary hover:underline"
|
|
307
|
+
class="text-sm text-primary hover:underline max-lg:inline-flex max-lg:min-h-11 max-lg:items-center"
|
|
293
308
|
>
|
|
294
309
|
{{ t('auth.login.forgotPassword') }}
|
|
295
310
|
</NuxtLink>
|
|
@@ -116,6 +116,7 @@ const hintColor = (type: string) =>
|
|
|
116
116
|
:model-value="selection.isSelected(lineKey)"
|
|
117
117
|
:aria-label="t('cart.selection.selectPosition', { name: item.name })"
|
|
118
118
|
tabindex="0"
|
|
119
|
+
:ui="{ base: 'relative max-lg:after:absolute max-lg:after:left-[calc((100%_-_2.75rem)/2)] max-lg:after:right-[calc((100%_-_2.75rem)/2)] max-lg:after:top-[calc((100%_-_2.75rem)/2)] max-lg:after:bottom-[calc((100%_-_2.75rem)/2)]' }"
|
|
119
120
|
@update:model-value="selection.toggle(lineKey)"
|
|
120
121
|
/>
|
|
121
122
|
<span
|
|
@@ -187,7 +188,8 @@ const hintColor = (type: string) =>
|
|
|
187
188
|
tabindex="0"
|
|
188
189
|
class="group/cc mt-1.5 w-fit text-xs text-muted hover:text-highlighted cursor-pointer
|
|
189
190
|
inline-flex items-center gap-1.5 rounded-md border border-(--ui-border)
|
|
190
|
-
hover:border-(--ui-border-accented) px-2 py-1 transition-colors
|
|
191
|
+
hover:border-(--ui-border-accented) px-2 py-1 transition-colors
|
|
192
|
+
relative max-lg:after:absolute max-lg:after:inset-x-0 max-lg:after:top-[calc((100%_-_2.75rem)/2)] max-lg:after:bottom-[calc((100%_-_2.75rem)/2)]"
|
|
191
193
|
:aria-label="t('cart.position.editCostCenter')"
|
|
192
194
|
@click="actions.open('cost-center', [lineKey])"
|
|
193
195
|
>
|
|
@@ -217,7 +219,7 @@ const hintColor = (type: string) =>
|
|
|
217
219
|
v-if="!readonly && item.positionTexts?.length"
|
|
218
220
|
type="button"
|
|
219
221
|
tabindex="0"
|
|
220
|
-
class="group/texts mt-1 w-fit text-left cursor-pointer"
|
|
222
|
+
class="group/texts mt-1 w-fit text-left cursor-pointer relative max-lg:after:absolute max-lg:after:inset-x-0 max-lg:after:top-[calc((100%_-_2.75rem)/2)] max-lg:after:bottom-[calc((100%_-_2.75rem)/2)]"
|
|
221
223
|
:aria-label="t('cart.position.editTexts')"
|
|
222
224
|
@click="actions.open('texts', [lineKey])"
|
|
223
225
|
>
|
|
@@ -251,7 +253,8 @@ const hintColor = (type: string) =>
|
|
|
251
253
|
type="button"
|
|
252
254
|
tabindex="0"
|
|
253
255
|
class="mt-1 w-fit text-xs text-dimmed hover:text-muted cursor-pointer
|
|
254
|
-
inline-flex items-center gap-1 transition-colors
|
|
256
|
+
inline-flex items-center gap-1 transition-colors
|
|
257
|
+
relative max-lg:after:absolute max-lg:after:inset-x-0 max-lg:after:top-[calc((100%_-_2.75rem)/2)] max-lg:after:bottom-[calc((100%_-_2.75rem)/2)]"
|
|
255
258
|
@click="actions.open('texts', [lineKey])"
|
|
256
259
|
>
|
|
257
260
|
<UIcon
|
|
@@ -280,6 +283,7 @@ const hintColor = (type: string) =>
|
|
|
280
283
|
variant="soft"
|
|
281
284
|
size="xs"
|
|
282
285
|
tabindex="0"
|
|
286
|
+
class="max-lg:min-h-11 max-lg:min-w-11 max-lg:justify-center"
|
|
283
287
|
:disabled="!canDecrease"
|
|
284
288
|
:aria-label="t('cart.item.ariaDecreaseQuantity', { name: item.name })"
|
|
285
289
|
@click="decrease"
|
|
@@ -289,7 +293,7 @@ const hintColor = (type: string) =>
|
|
|
289
293
|
type="text"
|
|
290
294
|
inputmode="numeric"
|
|
291
295
|
:aria-label="t('cart.item.ariaInputQuantity', { name: item.name })"
|
|
292
|
-
class="w-14 text-center text-sm border border-(--ui-border) rounded px-1 py-0.5
|
|
296
|
+
class="w-14 text-center text-sm border border-(--ui-border) rounded px-1 py-0.5 max-lg:min-h-11
|
|
293
297
|
bg-transparent focus:outline-none focus:ring-1 focus:ring-(--ui-primary)"
|
|
294
298
|
@input="onQuantityInput"
|
|
295
299
|
@keydown.enter.prevent="commitQuantity"
|
|
@@ -301,6 +305,7 @@ const hintColor = (type: string) =>
|
|
|
301
305
|
variant="soft"
|
|
302
306
|
size="xs"
|
|
303
307
|
tabindex="0"
|
|
308
|
+
class="max-lg:min-h-11 max-lg:min-w-11 max-lg:justify-center"
|
|
304
309
|
:aria-label="t('cart.item.ariaIncreaseQuantity', { name: item.name })"
|
|
305
310
|
@click="increase"
|
|
306
311
|
/>
|
|
@@ -354,6 +359,7 @@ const hintColor = (type: string) =>
|
|
|
354
359
|
variant="ghost"
|
|
355
360
|
size="xs"
|
|
356
361
|
tabindex="0"
|
|
362
|
+
class="max-lg:min-h-11 max-lg:min-w-11 max-lg:justify-center"
|
|
357
363
|
:aria-label="t('cart.bulk.saveToList')"
|
|
358
364
|
@click="actions.open('save', [lineKey])"
|
|
359
365
|
/>
|
|
@@ -365,6 +371,7 @@ const hintColor = (type: string) =>
|
|
|
365
371
|
variant="ghost"
|
|
366
372
|
size="xs"
|
|
367
373
|
tabindex="0"
|
|
374
|
+
class="max-lg:min-h-11 max-lg:min-w-11 max-lg:justify-center"
|
|
368
375
|
:aria-label="t('cart.item.ariaRemoveFromCart', { name: item.name })"
|
|
369
376
|
@click="cart.removeByKeys([lineKey])"
|
|
370
377
|
/>
|
|
@@ -156,10 +156,12 @@ function onSubmit(): void {
|
|
|
156
156
|
|
|
157
157
|
<template>
|
|
158
158
|
<div class="space-y-2">
|
|
159
|
-
|
|
159
|
+
<!-- Wraps by the room it gets, not by breakpoint: the cart's empty state
|
|
160
|
+
puts it in a half-width column from sm up, as narrow as a phone. -->
|
|
161
|
+
<div class="flex flex-wrap items-end gap-2">
|
|
160
162
|
<UFormField
|
|
161
163
|
:label="t('cart.quickAdd.skuLabel')"
|
|
162
|
-
class="flex-
|
|
164
|
+
class="flex-[1_1_12rem]"
|
|
163
165
|
>
|
|
164
166
|
<UInput
|
|
165
167
|
v-model="sku"
|
|
@@ -45,6 +45,7 @@ const { formatCurrency } = useCartSummaryFormatting();
|
|
|
45
45
|
variant="soft"
|
|
46
46
|
size="xs"
|
|
47
47
|
tabindex="0"
|
|
48
|
+
class="relative max-lg:after:absolute max-lg:after:left-[calc((100%_-_2.75rem)/2)] max-lg:after:right-[calc((100%_-_2.75rem)/2)] max-lg:after:top-[calc((100%_-_2.75rem)/2)] max-lg:after:bottom-[calc((100%_-_2.75rem)/2)]"
|
|
48
49
|
:icon="icon('plus')"
|
|
49
50
|
:aria-label="t('cart.boost.add')"
|
|
50
51
|
@click="emit('add')"
|
|
@@ -36,6 +36,7 @@ function bulkDelete(): void {
|
|
|
36
36
|
:model-value="selection.someSelected.value ? 'indeterminate' : selection.allSelected.value"
|
|
37
37
|
:aria-label="t('cart.selection.selectAll')"
|
|
38
38
|
tabindex="0"
|
|
39
|
+
:ui="{ base: 'relative max-lg:after:absolute max-lg:after:left-[calc((100%_-_2.75rem)/2)] max-lg:after:right-[calc((100%_-_2.75rem)/2)] max-lg:after:top-[calc((100%_-_2.75rem)/2)] max-lg:after:bottom-[calc((100%_-_2.75rem)/2)]' }"
|
|
39
40
|
@update:model-value="selection.toggleAll()"
|
|
40
41
|
/>
|
|
41
42
|
<span class="text-xs text-muted">
|
|
@@ -55,6 +56,7 @@ function bulkDelete(): void {
|
|
|
55
56
|
variant="ghost"
|
|
56
57
|
size="xs"
|
|
57
58
|
tabindex="0"
|
|
59
|
+
class="max-lg:min-h-11"
|
|
58
60
|
:label="t('cart.bulk.editCostCenter')"
|
|
59
61
|
@click="actions.open('cost-center', selection.selected.value)"
|
|
60
62
|
/>
|
|
@@ -64,6 +66,7 @@ function bulkDelete(): void {
|
|
|
64
66
|
variant="ghost"
|
|
65
67
|
size="xs"
|
|
66
68
|
tabindex="0"
|
|
69
|
+
class="max-lg:min-h-11"
|
|
67
70
|
:label="t('cart.bulk.editTexts')"
|
|
68
71
|
@click="actions.open('texts', selection.selected.value)"
|
|
69
72
|
/>
|
|
@@ -74,6 +77,7 @@ function bulkDelete(): void {
|
|
|
74
77
|
variant="ghost"
|
|
75
78
|
size="xs"
|
|
76
79
|
tabindex="0"
|
|
80
|
+
class="max-lg:min-h-11"
|
|
77
81
|
:label="t('cart.bulk.saveToList')"
|
|
78
82
|
@click="actions.open('save', selection.selected.value)"
|
|
79
83
|
/>
|
|
@@ -83,6 +87,7 @@ function bulkDelete(): void {
|
|
|
83
87
|
variant="ghost"
|
|
84
88
|
size="xs"
|
|
85
89
|
tabindex="0"
|
|
90
|
+
class="max-lg:min-h-11"
|
|
86
91
|
:label="t('cart.bulk.deletePositions')"
|
|
87
92
|
@click="bulkDelete"
|
|
88
93
|
/>
|