@quillsql/react 2.16.13 → 2.16.14
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 +21 -6
- package/dist/index.js +21 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -24491,8 +24491,9 @@ async function getExportData(client, dashboardFilters, reportId, getToken, event
|
|
|
24491
24491
|
}) : [];
|
|
24492
24492
|
const fetchResp = await quillFetch({
|
|
24493
24493
|
client,
|
|
24494
|
-
task: "
|
|
24494
|
+
task: "report",
|
|
24495
24495
|
metadata: {
|
|
24496
|
+
reportId,
|
|
24496
24497
|
dashboardItemId: reportId,
|
|
24497
24498
|
clientId: client.publicKey,
|
|
24498
24499
|
databaseType: client?.databaseType,
|
|
@@ -24503,9 +24504,19 @@ async function getExportData(client, dashboardFilters, reportId, getToken, event
|
|
|
24503
24504
|
},
|
|
24504
24505
|
getToken
|
|
24505
24506
|
});
|
|
24506
|
-
const resp = await parseFetchResponse(client, "
|
|
24507
|
+
const resp = await parseFetchResponse(client, "report", fetchResp, getToken);
|
|
24508
|
+
const candidateItem = resp && resp?.rows !== void 0 ? resp : resp?.item ?? resp?.report ?? resp?.data ?? resp;
|
|
24507
24509
|
const cleanedReport = await cleanDashboardItem({
|
|
24508
|
-
item:
|
|
24510
|
+
item: candidateItem ?? {
|
|
24511
|
+
_id: resp?._id ?? reportId,
|
|
24512
|
+
id: resp?.id ?? reportId,
|
|
24513
|
+
name: resp?.name,
|
|
24514
|
+
rows: resp?.rows ?? [],
|
|
24515
|
+
columns: resp?.columns ?? [],
|
|
24516
|
+
fields: resp?.fields ?? [],
|
|
24517
|
+
pivotRows: resp?.pivotRows ?? [],
|
|
24518
|
+
pivotColumns: resp?.pivotColumns ?? []
|
|
24519
|
+
},
|
|
24509
24520
|
dashboardFilters,
|
|
24510
24521
|
client,
|
|
24511
24522
|
customFields,
|
|
@@ -24588,10 +24599,14 @@ var useExport = (reportId, {
|
|
|
24588
24599
|
flags,
|
|
24589
24600
|
schemaData?.customFields
|
|
24590
24601
|
);
|
|
24602
|
+
const exportRows = resp?.pivot && resp?.pivotRows && downloadOptions?.usePivotRows ? resp.pivotRows : resp?.rows;
|
|
24603
|
+
const exportFields = resp?.pivot && resp?.pivotColumns && downloadOptions?.usePivotRows ? resp.pivotColumns : resp?.columns;
|
|
24604
|
+
const rowsToExport = exportRows && exportRows.length > 0 ? exportRows : dashboardReport?.rows ?? dashboardReport?.pivotRows ?? [];
|
|
24605
|
+
const fieldsToExport = exportFields && exportFields.length > 0 ? exportFields : dashboardReport?.columns ?? dashboardReport?.pivotColumns ?? [];
|
|
24591
24606
|
downloadCSV({
|
|
24592
|
-
rows:
|
|
24593
|
-
fields:
|
|
24594
|
-
name: resp
|
|
24607
|
+
rows: rowsToExport ?? [],
|
|
24608
|
+
fields: fieldsToExport,
|
|
24609
|
+
name: resp?.name || dashboardReport?.name || reports?.[reportId]?.name || "report"
|
|
24595
24610
|
});
|
|
24596
24611
|
setIsCSVLoading(false);
|
|
24597
24612
|
},
|
package/dist/index.js
CHANGED
|
@@ -24511,8 +24511,9 @@ async function getExportData(client, dashboardFilters, reportId, getToken, event
|
|
|
24511
24511
|
}) : [];
|
|
24512
24512
|
const fetchResp = await quillFetch({
|
|
24513
24513
|
client,
|
|
24514
|
-
task: "
|
|
24514
|
+
task: "report",
|
|
24515
24515
|
metadata: {
|
|
24516
|
+
reportId,
|
|
24516
24517
|
dashboardItemId: reportId,
|
|
24517
24518
|
clientId: client.publicKey,
|
|
24518
24519
|
databaseType: client?.databaseType,
|
|
@@ -24523,9 +24524,19 @@ async function getExportData(client, dashboardFilters, reportId, getToken, event
|
|
|
24523
24524
|
},
|
|
24524
24525
|
getToken
|
|
24525
24526
|
});
|
|
24526
|
-
const resp = await parseFetchResponse(client, "
|
|
24527
|
+
const resp = await parseFetchResponse(client, "report", fetchResp, getToken);
|
|
24528
|
+
const candidateItem = resp && resp?.rows !== void 0 ? resp : resp?.item ?? resp?.report ?? resp?.data ?? resp;
|
|
24527
24529
|
const cleanedReport = await cleanDashboardItem({
|
|
24528
|
-
item:
|
|
24530
|
+
item: candidateItem ?? {
|
|
24531
|
+
_id: resp?._id ?? reportId,
|
|
24532
|
+
id: resp?.id ?? reportId,
|
|
24533
|
+
name: resp?.name,
|
|
24534
|
+
rows: resp?.rows ?? [],
|
|
24535
|
+
columns: resp?.columns ?? [],
|
|
24536
|
+
fields: resp?.fields ?? [],
|
|
24537
|
+
pivotRows: resp?.pivotRows ?? [],
|
|
24538
|
+
pivotColumns: resp?.pivotColumns ?? []
|
|
24539
|
+
},
|
|
24529
24540
|
dashboardFilters,
|
|
24530
24541
|
client,
|
|
24531
24542
|
customFields,
|
|
@@ -24608,10 +24619,14 @@ var useExport = (reportId, {
|
|
|
24608
24619
|
flags,
|
|
24609
24620
|
schemaData?.customFields
|
|
24610
24621
|
);
|
|
24622
|
+
const exportRows = resp?.pivot && resp?.pivotRows && downloadOptions?.usePivotRows ? resp.pivotRows : resp?.rows;
|
|
24623
|
+
const exportFields = resp?.pivot && resp?.pivotColumns && downloadOptions?.usePivotRows ? resp.pivotColumns : resp?.columns;
|
|
24624
|
+
const rowsToExport = exportRows && exportRows.length > 0 ? exportRows : dashboardReport?.rows ?? dashboardReport?.pivotRows ?? [];
|
|
24625
|
+
const fieldsToExport = exportFields && exportFields.length > 0 ? exportFields : dashboardReport?.columns ?? dashboardReport?.pivotColumns ?? [];
|
|
24611
24626
|
downloadCSV({
|
|
24612
|
-
rows:
|
|
24613
|
-
fields:
|
|
24614
|
-
name: resp
|
|
24627
|
+
rows: rowsToExport ?? [],
|
|
24628
|
+
fields: fieldsToExport,
|
|
24629
|
+
name: resp?.name || dashboardReport?.name || reports?.[reportId]?.name || "report"
|
|
24615
24630
|
});
|
|
24616
24631
|
setIsCSVLoading(false);
|
|
24617
24632
|
},
|