@nkhang1902/strapi-plugin-export-import-clsx 1.4.5 → 1.4.7
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.
|
@@ -60,6 +60,7 @@ const ExportButtonsEditView = (props) => {
|
|
|
60
60
|
const queryParams = new URLSearchParams({
|
|
61
61
|
format: "excel",
|
|
62
62
|
contentType: contentType,
|
|
63
|
+
mode: "participant",
|
|
63
64
|
});
|
|
64
65
|
|
|
65
66
|
// Add event filter if we're in event manager
|
|
@@ -70,7 +71,7 @@ const ExportButtonsEditView = (props) => {
|
|
|
70
71
|
);
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
const response = await fetch(`/export-import-clsx/export?${queryParams}
|
|
74
|
+
const response = await fetch(`/export-import-clsx/export?${queryParams}`);
|
|
74
75
|
|
|
75
76
|
if (response.ok) {
|
|
76
77
|
const blob = await response.blob();
|
|
@@ -78,9 +79,7 @@ const ExportButtonsEditView = (props) => {
|
|
|
78
79
|
const a = document.createElement("a");
|
|
79
80
|
a.href = url;
|
|
80
81
|
|
|
81
|
-
const filename = `${contentType.replace("api::", "")}-export
|
|
82
|
-
new Date().toISOString().split("T")[0]
|
|
83
|
-
}.xlsx`;
|
|
82
|
+
const filename = `${contentType.replace("api::", "")}-participants-export.xlsx`;
|
|
84
83
|
|
|
85
84
|
a.download = filename;
|
|
86
85
|
document.body.appendChild(a);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nkhang1902/strapi-plugin-export-import-clsx",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.7",
|
|
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": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const XLSX = require("xlsx");
|
|
2
2
|
|
|
3
3
|
module.exports = ({ strapi }) => ({
|
|
4
|
-
async exportData(format = "json", contentType = null, rawFilters = {}, mode) {
|
|
4
|
+
async exportData(format = "json", contentType = null, rawFilters = {}, mode = '') {
|
|
5
5
|
// Normalize content type - handle both content-manager and event-manager formats
|
|
6
6
|
if (contentType && !contentType.startsWith("api::")) {
|
|
7
7
|
// If it's already in api:: format from event-manager, use as is
|
|
@@ -120,6 +120,7 @@ module.exports = ({ strapi }) => ({
|
|
|
120
120
|
if (format === "excel" && mode === "participant") {
|
|
121
121
|
return this.convertExperienceParticipantsToExcel(entries[0]);
|
|
122
122
|
} else {
|
|
123
|
+
console.log(mode)
|
|
123
124
|
return this.convertToExcel(exportData.data);
|
|
124
125
|
}
|
|
125
126
|
|