@nkhang1902/strapi-plugin-export-import-clsx 1.1.15 → 1.1.152
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.
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { useState, useRef } from "react";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
ModalHeader,
|
|
5
|
-
ModalBody,
|
|
6
|
-
ModalFooter,
|
|
3
|
+
Modal,
|
|
7
4
|
Typography,
|
|
8
5
|
Box,
|
|
9
6
|
Button,
|
|
@@ -199,6 +196,7 @@ const ExportImportButtons = (props) => {
|
|
|
199
196
|
const updated = result.summary?.updated || result.result.updated || 0;
|
|
200
197
|
|
|
201
198
|
const errorList = result.result?.errors || [];
|
|
199
|
+
const total = created + updated;
|
|
202
200
|
|
|
203
201
|
if (errorList.length > 0) {
|
|
204
202
|
setImportErrors(errorList);
|
|
@@ -277,17 +275,18 @@ const ExportImportButtons = (props) => {
|
|
|
277
275
|
</Button>
|
|
278
276
|
</div>
|
|
279
277
|
{showErrorModal && (
|
|
280
|
-
<
|
|
278
|
+
<Modal.Root
|
|
281
279
|
onClose={() => setShowErrorModal(false)}
|
|
282
280
|
labelledBy="import-errors-title"
|
|
283
281
|
>
|
|
284
|
-
<
|
|
282
|
+
<Modal.Content>
|
|
283
|
+
<Modal.Header>
|
|
285
284
|
<Typography id="import-errors-title" fontWeight="bold">
|
|
286
285
|
Import Errors ({importErrors.length})
|
|
287
286
|
</Typography>
|
|
288
|
-
</
|
|
287
|
+
</Modal.Header>
|
|
289
288
|
|
|
290
|
-
<
|
|
289
|
+
<Modal.Body>
|
|
291
290
|
<Box padding={4}>
|
|
292
291
|
{importErrors.map((err, index) => (
|
|
293
292
|
<Box key={index} paddingBottom={2}>
|
|
@@ -297,16 +296,17 @@ const ExportImportButtons = (props) => {
|
|
|
297
296
|
</Box>
|
|
298
297
|
))}
|
|
299
298
|
</Box>
|
|
300
|
-
</
|
|
299
|
+
</Modal.Body>
|
|
301
300
|
|
|
302
|
-
<
|
|
301
|
+
<Modal.Footer
|
|
303
302
|
endActions={
|
|
304
303
|
<Button onClick={() => setShowErrorModal(false)}>
|
|
305
304
|
Close
|
|
306
305
|
</Button>
|
|
307
306
|
}
|
|
308
307
|
/>
|
|
309
|
-
|
|
308
|
+
</Modal.Content>
|
|
309
|
+
</Modal.Root>
|
|
310
310
|
)}
|
|
311
311
|
</>
|
|
312
312
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nkhang1902/strapi-plugin-export-import-clsx",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.152",
|
|
4
4
|
"description": "A powerful Strapi plugin for exporting and importing data with Excel support and advanced filtering",
|
|
5
5
|
"main": "./strapi-server.js",
|
|
6
6
|
"scripts": {
|
|
@@ -342,10 +342,15 @@ module.exports = ({ strapi }) => ({
|
|
|
342
342
|
const f = parseFloat(value);
|
|
343
343
|
return Number.isNaN(f) ? 0 : f;
|
|
344
344
|
}
|
|
345
|
-
case 'date':
|
|
345
|
+
case 'date': {
|
|
346
|
+
const d = new Date(value);
|
|
347
|
+
if (isNaN(d.getTime())) return null;
|
|
348
|
+
return d.toISOString().slice(0, 10); // YYYY-MM-DD ONLY
|
|
349
|
+
}
|
|
346
350
|
case 'datetime': {
|
|
347
351
|
const d = new Date(value);
|
|
348
|
-
|
|
352
|
+
if (isNaN(d.getTime())) return null;
|
|
353
|
+
return d.toISOString(); // full ISO is valid here
|
|
349
354
|
}
|
|
350
355
|
default:
|
|
351
356
|
return value;
|