@open-mercato/core 0.10.1-develop.7827.1.5c631908e4 → 0.10.1-develop.7836.1.0ef0f453c6
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/.turbo/turbo-build.log +1 -1
- package/dist/helpers/integration/appRuntime.js +17 -0
- package/dist/helpers/integration/appRuntime.js.map +7 -0
- package/dist/modules/cart/api/current/lines/bulk/route.js +1 -1
- package/dist/modules/cart/api/current/lines/bulk/route.js.map +2 -2
- package/dist/modules/cart/api/current/lines/route.js +1 -1
- package/dist/modules/cart/api/current/lines/route.js.map +2 -2
- package/dist/modules/cart/commands/lines.js +5 -10
- package/dist/modules/cart/commands/lines.js.map +2 -2
- package/dist/modules/cart/lib/currentCartRoute.js +8 -0
- package/dist/modules/cart/lib/currentCartRoute.js.map +3 -3
- package/dist/modules/cart/lib/lineMutationLock.js +52 -0
- package/dist/modules/cart/lib/lineMutationLock.js.map +7 -0
- package/dist/modules/sales/commands/documents.js +3 -3
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/components/documents/ItemsSection.js +75 -21
- package/dist/modules/sales/components/documents/ItemsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/lineItemUtils.js +2 -2
- package/dist/modules/sales/components/documents/lineItemUtils.js.map +2 -2
- package/dist/modules/warranty_claims/search.js +7 -6
- package/dist/modules/warranty_claims/search.js.map +2 -2
- package/package.json +7 -7
- package/src/helpers/integration/appRuntime.ts +26 -0
- package/src/modules/cart/api/current/lines/bulk/route.ts +1 -1
- package/src/modules/cart/api/current/lines/route.ts +1 -1
- package/src/modules/cart/commands/lines.ts +5 -10
- package/src/modules/cart/i18n/de.json +1 -0
- package/src/modules/cart/i18n/en.json +1 -0
- package/src/modules/cart/i18n/es.json +1 -0
- package/src/modules/cart/i18n/ko.json +1 -0
- package/src/modules/cart/i18n/pl.json +1 -0
- package/src/modules/cart/lib/currentCartRoute.ts +8 -0
- package/src/modules/cart/lib/lineMutationLock.ts +59 -0
- package/src/modules/sales/commands/documents.ts +3 -3
- package/src/modules/sales/components/documents/ItemsSection.tsx +82 -23
- package/src/modules/sales/components/documents/lineItemUtils.ts +2 -2
- package/src/modules/sales/i18n/de.json +1 -0
- package/src/modules/sales/i18n/en.json +1 -0
- package/src/modules/sales/i18n/es.json +1 -0
- package/src/modules/sales/i18n/ko.json +1 -0
- package/src/modules/sales/i18n/pl.json +1 -0
- package/src/modules/warranty_claims/i18n/de.json +1 -0
- package/src/modules/warranty_claims/i18n/en.json +1 -0
- package/src/modules/warranty_claims/i18n/es.json +1 -0
- package/src/modules/warranty_claims/i18n/ko.json +1 -0
- package/src/modules/warranty_claims/i18n/pl.json +1 -0
- package/src/modules/warranty_claims/search.ts +8 -5
|
@@ -41,17 +41,20 @@ function resolveClaimId(record: Record<string, unknown>): string | null {
|
|
|
41
41
|
return readString(record, 'id', 'id')
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
function resolvePresenter(record: Record<string, unknown>): SearchResultPresenter {
|
|
44
|
+
async function resolvePresenter(record: Record<string, unknown>): Promise<SearchResultPresenter> {
|
|
45
|
+
const { t } = await resolveTranslations()
|
|
45
46
|
const claimNumber = readString(record, 'claim_number', 'claimNumber') ?? 'Warranty claim'
|
|
46
47
|
const customerName = readString(record, 'customer_name', 'customerName')
|
|
47
48
|
const claimType = readString(record, 'claim_type', 'claimType')
|
|
48
49
|
const status = readString(record, 'status', 'status')
|
|
49
|
-
const
|
|
50
|
+
const statusLabel = status ? t(`warranty_claims.status.${status}`, status) : null
|
|
51
|
+
const subtitle = [customerName, claimType, statusLabel]
|
|
52
|
+
.filter((value): value is string => Boolean(value))
|
|
53
|
+
.join(' — ')
|
|
50
54
|
return {
|
|
51
55
|
title: claimNumber,
|
|
52
56
|
subtitle: subtitle || undefined,
|
|
53
57
|
icon: 'shield-check',
|
|
54
|
-
badge: status ?? undefined,
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
|
|
@@ -138,7 +141,7 @@ export const searchConfig: SearchModuleConfig = {
|
|
|
138
141
|
appendLineRows(lines, lineRows)
|
|
139
142
|
if (!lines.length) return null
|
|
140
143
|
|
|
141
|
-
const presenter = resolvePresenter(record)
|
|
144
|
+
const presenter = await resolvePresenter(record)
|
|
142
145
|
const url = buildClaimUrl(record)
|
|
143
146
|
const links: SearchResultLink[] = url ? [{ href: url, label: presenter.title, kind: 'primary' }] : []
|
|
144
147
|
return {
|
|
@@ -153,7 +156,7 @@ export const searchConfig: SearchModuleConfig = {
|
|
|
153
156
|
}
|
|
154
157
|
},
|
|
155
158
|
|
|
156
|
-
formatResult: (ctx: SearchBuildContext): SearchResultPresenter | null => {
|
|
159
|
+
formatResult: async (ctx: SearchBuildContext): Promise<SearchResultPresenter | null> => {
|
|
157
160
|
assertTenantContext(ctx)
|
|
158
161
|
return resolvePresenter(ctx.record)
|
|
159
162
|
},
|