@nubitio/crud 0.5.4 → 0.5.6
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/index.cjs +16 -2
- package/dist/index.mjs +16 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -5384,7 +5384,21 @@ function consolidateAuditEntries(entries) {
|
|
|
5384
5384
|
group.push(entry);
|
|
5385
5385
|
}
|
|
5386
5386
|
flushGroup();
|
|
5387
|
-
return consolidated;
|
|
5387
|
+
return filterMeaningfulAuditEntries(consolidated);
|
|
5388
|
+
}
|
|
5389
|
+
function filterMeaningfulAuditEntries(entries) {
|
|
5390
|
+
return entries.flatMap((entry) => {
|
|
5391
|
+
const changes = Object.fromEntries(Object.entries(entry.changes).filter(([, change]) => !auditValuesEqual(change.before, change.after)));
|
|
5392
|
+
if (Object.keys(changes).length === 0) return [];
|
|
5393
|
+
return [{
|
|
5394
|
+
...entry,
|
|
5395
|
+
changes
|
|
5396
|
+
}];
|
|
5397
|
+
});
|
|
5398
|
+
}
|
|
5399
|
+
/** Consolidates burst rows and removes fields whose net diff is empty. */
|
|
5400
|
+
function prepareAuditEntries(entries) {
|
|
5401
|
+
return filterMeaningfulAuditEntries(consolidateAuditEntries(entries));
|
|
5388
5402
|
}
|
|
5389
5403
|
//#endregion
|
|
5390
5404
|
//#region packages/crud/crud/AuditTrailPanel.tsx
|
|
@@ -5511,7 +5525,7 @@ function AuditTrailPanel({ url, renderEntry, visible, onClose, recordSubtitle, r
|
|
|
5511
5525
|
httpClient.get(url).then((response) => {
|
|
5512
5526
|
setFetchState({
|
|
5513
5527
|
status: "success",
|
|
5514
|
-
entries:
|
|
5528
|
+
entries: prepareAuditEntries(response.data)
|
|
5515
5529
|
});
|
|
5516
5530
|
}).catch(() => {
|
|
5517
5531
|
setFetchState({ status: "error" });
|
package/dist/index.mjs
CHANGED
|
@@ -5360,7 +5360,21 @@ function consolidateAuditEntries(entries) {
|
|
|
5360
5360
|
group.push(entry);
|
|
5361
5361
|
}
|
|
5362
5362
|
flushGroup();
|
|
5363
|
-
return consolidated;
|
|
5363
|
+
return filterMeaningfulAuditEntries(consolidated);
|
|
5364
|
+
}
|
|
5365
|
+
function filterMeaningfulAuditEntries(entries) {
|
|
5366
|
+
return entries.flatMap((entry) => {
|
|
5367
|
+
const changes = Object.fromEntries(Object.entries(entry.changes).filter(([, change]) => !auditValuesEqual(change.before, change.after)));
|
|
5368
|
+
if (Object.keys(changes).length === 0) return [];
|
|
5369
|
+
return [{
|
|
5370
|
+
...entry,
|
|
5371
|
+
changes
|
|
5372
|
+
}];
|
|
5373
|
+
});
|
|
5374
|
+
}
|
|
5375
|
+
/** Consolidates burst rows and removes fields whose net diff is empty. */
|
|
5376
|
+
function prepareAuditEntries(entries) {
|
|
5377
|
+
return filterMeaningfulAuditEntries(consolidateAuditEntries(entries));
|
|
5364
5378
|
}
|
|
5365
5379
|
//#endregion
|
|
5366
5380
|
//#region packages/crud/crud/AuditTrailPanel.tsx
|
|
@@ -5487,7 +5501,7 @@ function AuditTrailPanel({ url, renderEntry, visible, onClose, recordSubtitle, r
|
|
|
5487
5501
|
httpClient.get(url).then((response) => {
|
|
5488
5502
|
setFetchState({
|
|
5489
5503
|
status: "success",
|
|
5490
|
-
entries:
|
|
5504
|
+
entries: prepareAuditEntries(response.data)
|
|
5491
5505
|
});
|
|
5492
5506
|
}).catch(() => {
|
|
5493
5507
|
setFetchState({ status: "error" });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nubitio/crud",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Declarative CRUD engine with field DSL, forms, datagrids, RBAC, conditional logic and pluggable adapters (Hydra/REST).",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"react-dom": "^19.0.0",
|
|
57
57
|
"react-i18next": "^14.0.0",
|
|
58
58
|
"react-router-dom": "^6.0.0",
|
|
59
|
-
"@nubitio/core": "^0.5.
|
|
60
|
-
"@nubitio/ui": "^0.5.
|
|
59
|
+
"@nubitio/core": "^0.5.6",
|
|
60
|
+
"@nubitio/ui": "^0.5.6"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"react-dropzone": "^15.0.0"
|