@nkhang1902/strapi-plugin-export-import-clsx 1.1.151 → 1.1.153

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.
@@ -101,6 +101,31 @@ const ExportImportButtons = (props) => {
101
101
  return filters;
102
102
  };
103
103
 
104
+ function showLongNotification(toggle, {
105
+ title,
106
+ message,
107
+ type = 'warning',
108
+ duration = 15000, // 15 seconds
109
+ }) {
110
+ toggle({
111
+ type,
112
+ title,
113
+ message: (
114
+ <div style={{
115
+ maxHeight: '260px',
116
+ overflowY: 'auto',
117
+ whiteSpace: 'pre-wrap',
118
+ fontSize: 13,
119
+ lineHeight: 1.5,
120
+ paddingRight: 4,
121
+ }}>
122
+ {message}
123
+ </div>
124
+ ),
125
+ timeout: duration,
126
+ });
127
+ }
128
+
104
129
  const handleExport = async () => {
105
130
  const contentType = getContentType();
106
131
  if (!contentType) {
@@ -196,10 +221,16 @@ const ExportImportButtons = (props) => {
196
221
  const updated = result.summary?.updated || result.result.updated || 0;
197
222
 
198
223
  const errorList = result.result?.errors || [];
224
+ const total = created + updated;
199
225
 
200
226
  if (errorList.length > 0) {
201
227
  setImportErrors(errorList);
202
228
  setShowErrorModal(true);
229
+ showLongNotification(toggleNotification, {
230
+ title: "Import errors",
231
+ message: errorList.join("\n"),
232
+ type: "danger",
233
+ })
203
234
  } else if (total > 0) {
204
235
  toggleNotification({
205
236
  type: "success",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nkhang1902/strapi-plugin-export-import-clsx",
3
- "version": "1.1.151",
3
+ "version": "1.1.153",
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
- return isNaN(d.getTime()) ? null : d.toISOString();
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;