@revenexx/cover 0.15.0 → 0.17.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/ui/forms/PasswordInput.vue +2 -0
- 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/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/pages/punchout/transfer.vue +36 -1
- package/app/pages/widerruf.vue +33 -0
- package/app/shared/addressLines.ts +66 -0
- package/app/shared/checkoutAddressRefusal.ts +63 -0
- 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/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/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/forms/[slug].get.ts +1 -3
- package/server/api/orders/index.post.ts +33 -50
- package/server/api/punchout/return.post.ts +3 -1
- package/server/data/forms/authored.json +69 -8
- package/server/dev/errorHandler.ts +47 -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/ApiCartService.ts +75 -6
- 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/orderPayment.ts +155 -0
- package/server/utils/punchoutFormAction.ts +44 -0
|
@@ -62,10 +62,11 @@ interface Row {
|
|
|
62
62
|
const emptyRow = (): Row => ({ sku: "", customSku: "", quantity: 1 });
|
|
63
63
|
const rows = ref<Row[]>([emptyRow()]);
|
|
64
64
|
|
|
65
|
-
const resolvedRows = computed(() => rows.value.map((row) => {
|
|
65
|
+
const resolvedRows = computed(() => rows.value.map((row, index) => {
|
|
66
66
|
const product = row.sku.trim() ? findProduct(row.sku) : undefined;
|
|
67
67
|
return {
|
|
68
68
|
...row,
|
|
69
|
+
index,
|
|
69
70
|
product,
|
|
70
71
|
state: !row.sku.trim() ? "empty" as const : product ? "found" as const : "unknown" as const,
|
|
71
72
|
};
|
|
@@ -277,6 +278,11 @@ async function finish(added: number): Promise<void> {
|
|
|
277
278
|
variant="link"
|
|
278
279
|
:items="tabs"
|
|
279
280
|
:content="false"
|
|
281
|
+
:ui="{
|
|
282
|
+
list: 'max-md:flex-col max-md:items-stretch max-md:gap-1 max-md:border-b-0',
|
|
283
|
+
indicator: 'max-md:hidden',
|
|
284
|
+
trigger: 'max-lg:min-h-11 max-md:w-full max-md:justify-start max-md:rounded-md max-md:px-3 max-md:data-[state=active]:bg-elevated',
|
|
285
|
+
}"
|
|
280
286
|
/>
|
|
281
287
|
|
|
282
288
|
<!-- Tab 1: quick row entry -->
|
|
@@ -284,7 +290,74 @@ async function finish(added: number): Promise<void> {
|
|
|
284
290
|
v-if="tab === 'entry'"
|
|
285
291
|
class="space-y-4"
|
|
286
292
|
>
|
|
287
|
-
|
|
293
|
+
<!-- Mobile (below md): one card per row, like the account tables -->
|
|
294
|
+
<UiTableCardList
|
|
295
|
+
:rows="resolvedRows"
|
|
296
|
+
:row-key="row => String(row.index)"
|
|
297
|
+
>
|
|
298
|
+
<template #item="{ row }">
|
|
299
|
+
<div class="space-y-3">
|
|
300
|
+
<UInput
|
|
301
|
+
v-model="rows[row.index]!.sku"
|
|
302
|
+
class="w-full"
|
|
303
|
+
:ui="{ base: 'min-h-11' }"
|
|
304
|
+
:placeholder="t('directOrder.skuPlaceholder')"
|
|
305
|
+
/>
|
|
306
|
+
<UInput
|
|
307
|
+
v-model="rows[row.index]!.customSku"
|
|
308
|
+
class="w-full"
|
|
309
|
+
:ui="{ base: 'min-h-11' }"
|
|
310
|
+
:placeholder="t('directOrder.customSkuPlaceholder')"
|
|
311
|
+
/>
|
|
312
|
+
<div class="flex items-center justify-between gap-2">
|
|
313
|
+
<UInputNumber
|
|
314
|
+
v-model="rows[row.index]!.quantity"
|
|
315
|
+
:min="1"
|
|
316
|
+
class="w-36"
|
|
317
|
+
:ui="{
|
|
318
|
+
base: 'min-h-11',
|
|
319
|
+
increment: '[&>button]:size-11',
|
|
320
|
+
decrement: '[&>button]:size-11',
|
|
321
|
+
}"
|
|
322
|
+
/>
|
|
323
|
+
<UButton
|
|
324
|
+
:icon="icon('delete')"
|
|
325
|
+
color="neutral"
|
|
326
|
+
variant="ghost"
|
|
327
|
+
tabindex="0"
|
|
328
|
+
class="size-11 justify-center"
|
|
329
|
+
:aria-label="t('directOrder.removeRow')"
|
|
330
|
+
@click="removeRow(row.index)"
|
|
331
|
+
/>
|
|
332
|
+
</div>
|
|
333
|
+
<span
|
|
334
|
+
v-if="row.state === 'found'"
|
|
335
|
+
class="flex items-center gap-1.5 text-sm text-success"
|
|
336
|
+
>
|
|
337
|
+
<UIcon
|
|
338
|
+
:name="icon('success')"
|
|
339
|
+
class="size-4 shrink-0"
|
|
340
|
+
/>
|
|
341
|
+
<span class="text-highlighted">{{ row.product!.name }}</span>
|
|
342
|
+
</span>
|
|
343
|
+
<span
|
|
344
|
+
v-else-if="row.state === 'unknown'"
|
|
345
|
+
class="flex items-center gap-1.5 text-xs text-error"
|
|
346
|
+
>
|
|
347
|
+
<UIcon
|
|
348
|
+
:name="icon('error')"
|
|
349
|
+
class="size-4 shrink-0"
|
|
350
|
+
/>
|
|
351
|
+
{{ t('directOrder.unknownSku') }}
|
|
352
|
+
</span>
|
|
353
|
+
</div>
|
|
354
|
+
</template>
|
|
355
|
+
<template #empty>
|
|
356
|
+
<span />
|
|
357
|
+
</template>
|
|
358
|
+
</UiTableCardList>
|
|
359
|
+
|
|
360
|
+
<div class="hidden md:block rounded-xl border border-(--ui-border) overflow-x-auto">
|
|
288
361
|
<table class="w-full text-sm">
|
|
289
362
|
<thead>
|
|
290
363
|
<tr class="text-left text-xs uppercase tracking-wide text-muted bg-elevated/60">
|
|
@@ -312,7 +385,8 @@ async function finish(added: number): Promise<void> {
|
|
|
312
385
|
<UInput
|
|
313
386
|
v-model="rows[index]!.sku"
|
|
314
387
|
size="sm"
|
|
315
|
-
class="w-full min-w-40"
|
|
388
|
+
class="w-full min-w-40 max-lg:min-w-32"
|
|
389
|
+
:ui="{ base: 'max-lg:min-h-11' }"
|
|
316
390
|
:placeholder="t('directOrder.skuPlaceholder')"
|
|
317
391
|
/>
|
|
318
392
|
</td>
|
|
@@ -320,7 +394,8 @@ async function finish(added: number): Promise<void> {
|
|
|
320
394
|
<UInput
|
|
321
395
|
v-model="rows[index]!.customSku"
|
|
322
396
|
size="sm"
|
|
323
|
-
class="w-full min-w-40"
|
|
397
|
+
class="w-full min-w-40 max-lg:min-w-32"
|
|
398
|
+
:ui="{ base: 'max-lg:min-h-11' }"
|
|
324
399
|
:placeholder="t('directOrder.customSkuPlaceholder')"
|
|
325
400
|
/>
|
|
326
401
|
</td>
|
|
@@ -329,19 +404,24 @@ async function finish(added: number): Promise<void> {
|
|
|
329
404
|
v-model="rows[index]!.quantity"
|
|
330
405
|
size="sm"
|
|
331
406
|
:min="1"
|
|
332
|
-
class="w-32"
|
|
407
|
+
class="w-32 max-lg:w-36"
|
|
408
|
+
:ui="{
|
|
409
|
+
base: 'max-lg:min-h-11',
|
|
410
|
+
increment: 'max-lg:[&>button]:size-11',
|
|
411
|
+
decrement: 'max-lg:[&>button]:size-11',
|
|
412
|
+
}"
|
|
333
413
|
/>
|
|
334
414
|
</td>
|
|
335
|
-
<td class="py-2 px-3">
|
|
415
|
+
<td class="py-2 px-3 md:max-w-0 lg:max-w-none">
|
|
336
416
|
<span
|
|
337
417
|
v-if="row.state === 'found'"
|
|
338
|
-
class="inline-flex items-center gap-1.5 text-success"
|
|
418
|
+
class="inline-flex max-w-full items-center gap-1.5 text-success"
|
|
339
419
|
>
|
|
340
420
|
<UIcon
|
|
341
421
|
:name="icon('success')"
|
|
342
|
-
class="size-4"
|
|
422
|
+
class="size-4 shrink-0"
|
|
343
423
|
/>
|
|
344
|
-
<span class="
|
|
424
|
+
<span class="text-highlighted lg:truncate">{{ row.product!.name }}</span>
|
|
345
425
|
</span>
|
|
346
426
|
<span
|
|
347
427
|
v-else-if="row.state === 'unknown'"
|
|
@@ -349,7 +429,7 @@ async function finish(added: number): Promise<void> {
|
|
|
349
429
|
>
|
|
350
430
|
<UIcon
|
|
351
431
|
:name="icon('error')"
|
|
352
|
-
class="size-4"
|
|
432
|
+
class="size-4 shrink-0"
|
|
353
433
|
/>
|
|
354
434
|
{{ t('directOrder.unknownSku') }}
|
|
355
435
|
</span>
|
|
@@ -366,6 +446,7 @@ async function finish(added: number): Promise<void> {
|
|
|
366
446
|
variant="ghost"
|
|
367
447
|
size="xs"
|
|
368
448
|
tabindex="0"
|
|
449
|
+
class="max-lg:size-11 max-lg:justify-center"
|
|
369
450
|
:aria-label="t('directOrder.removeRow')"
|
|
370
451
|
@click="removeRow(index)"
|
|
371
452
|
/>
|
|
@@ -379,6 +460,7 @@ async function finish(added: number): Promise<void> {
|
|
|
379
460
|
<UButton
|
|
380
461
|
color="primary"
|
|
381
462
|
tabindex="0"
|
|
463
|
+
class="max-lg:min-h-11"
|
|
382
464
|
:icon="icon('cart')"
|
|
383
465
|
:disabled="validRowCount === 0"
|
|
384
466
|
:label="t('directOrder.submitRows')"
|
|
@@ -388,6 +470,7 @@ async function finish(added: number): Promise<void> {
|
|
|
388
470
|
color="neutral"
|
|
389
471
|
variant="soft"
|
|
390
472
|
tabindex="0"
|
|
473
|
+
class="max-lg:min-h-11"
|
|
391
474
|
:icon="icon('plus')"
|
|
392
475
|
:label="t('directOrder.addRow')"
|
|
393
476
|
@click="addRow"
|
|
@@ -411,12 +494,14 @@ async function finish(added: number): Promise<void> {
|
|
|
411
494
|
v-model="uploadFormat"
|
|
412
495
|
:items="formatItems"
|
|
413
496
|
:aria-label="t('directOrder.upload.format')"
|
|
414
|
-
class="w-72"
|
|
497
|
+
class="w-72 max-w-full"
|
|
498
|
+
:ui="{ base: 'max-lg:min-h-11' }"
|
|
415
499
|
/>
|
|
416
500
|
<UButton
|
|
417
501
|
color="neutral"
|
|
418
502
|
variant="soft"
|
|
419
503
|
tabindex="0"
|
|
504
|
+
class="max-lg:min-h-11"
|
|
420
505
|
:trailing-icon="icon('chevron-right')"
|
|
421
506
|
:label="t('directOrder.upload.template')"
|
|
422
507
|
:to="templateUrl"
|
|
@@ -451,6 +536,7 @@ async function finish(added: number): Promise<void> {
|
|
|
451
536
|
<UButton
|
|
452
537
|
color="primary"
|
|
453
538
|
tabindex="0"
|
|
539
|
+
class="max-lg:min-h-11"
|
|
454
540
|
:icon="icon('cart')"
|
|
455
541
|
:disabled="uploadFoundCount === 0"
|
|
456
542
|
:label="t('directOrder.upload.submit')"
|
|
@@ -482,7 +568,8 @@ async function finish(added: number): Promise<void> {
|
|
|
482
568
|
v-model="separator"
|
|
483
569
|
:items="separatorItems"
|
|
484
570
|
:aria-label="t('directOrder.paste.separator')"
|
|
485
|
-
class="w-72"
|
|
571
|
+
class="w-72 max-w-full"
|
|
572
|
+
:ui="{ base: 'max-lg:min-h-11' }"
|
|
486
573
|
/>
|
|
487
574
|
|
|
488
575
|
<UTextarea
|
|
@@ -496,6 +583,7 @@ async function finish(added: number): Promise<void> {
|
|
|
496
583
|
<UButton
|
|
497
584
|
color="primary"
|
|
498
585
|
tabindex="0"
|
|
586
|
+
class="max-lg:min-h-11"
|
|
499
587
|
:icon="icon('cart')"
|
|
500
588
|
:disabled="pasteFoundCount === 0"
|
|
501
589
|
:label="t('directOrder.paste.submit')"
|
|
@@ -57,17 +57,33 @@ const filterItems = computed(() => [
|
|
|
57
57
|
/* ---- columns + sorting ------------------------------------------------ */
|
|
58
58
|
const sorting = ref([{ id: "label", desc: false }]);
|
|
59
59
|
|
|
60
|
+
function thresholdValue(limit: ApprovalLimit): number {
|
|
61
|
+
return limit.maxAmount ?? limit.availableBudget ?? limit.totalBudget ?? -1;
|
|
62
|
+
}
|
|
63
|
+
|
|
60
64
|
const columns = computed<TableColumn<ApprovalLimit>[]>(() => [
|
|
61
65
|
{ accessorKey: "label", header: t("governance.approvals.columns.label") },
|
|
62
66
|
{ id: "type", header: t("governance.approvals.columns.type"), enableSorting: false },
|
|
63
67
|
{
|
|
64
68
|
id: "threshold",
|
|
65
|
-
accessorFn: row => row
|
|
69
|
+
accessorFn: row => thresholdValue(row),
|
|
66
70
|
header: t("governance.approvals.columns.threshold"),
|
|
67
71
|
meta: { class: { th: "text-right", td: "text-right" } },
|
|
68
72
|
},
|
|
69
73
|
{ id: "approval", header: t("governance.approvals.columns.approval"), enableSorting: false },
|
|
70
|
-
|
|
74
|
+
// Below lg the deputy folds into the approver cell as a second line.
|
|
75
|
+
{
|
|
76
|
+
id: "deputy",
|
|
77
|
+
header: t("governance.approvals.columns.deputy"),
|
|
78
|
+
enableSorting: false,
|
|
79
|
+
meta: { class: { th: "max-lg:hidden", td: "max-lg:hidden" } },
|
|
80
|
+
},
|
|
81
|
+
]);
|
|
82
|
+
|
|
83
|
+
/* ---- mobile card list (below md) ---------------------------------------- */
|
|
84
|
+
const { items: sortItems, model: mobileSort, sorted: sortedLimits } = useMobileTableSort(filtered, sorting, () => [
|
|
85
|
+
{ id: "label", label: t("governance.approvals.columns.label"), kind: "text", value: limit => limit.label },
|
|
86
|
+
{ id: "threshold", label: t("governance.approvals.columns.threshold"), kind: "number", value: thresholdValue },
|
|
71
87
|
]);
|
|
72
88
|
|
|
73
89
|
const typeColors: Record<ApprovalLimit["type"], "primary" | "info" | "warning" | "neutral"> = {
|
|
@@ -106,6 +122,7 @@ function thresholdLabel(limit: ApprovalLimit): string | null {
|
|
|
106
122
|
<UButton
|
|
107
123
|
color="primary"
|
|
108
124
|
tabindex="0"
|
|
125
|
+
class="max-lg:min-h-11"
|
|
109
126
|
:icon="icon('plus')"
|
|
110
127
|
:label="t('governance.approvals.add')"
|
|
111
128
|
@click="modalOpen = true"
|
|
@@ -113,8 +130,88 @@ function thresholdLabel(limit: ApprovalLimit): string | null {
|
|
|
113
130
|
</template>
|
|
114
131
|
</UiTableToolbar>
|
|
115
132
|
|
|
133
|
+
<UiTableCardList
|
|
134
|
+
v-model:sort="mobileSort"
|
|
135
|
+
:rows="sortedLimits"
|
|
136
|
+
:row-key="limit => limit.id"
|
|
137
|
+
:sort-items="sortItems"
|
|
138
|
+
:loading="status === 'pending'"
|
|
139
|
+
>
|
|
140
|
+
<template #item="{ row }">
|
|
141
|
+
<div class="flex flex-wrap items-center gap-1.5">
|
|
142
|
+
<span class="font-semibold text-highlighted break-words min-w-0">{{ row.label }}</span>
|
|
143
|
+
<UBadge
|
|
144
|
+
:color="typeColors[row.type]"
|
|
145
|
+
variant="subtle"
|
|
146
|
+
size="sm"
|
|
147
|
+
:label="t(`governance.approvals.types.${row.type}`)"
|
|
148
|
+
/>
|
|
149
|
+
</div>
|
|
150
|
+
<p class="mt-1 text-sm tabular-nums text-highlighted">
|
|
151
|
+
<span v-if="thresholdLabel(row)">{{ thresholdLabel(row) }}</span>
|
|
152
|
+
<span
|
|
153
|
+
v-else
|
|
154
|
+
class="text-dimmed"
|
|
155
|
+
>—</span>
|
|
156
|
+
</p>
|
|
157
|
+
<dl class="mt-2 space-y-1 text-sm">
|
|
158
|
+
<div class="flex flex-wrap items-baseline gap-x-2">
|
|
159
|
+
<dt class="text-xs text-muted">
|
|
160
|
+
{{ t('governance.approvals.columns.approval') }}
|
|
161
|
+
</dt>
|
|
162
|
+
<dd class="min-w-0">
|
|
163
|
+
<template v-if="row.approval.required">
|
|
164
|
+
{{ row.approval.approverName }}
|
|
165
|
+
<span
|
|
166
|
+
v-if="row.approval.timeLimitHours"
|
|
167
|
+
class="text-muted whitespace-nowrap"
|
|
168
|
+
>· {{ t('governance.approvals.timeFrame', { hours: row.approval.timeLimitHours }) }}</span>
|
|
169
|
+
</template>
|
|
170
|
+
<UBadge
|
|
171
|
+
v-else
|
|
172
|
+
color="neutral"
|
|
173
|
+
variant="subtle"
|
|
174
|
+
size="sm"
|
|
175
|
+
:label="t('governance.approvals.infoOnly')"
|
|
176
|
+
/>
|
|
177
|
+
</dd>
|
|
178
|
+
</div>
|
|
179
|
+
<div
|
|
180
|
+
v-if="row.approval.deputyName"
|
|
181
|
+
class="flex flex-wrap items-baseline gap-x-2"
|
|
182
|
+
>
|
|
183
|
+
<dt class="text-xs text-muted">
|
|
184
|
+
{{ t('governance.approvals.columns.deputy') }}
|
|
185
|
+
</dt>
|
|
186
|
+
<dd class="min-w-0">
|
|
187
|
+
{{ row.approval.deputyName }}
|
|
188
|
+
<span
|
|
189
|
+
v-if="row.approval.deputyTimeLimitHours"
|
|
190
|
+
class="text-muted whitespace-nowrap"
|
|
191
|
+
>· {{ t('governance.approvals.timeFrame', { hours: row.approval.deputyTimeLimitHours }) }}</span>
|
|
192
|
+
</dd>
|
|
193
|
+
</div>
|
|
194
|
+
</dl>
|
|
195
|
+
</template>
|
|
196
|
+
<template #empty>
|
|
197
|
+
<UiFeedbackEmptyState
|
|
198
|
+
v-if="search || typeFilter !== 'all'"
|
|
199
|
+
:icon="icon('no-results')"
|
|
200
|
+
:title="t('table.noResults.title')"
|
|
201
|
+
:description="t('table.noResults.description')"
|
|
202
|
+
/>
|
|
203
|
+
<UiFeedbackEmptyState
|
|
204
|
+
v-else
|
|
205
|
+
:icon="icon('empty')"
|
|
206
|
+
:title="t('governance.approvals.empty.title')"
|
|
207
|
+
:description="t('governance.approvals.empty.description')"
|
|
208
|
+
/>
|
|
209
|
+
</template>
|
|
210
|
+
</UiTableCardList>
|
|
211
|
+
|
|
116
212
|
<UTable
|
|
117
213
|
v-model:sorting="sorting"
|
|
214
|
+
class="hidden md:block"
|
|
118
215
|
:data="filtered"
|
|
119
216
|
:columns="columns"
|
|
120
217
|
:loading="status === 'pending'"
|
|
@@ -147,7 +244,7 @@ function thresholdLabel(limit: ApprovalLimit): string | null {
|
|
|
147
244
|
<template #threshold-cell="{ row }">
|
|
148
245
|
<span
|
|
149
246
|
v-if="thresholdLabel(row.original)"
|
|
150
|
-
class="tabular-nums"
|
|
247
|
+
class="tabular-nums whitespace-normal block"
|
|
151
248
|
>{{ thresholdLabel(row.original) }}</span>
|
|
152
249
|
<span
|
|
153
250
|
v-else
|
|
@@ -155,15 +252,18 @@ function thresholdLabel(limit: ApprovalLimit): string | null {
|
|
|
155
252
|
>—</span>
|
|
156
253
|
</template>
|
|
157
254
|
<template #approval-cell="{ row }">
|
|
158
|
-
<
|
|
255
|
+
<div
|
|
256
|
+
v-if="row.original.approval.required"
|
|
257
|
+
class="whitespace-normal"
|
|
258
|
+
>
|
|
159
259
|
{{ row.original.approval.approverName }}
|
|
160
260
|
<span
|
|
161
261
|
v-if="row.original.approval.timeLimitHours"
|
|
162
|
-
class="text-muted"
|
|
262
|
+
class="text-muted whitespace-nowrap"
|
|
163
263
|
>
|
|
164
264
|
· {{ t('governance.approvals.timeFrame', { hours: row.original.approval.timeLimitHours }) }}
|
|
165
265
|
</span>
|
|
166
|
-
</
|
|
266
|
+
</div>
|
|
167
267
|
<UBadge
|
|
168
268
|
v-else
|
|
169
269
|
color="neutral"
|
|
@@ -171,13 +271,29 @@ function thresholdLabel(limit: ApprovalLimit): string | null {
|
|
|
171
271
|
size="sm"
|
|
172
272
|
:label="t('governance.approvals.infoOnly')"
|
|
173
273
|
/>
|
|
274
|
+
<div
|
|
275
|
+
v-if="row.original.approval.deputyName"
|
|
276
|
+
class="mt-1 whitespace-normal text-xs text-muted lg:hidden"
|
|
277
|
+
>
|
|
278
|
+
{{ t('governance.approvals.columns.deputy') }}:
|
|
279
|
+
{{ row.original.approval.deputyName }}
|
|
280
|
+
<span
|
|
281
|
+
v-if="row.original.approval.deputyTimeLimitHours"
|
|
282
|
+
class="whitespace-nowrap"
|
|
283
|
+
>
|
|
284
|
+
· {{ t('governance.approvals.timeFrame', { hours: row.original.approval.deputyTimeLimitHours }) }}
|
|
285
|
+
</span>
|
|
286
|
+
</div>
|
|
174
287
|
</template>
|
|
175
288
|
<template #deputy-cell="{ row }">
|
|
176
|
-
<span
|
|
289
|
+
<span
|
|
290
|
+
v-if="row.original.approval.deputyName"
|
|
291
|
+
class="whitespace-normal block"
|
|
292
|
+
>
|
|
177
293
|
{{ row.original.approval.deputyName }}
|
|
178
294
|
<span
|
|
179
295
|
v-if="row.original.approval.deputyTimeLimitHours"
|
|
180
|
-
class="text-muted"
|
|
296
|
+
class="text-muted whitespace-nowrap"
|
|
181
297
|
>
|
|
182
298
|
· {{ t('governance.approvals.timeFrame', { hours: row.original.approval.deputyTimeLimitHours }) }}
|
|
183
299
|
</span>
|
|
@@ -93,7 +93,7 @@ const editOpen = ref(false);
|
|
|
93
93
|
</div>
|
|
94
94
|
<UButton
|
|
95
95
|
v-if="canManage"
|
|
96
|
-
class="ms-auto"
|
|
96
|
+
class="ms-auto max-lg:min-h-11"
|
|
97
97
|
color="neutral"
|
|
98
98
|
variant="outline"
|
|
99
99
|
size="sm"
|
|
@@ -221,7 +221,8 @@ const editOpen = ref(false);
|
|
|
221
221
|
{{ t('governance.costCenters.requisitionsTitle') }}
|
|
222
222
|
</h2>
|
|
223
223
|
<ULink
|
|
224
|
-
class="text-xs font-medium text-primary hover:underline
|
|
224
|
+
class="inline-flex shrink-0 items-center whitespace-nowrap text-xs font-medium text-primary hover:underline
|
|
225
|
+
max-lg:-my-3 max-lg:min-h-11"
|
|
225
226
|
:to="localePath('/account/requisitions')"
|
|
226
227
|
>
|
|
227
228
|
{{ t('account.dashboard.viewAll') }} →
|
|
@@ -69,6 +69,14 @@ const columns = computed<TableColumn<CostCenter>[]>(() => [
|
|
|
69
69
|
{ id: "actions", header: "", enableSorting: false },
|
|
70
70
|
]);
|
|
71
71
|
|
|
72
|
+
/* ---- mobile card list (below md) ---------------------------------------- */
|
|
73
|
+
const { items: sortItems, model: mobileSort, sorted: sortedCostCenters } = useMobileTableSort(filtered, sorting, () => [
|
|
74
|
+
{ id: "code", label: t("governance.costCenters.columns.code"), kind: "text", value: costCenter => costCenter.code },
|
|
75
|
+
{ id: "label", label: t("governance.costCenters.columns.label"), kind: "text", value: costCenter => costCenter.label },
|
|
76
|
+
{ id: "budget", label: t("governance.costCenters.columns.budget"), kind: "number", value: costCenter => costCenter.limit?.totalBudget ?? -1 },
|
|
77
|
+
{ id: "available", label: t("governance.costCenters.columns.available"), kind: "number", value: costCenter => costCenter.limit?.availableBudget ?? -1 },
|
|
78
|
+
]);
|
|
79
|
+
|
|
72
80
|
function utilization(cc: CostCenter): number | null {
|
|
73
81
|
const limit = cc.limit;
|
|
74
82
|
if (!limit?.totalBudget || limit.availableBudget === undefined) {
|
|
@@ -91,6 +99,7 @@ function utilization(cc: CostCenter): number | null {
|
|
|
91
99
|
<UButton
|
|
92
100
|
color="primary"
|
|
93
101
|
tabindex="0"
|
|
102
|
+
class="max-lg:min-h-11"
|
|
94
103
|
:icon="icon('plus')"
|
|
95
104
|
:label="t('governance.costCenters.add')"
|
|
96
105
|
@click="add"
|
|
@@ -98,12 +107,125 @@ function utilization(cc: CostCenter): number | null {
|
|
|
98
107
|
</template>
|
|
99
108
|
</UiTableToolbar>
|
|
100
109
|
|
|
110
|
+
<UiTableCardList
|
|
111
|
+
v-model:sort="mobileSort"
|
|
112
|
+
:rows="sortedCostCenters"
|
|
113
|
+
:row-key="costCenter => costCenter.id"
|
|
114
|
+
:sort-items="sortItems"
|
|
115
|
+
:loading="status === 'pending'"
|
|
116
|
+
>
|
|
117
|
+
<template #item="{ row }">
|
|
118
|
+
<div class="flex items-start justify-between gap-2">
|
|
119
|
+
<div class="min-w-0 -mt-1">
|
|
120
|
+
<p class="text-xs text-muted">
|
|
121
|
+
{{ row.code }}
|
|
122
|
+
</p>
|
|
123
|
+
<ULink
|
|
124
|
+
class="inline-flex min-h-11 items-center font-semibold text-highlighted hover:text-primary transition-colors break-words"
|
|
125
|
+
:to="localePath(`/account/cost-centers/${row.id}`)"
|
|
126
|
+
>
|
|
127
|
+
{{ row.label }}
|
|
128
|
+
</ULink>
|
|
129
|
+
</div>
|
|
130
|
+
<div class="flex items-center shrink-0 -my-2 -me-2.5">
|
|
131
|
+
<UButton
|
|
132
|
+
color="neutral"
|
|
133
|
+
variant="ghost"
|
|
134
|
+
class="size-11 justify-center"
|
|
135
|
+
:icon="icon('eye')"
|
|
136
|
+
:aria-label="t('governance.requisitions.details')"
|
|
137
|
+
:to="localePath(`/account/cost-centers/${row.id}`)"
|
|
138
|
+
/>
|
|
139
|
+
<UButton
|
|
140
|
+
v-if="canManage"
|
|
141
|
+
color="neutral"
|
|
142
|
+
variant="ghost"
|
|
143
|
+
class="size-11 justify-center"
|
|
144
|
+
:icon="icon('edit')"
|
|
145
|
+
:aria-label="t('governance.edit')"
|
|
146
|
+
@click="edit(row)"
|
|
147
|
+
/>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
<dl
|
|
151
|
+
v-if="row.limit"
|
|
152
|
+
class="mt-2 space-y-1 text-sm"
|
|
153
|
+
>
|
|
154
|
+
<div
|
|
155
|
+
v-if="row.limit.totalBudget !== undefined"
|
|
156
|
+
class="flex flex-wrap items-baseline gap-x-2"
|
|
157
|
+
>
|
|
158
|
+
<dt class="text-xs text-muted">
|
|
159
|
+
{{ t('governance.costCenters.columns.budget') }}
|
|
160
|
+
</dt>
|
|
161
|
+
<dd class="tabular-nums">
|
|
162
|
+
{{ formatCurrency(row.limit.totalBudget) }}
|
|
163
|
+
</dd>
|
|
164
|
+
</div>
|
|
165
|
+
<div
|
|
166
|
+
v-if="row.limit.availableBudget !== undefined"
|
|
167
|
+
class="space-y-1"
|
|
168
|
+
>
|
|
169
|
+
<div class="flex flex-wrap items-baseline gap-x-2">
|
|
170
|
+
<dt class="text-xs text-muted">
|
|
171
|
+
{{ t('governance.costCenters.columns.available') }}
|
|
172
|
+
</dt>
|
|
173
|
+
<dd class="tabular-nums">
|
|
174
|
+
{{ formatCurrency(row.limit.availableBudget) }}
|
|
175
|
+
</dd>
|
|
176
|
+
</div>
|
|
177
|
+
<div class="h-1.5 rounded-full bg-elevated overflow-hidden">
|
|
178
|
+
<div
|
|
179
|
+
class="h-full rounded-full"
|
|
180
|
+
:class="(utilization(row) ?? 0) >= 90 ? 'bg-warning' : 'bg-primary'"
|
|
181
|
+
:style="{ width: `${utilization(row) ?? 0}%` }"
|
|
182
|
+
/>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
<div
|
|
186
|
+
v-if="row.limit.approval.approverName"
|
|
187
|
+
class="flex flex-wrap items-baseline gap-x-2"
|
|
188
|
+
>
|
|
189
|
+
<dt class="text-xs text-muted">
|
|
190
|
+
{{ t('governance.costCenters.columns.approver') }}
|
|
191
|
+
</dt>
|
|
192
|
+
<dd class="min-w-0">
|
|
193
|
+
{{ row.limit.approval.approverName }}
|
|
194
|
+
<UBadge
|
|
195
|
+
v-if="row.limit.approval.required"
|
|
196
|
+
color="warning"
|
|
197
|
+
variant="subtle"
|
|
198
|
+
size="sm"
|
|
199
|
+
class="ml-1"
|
|
200
|
+
:label="t('governance.approvalRequired')"
|
|
201
|
+
/>
|
|
202
|
+
</dd>
|
|
203
|
+
</div>
|
|
204
|
+
</dl>
|
|
205
|
+
</template>
|
|
206
|
+
<template #empty>
|
|
207
|
+
<UiFeedbackEmptyState
|
|
208
|
+
v-if="search"
|
|
209
|
+
:icon="icon('no-results')"
|
|
210
|
+
:title="t('table.noResults.title')"
|
|
211
|
+
:description="t('table.noResults.description')"
|
|
212
|
+
/>
|
|
213
|
+
<UiFeedbackEmptyState
|
|
214
|
+
v-else
|
|
215
|
+
:icon="icon('empty')"
|
|
216
|
+
:title="t('governance.costCenters.empty.title')"
|
|
217
|
+
:description="t('governance.costCenters.empty.description')"
|
|
218
|
+
/>
|
|
219
|
+
</template>
|
|
220
|
+
</UiTableCardList>
|
|
221
|
+
|
|
101
222
|
<UTable
|
|
102
223
|
v-model:sorting="sorting"
|
|
224
|
+
class="hidden md:block"
|
|
103
225
|
:data="filtered"
|
|
104
226
|
:columns="columns"
|
|
105
227
|
:loading="status === 'pending'"
|
|
106
|
-
:ui="tableUi"
|
|
228
|
+
:ui="{ ...tableUi, th: `${tableUi.th} max-lg:px-2`, td: `${tableUi.td} max-lg:px-2` }"
|
|
107
229
|
>
|
|
108
230
|
<template #code-header="{ column }">
|
|
109
231
|
<UiTableSortButton
|
|
@@ -132,7 +254,7 @@ function utilization(cc: CostCenter): number | null {
|
|
|
132
254
|
|
|
133
255
|
<template #label-cell="{ row }">
|
|
134
256
|
<ULink
|
|
135
|
-
class="font-semibold text-highlighted hover:text-primary transition-colors"
|
|
257
|
+
class="font-semibold text-highlighted hover:text-primary transition-colors max-lg:inline-block max-lg:py-3 max-lg:-my-3"
|
|
136
258
|
:to="localePath(`/account/cost-centers/${row.original.id}`)"
|
|
137
259
|
>
|
|
138
260
|
{{ row.original.label }}
|
|
@@ -153,7 +275,7 @@ function utilization(cc: CostCenter): number | null {
|
|
|
153
275
|
<template #available-cell="{ row }">
|
|
154
276
|
<div
|
|
155
277
|
v-if="row.original.limit?.availableBudget !== undefined"
|
|
156
|
-
class="flex items-center gap-2 min-w-32"
|
|
278
|
+
class="flex items-center gap-2 min-w-32 max-lg:min-w-24"
|
|
157
279
|
>
|
|
158
280
|
<span class="tabular-nums shrink-0">
|
|
159
281
|
{{ formatCurrency(row.original.limit.availableBudget) }}
|
|
@@ -172,14 +294,17 @@ function utilization(cc: CostCenter): number | null {
|
|
|
172
294
|
>—</span>
|
|
173
295
|
</template>
|
|
174
296
|
<template #approver-cell="{ row }">
|
|
175
|
-
<span
|
|
297
|
+
<span
|
|
298
|
+
v-if="row.original.limit?.approval.approverName"
|
|
299
|
+
class="whitespace-normal block"
|
|
300
|
+
>
|
|
176
301
|
{{ row.original.limit.approval.approverName }}
|
|
177
302
|
<UBadge
|
|
178
303
|
v-if="row.original.limit.approval.required"
|
|
179
304
|
color="warning"
|
|
180
305
|
variant="subtle"
|
|
181
306
|
size="sm"
|
|
182
|
-
class="ml-1.5"
|
|
307
|
+
class="ml-1.5 max-lg:ml-0 max-lg:mt-1 max-lg:block max-lg:w-fit"
|
|
183
308
|
:label="t('governance.approvalRequired')"
|
|
184
309
|
/>
|
|
185
310
|
</span>
|
|
@@ -189,13 +314,14 @@ function utilization(cc: CostCenter): number | null {
|
|
|
189
314
|
>—</span>
|
|
190
315
|
</template>
|
|
191
316
|
<template #actions-cell="{ row }">
|
|
192
|
-
<div class="flex items-center justify-end gap-1">
|
|
317
|
+
<div class="flex items-center justify-end gap-1 max-lg:gap-0">
|
|
193
318
|
<UTooltip :text="t('governance.requisitions.details')">
|
|
194
319
|
<UButton
|
|
195
320
|
color="neutral"
|
|
196
321
|
variant="ghost"
|
|
197
322
|
size="sm"
|
|
198
323
|
tabindex="0"
|
|
324
|
+
class="max-lg:size-11 max-lg:justify-center"
|
|
199
325
|
:icon="icon('eye')"
|
|
200
326
|
:aria-label="t('governance.requisitions.details')"
|
|
201
327
|
:to="localePath(`/account/cost-centers/${row.original.id}`)"
|
|
@@ -211,6 +337,7 @@ function utilization(cc: CostCenter): number | null {
|
|
|
211
337
|
variant="ghost"
|
|
212
338
|
size="sm"
|
|
213
339
|
tabindex="0"
|
|
340
|
+
class="max-lg:size-11 max-lg:justify-center"
|
|
214
341
|
:aria-label="t('governance.edit')"
|
|
215
342
|
@click="edit(row.original)"
|
|
216
343
|
/>
|
|
@@ -161,6 +161,7 @@ async function loadIntoCart(): Promise<void> {
|
|
|
161
161
|
color="primary"
|
|
162
162
|
size="sm"
|
|
163
163
|
tabindex="0"
|
|
164
|
+
class="max-lg:min-h-11"
|
|
164
165
|
:icon="icon('cart')"
|
|
165
166
|
:label="t('cart.requisition.load')"
|
|
166
167
|
@click="loadIntoCart"
|
|
@@ -189,7 +190,7 @@ async function loadIntoCart(): Promise<void> {
|
|
|
189
190
|
/>
|
|
190
191
|
</span>
|
|
191
192
|
<div class="min-w-0 flex-1">
|
|
192
|
-
<p class="text-sm font-medium text-highlighted truncate">
|
|
193
|
+
<p class="text-sm font-medium text-highlighted md:truncate">
|
|
193
194
|
{{ item.name }}
|
|
194
195
|
</p>
|
|
195
196
|
<p class="text-xs text-muted">
|