@revenexx/cover 0.14.0 → 0.16.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/account.ts +1 -0
- package/app/components/RevenexxForm.vue +183 -19
- package/app/components/account/address/AccountAddressCard.vue +8 -2
- package/app/components/account/address/AccountAddressView.vue +5 -1
- package/app/components/account/carts/AccountCartsTable.vue +85 -3
- package/app/components/account/dashboard/AccountDashboardBudgets.vue +2 -1
- package/app/components/account/dashboard/AccountDashboardRecentOrders.vue +2 -1
- package/app/components/account/dashboard/AccountDashboardRequisitions.vue +2 -1
- package/app/components/account/directorder/AccountDirectOrder.vue +100 -12
- package/app/components/account/governance/AccountApprovalLimitsTable.vue +124 -8
- package/app/components/account/governance/AccountCostCenterDetail.vue +3 -2
- package/app/components/account/governance/AccountCostCentersTable.vue +133 -6
- package/app/components/account/governance/AccountRequisitionDetail.vue +2 -1
- package/app/components/account/governance/AccountRequisitionsTable.vue +102 -6
- package/app/components/account/governance/AccountWorkflowDetail.vue +3 -2
- package/app/components/account/governance/AccountWorkflowsTable.vue +76 -1
- package/app/components/account/governance/GovernanceApprovalLimitModal.vue +8 -0
- package/app/components/account/governance/GovernanceCostCenterModal.vue +7 -0
- package/app/components/account/governance/GovernanceWorkflowModal.vue +7 -0
- package/app/components/account/orderlists/AccountOrderListDetail.vue +14 -4
- package/app/components/account/orderlists/AccountOrderListsTable.vue +115 -7
- package/app/components/account/orders/AccountOrderDetail.vue +67 -3
- package/app/components/account/orders/AccountOrderPay.vue +211 -0
- package/app/components/account/orders/AccountOrdersTable.vue +119 -10
- package/app/components/account/organization/AccountOrganization.vue +6 -0
- package/app/components/account/profile/AccountPasswordForm.vue +2 -0
- package/app/components/account/profile/AccountProfileForm.vue +4 -0
- package/app/components/account/quotes/AccountQuoteDetail.vue +7 -10
- package/app/components/account/team/AccountTeam.vue +91 -0
- package/app/components/auth/AuthLoginTeaser.vue +1 -1
- package/app/components/auth/AuthRegisterPanel.vue +22 -3
- package/app/components/cart/manage/CartNameModal.vue +4 -0
- package/app/components/checkout/onepage/CheckoutAddressSection.vue +5 -1
- package/app/components/checkout/onepage/CheckoutGuestDetailsSection.vue +9 -1
- package/app/components/checkout/onepage/CheckoutSummarySection.vue +6 -1
- package/app/components/form/FormPage.vue +7 -4
- package/app/components/layout/footer/Footer.vue +15 -2
- package/app/components/layout/header/LocaleSwitcher.vue +79 -12
- package/app/components/ui/forms/PasswordInput.vue +2 -0
- package/app/components/ui/forms/SearchInput.vue +205 -8
- package/app/components/ui/table/TableCardList.vue +69 -0
- package/app/components/ui/table/TableSortButton.vue +1 -1
- package/app/components/ui/table/TableToolbar.vue +2 -0
- package/app/components/withdrawal/WithdrawalDeclaration.vue +286 -0
- package/app/composables/useCheckoutOnePage.ts +22 -0
- package/app/composables/useMobileTableSort.ts +82 -0
- package/app/composables/useProductCard.ts +14 -0
- package/app/composables/useProductListing.ts +27 -1
- package/app/composables/useSearchEvents.ts +67 -0
- package/app/config/forms.ts +8 -0
- package/app/config/navigation.ts +8 -0
- package/app/formkit.config.ts +21 -0
- package/app/interfaces/account/order-list.ts +11 -0
- package/app/interfaces/account/quotes.ts +7 -3
- package/app/interfaces/market.ts +7 -0
- package/app/pages/punchout/transfer.vue +36 -1
- package/app/pages/widerruf.vue +33 -0
- package/app/plugins/search-events.client.ts +41 -0
- package/app/shared/addressLines.ts +66 -0
- package/app/shared/checkoutAddressRefusal.ts +63 -0
- package/app/shared/locale.ts +133 -0
- package/app/shared/searchAttribution.ts +91 -0
- package/app/shared/themeEvents.ts +1 -1
- package/i18n/locales/de/account.json +13 -1
- package/i18n/locales/de/cart.json +1 -0
- package/i18n/locales/de/checkout.json +1 -1
- package/i18n/locales/de/common.json +7 -0
- package/i18n/locales/de/search.json +7 -0
- package/i18n/locales/de/withdrawal.json +34 -0
- package/i18n/locales/en/account.json +13 -1
- package/i18n/locales/en/cart.json +1 -0
- package/i18n/locales/en/checkout.json +1 -1
- package/i18n/locales/en/common.json +7 -0
- package/i18n/locales/en/search.json +7 -0
- package/i18n/locales/en/withdrawal.json +34 -0
- package/nuxt.config.ts +3 -0
- package/package.json +1 -1
- package/server/api/account/orders/[id]/pay.post.ts +100 -0
- package/server/api/account/orders/[id].get.ts +5 -1
- package/server/api/account/quotes/[id]/order.post.ts +22 -22
- package/server/api/brands.get.ts +3 -2
- package/server/api/categories/[slug]/subcategories.get.ts +9 -6
- package/server/api/forms/[slug].get.ts +1 -3
- package/server/api/orders/index.post.ts +33 -50
- package/server/api/products/index.get.ts +6 -1
- package/server/api/punchout/return.post.ts +3 -1
- package/server/api/search/events.post.ts +65 -0
- package/server/api/typesense/search.post.ts +12 -1
- package/server/api/typesense/suggest.post.ts +43 -22
- package/server/data/forms/authored.json +69 -8
- package/server/dev/errorHandler.ts +47 -0
- package/server/interfaces/brand.ts +3 -2
- package/server/interfaces/product.ts +5 -0
- package/server/interfaces/punchout.ts +5 -0
- package/server/middleware/missing-media.ts +35 -0
- package/server/middleware/punchout-hand-back-csp.ts +17 -0
- package/server/plugins/vue-devtools-sink.ts +28 -0
- package/server/services/ApiBrandService.ts +8 -8
- package/server/services/ApiMarketService.ts +9 -2
- package/server/services/ApiProductService.ts +1 -1
- package/server/services/MockFormsService.ts +3 -1
- package/server/utils/addressRefusal.ts +63 -0
- package/server/utils/country.ts +23 -0
- package/server/utils/forms.ts +23 -1
- package/server/utils/liveOrders.ts +44 -2
- package/server/utils/locale.ts +58 -4
- package/server/utils/orderPayment.ts +155 -0
- package/server/utils/punchoutFormAction.ts +44 -0
- package/server/utils/searchClient.ts +27 -4
- package/server/utils/searchEvents.ts +46 -0
- package/server/utils/searchMultiSearchFallback.ts +2 -0
- package/server/utils/searchSuggest.ts +207 -0
- package/server/utils/suggestTiles.ts +141 -0
|
@@ -98,7 +98,13 @@ const columns = computed<TableColumn<AccountOrder>[]>(() => [
|
|
|
98
98
|
meta: { class: { th: "text-right", td: "text-right" } },
|
|
99
99
|
},
|
|
100
100
|
{ accessorKey: "status", header: t("orders.columns.status"), enableSorting: false },
|
|
101
|
-
|
|
101
|
+
// Below lg the payment badge folds into the status cell.
|
|
102
|
+
{
|
|
103
|
+
id: "payment",
|
|
104
|
+
header: t("orders.columns.payment"),
|
|
105
|
+
enableSorting: false,
|
|
106
|
+
meta: { class: { th: "max-lg:hidden", td: "max-lg:hidden" } },
|
|
107
|
+
},
|
|
102
108
|
{ id: "actions", header: "", enableSorting: false },
|
|
103
109
|
]);
|
|
104
110
|
|
|
@@ -107,6 +113,14 @@ const formatDate = (value: string) => {
|
|
|
107
113
|
return Number.isNaN(parsed.getTime()) ? value : d(parsed, { dateStyle: "medium" });
|
|
108
114
|
};
|
|
109
115
|
|
|
116
|
+
/* ---- mobile card list (below md) ---------------------------------------- */
|
|
117
|
+
const { items: sortItems, model: mobileSort, sorted: sortedOrders } = useMobileTableSort(filtered, sorting, () => [
|
|
118
|
+
{ id: "date", label: t("orders.columns.date"), kind: "date", value: order => order.date },
|
|
119
|
+
{ id: "id", label: t("orders.columns.id"), kind: "text", value: order => order.id },
|
|
120
|
+
{ id: "total", label: t("orders.columns.total"), kind: "number", value: order => order.total },
|
|
121
|
+
{ id: "positions", label: t("orders.columns.positions"), kind: "number", value: order => order.positions.length },
|
|
122
|
+
]);
|
|
123
|
+
|
|
110
124
|
/* ---- order again --------------------------------------------------------- */
|
|
111
125
|
async function orderAgain(order: AccountOrder): Promise<void> {
|
|
112
126
|
let added = 0;
|
|
@@ -157,12 +171,94 @@ async function orderAgain(order: AccountOrder): Promise<void> {
|
|
|
157
171
|
:filter-items="filterItems"
|
|
158
172
|
/>
|
|
159
173
|
|
|
174
|
+
<UiTableCardList
|
|
175
|
+
v-model:sort="mobileSort"
|
|
176
|
+
:rows="sortedOrders"
|
|
177
|
+
:row-key="order => order.id"
|
|
178
|
+
:sort-items="sortItems"
|
|
179
|
+
:loading="status === 'pending'"
|
|
180
|
+
>
|
|
181
|
+
<template #item="{ row }">
|
|
182
|
+
<div class="flex items-start justify-between gap-2">
|
|
183
|
+
<div class="min-w-0 -mt-1">
|
|
184
|
+
<ULink
|
|
185
|
+
class="inline-flex min-h-11 items-center font-semibold text-highlighted hover:text-primary transition-colors break-all"
|
|
186
|
+
:to="localePath(`/account/orders/${row.id}`)"
|
|
187
|
+
>
|
|
188
|
+
{{ row.id }}
|
|
189
|
+
</ULink>
|
|
190
|
+
<p
|
|
191
|
+
v-if="row.orderNumber"
|
|
192
|
+
class="-mt-2 text-xs text-muted break-words"
|
|
193
|
+
>
|
|
194
|
+
{{ row.orderNumber }}
|
|
195
|
+
</p>
|
|
196
|
+
</div>
|
|
197
|
+
<div class="flex items-center shrink-0 -my-2 -me-2.5">
|
|
198
|
+
<UButton
|
|
199
|
+
color="neutral"
|
|
200
|
+
variant="ghost"
|
|
201
|
+
class="size-11 justify-center"
|
|
202
|
+
:icon="icon('eye')"
|
|
203
|
+
:aria-label="t('orders.details')"
|
|
204
|
+
:to="localePath(`/account/orders/${row.id}`)"
|
|
205
|
+
/>
|
|
206
|
+
<UButton
|
|
207
|
+
v-if="row.status !== 'cancelled'"
|
|
208
|
+
color="primary"
|
|
209
|
+
variant="soft"
|
|
210
|
+
class="size-11 justify-center"
|
|
211
|
+
:icon="icon('reset')"
|
|
212
|
+
:aria-label="t('orders.orderAgain')"
|
|
213
|
+
@click="orderAgain(row)"
|
|
214
|
+
/>
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
<div class="mt-2 flex flex-wrap gap-1.5">
|
|
218
|
+
<UBadge
|
|
219
|
+
:color="statusColors[row.status]"
|
|
220
|
+
variant="subtle"
|
|
221
|
+
size="sm"
|
|
222
|
+
:label="t(`orders.status.${row.status}`)"
|
|
223
|
+
/>
|
|
224
|
+
<UBadge
|
|
225
|
+
:color="paymentColors[row.paymentStatus]"
|
|
226
|
+
variant="outline"
|
|
227
|
+
size="sm"
|
|
228
|
+
:label="t(`orders.payment.${row.paymentStatus}`)"
|
|
229
|
+
/>
|
|
230
|
+
</div>
|
|
231
|
+
<p class="mt-2 text-sm tabular-nums">
|
|
232
|
+
<span class="text-muted">{{ formatDate(row.date) }}</span>
|
|
233
|
+
<span class="text-dimmed"> · </span>
|
|
234
|
+
<span class="text-muted">{{ t('orders.columns.positions') }}: {{ row.positions.length }}</span>
|
|
235
|
+
<span class="text-dimmed"> · </span>
|
|
236
|
+
<span class="text-highlighted">{{ formatCurrency(row.total) }}</span>
|
|
237
|
+
</p>
|
|
238
|
+
</template>
|
|
239
|
+
<template #empty>
|
|
240
|
+
<UiFeedbackEmptyState
|
|
241
|
+
v-if="search || statusFilter !== 'all'"
|
|
242
|
+
:icon="icon('no-results')"
|
|
243
|
+
:title="t('table.noResults.title')"
|
|
244
|
+
:description="t('table.noResults.description')"
|
|
245
|
+
/>
|
|
246
|
+
<UiFeedbackEmptyState
|
|
247
|
+
v-else
|
|
248
|
+
:icon="icon('orders-empty')"
|
|
249
|
+
:title="t('orders.empty.title')"
|
|
250
|
+
:description="t('orders.empty.description')"
|
|
251
|
+
/>
|
|
252
|
+
</template>
|
|
253
|
+
</UiTableCardList>
|
|
254
|
+
|
|
160
255
|
<UTable
|
|
161
256
|
v-model:sorting="sorting"
|
|
257
|
+
class="hidden md:block"
|
|
162
258
|
:data="filtered"
|
|
163
259
|
:columns="columns"
|
|
164
260
|
:loading="status === 'pending'"
|
|
165
|
-
:ui="tableUi"
|
|
261
|
+
:ui="{ ...tableUi, th: `${tableUi.th} max-lg:px-2`, td: `${tableUi.td} max-lg:px-2` }"
|
|
166
262
|
>
|
|
167
263
|
<template #id-header="{ column }">
|
|
168
264
|
<UiTableSortButton
|
|
@@ -192,7 +288,7 @@ async function orderAgain(order: AccountOrder): Promise<void> {
|
|
|
192
288
|
<template #id-cell="{ row }">
|
|
193
289
|
<div class="min-w-0">
|
|
194
290
|
<ULink
|
|
195
|
-
class="font-semibold text-highlighted hover:text-primary transition-colors"
|
|
291
|
+
class="font-semibold text-highlighted hover:text-primary transition-colors whitespace-normal break-all max-lg:inline-block max-lg:py-3 max-lg:-my-3"
|
|
196
292
|
:to="localePath(`/account/orders/${row.original.id}`)"
|
|
197
293
|
>
|
|
198
294
|
{{ row.original.id }}
|
|
@@ -215,12 +311,21 @@ async function orderAgain(order: AccountOrder): Promise<void> {
|
|
|
215
311
|
<span class="tabular-nums text-highlighted">{{ formatCurrency(row.original.total) }}</span>
|
|
216
312
|
</template>
|
|
217
313
|
<template #status-cell="{ row }">
|
|
218
|
-
<
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
314
|
+
<div class="flex flex-wrap gap-1">
|
|
315
|
+
<UBadge
|
|
316
|
+
:color="statusColors[row.original.status]"
|
|
317
|
+
variant="subtle"
|
|
318
|
+
size="sm"
|
|
319
|
+
:label="t(`orders.status.${row.original.status}`)"
|
|
320
|
+
/>
|
|
321
|
+
<UBadge
|
|
322
|
+
class="lg:hidden"
|
|
323
|
+
:color="paymentColors[row.original.paymentStatus]"
|
|
324
|
+
variant="outline"
|
|
325
|
+
size="sm"
|
|
326
|
+
:label="t(`orders.payment.${row.original.paymentStatus}`)"
|
|
327
|
+
/>
|
|
328
|
+
</div>
|
|
224
329
|
</template>
|
|
225
330
|
<template #payment-cell="{ row }">
|
|
226
331
|
<UBadge
|
|
@@ -231,13 +336,14 @@ async function orderAgain(order: AccountOrder): Promise<void> {
|
|
|
231
336
|
/>
|
|
232
337
|
</template>
|
|
233
338
|
<template #actions-cell="{ row }">
|
|
234
|
-
<div class="flex items-center justify-end gap-1">
|
|
339
|
+
<div class="flex items-center justify-end gap-1 max-lg:gap-0">
|
|
235
340
|
<UTooltip :text="t('orders.details')">
|
|
236
341
|
<UButton
|
|
237
342
|
color="neutral"
|
|
238
343
|
variant="ghost"
|
|
239
344
|
size="sm"
|
|
240
345
|
tabindex="0"
|
|
346
|
+
class="max-lg:size-11 max-lg:justify-center"
|
|
241
347
|
:icon="icon('eye')"
|
|
242
348
|
:aria-label="t('orders.details')"
|
|
243
349
|
:to="localePath(`/account/orders/${row.original.id}`)"
|
|
@@ -252,6 +358,7 @@ async function orderAgain(order: AccountOrder): Promise<void> {
|
|
|
252
358
|
variant="soft"
|
|
253
359
|
size="sm"
|
|
254
360
|
tabindex="0"
|
|
361
|
+
class="max-lg:size-11 max-lg:justify-center"
|
|
255
362
|
:icon="icon('reset')"
|
|
256
363
|
:aria-label="t('orders.orderAgain')"
|
|
257
364
|
@click="orderAgain(row.original)"
|
|
@@ -297,6 +404,7 @@ async function orderAgain(order: AccountOrder): Promise<void> {
|
|
|
297
404
|
:icon="icon('chevron-left')"
|
|
298
405
|
color="neutral"
|
|
299
406
|
variant="outline"
|
|
407
|
+
class="max-lg:min-h-11"
|
|
300
408
|
:disabled="page <= 1"
|
|
301
409
|
:label="t('orders.pagination.prev')"
|
|
302
410
|
@click="prevPage"
|
|
@@ -305,6 +413,7 @@ async function orderAgain(order: AccountOrder): Promise<void> {
|
|
|
305
413
|
:icon="icon('chevron-right')"
|
|
306
414
|
color="neutral"
|
|
307
415
|
variant="outline"
|
|
416
|
+
class="max-lg:min-h-11"
|
|
308
417
|
trailing
|
|
309
418
|
:disabled="page >= pageCount"
|
|
310
419
|
:label="t('orders.pagination.next')"
|
|
@@ -83,6 +83,7 @@ async function save(): Promise<void> {
|
|
|
83
83
|
color="neutral"
|
|
84
84
|
variant="outline"
|
|
85
85
|
size="sm"
|
|
86
|
+
class="max-lg:min-h-11"
|
|
86
87
|
:icon="icon('edit')"
|
|
87
88
|
:label="t('organization.edit')"
|
|
88
89
|
@click="openEdit"
|
|
@@ -132,6 +133,7 @@ async function save(): Promise<void> {
|
|
|
132
133
|
<UModal
|
|
133
134
|
v-model:open="editing"
|
|
134
135
|
:title="t('organization.editTitle')"
|
|
136
|
+
:close="{ class: 'max-lg:size-11 max-lg:justify-center' }"
|
|
135
137
|
>
|
|
136
138
|
<template #body>
|
|
137
139
|
<div class="space-y-4">
|
|
@@ -139,6 +141,7 @@ async function save(): Promise<void> {
|
|
|
139
141
|
<UInput
|
|
140
142
|
v-model="form.name"
|
|
141
143
|
class="w-full"
|
|
144
|
+
:ui="{ base: 'max-lg:min-h-11' }"
|
|
142
145
|
:placeholder="t('organization.fields.name')"
|
|
143
146
|
/>
|
|
144
147
|
</UFormField>
|
|
@@ -146,6 +149,7 @@ async function save(): Promise<void> {
|
|
|
146
149
|
<UInput
|
|
147
150
|
v-model="form.vatId"
|
|
148
151
|
class="w-full"
|
|
152
|
+
:ui="{ base: 'max-lg:min-h-11' }"
|
|
149
153
|
placeholder="DE123456789"
|
|
150
154
|
/>
|
|
151
155
|
</UFormField>
|
|
@@ -156,11 +160,13 @@ async function save(): Promise<void> {
|
|
|
156
160
|
<UButton
|
|
157
161
|
color="neutral"
|
|
158
162
|
variant="ghost"
|
|
163
|
+
class="max-lg:min-h-11"
|
|
159
164
|
:label="t('organization.cancel')"
|
|
160
165
|
@click="editing = false"
|
|
161
166
|
/>
|
|
162
167
|
<UButton
|
|
163
168
|
color="primary"
|
|
169
|
+
class="max-lg:min-h-11"
|
|
164
170
|
:loading="saving"
|
|
165
171
|
:disabled="!form.name.trim()"
|
|
166
172
|
:label="t('organization.save')"
|
|
@@ -42,6 +42,7 @@ function toggleEdit() {
|
|
|
42
42
|
:icon="icon('edit')"
|
|
43
43
|
variant="ghost"
|
|
44
44
|
color="primary"
|
|
45
|
+
class="shrink-0 max-lg:size-11 max-lg:justify-center"
|
|
45
46
|
:aria-label="t('actions.edit')"
|
|
46
47
|
@click="toggleEdit"
|
|
47
48
|
/>
|
|
@@ -147,6 +148,7 @@ function toggleEdit() {
|
|
|
147
148
|
<div class="pt-2 flex justify-end">
|
|
148
149
|
<UButton
|
|
149
150
|
type="submit"
|
|
151
|
+
class="max-lg:min-h-11"
|
|
150
152
|
:label="t('profile.actions.changePassword')"
|
|
151
153
|
/>
|
|
152
154
|
</div>
|
|
@@ -95,6 +95,7 @@ async function onSubmit() {
|
|
|
95
95
|
:icon="icon('edit')"
|
|
96
96
|
variant="ghost"
|
|
97
97
|
color="primary"
|
|
98
|
+
class="shrink-0 max-lg:size-11 max-lg:justify-center"
|
|
98
99
|
:aria-label="t('actions.edit')"
|
|
99
100
|
@click="toggleEdit"
|
|
100
101
|
/>
|
|
@@ -135,6 +136,7 @@ async function onSubmit() {
|
|
|
135
136
|
type="text"
|
|
136
137
|
name="phone"
|
|
137
138
|
validation="required|length:8,16|phoneNumber"
|
|
139
|
+
input-class="max-lg:min-h-11"
|
|
138
140
|
:validation-messages="{ phoneNumber: t('validation.invalidPhoneNumber') }"
|
|
139
141
|
autocomplete="tel"
|
|
140
142
|
/>
|
|
@@ -144,6 +146,7 @@ async function onSubmit() {
|
|
|
144
146
|
type="text"
|
|
145
147
|
name="company"
|
|
146
148
|
validation="required|length:3,64"
|
|
149
|
+
input-class="max-lg:min-h-11"
|
|
147
150
|
autocomplete="organization"
|
|
148
151
|
/>
|
|
149
152
|
<template v-else>
|
|
@@ -163,6 +166,7 @@ async function onSubmit() {
|
|
|
163
166
|
<div class="flex justify-end">
|
|
164
167
|
<UButton
|
|
165
168
|
type="submit"
|
|
169
|
+
class="max-lg:min-h-11"
|
|
166
170
|
:loading="saving"
|
|
167
171
|
:label="t('profile.actions.updateData')"
|
|
168
172
|
/>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { AccountQuoteStatus } from "../../../interfaces/account/quotes";
|
|
3
|
+
import { addressLines as printAddress } from "../../../shared/addressLines";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* One quote, as its buyer reads it (RX-783): where it stands, what is on it,
|
|
@@ -35,16 +36,12 @@ const formatDate = (value: string | null | undefined) => {
|
|
|
35
36
|
return Number.isNaN(parsed.getTime()) ? value : d(parsed, { dateStyle: "medium" });
|
|
36
37
|
};
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
`${a.postalCode ?? ""} ${a.city ?? ""}`.trim(),
|
|
45
|
-
a.country,
|
|
46
|
-
].map(v => String(v ?? "").trim()).filter(Boolean);
|
|
47
|
-
};
|
|
39
|
+
/**
|
|
40
|
+
* The quotes app answers the address type plus the old flat keys (RAD-236):
|
|
41
|
+
* printed lines where it has them, else the type's keys, country included.
|
|
42
|
+
*/
|
|
43
|
+
const addressLines = (a: Record<string, unknown> | null | undefined): string[] =>
|
|
44
|
+
printAddress(a, { country: true });
|
|
48
45
|
|
|
49
46
|
/** The sentence under the head: what the buyer is waiting for, or what is waiting on them. */
|
|
50
47
|
const stateHint = computed(() => {
|
|
@@ -92,6 +92,16 @@ const columns = computed<TableColumn<AccountTeamMember>[]>(() => [
|
|
|
92
92
|
{ id: "actions", header: "", enableSorting: false },
|
|
93
93
|
]);
|
|
94
94
|
|
|
95
|
+
/* ---- mobile card list (below md) --------------------------------------- */
|
|
96
|
+
// The cards share the table's sorting state, so both views always agree;
|
|
97
|
+
// the select stands in for the sortable column headers.
|
|
98
|
+
const memberName = (member: AccountTeamMember): string => `${member.firstName} ${member.lastName}`.trim();
|
|
99
|
+
|
|
100
|
+
const { items: sortItems, model: mobileSort, sorted: sortedMembers } = useMobileTableSort(filtered, sorting, () => [
|
|
101
|
+
{ id: "name", label: t("team.columns.name"), kind: "text", value: memberName },
|
|
102
|
+
{ id: "email", label: t("team.columns.email"), kind: "text", value: member => member.email },
|
|
103
|
+
]);
|
|
104
|
+
|
|
95
105
|
/* ---- invite modal ------------------------------------------------------ */
|
|
96
106
|
const inviting = ref(false);
|
|
97
107
|
const savingInvite = ref(false);
|
|
@@ -185,6 +195,7 @@ async function saveEdit(): Promise<void> {
|
|
|
185
195
|
v-if="editable"
|
|
186
196
|
color="primary"
|
|
187
197
|
tabindex="0"
|
|
198
|
+
class="max-lg:min-h-11"
|
|
188
199
|
:icon="icon('plus')"
|
|
189
200
|
:label="t('team.invite')"
|
|
190
201
|
@click="openInvite"
|
|
@@ -192,8 +203,76 @@ async function saveEdit(): Promise<void> {
|
|
|
192
203
|
</template>
|
|
193
204
|
</UiTableToolbar>
|
|
194
205
|
|
|
206
|
+
<UiTableCardList
|
|
207
|
+
v-model:sort="mobileSort"
|
|
208
|
+
:rows="sortedMembers"
|
|
209
|
+
:row-key="member => member.id"
|
|
210
|
+
:sort-items="sortItems"
|
|
211
|
+
:loading="status === 'pending'"
|
|
212
|
+
>
|
|
213
|
+
<template #item="{ row }">
|
|
214
|
+
<div class="flex items-start gap-2">
|
|
215
|
+
<div class="min-w-0 flex-1 space-y-2">
|
|
216
|
+
<div class="flex flex-wrap items-center gap-1.5">
|
|
217
|
+
<span class="font-semibold text-highlighted">
|
|
218
|
+
{{ memberName(row) || '—' }}
|
|
219
|
+
</span>
|
|
220
|
+
<UBadge
|
|
221
|
+
v-if="row.isPrimary"
|
|
222
|
+
color="primary"
|
|
223
|
+
variant="subtle"
|
|
224
|
+
size="sm"
|
|
225
|
+
:label="t('team.primary')"
|
|
226
|
+
/>
|
|
227
|
+
</div>
|
|
228
|
+
<p class="text-sm text-muted truncate">
|
|
229
|
+
{{ row.email }}
|
|
230
|
+
</p>
|
|
231
|
+
<div class="flex flex-wrap items-center gap-1.5">
|
|
232
|
+
<UBadge
|
|
233
|
+
:color="roleColors[row.role]"
|
|
234
|
+
variant="subtle"
|
|
235
|
+
size="sm"
|
|
236
|
+
:label="t(`team.roles.${row.role}`)"
|
|
237
|
+
/>
|
|
238
|
+
<UBadge
|
|
239
|
+
:color="statusColors[row.status]"
|
|
240
|
+
variant="outline"
|
|
241
|
+
size="sm"
|
|
242
|
+
:label="t(`team.statuses.${row.status}`)"
|
|
243
|
+
/>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
<UButton
|
|
247
|
+
v-if="editable && canEditMember(row)"
|
|
248
|
+
:icon="icon('edit')"
|
|
249
|
+
color="neutral"
|
|
250
|
+
variant="ghost"
|
|
251
|
+
class="shrink-0 size-11 justify-center -mt-2.5 -me-2.5"
|
|
252
|
+
:aria-label="t('team.editTitle')"
|
|
253
|
+
@click="openEdit(row)"
|
|
254
|
+
/>
|
|
255
|
+
</div>
|
|
256
|
+
</template>
|
|
257
|
+
<template #empty>
|
|
258
|
+
<UiFeedbackEmptyState
|
|
259
|
+
v-if="search"
|
|
260
|
+
:icon="icon('no-results')"
|
|
261
|
+
:title="t('table.noResults.title')"
|
|
262
|
+
:description="t('table.noResults.description')"
|
|
263
|
+
/>
|
|
264
|
+
<UiFeedbackEmptyState
|
|
265
|
+
v-else
|
|
266
|
+
:icon="icon('users')"
|
|
267
|
+
:title="t('team.empty.title')"
|
|
268
|
+
:description="t('team.empty.description')"
|
|
269
|
+
/>
|
|
270
|
+
</template>
|
|
271
|
+
</UiTableCardList>
|
|
272
|
+
|
|
195
273
|
<UTable
|
|
196
274
|
v-model:sorting="sorting"
|
|
275
|
+
class="hidden md:block"
|
|
197
276
|
:data="filtered"
|
|
198
277
|
:columns="columns"
|
|
199
278
|
:loading="status === 'pending'"
|
|
@@ -253,6 +332,7 @@ async function saveEdit(): Promise<void> {
|
|
|
253
332
|
variant="ghost"
|
|
254
333
|
size="sm"
|
|
255
334
|
tabindex="0"
|
|
335
|
+
class="max-lg:size-11 max-lg:justify-center"
|
|
256
336
|
:aria-label="t('team.editTitle')"
|
|
257
337
|
@click="openEdit(row.original)"
|
|
258
338
|
/>
|
|
@@ -289,6 +369,7 @@ async function saveEdit(): Promise<void> {
|
|
|
289
369
|
<UModal
|
|
290
370
|
v-model:open="inviting"
|
|
291
371
|
:title="t('team.inviteTitle')"
|
|
372
|
+
:close="{ class: 'max-lg:size-11 max-lg:justify-center' }"
|
|
292
373
|
>
|
|
293
374
|
<template #body>
|
|
294
375
|
<div class="space-y-4">
|
|
@@ -300,6 +381,7 @@ async function saveEdit(): Promise<void> {
|
|
|
300
381
|
v-model="inviteForm.email"
|
|
301
382
|
type="email"
|
|
302
383
|
class="w-full"
|
|
384
|
+
:ui="{ base: 'max-lg:min-h-11' }"
|
|
303
385
|
placeholder="name@firma.de"
|
|
304
386
|
/>
|
|
305
387
|
</UFormField>
|
|
@@ -308,12 +390,14 @@ async function saveEdit(): Promise<void> {
|
|
|
308
390
|
<UInput
|
|
309
391
|
v-model="inviteForm.firstName"
|
|
310
392
|
class="w-full"
|
|
393
|
+
:ui="{ base: 'max-lg:min-h-11' }"
|
|
311
394
|
/>
|
|
312
395
|
</UFormField>
|
|
313
396
|
<UFormField :label="t('team.lastName')">
|
|
314
397
|
<UInput
|
|
315
398
|
v-model="inviteForm.lastName"
|
|
316
399
|
class="w-full"
|
|
400
|
+
:ui="{ base: 'max-lg:min-h-11' }"
|
|
317
401
|
/>
|
|
318
402
|
</UFormField>
|
|
319
403
|
</div>
|
|
@@ -322,6 +406,7 @@ async function saveEdit(): Promise<void> {
|
|
|
322
406
|
v-model="inviteForm.role"
|
|
323
407
|
:items="roleItems"
|
|
324
408
|
class="w-full"
|
|
409
|
+
:ui="{ base: 'max-lg:min-h-11' }"
|
|
325
410
|
/>
|
|
326
411
|
</UFormField>
|
|
327
412
|
</div>
|
|
@@ -332,12 +417,14 @@ async function saveEdit(): Promise<void> {
|
|
|
332
417
|
color="neutral"
|
|
333
418
|
variant="ghost"
|
|
334
419
|
tabindex="0"
|
|
420
|
+
class="max-lg:min-h-11"
|
|
335
421
|
:label="t('team.cancel')"
|
|
336
422
|
@click="inviting = false"
|
|
337
423
|
/>
|
|
338
424
|
<UButton
|
|
339
425
|
color="primary"
|
|
340
426
|
tabindex="0"
|
|
427
|
+
class="max-lg:min-h-11"
|
|
341
428
|
:loading="savingInvite"
|
|
342
429
|
:disabled="!inviteForm.email.trim()"
|
|
343
430
|
:label="t('team.invite')"
|
|
@@ -350,6 +437,7 @@ async function saveEdit(): Promise<void> {
|
|
|
350
437
|
<UModal
|
|
351
438
|
v-model:open="editing"
|
|
352
439
|
:title="t('team.editTitle')"
|
|
440
|
+
:close="{ class: 'max-lg:size-11 max-lg:justify-center' }"
|
|
353
441
|
>
|
|
354
442
|
<template #body>
|
|
355
443
|
<div class="space-y-4">
|
|
@@ -358,6 +446,7 @@ async function saveEdit(): Promise<void> {
|
|
|
358
446
|
v-model="editRole"
|
|
359
447
|
:items="roleItems"
|
|
360
448
|
class="w-full"
|
|
449
|
+
:ui="{ base: 'max-lg:min-h-11' }"
|
|
361
450
|
/>
|
|
362
451
|
</UFormField>
|
|
363
452
|
</div>
|
|
@@ -368,12 +457,14 @@ async function saveEdit(): Promise<void> {
|
|
|
368
457
|
color="neutral"
|
|
369
458
|
variant="ghost"
|
|
370
459
|
tabindex="0"
|
|
460
|
+
class="max-lg:min-h-11"
|
|
371
461
|
:label="t('team.cancel')"
|
|
372
462
|
@click="editing = false"
|
|
373
463
|
/>
|
|
374
464
|
<UButton
|
|
375
465
|
color="primary"
|
|
376
466
|
tabindex="0"
|
|
467
|
+
class="max-lg:min-h-11"
|
|
377
468
|
:loading="savingEdit"
|
|
378
469
|
:label="t('team.save')"
|
|
379
470
|
@click="saveEdit"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { COUNTRIES } from "../../config/countries";
|
|
3
|
+
import { REQUIRED_MARK, REQUIRED_MARK_LEADING } from "../../config/forms";
|
|
3
4
|
import type { RegisterFormState, RegistrationMode, RegistrationProfile } from "../../interfaces/auth";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -152,7 +153,10 @@ async function onSubmit(): Promise<void> {
|
|
|
152
153
|
</script>
|
|
153
154
|
|
|
154
155
|
<template>
|
|
155
|
-
<div
|
|
156
|
+
<div
|
|
157
|
+
class="bg-elevated py-6 px-6 sm:px-8 rounded-lg
|
|
158
|
+
max-lg:[&_input:not([type=checkbox]):not([type=radio])]:min-h-11 max-lg:[&_select]:min-h-11"
|
|
159
|
+
>
|
|
156
160
|
<div class="rounded-lg bg-default shadow-sm p-6 mb-4">
|
|
157
161
|
<h2 class="text-xl font-semibold text-highlighted">
|
|
158
162
|
{{ registrationEnabled ? t('auth.register.title') : t('auth.register.disabled.title') }}
|
|
@@ -234,6 +238,7 @@ async function onSubmit(): Promise<void> {
|
|
|
234
238
|
type="text"
|
|
235
239
|
:label="t('auth.register.fields.company')"
|
|
236
240
|
name="company"
|
|
241
|
+
:label-class="REQUIRED_MARK"
|
|
237
242
|
validation="required|companyName"
|
|
238
243
|
:validation-messages="{ companyName: t('validation.invalidCompanyName') }"
|
|
239
244
|
:help="t('auth.register.companyRequiredHint')"
|
|
@@ -246,6 +251,7 @@ async function onSubmit(): Promise<void> {
|
|
|
246
251
|
type="text"
|
|
247
252
|
:label="t('auth.register.fields2.vatId')"
|
|
248
253
|
name="vatId"
|
|
254
|
+
:label-class="vatRules?.includes('required') ? REQUIRED_MARK : undefined"
|
|
249
255
|
:validation="vatRules"
|
|
250
256
|
:help="vatValidation === 'vies'
|
|
251
257
|
? t('auth.register.fields2.vatIdVerified')
|
|
@@ -258,6 +264,7 @@ async function onSubmit(): Promise<void> {
|
|
|
258
264
|
type="text"
|
|
259
265
|
:label="t('auth.register.fields2.customerNumber')"
|
|
260
266
|
name="customerNumber"
|
|
267
|
+
:label-class="REQUIRED_MARK"
|
|
261
268
|
validation="required"
|
|
262
269
|
:help="t('auth.register.fields2.customerNumberHint')"
|
|
263
270
|
/>
|
|
@@ -282,6 +289,7 @@ async function onSubmit(): Promise<void> {
|
|
|
282
289
|
type="text"
|
|
283
290
|
:label="t('auth.register.fields.firstName')"
|
|
284
291
|
name="firstName"
|
|
292
|
+
:label-class="REQUIRED_MARK"
|
|
285
293
|
validation="required"
|
|
286
294
|
autocomplete="given-name"
|
|
287
295
|
/>
|
|
@@ -290,6 +298,7 @@ async function onSubmit(): Promise<void> {
|
|
|
290
298
|
type="text"
|
|
291
299
|
:label="t('auth.register.fields.lastName')"
|
|
292
300
|
name="lastName"
|
|
301
|
+
:label-class="REQUIRED_MARK"
|
|
293
302
|
validation="required"
|
|
294
303
|
autocomplete="family-name"
|
|
295
304
|
/>
|
|
@@ -322,21 +331,23 @@ async function onSubmit(): Promise<void> {
|
|
|
322
331
|
<h3 class="text-xl font-semibold text-highlighted">
|
|
323
332
|
{{ t('auth.register.sections.address') }}
|
|
324
333
|
</h3>
|
|
325
|
-
<div class="grid grid-cols-3 gap-4">
|
|
334
|
+
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
|
|
326
335
|
<FormKit
|
|
327
336
|
v-model="state.street"
|
|
328
337
|
type="text"
|
|
329
338
|
:label="t('auth.register.fields2.street')"
|
|
330
339
|
name="street"
|
|
340
|
+
:label-class="REQUIRED_MARK"
|
|
331
341
|
validation="required"
|
|
332
342
|
autocomplete="address-line1"
|
|
333
|
-
outer-class="col-span-2"
|
|
343
|
+
outer-class="sm:col-span-2"
|
|
334
344
|
/>
|
|
335
345
|
<FormKit
|
|
336
346
|
v-model="state.streetNumber"
|
|
337
347
|
type="text"
|
|
338
348
|
:label="t('auth.register.fields2.streetNumber')"
|
|
339
349
|
name="streetNumber"
|
|
350
|
+
:label-class="REQUIRED_MARK"
|
|
340
351
|
validation="required"
|
|
341
352
|
autocomplete="address-line2"
|
|
342
353
|
/>
|
|
@@ -347,6 +358,7 @@ async function onSubmit(): Promise<void> {
|
|
|
347
358
|
type="text"
|
|
348
359
|
:label="t('auth.register.fields2.zip')"
|
|
349
360
|
name="zip"
|
|
361
|
+
:label-class="REQUIRED_MARK"
|
|
350
362
|
validation="required|zip"
|
|
351
363
|
:validation-messages="{ zip: t('validation.invalidZipCode') }"
|
|
352
364
|
autocomplete="postal-code"
|
|
@@ -356,6 +368,7 @@ async function onSubmit(): Promise<void> {
|
|
|
356
368
|
type="text"
|
|
357
369
|
:label="t('auth.register.fields2.city')"
|
|
358
370
|
name="city"
|
|
371
|
+
:label-class="REQUIRED_MARK"
|
|
359
372
|
validation="required"
|
|
360
373
|
autocomplete="address-level2"
|
|
361
374
|
outer-class="col-span-2"
|
|
@@ -366,6 +379,7 @@ async function onSubmit(): Promise<void> {
|
|
|
366
379
|
type="select"
|
|
367
380
|
:label="t('auth.register.fields2.country')"
|
|
368
381
|
name="country"
|
|
382
|
+
:label-class="REQUIRED_MARK"
|
|
369
383
|
validation="required"
|
|
370
384
|
:options="COUNTRIES"
|
|
371
385
|
/>
|
|
@@ -381,6 +395,7 @@ async function onSubmit(): Promise<void> {
|
|
|
381
395
|
type="email"
|
|
382
396
|
:label="t('auth.register.fields.email')"
|
|
383
397
|
name="email"
|
|
398
|
+
:label-class="REQUIRED_MARK"
|
|
384
399
|
validation="required|email"
|
|
385
400
|
autocomplete="email"
|
|
386
401
|
:placeholder="t('auth.register.fields.emailPlaceholder')"
|
|
@@ -391,6 +406,7 @@ async function onSubmit(): Promise<void> {
|
|
|
391
406
|
type="password"
|
|
392
407
|
:label="t('auth.register.fields.password')"
|
|
393
408
|
name="password"
|
|
409
|
+
:label-class="REQUIRED_MARK"
|
|
394
410
|
validation="required|length:8"
|
|
395
411
|
autocomplete="new-password"
|
|
396
412
|
:placeholder="t('auth.register.fields.passwordPlaceholder')"
|
|
@@ -400,6 +416,7 @@ async function onSubmit(): Promise<void> {
|
|
|
400
416
|
type="password"
|
|
401
417
|
:label="t('auth.register.fields.passwordConfirm')"
|
|
402
418
|
name="passwordConfirm"
|
|
419
|
+
:label-class="REQUIRED_MARK"
|
|
403
420
|
validation="required|confirm:password"
|
|
404
421
|
autocomplete="new-password"
|
|
405
422
|
:placeholder="t('auth.register.fields.passwordConfirmPlaceholder')"
|
|
@@ -412,6 +429,7 @@ async function onSubmit(): Promise<void> {
|
|
|
412
429
|
type="checkbox"
|
|
413
430
|
:label="t('auth.register.fields.acceptTerms')"
|
|
414
431
|
name="acceptTerms"
|
|
432
|
+
:label-class="REQUIRED_MARK_LEADING"
|
|
415
433
|
validation="accepted"
|
|
416
434
|
:validation-messages="{ accepted: t('validation.termsRequired') }"
|
|
417
435
|
:help="t('auth.register.fields.acceptTermsDescription')"
|
|
@@ -443,6 +461,7 @@ async function onSubmit(): Promise<void> {
|
|
|
443
461
|
color="primary"
|
|
444
462
|
variant="solid"
|
|
445
463
|
block
|
|
464
|
+
class="max-lg:min-h-11"
|
|
446
465
|
:loading="loading"
|
|
447
466
|
:label="t('auth.register.submit')"
|
|
448
467
|
/>
|