@open-mercato/core 0.6.6-develop.6198.1.0822f97cc6 → 0.6.6-develop.6204.1.30b1f58642
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/dist/modules/catalog/backend/catalog/products/[id]/page.js +52 -45
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js +9 -13
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivitiesSection.js +17 -12
- package/dist/modules/customers/components/detail/ActivitiesSection.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivityHistorySection.js +11 -7
- package/dist/modules/customers/components/detail/ActivityHistorySection.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionariesManager.js +75 -33
- package/dist/modules/dictionaries/components/DictionariesManager.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js +95 -43
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionarySelectControl.js +40 -19
- package/dist/modules/dictionaries/components/DictionarySelectControl.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js +81 -37
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/page.js +45 -24
- package/dist/modules/integrations/backend/integrations/page.js.map +2 -2
- package/dist/modules/notifications/api/[id]/action/route.js +18 -3
- package/dist/modules/notifications/api/[id]/action/route.js.map +2 -2
- package/dist/modules/notifications/api/[id]/restore/route.js +19 -3
- package/dist/modules/notifications/api/[id]/restore/route.js.map +2 -2
- package/dist/modules/notifications/api/mark-all-read/route.js +18 -4
- package/dist/modules/notifications/api/mark-all-read/route.js.map +2 -2
- package/dist/modules/notifications/api/route.js +17 -4
- package/dist/modules/notifications/api/route.js.map +2 -2
- package/dist/modules/notifications/api/settings/route.js +26 -5
- package/dist/modules/notifications/api/settings/route.js.map +2 -2
- package/dist/modules/notifications/lib/routeHelpers.js +64 -5
- package/dist/modules/notifications/lib/routeHelpers.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +58 -48
- package/src/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.tsx +14 -13
- package/src/modules/customers/components/detail/ActivitiesSection.tsx +22 -13
- package/src/modules/customers/components/detail/ActivityHistorySection.tsx +13 -7
- package/src/modules/dictionaries/components/DictionariesManager.tsx +82 -34
- package/src/modules/dictionaries/components/DictionaryEntriesEditor.tsx +99 -42
- package/src/modules/dictionaries/components/DictionarySelectControl.tsx +43 -18
- package/src/modules/integrations/backend/integrations/bundle/[id]/page.tsx +78 -35
- package/src/modules/integrations/backend/integrations/page.tsx +42 -21
- package/src/modules/notifications/api/[id]/action/route.ts +17 -2
- package/src/modules/notifications/api/[id]/restore/route.ts +19 -3
- package/src/modules/notifications/api/mark-all-read/route.ts +18 -4
- package/src/modules/notifications/api/route.ts +16 -3
- package/src/modules/notifications/api/settings/route.ts +26 -5
- package/src/modules/notifications/lib/routeHelpers.ts +101 -4
|
@@ -277,44 +277,51 @@ function EditCatalogProductPage({
|
|
|
277
277
|
setVariantMediaGroups([]);
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
280
|
+
void (async () => {
|
|
281
|
+
try {
|
|
282
|
+
const CONCURRENCY = 5;
|
|
283
|
+
const groups2 = [];
|
|
284
|
+
for (let i = 0; i < mapped.length; i += CONCURRENCY) {
|
|
285
|
+
const batch = mapped.slice(i, i + CONCURRENCY);
|
|
286
|
+
const results = await Promise.all(
|
|
287
|
+
batch.map(async (variant) => {
|
|
288
|
+
try {
|
|
289
|
+
const res = await apiCall(
|
|
290
|
+
`/api/attachments?entityId=${encodeURIComponent(E.catalog.catalog_product_variant)}&recordId=${encodeURIComponent(variant.id)}`
|
|
291
|
+
);
|
|
292
|
+
if (!res.ok) return null;
|
|
293
|
+
const mediaItems = (res.result?.items ?? []).map(
|
|
294
|
+
(item) => ({
|
|
295
|
+
id: item.id,
|
|
296
|
+
url: item.url,
|
|
297
|
+
fileName: item.fileName,
|
|
298
|
+
fileSize: item.fileSize,
|
|
299
|
+
thumbnailUrl: item.thumbnailUrl ?? void 0
|
|
300
|
+
})
|
|
301
|
+
);
|
|
302
|
+
if (!mediaItems.length) return null;
|
|
303
|
+
return {
|
|
304
|
+
variantId: variant.id,
|
|
305
|
+
variantName: variant.name,
|
|
306
|
+
defaultMediaId: variant.defaultMediaId,
|
|
307
|
+
items: mediaItems,
|
|
308
|
+
editUrl: `/backend/catalog/products/${id}/variants/${variant.id}`
|
|
309
|
+
};
|
|
310
|
+
} catch {
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
})
|
|
314
|
+
);
|
|
315
|
+
for (const result of results) {
|
|
316
|
+
if (result) groups2.push(result);
|
|
310
317
|
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
318
|
+
}
|
|
319
|
+
setVariantMediaGroups(groups2);
|
|
320
|
+
} catch (err) {
|
|
321
|
+
console.error("catalog.variants.media.fetch failed", err);
|
|
322
|
+
setVariantMediaGroups([]);
|
|
315
323
|
}
|
|
316
|
-
}
|
|
317
|
-
setVariantMediaGroups(groups2);
|
|
324
|
+
})();
|
|
318
325
|
} catch (err) {
|
|
319
326
|
console.error("catalog.variants.fetch failed", err);
|
|
320
327
|
setVariants([]);
|
|
@@ -421,15 +428,8 @@ function EditCatalogProductPage({
|
|
|
421
428
|
const metadata = normalizeMetadata(rawMetadata);
|
|
422
429
|
const optionSchemaId = typeof record.option_schema_id === "string" ? record.option_schema_id : typeof record.optionSchemaId === "string" ? record.optionSchemaId : null;
|
|
423
430
|
const taxRateId = typeof record.tax_rate_id === "string" ? record.tax_rate_id : typeof record.taxRateId === "string" ? record.taxRateId : null;
|
|
424
|
-
const optionSchemaTemplate
|
|
425
|
-
|
|
426
|
-
optionSchemaTemplate?.schema
|
|
427
|
-
);
|
|
428
|
-
let optionInputs = normalizedSchema ? convertSchemaToProductOptions(normalizedSchema) : [];
|
|
429
|
-
if (!optionInputs.length) {
|
|
430
|
-
optionInputs = readOptionSchema(metadata);
|
|
431
|
-
}
|
|
432
|
-
const [attachments, conversionsRes] = await Promise.all([
|
|
431
|
+
const [optionSchemaTemplate, attachments, conversionsRes] = await Promise.all([
|
|
432
|
+
optionSchemaId ? fetchOptionSchemaTemplate(optionSchemaId) : Promise.resolve(null),
|
|
433
433
|
fetchAttachments(productId),
|
|
434
434
|
apiCall(
|
|
435
435
|
`/api/catalog/product-unit-conversions?productId=${encodeURIComponent(productId)}&page=1&pageSize=100`,
|
|
@@ -437,6 +437,13 @@ function EditCatalogProductPage({
|
|
|
437
437
|
{ fallback: { items: [] } }
|
|
438
438
|
)
|
|
439
439
|
]);
|
|
440
|
+
const normalizedSchema = normalizeOptionSchemaRecord(
|
|
441
|
+
optionSchemaTemplate?.schema
|
|
442
|
+
);
|
|
443
|
+
let optionInputs = normalizedSchema ? convertSchemaToProductOptions(normalizedSchema) : [];
|
|
444
|
+
if (!optionInputs.length) {
|
|
445
|
+
optionInputs = readOptionSchema(metadata);
|
|
446
|
+
}
|
|
440
447
|
const conversionRows = conversionsRes.ok ? readProductConversionRows(conversionsRes.result?.items) : [];
|
|
441
448
|
initialConversionsRef.current = conversionRows;
|
|
442
449
|
const customValues = extractCustomFieldEntries(record);
|