@nestledjs/data-browser 0.1.22 → 0.1.23
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.
|
@@ -355,18 +355,21 @@ function AdminDataEditPageContent({ model, id, basePath, formTheme }) {
|
|
|
355
355
|
status: "error",
|
|
356
356
|
message: result.errors.map((err) => err.message).join(", ")
|
|
357
357
|
});
|
|
358
|
+
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
358
359
|
return;
|
|
359
360
|
}
|
|
360
361
|
setSubmissionState({
|
|
361
362
|
status: "success",
|
|
362
363
|
message: `${toReadableText(model.name)} updated successfully!`
|
|
363
364
|
});
|
|
365
|
+
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
364
366
|
await refetch();
|
|
365
367
|
} catch (error2) {
|
|
366
368
|
setSubmissionState({
|
|
367
369
|
status: "error",
|
|
368
370
|
message: error2 instanceof Error ? error2.message : "An unexpected error occurred"
|
|
369
371
|
});
|
|
372
|
+
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
370
373
|
}
|
|
371
374
|
};
|
|
372
375
|
const handleDelete = async () => {
|
|
@@ -375,6 +375,7 @@ function shouldSkipValue(key, value) {
|
|
|
375
375
|
return SYSTEM_FIELDS.has(key) || value === void 0;
|
|
376
376
|
}
|
|
377
377
|
function convertStringValue(value, field) {
|
|
378
|
+
var _a;
|
|
378
379
|
if (value === "") {
|
|
379
380
|
return null;
|
|
380
381
|
}
|
|
@@ -388,11 +389,15 @@ function convertStringValue(value, field) {
|
|
|
388
389
|
}
|
|
389
390
|
if (value === "true") return true;
|
|
390
391
|
if (value === "false") return false;
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
392
|
+
const fieldType = (_a = field == null ? void 0 : field.type) == null ? void 0 : _a.toLowerCase();
|
|
393
|
+
const isNumericField = fieldType && ["int", "bigint", "float", "decimal"].includes(fieldType);
|
|
394
|
+
if (isNumericField) {
|
|
395
|
+
const numericPattern = /^-?\d+(\.\d+)?$/;
|
|
396
|
+
if (numericPattern.test(value)) {
|
|
397
|
+
const numericValue = Number(value);
|
|
398
|
+
if (!isNaN(numericValue)) {
|
|
399
|
+
return numericValue;
|
|
400
|
+
}
|
|
396
401
|
}
|
|
397
402
|
}
|
|
398
403
|
return value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestledjs/data-browser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "Universal admin data browser for Nestled framework projects with full CRUD operations",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@apollo/client": "^4.0.0",
|
|
39
39
|
"@heroicons/react": "^2.0.0",
|
|
40
40
|
"@nestledjs/forms": "^0.5.0",
|
|
41
|
-
"@nestledjs/shared-components": "^0.1.
|
|
41
|
+
"@nestledjs/shared-components": "^0.1.23",
|
|
42
42
|
"react": "^19.0.0",
|
|
43
43
|
"react-router": "^7.0.0"
|
|
44
44
|
},
|