@quillsql/react 2.13.3 → 2.13.4
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/cjs/Context.d.ts.map +1 -1
- package/dist/cjs/Context.js +14 -1
- package/dist/cjs/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DataLoader.js +105 -40
- package/dist/cjs/components/QuillSelectWithCombo.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelectWithCombo.js +1 -1
- package/dist/cjs/utils/dataFetcher.d.ts +2 -2
- package/dist/cjs/utils/dataFetcher.d.ts.map +1 -1
- package/dist/cjs/utils/dataFetcher.js +30 -22
- package/dist/cjs/utils/report.d.ts +2 -2
- package/dist/cjs/utils/report.d.ts.map +1 -1
- package/dist/cjs/utils/report.js +7 -4
- package/dist/cjs/utils/tableProcessing.d.ts +1 -1
- package/dist/cjs/utils/tableProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/tableProcessing.js +6 -2
- package/dist/esm/Context.d.ts.map +1 -1
- package/dist/esm/Context.js +15 -2
- package/dist/esm/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DataLoader.js +105 -40
- package/dist/esm/components/QuillSelectWithCombo.d.ts.map +1 -1
- package/dist/esm/components/QuillSelectWithCombo.js +1 -1
- package/dist/esm/utils/dataFetcher.d.ts +2 -2
- package/dist/esm/utils/dataFetcher.d.ts.map +1 -1
- package/dist/esm/utils/dataFetcher.js +30 -22
- package/dist/esm/utils/report.d.ts +2 -2
- package/dist/esm/utils/report.d.ts.map +1 -1
- package/dist/esm/utils/report.js +7 -4
- package/dist/esm/utils/tableProcessing.d.ts +1 -1
- package/dist/esm/utils/tableProcessing.d.ts.map +1 -1
- package/dist/esm/utils/tableProcessing.js +6 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/Context.tsx"],"names":[],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HANGED
|
@@ -147,6 +147,7 @@ const ContextProvider = ({ children, initialTheme, publicKey, organizationId, qu
|
|
|
147
147
|
const [dashboard, dispatch] = (0, react_1.useReducer)(dashboardReducer, {});
|
|
148
148
|
const [dashboardConfig, dashboardConfigDispatch] = (0, react_1.useReducer)(dashboardConfigReducer, {});
|
|
149
149
|
const [dashboardFilters, dashboardFiltersDispatch] = (0, react_1.useReducer)(dashboardFiltersReducer, {});
|
|
150
|
+
const filterOptionsAbortControllers = (0, react_1.useRef)(new Set());
|
|
150
151
|
const [reportFilters, reportFiltersDispatch] = (0, react_1.useReducer)(reportFiltersReducer, {});
|
|
151
152
|
// SETS INITIAL THEME
|
|
152
153
|
(0, react_1.useEffect)(() => {
|
|
@@ -169,6 +170,8 @@ const ContextProvider = ({ children, initialTheme, publicKey, organizationId, qu
|
|
|
169
170
|
}
|
|
170
171
|
}, [initialTheme]);
|
|
171
172
|
async function loadFiltersForDashboard(dashboardName, filters, updatedFilterLabel) {
|
|
173
|
+
// Abort all previous fetch requests
|
|
174
|
+
filterOptionsAbortControllers.current.forEach((controller) => controller.abort());
|
|
172
175
|
dashboardFiltersDispatch({
|
|
173
176
|
type: 'ADD_DASHBOARD_FILTERS',
|
|
174
177
|
dashboardName,
|
|
@@ -182,11 +185,13 @@ const ContextProvider = ({ children, initialTheme, publicKey, organizationId, qu
|
|
|
182
185
|
});
|
|
183
186
|
// For each filter, send a fetch request to get the filter options
|
|
184
187
|
// Once the options are received, update the filter in the state
|
|
185
|
-
await Promise.
|
|
188
|
+
await Promise.allSettled(filters.map(async (filter) => {
|
|
186
189
|
if (filter.filterType !== 'string')
|
|
187
190
|
return null;
|
|
188
191
|
if (filter.label === updatedFilterLabel)
|
|
189
192
|
return null;
|
|
193
|
+
const filterOptionsAbortController = new AbortController();
|
|
194
|
+
filterOptionsAbortControllers.current.add(filterOptionsAbortController);
|
|
190
195
|
try {
|
|
191
196
|
const response = await fetch(`${queryEndpoint}?filterOptions`, {
|
|
192
197
|
method: 'POST',
|
|
@@ -215,6 +220,7 @@ const ContextProvider = ({ children, initialTheme, publicKey, organizationId, qu
|
|
|
215
220
|
})),
|
|
216
221
|
},
|
|
217
222
|
}),
|
|
223
|
+
signal: filterOptionsAbortController?.signal,
|
|
218
224
|
credentials: withCredentials ? 'include' : 'omit',
|
|
219
225
|
});
|
|
220
226
|
return response.json().then((result) => {
|
|
@@ -234,8 +240,15 @@ const ContextProvider = ({ children, initialTheme, publicKey, organizationId, qu
|
|
|
234
240
|
});
|
|
235
241
|
}
|
|
236
242
|
catch (error) {
|
|
243
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
244
|
+
// console.log('Aborted fetching filter options');
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
237
247
|
console.error('ERROR:', error);
|
|
238
248
|
}
|
|
249
|
+
finally {
|
|
250
|
+
filterOptionsAbortControllers.current.delete(filterOptionsAbortController);
|
|
251
|
+
}
|
|
239
252
|
}));
|
|
240
253
|
}
|
|
241
254
|
async function fetchSchema(client, caller) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataLoader.d.ts","sourceRoot":"","sources":["../../../../src/components/Dashboard/DataLoader.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,WAAW,EAAuB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAajD,OAAO,EACL,oBAAoB,EAErB,MAAM,6BAA6B,CAAC;AAuBrC,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,YAAY,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACnE,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,CAAC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E;IACD,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IACtB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,QAAQ,EAAE,CAAC,EACT,SAAS,EACT,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,IAAI,GACL,EAAE,oBAAoB,KAAK,GAAG,CAAC,OAAO,CAAC;CACzC,GAAG,GAAG,CAAC,OAAO,CAiPd;AAED,KAAK,YAAY,GAAG;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;KACjC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAIF,eAAO,MAAM,eAAe;UAOpB,WAAW;;mCAGN,WAAW,UACZ,UAAU,KACf,YAAY;0BACK,oBAAoB;aACjC,GAAG,EAAE,GAAG,IAAI;qFAQlB,yBAAyB,KAAK,WAAW;MAC1C,WAmGH,CAAC"}
|
|
@@ -71,21 +71,44 @@ function DataLoader({ item, children, filters, additionalProcessing: defaultAddi
|
|
|
71
71
|
const previousFilters = (0, react_1.useRef)(null);
|
|
72
72
|
const [rowCount, setRowCount] = (0, react_1.useState)(dashboard[item.id]?.rowCount ?? 0);
|
|
73
73
|
const [rowCountIsLoading, setRowCountIsLoading] = (0, react_1.useState)(false);
|
|
74
|
+
const rowsRequestId = (0, react_1.useRef)(0);
|
|
75
|
+
const rowsAbortController = (0, react_1.useRef)(null);
|
|
76
|
+
const rowCountRequestId = (0, react_1.useRef)(0);
|
|
77
|
+
const rowCountAbortController = (0, react_1.useRef)(null);
|
|
78
|
+
const updateTableRowsRequestId = (0, react_1.useRef)(0);
|
|
79
|
+
const updateTableRowsAbortController = (0, react_1.useRef)(null);
|
|
74
80
|
const fetchRowCount = async (processing) => {
|
|
75
81
|
if (!client || !filters) {
|
|
76
82
|
return;
|
|
77
83
|
}
|
|
84
|
+
const fetchReportRowCountRequestId = rowCountRequestId.current + 1;
|
|
85
|
+
rowCountRequestId.current = fetchReportRowCountRequestId;
|
|
78
86
|
setRowCountIsLoading(true);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
rowCountAbortController.current?.abort();
|
|
88
|
+
rowCountAbortController.current = new AbortController();
|
|
89
|
+
try {
|
|
90
|
+
const rowCount = await (0, report_1.fetchReportRowCount)(item.id, client, true, filters, processing, schemaData.customFields, rowCountAbortController.current.signal);
|
|
91
|
+
rowCountAbortController.current = null;
|
|
92
|
+
if (rowCount) {
|
|
93
|
+
dispatch({
|
|
94
|
+
type: 'UPDATE_DASHBOARD_ITEM',
|
|
95
|
+
id: item.id,
|
|
96
|
+
data: { rowCount },
|
|
97
|
+
});
|
|
98
|
+
setRowCount(rowCount);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch (e) {
|
|
102
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
103
|
+
// console.log('Aborted fetching row count');
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
finally {
|
|
108
|
+
if (fetchReportRowCountRequestId === rowCountRequestId.current) {
|
|
109
|
+
setRowCountIsLoading(false);
|
|
110
|
+
}
|
|
87
111
|
}
|
|
88
|
-
setRowCountIsLoading(false);
|
|
89
112
|
};
|
|
90
113
|
const onPageChange = (page) => {
|
|
91
114
|
if (additionalProcessing &&
|
|
@@ -104,10 +127,10 @@ function DataLoader({ item, children, filters, additionalProcessing: defaultAddi
|
|
|
104
127
|
}
|
|
105
128
|
};
|
|
106
129
|
const onSortChange = (sort) => {
|
|
107
|
-
if ((0, paginationProcessing_1.shouldSortInMemory)(paginationProcessing_1.DEFAULT_PAGINATION, report.rowCount, !!report.pivot)) {
|
|
130
|
+
if ((0, paginationProcessing_1.shouldSortInMemory)(additionalProcessing.page ?? paginationProcessing_1.DEFAULT_PAGINATION, report.rowCount, !!report.pivot)) {
|
|
108
131
|
return;
|
|
109
132
|
}
|
|
110
|
-
const updatedProcessing = { page:
|
|
133
|
+
const updatedProcessing = { page: additionalProcessing.page, sort };
|
|
111
134
|
fetchReportHelper(additionalProcessing);
|
|
112
135
|
updateTableRows(updatedProcessing, true);
|
|
113
136
|
setPreviousPage(0);
|
|
@@ -117,10 +140,15 @@ function DataLoader({ item, children, filters, additionalProcessing: defaultAddi
|
|
|
117
140
|
return;
|
|
118
141
|
}
|
|
119
142
|
if (!loading) {
|
|
143
|
+
const fetchUpdateTableRowsRequestId = updateTableRowsRequestId.current + 1;
|
|
144
|
+
updateTableRowsRequestId.current = fetchUpdateTableRowsRequestId;
|
|
120
145
|
setLoading(true);
|
|
121
146
|
try {
|
|
147
|
+
updateTableRowsAbortController.current?.abort();
|
|
148
|
+
updateTableRowsAbortController.current = new AbortController();
|
|
122
149
|
const updatedProcessing = { ...additionalProcessing, ...processing };
|
|
123
|
-
const paginatedRows = await (0, tableProcessing_1.fetchResultsByReport)(report.id, client, updatedProcessing, filters, schemaData.customFields, true);
|
|
150
|
+
const paginatedRows = await (0, tableProcessing_1.fetchResultsByReport)(report.id, client, updatedProcessing, filters, schemaData.customFields, true, undefined, updateTableRowsAbortController.current.signal);
|
|
151
|
+
updateTableRowsAbortController.current = null;
|
|
124
152
|
if (paginatedRows.error) {
|
|
125
153
|
throw new Error('Error fetching chart');
|
|
126
154
|
}
|
|
@@ -130,11 +158,14 @@ function DataLoader({ item, children, filters, additionalProcessing: defaultAddi
|
|
|
130
158
|
}
|
|
131
159
|
setReport({ ...report, rows: tempRows });
|
|
132
160
|
setAdditionProcessing(updatedProcessing);
|
|
133
|
-
setLoading(false);
|
|
134
161
|
}
|
|
135
162
|
catch (e) {
|
|
136
163
|
console.log(e);
|
|
137
|
-
|
|
164
|
+
}
|
|
165
|
+
finally {
|
|
166
|
+
if (fetchUpdateTableRowsRequestId === updateTableRowsRequestId.current) {
|
|
167
|
+
setLoading(false);
|
|
168
|
+
}
|
|
138
169
|
}
|
|
139
170
|
}
|
|
140
171
|
};
|
|
@@ -154,19 +185,38 @@ function DataLoader({ item, children, filters, additionalProcessing: defaultAddi
|
|
|
154
185
|
setReport(convertedReport);
|
|
155
186
|
return;
|
|
156
187
|
}
|
|
188
|
+
const fetchRowsRequestId = rowsRequestId.current + 1;
|
|
189
|
+
rowsRequestId.current = fetchRowsRequestId;
|
|
157
190
|
setLoading(true);
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
191
|
+
console.log('fetching', item.id, filters);
|
|
192
|
+
rowsAbortController.current?.abort();
|
|
193
|
+
rowsAbortController.current = new AbortController();
|
|
194
|
+
try {
|
|
195
|
+
const { report: fetchedReport, error } = await (0, report_1.fetchReport)(item.id, client, true, filters, processing, undefined, schemaData.customFields, true, false, rowsAbortController.current.signal);
|
|
196
|
+
rowsAbortController.current = null;
|
|
197
|
+
dispatch({
|
|
198
|
+
type: 'ADD_DASHBOARD_ITEM',
|
|
199
|
+
id: item.id,
|
|
200
|
+
data: { ...fetchedReport, triggerReload: false, rowCount: 0 }, // rowCount 0 indicates it's still loading if row length is nonzero
|
|
201
|
+
});
|
|
202
|
+
fetchRowCount(processing);
|
|
203
|
+
const convertedReport = (0, report_1.convertInternalReportToReport)(fetchedReport);
|
|
204
|
+
setReport(convertedReport);
|
|
205
|
+
setAdditionProcessing(processing);
|
|
206
|
+
setError(error);
|
|
207
|
+
}
|
|
208
|
+
catch (e) {
|
|
209
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
210
|
+
// console.log('Aborted fetching rows');
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
throw e;
|
|
214
|
+
}
|
|
215
|
+
finally {
|
|
216
|
+
if (fetchRowsRequestId === rowsRequestId.current) {
|
|
217
|
+
setLoading(false);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
170
220
|
};
|
|
171
221
|
(0, react_1.useEffect)(() => {
|
|
172
222
|
if (!filters) {
|
|
@@ -208,6 +258,7 @@ const ChartDataLoader = ({ item, children, dateBucket, additionalProcessing, fil
|
|
|
208
258
|
const [client] = (0, react_1.useContext)(Context_1.ClientContext);
|
|
209
259
|
const [schemaData] = (0, react_1.useContext)(Context_1.SchemaDataContext);
|
|
210
260
|
const previousFilters = (0, react_1.useRef)(null);
|
|
261
|
+
const fetchReportAbortController = (0, react_1.useRef)(null);
|
|
211
262
|
const fetchReportHelper = async (useReportTask = true) => {
|
|
212
263
|
if (!client || !filters) {
|
|
213
264
|
return;
|
|
@@ -223,20 +274,34 @@ const ChartDataLoader = ({ item, children, dateBucket, additionalProcessing, fil
|
|
|
223
274
|
return;
|
|
224
275
|
}
|
|
225
276
|
setLoading(true);
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
277
|
+
fetchReportAbortController.current?.abort();
|
|
278
|
+
fetchReportAbortController.current = new AbortController();
|
|
279
|
+
try {
|
|
280
|
+
const { report, error } = await (0, report_1.fetchReport)(item.id, client, useReportTask, filters, {
|
|
281
|
+
...additionalProcessing,
|
|
282
|
+
...(item.pivot ? {} : { page: paginationProcessing_1.DEFAULT_PAGINATION }),
|
|
283
|
+
}, dateBucket, schemaData.customFields, undefined, undefined, fetchReportAbortController.current.signal);
|
|
284
|
+
fetchReportAbortController.current = null;
|
|
285
|
+
dispatch({
|
|
286
|
+
type: 'ADD_DASHBOARD_ITEM',
|
|
287
|
+
id: item.id,
|
|
288
|
+
data: { ...report, triggerReload: false },
|
|
289
|
+
});
|
|
290
|
+
const convertedReport = (0, report_1.convertInternalReportToReport)(report);
|
|
291
|
+
setReport(convertedReport);
|
|
292
|
+
setLocalDateBucket(dateBucket);
|
|
293
|
+
setError(error);
|
|
294
|
+
}
|
|
295
|
+
catch (e) {
|
|
296
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
297
|
+
// console.log('Aborted fetching rows for chart');
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
throw e;
|
|
301
|
+
}
|
|
302
|
+
finally {
|
|
303
|
+
setLoading(false);
|
|
304
|
+
}
|
|
240
305
|
};
|
|
241
306
|
(0, react_1.useEffect)(() => {
|
|
242
307
|
if (!filters) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuillSelectWithCombo.d.ts","sourceRoot":"","sources":["../../../src/components/QuillSelectWithCombo.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAWtE;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,OAAO,EACP,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,EACL,SAAS,EACT,eAAe,EACf,QAAQ,GACT,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"QuillSelectWithCombo.d.ts","sourceRoot":"","sources":["../../../src/components/QuillSelectWithCombo.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAWtE;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,OAAO,EACP,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,EACL,SAAS,EACT,eAAe,EACf,QAAQ,GACT,EAAE,oBAAoB,2CA2RtB"}
|
|
@@ -173,7 +173,7 @@ function QuillSelectComponentWithCombo({ options, value, width, onChange, label,
|
|
|
173
173
|
minHeight: 34,
|
|
174
174
|
}, className: "quill-option", onClick: () => {
|
|
175
175
|
// Manually create a synthetic ChangeEvent and pass it to callback
|
|
176
|
-
const changeEvent = { target: { value:
|
|
176
|
+
const changeEvent = { target: { value: undefined } };
|
|
177
177
|
onChange(changeEvent);
|
|
178
178
|
setShowModal(false);
|
|
179
179
|
}, children: [(0, jsx_runtime_1.jsx)("style", { children: `
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QuillProviderClient } from '../models/Client';
|
|
2
|
-
export declare function getData(client: QuillProviderClient, cloudQueryEndpoint: string, noCred: RequestCredentials, hostedRequestBody: any, cloudRequestBody: any, method?: string, queryParam?: string): Promise<any>;
|
|
3
|
-
export declare function getDataFromCloud(client: QuillProviderClient, cloudQueryEndpoint: string, cloudRequestBody: any, method?: string): Promise<any>;
|
|
2
|
+
export declare function getData(client: QuillProviderClient, cloudQueryEndpoint: string, noCred: RequestCredentials, hostedRequestBody: any, cloudRequestBody: any, method?: string, queryParam?: string, abortSignal?: AbortSignal): Promise<any>;
|
|
3
|
+
export declare function getDataFromCloud(client: QuillProviderClient, cloudQueryEndpoint: string, cloudRequestBody: any, method?: string, abortSignal?: AbortSignal): Promise<any>;
|
|
4
4
|
export declare function fetchSqlQuery(ast: any, client: QuillProviderClient, formData?: any): Promise<{
|
|
5
5
|
query: string;
|
|
6
6
|
error?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataFetcher.d.ts","sourceRoot":"","sources":["../../../src/utils/dataFetcher.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AA8EvD,wBAAsB,OAAO,CAC3B,MAAM,EAAE,mBAAmB,EAC3B,kBAAkB,EAAE,MAAM,EAC1B,MAAM,EAAE,kBAAkB,EAC1B,iBAAiB,EAAE,GAAG,EACtB,gBAAgB,EAAE,GAAG,EACrB,MAAM,SAAS,EACf,UAAU,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"dataFetcher.d.ts","sourceRoot":"","sources":["../../../src/utils/dataFetcher.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AA8EvD,wBAAsB,OAAO,CAC3B,MAAM,EAAE,mBAAmB,EAC3B,kBAAkB,EAAE,MAAM,EAC1B,MAAM,EAAE,kBAAkB,EAC1B,iBAAiB,EAAE,GAAG,EACtB,gBAAgB,EAAE,GAAG,EACrB,MAAM,SAAS,EACf,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,WAAW,gBAqJ1B;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,mBAAmB,EAC3B,kBAAkB,EAAE,MAAM,EAC1B,gBAAgB,EAAE,GAAG,EACrB,MAAM,SAAS,EACf,WAAW,CAAC,EAAE,WAAW,gBAiC1B;AAED,wBAAsB,aAAa,CACjC,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,CAAC,EAAE,GAAG,GACb,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAmB5C"}
|
|
@@ -64,7 +64,7 @@ async function testSqlViewState(hostedRequestBody, client, referencedTables) {
|
|
|
64
64
|
}
|
|
65
65
|
// this function gets the data either from the self hosted endpoint or
|
|
66
66
|
// our cloud server
|
|
67
|
-
async function getData(client, cloudQueryEndpoint, noCred, hostedRequestBody, cloudRequestBody, method = 'POST', queryParam) {
|
|
67
|
+
async function getData(client, cloudQueryEndpoint, noCred, hostedRequestBody, cloudRequestBody, method = 'POST', queryParam, abortSignal) {
|
|
68
68
|
if (!client) {
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
@@ -80,6 +80,7 @@ async function getData(client, cloudQueryEndpoint, noCred, hostedRequestBody, cl
|
|
|
80
80
|
},
|
|
81
81
|
credentials: client.withCredentials ? 'include' : noCred,
|
|
82
82
|
body: JSON.stringify(hostedRequestBody),
|
|
83
|
+
signal: abortSignal,
|
|
83
84
|
});
|
|
84
85
|
const responseJson = await resp.json();
|
|
85
86
|
if (responseJson.status === 'error' &&
|
|
@@ -172,39 +173,46 @@ async function getData(client, cloudQueryEndpoint, noCred, hostedRequestBody, cl
|
|
|
172
173
|
}
|
|
173
174
|
else {
|
|
174
175
|
// cloud
|
|
175
|
-
return await getDataFromCloud(client, cloudQueryEndpoint, cloudRequestBody, method);
|
|
176
|
+
return await getDataFromCloud(client, cloudQueryEndpoint, cloudRequestBody, method, abortSignal);
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
179
|
catch (e) {
|
|
180
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
181
|
+
throw e;
|
|
182
|
+
}
|
|
179
183
|
console.error('Failed to parse JSON:', e);
|
|
180
184
|
return null;
|
|
181
185
|
}
|
|
182
186
|
}
|
|
183
187
|
exports.getData = getData;
|
|
184
|
-
async function getDataFromCloud(client, cloudQueryEndpoint, cloudRequestBody, method = 'POST') {
|
|
185
|
-
const host = (typeof process !== 'undefined' && process?.env?.QUILL_SERVER_HOST) ||
|
|
186
|
-
'https://quill-344421.uc.r.appspot.com';
|
|
187
|
-
const url = `${host}/${cloudQueryEndpoint}`;
|
|
188
|
-
const resp = await fetch(url, {
|
|
189
|
-
method,
|
|
190
|
-
headers: {
|
|
191
|
-
Authorization: 'Bearer ',
|
|
192
|
-
'Content-Type': 'application/json',
|
|
193
|
-
},
|
|
194
|
-
body: method === 'POST'
|
|
195
|
-
? JSON.stringify({
|
|
196
|
-
...cloudRequestBody,
|
|
197
|
-
...{
|
|
198
|
-
publicKey: client?.publicKey,
|
|
199
|
-
orgId: client?.organizationId,
|
|
200
|
-
},
|
|
201
|
-
})
|
|
202
|
-
: null,
|
|
203
|
-
});
|
|
188
|
+
async function getDataFromCloud(client, cloudQueryEndpoint, cloudRequestBody, method = 'POST', abortSignal) {
|
|
204
189
|
try {
|
|
190
|
+
const host = (typeof process !== 'undefined' && process?.env?.QUILL_SERVER_HOST) ||
|
|
191
|
+
'https://quill-344421.uc.r.appspot.com';
|
|
192
|
+
const url = `${host}/${cloudQueryEndpoint}`;
|
|
193
|
+
const resp = await fetch(url, {
|
|
194
|
+
method,
|
|
195
|
+
headers: {
|
|
196
|
+
Authorization: 'Bearer ',
|
|
197
|
+
'Content-Type': 'application/json',
|
|
198
|
+
},
|
|
199
|
+
body: method === 'POST'
|
|
200
|
+
? JSON.stringify({
|
|
201
|
+
...cloudRequestBody,
|
|
202
|
+
...{
|
|
203
|
+
publicKey: client?.publicKey,
|
|
204
|
+
orgId: client?.organizationId,
|
|
205
|
+
},
|
|
206
|
+
})
|
|
207
|
+
: null,
|
|
208
|
+
signal: abortSignal,
|
|
209
|
+
});
|
|
205
210
|
return await resp.json();
|
|
206
211
|
}
|
|
207
212
|
catch (e) {
|
|
213
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
214
|
+
throw e;
|
|
215
|
+
}
|
|
208
216
|
console.error('Failed to parse JSON:', e);
|
|
209
217
|
return null;
|
|
210
218
|
}
|
|
@@ -23,11 +23,11 @@ export type ReportBuilderInfo = {
|
|
|
23
23
|
};
|
|
24
24
|
export declare const EMPTY_REPORT: QuillReport;
|
|
25
25
|
export declare const EMPTY_INTERNAL_REPORT: QuillReportInternal;
|
|
26
|
-
export declare function fetchReport(reportId: string, client: QuillProviderClient, useReportTask?: boolean, filters?: any[], additionalProcessing?: AdditionalProcessing, dateBucket?: string, customFields?: any, rowsOnly?: boolean, rowCountOnly?: boolean): Promise<{
|
|
26
|
+
export declare function fetchReport(reportId: string, client: QuillProviderClient, useReportTask?: boolean, filters?: any[], additionalProcessing?: AdditionalProcessing, dateBucket?: string, customFields?: any, rowsOnly?: boolean, rowCountOnly?: boolean, abortSignal?: AbortSignal): Promise<{
|
|
27
27
|
report: QuillReportInternal;
|
|
28
28
|
error?: string;
|
|
29
29
|
}>;
|
|
30
|
-
export declare function fetchReportRowCount(reportId: string, client: QuillProviderClient, useReportTask?: boolean, filters?: any[], additionalProcessing?: AdditionalProcessing, customFields?: any): Promise<number | undefined>;
|
|
30
|
+
export declare function fetchReportRowCount(reportId: string, client: QuillProviderClient, useReportTask?: boolean, filters?: any[], additionalProcessing?: AdditionalProcessing, customFields?: any, abortSignal?: AbortSignal): Promise<number | undefined>;
|
|
31
31
|
export declare function saveReport({ report, dashboardItemId, client, }: {
|
|
32
32
|
report: any;
|
|
33
33
|
dashboardItemId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/utils/report.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAU,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EACL,kBAAkB,EAClB,KAAK,EACL,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAa1B,OAAO,EACL,oBAAoB,EAIrB,MAAM,mBAAmB,CAAC;AAI3B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE;QAAE,IAAI,EAAE,GAAG,EAAE,CAAC;QAAC,OAAO,EAAE,cA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,GACP,EAAE;IACD,MAAM,EAAE,GAAG,CAAC;IACZ,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,mBAAmB,CAAC;CAC7B,GAAG,OAAO,CAAC,GAAG,CAAC,CA4Cf;AAED,eAAO,MAAM,oBAAoB,WAAY,GAAG,QAkB/C,CAAC;AAEF,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,mBAAmB,GAC1B,WAAW,CAsDb;AAED,eAAO,MAAM,6BAA6B,YAC/B,GAAG,YACF,GAAG,UACL,KAAK,EAAE,UACP,mBAAmB,UACnB,KAAK,qBACM,GAAG,iBACP,MAAM,qBACF;IACjB,aAAa,EAAE,mBAAmB,CAAC;IACnC,UAAU,EAAE,kBAAkB,CAAC;CAChC,WACQ,mBAAmB,iBACb,GAAG,qBACC,OAAO,iBACX,OAAO,eACT,oBAAoB,KAChC,QAAQ,iBAAiB,CAgK3B,CAAC"}
|
package/dist/cjs/utils/report.js
CHANGED
|
@@ -64,7 +64,7 @@ function extractAllReportValuesFromQuillInternalReport(reportInternal) {
|
|
|
64
64
|
template: reportInternal.template,
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
async function fetchReport(reportId, client, useReportTask = true, filters = [], additionalProcessing, dateBucket, customFields, rowsOnly, rowCountOnly) {
|
|
67
|
+
async function fetchReport(reportId, client, useReportTask = true, filters = [], additionalProcessing, dateBucket, customFields, rowsOnly, rowCountOnly, abortSignal) {
|
|
68
68
|
let reportInfo = undefined;
|
|
69
69
|
let errorMessage = undefined;
|
|
70
70
|
try {
|
|
@@ -90,7 +90,7 @@ async function fetchReport(reportId, client, useReportTask = true, filters = [],
|
|
|
90
90
|
filters: filters,
|
|
91
91
|
useNewNodeSql: true,
|
|
92
92
|
};
|
|
93
|
-
const resp = await (0, dataFetcher_1.getData)(client, 'itempost', 'omit', hostedBody, cloudBody, 'POST', 'fetch-data');
|
|
93
|
+
const resp = await (0, dataFetcher_1.getData)(client, 'itempost', 'omit', hostedBody, cloudBody, 'POST', 'fetch-data', abortSignal);
|
|
94
94
|
(0, errorProcessing_1.processFilterErrorList)(resp);
|
|
95
95
|
const dashboardItem = { ...resp, filtersApplied: filters };
|
|
96
96
|
if (resp.errorMessage) {
|
|
@@ -136,6 +136,9 @@ async function fetchReport(reportId, client, useReportTask = true, filters = [],
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
catch (error) {
|
|
139
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
139
142
|
if (error instanceof error_1.DataLoadError) {
|
|
140
143
|
if (error.data.useReportTask) {
|
|
141
144
|
(0, logging_1.internalLog)('USING ITEM AS BACKUP');
|
|
@@ -167,7 +170,7 @@ async function fetchReport(reportId, client, useReportTask = true, filters = [],
|
|
|
167
170
|
return { report: reportInfo || exports.EMPTY_INTERNAL_REPORT, error: errorMessage };
|
|
168
171
|
}
|
|
169
172
|
exports.fetchReport = fetchReport;
|
|
170
|
-
async function fetchReportRowCount(reportId, client, useReportTask = true, filters = [], additionalProcessing, customFields) {
|
|
173
|
+
async function fetchReportRowCount(reportId, client, useReportTask = true, filters = [], additionalProcessing, customFields, abortSignal) {
|
|
171
174
|
// Remove extra fields on each filter so we don't confuse the backend.
|
|
172
175
|
const hostedBody = {
|
|
173
176
|
metadata: {
|
|
@@ -189,7 +192,7 @@ async function fetchReportRowCount(reportId, client, useReportTask = true, filte
|
|
|
189
192
|
filters: filters,
|
|
190
193
|
useNewNodeSql: true,
|
|
191
194
|
};
|
|
192
|
-
const resp = await (0, dataFetcher_1.getData)(client, 'itempost', 'omit', hostedBody, cloudBody, 'POST', 'fetch-data');
|
|
195
|
+
const resp = await (0, dataFetcher_1.getData)(client, 'itempost', 'omit', hostedBody, cloudBody, 'POST', 'fetch-data', abortSignal);
|
|
193
196
|
return resp.rowCount;
|
|
194
197
|
}
|
|
195
198
|
exports.fetchReportRowCount = fetchReportRowCount;
|
|
@@ -52,7 +52,7 @@ export declare const fetchResultsByQuery: (query: string, client: QuillProviderC
|
|
|
52
52
|
error?: string | undefined;
|
|
53
53
|
itemQuery?: string[] | undefined;
|
|
54
54
|
}>;
|
|
55
|
-
export declare const fetchResultsByReport: (reportId: string, client: QuillProviderClient, processing?: AdditionalProcessing, filters?: any, customFields?: any, rowsOnly?: boolean, rowCountOnly?: boolean) => Promise<{
|
|
55
|
+
export declare const fetchResultsByReport: (reportId: string, client: QuillProviderClient, processing?: AdditionalProcessing, filters?: any, customFields?: any, rowsOnly?: boolean, rowCountOnly?: boolean, abortSignal?: AbortSignal) => Promise<{
|
|
56
56
|
columns: Column[];
|
|
57
57
|
rows: any[];
|
|
58
58
|
rowCount?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableProcessing.d.ts","sourceRoot":"","sources":["../../../src/utils/tableProcessing.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACd,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAgB5E,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,cAAc,YAChB,MAAM,EAAE,qBACE,MAAM,EAAE,KAC1B,OAUF,CAAC;AAEF,eAAO,MAAM,wBAAwB,YAC1B,MAAM,EAAE,SACV,MAAM,QACP,GAAG,U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+307,7 @@ const fetchResultsByQuery = async (query, client, processing, customFields, filt
|
|
|
307
307
|
return { rows, columns, rowCount, error, itemQuery };
|
|
308
308
|
};
|
|
309
309
|
exports.fetchResultsByQuery = fetchResultsByQuery;
|
|
310
|
-
const fetchResultsByReport = async (reportId, client, processing, filters, customFields, rowsOnly, rowCountOnly) => {
|
|
310
|
+
const fetchResultsByReport = async (reportId, client, processing, filters, customFields, rowsOnly, rowCountOnly, abortSignal) => {
|
|
311
311
|
const updatedProcessing = { ...processing };
|
|
312
312
|
let rows = [];
|
|
313
313
|
let columns = [];
|
|
@@ -351,7 +351,7 @@ const fetchResultsByReport = async (reportId, client, processing, filters, custo
|
|
|
351
351
|
filters: [],
|
|
352
352
|
useNewNodeSql: true,
|
|
353
353
|
};
|
|
354
|
-
const resp = await (0, dataFetcher_1.getData)(client, 'itempost', 'omit', hostedBody, cloudBody);
|
|
354
|
+
const resp = await (0, dataFetcher_1.getData)(client, 'itempost', 'omit', hostedBody, cloudBody, undefined, undefined, abortSignal);
|
|
355
355
|
if (resp.errorMessage) {
|
|
356
356
|
throw new Error(resp.errorMessage);
|
|
357
357
|
}
|
|
@@ -372,6 +372,10 @@ const fetchResultsByReport = async (reportId, client, processing, filters, custo
|
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
catch (e) {
|
|
375
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
376
|
+
console.log('Aborted fetch results by report');
|
|
377
|
+
throw e;
|
|
378
|
+
}
|
|
375
379
|
rows = [];
|
|
376
380
|
columns = [];
|
|
377
381
|
rowCount = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/Context.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/Context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,mBAAmB,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IACZ,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,CAAC;AAkBF,eAAO,MAAM,oBAAoB;mBAChB,kBAAkB;2BACV,MAAM,QAAQ,CAAC,mBAAmB,CAAC;EACC,CAAC;AAE9D,KAAK,qBAAqB,GAAG;IAC3B,CAAC,aAAa,EAAE,MAAM,GAAG;QACvB,CAAC,UAAU,EAAE,MAAM,GAAG;YAAE,MAAM,EAAE,eAAe,CAAC;YAAC,OAAO,EAAE,OAAO,CAAA;SAAE,CAAC;KACrE,CAAC;CACH,CAAC;AACF,KAAK,0BAA0B,GAC3B,yBAAyB,GACzB,0BAA0B,GAC1B,uBAAuB,GACvB,yBAAyB,CAAC;AAC9B,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,0BAA0B,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EACD;QACE,MAAM,EAAE,eAAe,CAAC;QACxB,OAAO,EAAE,OAAO,CAAC;KAClB,GACD;QACE,CAAC,UAAU,EAAE,MAAM,GAAG;YACpB,MAAM,EAAE,eAAe,CAAC;YACxB,OAAO,EAAE,OAAO,CAAC;SAClB,CAAC;KACH,GACD,eAAe,GACf,SAAS,CAAC;CACf,CAAC;AAmDF,eAAO,MAAM,uBAAuB;sBAChB,qBAAqB;cAC7B,MAAM,QAAQ,CAAC,sBAAsB,CAAC;6CAE/B,MAAM,WACZ,eAAe,EAAE,uBACL,MAAM,KACxB,IAAI;EAKT,CAAC;AAEH,eAAO,MAAM,eAAe;cAShB,MAAM,SAAS;kBACX,UAAU;eACb,MAAM;;mBAEF,MAAM;;;oDA4StB,CAAC"}
|
package/dist/esm/Context.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, createContext, useEffect, useReducer } from 'react';
|
|
2
|
+
import { useState, createContext, useEffect, useReducer, useRef, } from 'react';
|
|
3
3
|
import { getSchemaInfoWithCustomFields } from './utils/schema';
|
|
4
4
|
import { fetchClient } from './utils/client';
|
|
5
5
|
const dummySetter = () => { };
|
|
@@ -144,6 +144,7 @@ export const ContextProvider = ({ children, initialTheme, publicKey, organizatio
|
|
|
144
144
|
const [dashboard, dispatch] = useReducer(dashboardReducer, {});
|
|
145
145
|
const [dashboardConfig, dashboardConfigDispatch] = useReducer(dashboardConfigReducer, {});
|
|
146
146
|
const [dashboardFilters, dashboardFiltersDispatch] = useReducer(dashboardFiltersReducer, {});
|
|
147
|
+
const filterOptionsAbortControllers = useRef(new Set());
|
|
147
148
|
const [reportFilters, reportFiltersDispatch] = useReducer(reportFiltersReducer, {});
|
|
148
149
|
// SETS INITIAL THEME
|
|
149
150
|
useEffect(() => {
|
|
@@ -166,6 +167,8 @@ export const ContextProvider = ({ children, initialTheme, publicKey, organizatio
|
|
|
166
167
|
}
|
|
167
168
|
}, [initialTheme]);
|
|
168
169
|
async function loadFiltersForDashboard(dashboardName, filters, updatedFilterLabel) {
|
|
170
|
+
// Abort all previous fetch requests
|
|
171
|
+
filterOptionsAbortControllers.current.forEach((controller) => controller.abort());
|
|
169
172
|
dashboardFiltersDispatch({
|
|
170
173
|
type: 'ADD_DASHBOARD_FILTERS',
|
|
171
174
|
dashboardName,
|
|
@@ -179,11 +182,13 @@ export const ContextProvider = ({ children, initialTheme, publicKey, organizatio
|
|
|
179
182
|
});
|
|
180
183
|
// For each filter, send a fetch request to get the filter options
|
|
181
184
|
// Once the options are received, update the filter in the state
|
|
182
|
-
await Promise.
|
|
185
|
+
await Promise.allSettled(filters.map(async (filter) => {
|
|
183
186
|
if (filter.filterType !== 'string')
|
|
184
187
|
return null;
|
|
185
188
|
if (filter.label === updatedFilterLabel)
|
|
186
189
|
return null;
|
|
190
|
+
const filterOptionsAbortController = new AbortController();
|
|
191
|
+
filterOptionsAbortControllers.current.add(filterOptionsAbortController);
|
|
187
192
|
try {
|
|
188
193
|
const response = await fetch(`${queryEndpoint}?filterOptions`, {
|
|
189
194
|
method: 'POST',
|
|
@@ -212,6 +217,7 @@ export const ContextProvider = ({ children, initialTheme, publicKey, organizatio
|
|
|
212
217
|
})),
|
|
213
218
|
},
|
|
214
219
|
}),
|
|
220
|
+
signal: filterOptionsAbortController?.signal,
|
|
215
221
|
credentials: withCredentials ? 'include' : 'omit',
|
|
216
222
|
});
|
|
217
223
|
return response.json().then((result) => {
|
|
@@ -231,8 +237,15 @@ export const ContextProvider = ({ children, initialTheme, publicKey, organizatio
|
|
|
231
237
|
});
|
|
232
238
|
}
|
|
233
239
|
catch (error) {
|
|
240
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
241
|
+
// console.log('Aborted fetching filter options');
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
234
244
|
console.error('ERROR:', error);
|
|
235
245
|
}
|
|
246
|
+
finally {
|
|
247
|
+
filterOptionsAbortControllers.current.delete(filterOptionsAbortController);
|
|
248
|
+
}
|
|
236
249
|
}));
|
|
237
250
|
}
|
|
238
251
|
async function fetchSchema(client, caller) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataLoader.d.ts","sourceRoot":"","sources":["../../../../src/components/Dashboard/DataLoader.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,WAAW,EAAuB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAajD,OAAO,EACL,oBAAoB,EAErB,MAAM,6BAA6B,CAAC;AAuBrC,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,YAAY,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACnE,IAAI,EAAE,W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AoB,EAAE,2BAA2B,GAClD,EAAE;IACD,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IACtB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,QAAQ,EAAE,CAAC,EACT,SAAS,EACT,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,IAAI,GACL,EAAE,oBAAoB,KAAK,GAAG,CAAC,OAAO,CAAC;CACzC,GAAG,GAAG,CAAC,OAAO,CAiPd;AAED,KAAK,YAAY,GAAG;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;KACjC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAIF,eAAO,MAAM,eAAe;UAOpB,WAAW;;mCAGN,WAAW,UACZ,UAAU,KACf,YAAY;0BACK,oBAAoB;aACjC,GAAG,EAAE,GAAG,IAAI;qFAQlB,yBAAyB,KAAK,WAAW;MAC1C,WAmGH,CAAC"}
|
|
@@ -68,21 +68,44 @@ export default function DataLoader({ item, children, filters, additionalProcessi
|
|
|
68
68
|
const previousFilters = useRef(null);
|
|
69
69
|
const [rowCount, setRowCount] = useState(dashboard[item.id]?.rowCount ?? 0);
|
|
70
70
|
const [rowCountIsLoading, setRowCountIsLoading] = useState(false);
|
|
71
|
+
const rowsRequestId = useRef(0);
|
|
72
|
+
const rowsAbortController = useRef(null);
|
|
73
|
+
const rowCountRequestId = useRef(0);
|
|
74
|
+
const rowCountAbortController = useRef(null);
|
|
75
|
+
const updateTableRowsRequestId = useRef(0);
|
|
76
|
+
const updateTableRowsAbortController = useRef(null);
|
|
71
77
|
const fetchRowCount = async (processing) => {
|
|
72
78
|
if (!client || !filters) {
|
|
73
79
|
return;
|
|
74
80
|
}
|
|
81
|
+
const fetchReportRowCountRequestId = rowCountRequestId.current + 1;
|
|
82
|
+
rowCountRequestId.current = fetchReportRowCountRequestId;
|
|
75
83
|
setRowCountIsLoading(true);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
rowCountAbortController.current?.abort();
|
|
85
|
+
rowCountAbortController.current = new AbortController();
|
|
86
|
+
try {
|
|
87
|
+
const rowCount = await fetchReportRowCount(item.id, client, true, filters, processing, schemaData.customFields, rowCountAbortController.current.signal);
|
|
88
|
+
rowCountAbortController.current = null;
|
|
89
|
+
if (rowCount) {
|
|
90
|
+
dispatch({
|
|
91
|
+
type: 'UPDATE_DASHBOARD_ITEM',
|
|
92
|
+
id: item.id,
|
|
93
|
+
data: { rowCount },
|
|
94
|
+
});
|
|
95
|
+
setRowCount(rowCount);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch (e) {
|
|
99
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
100
|
+
// console.log('Aborted fetching row count');
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
finally {
|
|
105
|
+
if (fetchReportRowCountRequestId === rowCountRequestId.current) {
|
|
106
|
+
setRowCountIsLoading(false);
|
|
107
|
+
}
|
|
84
108
|
}
|
|
85
|
-
setRowCountIsLoading(false);
|
|
86
109
|
};
|
|
87
110
|
const onPageChange = (page) => {
|
|
88
111
|
if (additionalProcessing &&
|
|
@@ -101,10 +124,10 @@ export default function DataLoader({ item, children, filters, additionalProcessi
|
|
|
101
124
|
}
|
|
102
125
|
};
|
|
103
126
|
const onSortChange = (sort) => {
|
|
104
|
-
if (shouldSortInMemory(DEFAULT_PAGINATION, report.rowCount, !!report.pivot)) {
|
|
127
|
+
if (shouldSortInMemory(additionalProcessing.page ?? DEFAULT_PAGINATION, report.rowCount, !!report.pivot)) {
|
|
105
128
|
return;
|
|
106
129
|
}
|
|
107
|
-
const updatedProcessing = { page:
|
|
130
|
+
const updatedProcessing = { page: additionalProcessing.page, sort };
|
|
108
131
|
fetchReportHelper(additionalProcessing);
|
|
109
132
|
updateTableRows(updatedProcessing, true);
|
|
110
133
|
setPreviousPage(0);
|
|
@@ -114,10 +137,15 @@ export default function DataLoader({ item, children, filters, additionalProcessi
|
|
|
114
137
|
return;
|
|
115
138
|
}
|
|
116
139
|
if (!loading) {
|
|
140
|
+
const fetchUpdateTableRowsRequestId = updateTableRowsRequestId.current + 1;
|
|
141
|
+
updateTableRowsRequestId.current = fetchUpdateTableRowsRequestId;
|
|
117
142
|
setLoading(true);
|
|
118
143
|
try {
|
|
144
|
+
updateTableRowsAbortController.current?.abort();
|
|
145
|
+
updateTableRowsAbortController.current = new AbortController();
|
|
119
146
|
const updatedProcessing = { ...additionalProcessing, ...processing };
|
|
120
|
-
const paginatedRows = await fetchResultsByReport(report.id, client, updatedProcessing, filters, schemaData.customFields, true);
|
|
147
|
+
const paginatedRows = await fetchResultsByReport(report.id, client, updatedProcessing, filters, schemaData.customFields, true, undefined, updateTableRowsAbortController.current.signal);
|
|
148
|
+
updateTableRowsAbortController.current = null;
|
|
121
149
|
if (paginatedRows.error) {
|
|
122
150
|
throw new Error('Error fetching chart');
|
|
123
151
|
}
|
|
@@ -127,11 +155,14 @@ export default function DataLoader({ item, children, filters, additionalProcessi
|
|
|
127
155
|
}
|
|
128
156
|
setReport({ ...report, rows: tempRows });
|
|
129
157
|
setAdditionProcessing(updatedProcessing);
|
|
130
|
-
setLoading(false);
|
|
131
158
|
}
|
|
132
159
|
catch (e) {
|
|
133
160
|
console.log(e);
|
|
134
|
-
|
|
161
|
+
}
|
|
162
|
+
finally {
|
|
163
|
+
if (fetchUpdateTableRowsRequestId === updateTableRowsRequestId.current) {
|
|
164
|
+
setLoading(false);
|
|
165
|
+
}
|
|
135
166
|
}
|
|
136
167
|
}
|
|
137
168
|
};
|
|
@@ -151,19 +182,38 @@ export default function DataLoader({ item, children, filters, additionalProcessi
|
|
|
151
182
|
setReport(convertedReport);
|
|
152
183
|
return;
|
|
153
184
|
}
|
|
185
|
+
const fetchRowsRequestId = rowsRequestId.current + 1;
|
|
186
|
+
rowsRequestId.current = fetchRowsRequestId;
|
|
154
187
|
setLoading(true);
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
188
|
+
console.log('fetching', item.id, filters);
|
|
189
|
+
rowsAbortController.current?.abort();
|
|
190
|
+
rowsAbortController.current = new AbortController();
|
|
191
|
+
try {
|
|
192
|
+
const { report: fetchedReport, error } = await fetchReport(item.id, client, true, filters, processing, undefined, schemaData.customFields, true, false, rowsAbortController.current.signal);
|
|
193
|
+
rowsAbortController.current = null;
|
|
194
|
+
dispatch({
|
|
195
|
+
type: 'ADD_DASHBOARD_ITEM',
|
|
196
|
+
id: item.id,
|
|
197
|
+
data: { ...fetchedReport, triggerReload: false, rowCount: 0 }, // rowCount 0 indicates it's still loading if row length is nonzero
|
|
198
|
+
});
|
|
199
|
+
fetchRowCount(processing);
|
|
200
|
+
const convertedReport = convertInternalReportToReport(fetchedReport);
|
|
201
|
+
setReport(convertedReport);
|
|
202
|
+
setAdditionProcessing(processing);
|
|
203
|
+
setError(error);
|
|
204
|
+
}
|
|
205
|
+
catch (e) {
|
|
206
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
207
|
+
// console.log('Aborted fetching rows');
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
throw e;
|
|
211
|
+
}
|
|
212
|
+
finally {
|
|
213
|
+
if (fetchRowsRequestId === rowsRequestId.current) {
|
|
214
|
+
setLoading(false);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
167
217
|
};
|
|
168
218
|
useEffect(() => {
|
|
169
219
|
if (!filters) {
|
|
@@ -204,6 +254,7 @@ export const ChartDataLoader = ({ item, children, dateBucket, additionalProcessi
|
|
|
204
254
|
const [client] = useContext(ClientContext);
|
|
205
255
|
const [schemaData] = useContext(SchemaDataContext);
|
|
206
256
|
const previousFilters = useRef(null);
|
|
257
|
+
const fetchReportAbortController = useRef(null);
|
|
207
258
|
const fetchReportHelper = async (useReportTask = true) => {
|
|
208
259
|
if (!client || !filters) {
|
|
209
260
|
return;
|
|
@@ -219,20 +270,34 @@ export const ChartDataLoader = ({ item, children, dateBucket, additionalProcessi
|
|
|
219
270
|
return;
|
|
220
271
|
}
|
|
221
272
|
setLoading(true);
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
273
|
+
fetchReportAbortController.current?.abort();
|
|
274
|
+
fetchReportAbortController.current = new AbortController();
|
|
275
|
+
try {
|
|
276
|
+
const { report, error } = await fetchReport(item.id, client, useReportTask, filters, {
|
|
277
|
+
...additionalProcessing,
|
|
278
|
+
...(item.pivot ? {} : { page: DEFAULT_PAGINATION }),
|
|
279
|
+
}, dateBucket, schemaData.customFields, undefined, undefined, fetchReportAbortController.current.signal);
|
|
280
|
+
fetchReportAbortController.current = null;
|
|
281
|
+
dispatch({
|
|
282
|
+
type: 'ADD_DASHBOARD_ITEM',
|
|
283
|
+
id: item.id,
|
|
284
|
+
data: { ...report, triggerReload: false },
|
|
285
|
+
});
|
|
286
|
+
const convertedReport = convertInternalReportToReport(report);
|
|
287
|
+
setReport(convertedReport);
|
|
288
|
+
setLocalDateBucket(dateBucket);
|
|
289
|
+
setError(error);
|
|
290
|
+
}
|
|
291
|
+
catch (e) {
|
|
292
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
293
|
+
// console.log('Aborted fetching rows for chart');
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
throw e;
|
|
297
|
+
}
|
|
298
|
+
finally {
|
|
299
|
+
setLoading(false);
|
|
300
|
+
}
|
|
236
301
|
};
|
|
237
302
|
useEffect(() => {
|
|
238
303
|
if (!filters) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuillSelectWithCombo.d.ts","sourceRoot":"","sources":["../../../src/components/QuillSelectWithCombo.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAWtE;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,OAAO,EACP,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,EACL,SAAS,EACT,eAAe,EACf,QAAQ,GACT,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"QuillSelectWithCombo.d.ts","sourceRoot":"","sources":["../../../src/components/QuillSelectWithCombo.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAWtE;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,OAAO,EACP,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,EACL,SAAS,EACT,eAAe,EACf,QAAQ,GACT,EAAE,oBAAoB,2CA2RtB"}
|
|
@@ -147,7 +147,7 @@ export function QuillSelectComponentWithCombo({ options, value, width, onChange,
|
|
|
147
147
|
minHeight: 34,
|
|
148
148
|
}, className: "quill-option", onClick: () => {
|
|
149
149
|
// Manually create a synthetic ChangeEvent and pass it to callback
|
|
150
|
-
const changeEvent = { target: { value:
|
|
150
|
+
const changeEvent = { target: { value: undefined } };
|
|
151
151
|
onChange(changeEvent);
|
|
152
152
|
setShowModal(false);
|
|
153
153
|
}, children: [_jsx("style", { children: `
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QuillProviderClient } from '../models/Client';
|
|
2
|
-
export declare function getData(client: QuillProviderClient, cloudQueryEndpoint: string, noCred: RequestCredentials, hostedRequestBody: any, cloudRequestBody: any, method?: string, queryParam?: string): Promise<any>;
|
|
3
|
-
export declare function getDataFromCloud(client: QuillProviderClient, cloudQueryEndpoint: string, cloudRequestBody: any, method?: string): Promise<any>;
|
|
2
|
+
export declare function getData(client: QuillProviderClient, cloudQueryEndpoint: string, noCred: RequestCredentials, hostedRequestBody: any, cloudRequestBody: any, method?: string, queryParam?: string, abortSignal?: AbortSignal): Promise<any>;
|
|
3
|
+
export declare function getDataFromCloud(client: QuillProviderClient, cloudQueryEndpoint: string, cloudRequestBody: any, method?: string, abortSignal?: AbortSignal): Promise<any>;
|
|
4
4
|
export declare function fetchSqlQuery(ast: any, client: QuillProviderClient, formData?: any): Promise<{
|
|
5
5
|
query: string;
|
|
6
6
|
error?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataFetcher.d.ts","sourceRoot":"","sources":["../../../src/utils/dataFetcher.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AA8EvD,wBAAsB,OAAO,CAC3B,MAAM,EAAE,mBAAmB,EAC3B,kBAAkB,EAAE,MAAM,EAC1B,MAAM,EAAE,kBAAkB,EAC1B,iBAAiB,EAAE,GAAG,EACtB,gBAAgB,EAAE,GAAG,EACrB,MAAM,SAAS,EACf,UAAU,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"dataFetcher.d.ts","sourceRoot":"","sources":["../../../src/utils/dataFetcher.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AA8EvD,wBAAsB,OAAO,CAC3B,MAAM,EAAE,mBAAmB,EAC3B,kBAAkB,EAAE,MAAM,EAC1B,MAAM,EAAE,kBAAkB,EAC1B,iBAAiB,EAAE,GAAG,EACtB,gBAAgB,EAAE,GAAG,EACrB,MAAM,SAAS,EACf,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,WAAW,gBAqJ1B;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,mBAAmB,EAC3B,kBAAkB,EAAE,MAAM,EAC1B,gBAAgB,EAAE,GAAG,EACrB,MAAM,SAAS,EACf,WAAW,CAAC,EAAE,WAAW,gBAiC1B;AAED,wBAAsB,aAAa,CACjC,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,CAAC,EAAE,GAAG,GACb,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAmB5C"}
|
|
@@ -61,7 +61,7 @@ async function testSqlViewState(hostedRequestBody, client, referencedTables) {
|
|
|
61
61
|
}
|
|
62
62
|
// this function gets the data either from the self hosted endpoint or
|
|
63
63
|
// our cloud server
|
|
64
|
-
export async function getData(client, cloudQueryEndpoint, noCred, hostedRequestBody, cloudRequestBody, method = 'POST', queryParam) {
|
|
64
|
+
export async function getData(client, cloudQueryEndpoint, noCred, hostedRequestBody, cloudRequestBody, method = 'POST', queryParam, abortSignal) {
|
|
65
65
|
if (!client) {
|
|
66
66
|
return null;
|
|
67
67
|
}
|
|
@@ -77,6 +77,7 @@ export async function getData(client, cloudQueryEndpoint, noCred, hostedRequestB
|
|
|
77
77
|
},
|
|
78
78
|
credentials: client.withCredentials ? 'include' : noCred,
|
|
79
79
|
body: JSON.stringify(hostedRequestBody),
|
|
80
|
+
signal: abortSignal,
|
|
80
81
|
});
|
|
81
82
|
const responseJson = await resp.json();
|
|
82
83
|
if (responseJson.status === 'error' &&
|
|
@@ -169,38 +170,45 @@ export async function getData(client, cloudQueryEndpoint, noCred, hostedRequestB
|
|
|
169
170
|
}
|
|
170
171
|
else {
|
|
171
172
|
// cloud
|
|
172
|
-
return await getDataFromCloud(client, cloudQueryEndpoint, cloudRequestBody, method);
|
|
173
|
+
return await getDataFromCloud(client, cloudQueryEndpoint, cloudRequestBody, method, abortSignal);
|
|
173
174
|
}
|
|
174
175
|
}
|
|
175
176
|
catch (e) {
|
|
177
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
178
|
+
throw e;
|
|
179
|
+
}
|
|
176
180
|
console.error('Failed to parse JSON:', e);
|
|
177
181
|
return null;
|
|
178
182
|
}
|
|
179
183
|
}
|
|
180
|
-
export async function getDataFromCloud(client, cloudQueryEndpoint, cloudRequestBody, method = 'POST') {
|
|
181
|
-
const host = (typeof process !== 'undefined' && process?.env?.QUILL_SERVER_HOST) ||
|
|
182
|
-
'https://quill-344421.uc.r.appspot.com';
|
|
183
|
-
const url = `${host}/${cloudQueryEndpoint}`;
|
|
184
|
-
const resp = await fetch(url, {
|
|
185
|
-
method,
|
|
186
|
-
headers: {
|
|
187
|
-
Authorization: 'Bearer ',
|
|
188
|
-
'Content-Type': 'application/json',
|
|
189
|
-
},
|
|
190
|
-
body: method === 'POST'
|
|
191
|
-
? JSON.stringify({
|
|
192
|
-
...cloudRequestBody,
|
|
193
|
-
...{
|
|
194
|
-
publicKey: client?.publicKey,
|
|
195
|
-
orgId: client?.organizationId,
|
|
196
|
-
},
|
|
197
|
-
})
|
|
198
|
-
: null,
|
|
199
|
-
});
|
|
184
|
+
export async function getDataFromCloud(client, cloudQueryEndpoint, cloudRequestBody, method = 'POST', abortSignal) {
|
|
200
185
|
try {
|
|
186
|
+
const host = (typeof process !== 'undefined' && process?.env?.QUILL_SERVER_HOST) ||
|
|
187
|
+
'https://quill-344421.uc.r.appspot.com';
|
|
188
|
+
const url = `${host}/${cloudQueryEndpoint}`;
|
|
189
|
+
const resp = await fetch(url, {
|
|
190
|
+
method,
|
|
191
|
+
headers: {
|
|
192
|
+
Authorization: 'Bearer ',
|
|
193
|
+
'Content-Type': 'application/json',
|
|
194
|
+
},
|
|
195
|
+
body: method === 'POST'
|
|
196
|
+
? JSON.stringify({
|
|
197
|
+
...cloudRequestBody,
|
|
198
|
+
...{
|
|
199
|
+
publicKey: client?.publicKey,
|
|
200
|
+
orgId: client?.organizationId,
|
|
201
|
+
},
|
|
202
|
+
})
|
|
203
|
+
: null,
|
|
204
|
+
signal: abortSignal,
|
|
205
|
+
});
|
|
201
206
|
return await resp.json();
|
|
202
207
|
}
|
|
203
208
|
catch (e) {
|
|
209
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
210
|
+
throw e;
|
|
211
|
+
}
|
|
204
212
|
console.error('Failed to parse JSON:', e);
|
|
205
213
|
return null;
|
|
206
214
|
}
|
|
@@ -23,11 +23,11 @@ export type ReportBuilderInfo = {
|
|
|
23
23
|
};
|
|
24
24
|
export declare const EMPTY_REPORT: QuillReport;
|
|
25
25
|
export declare const EMPTY_INTERNAL_REPORT: QuillReportInternal;
|
|
26
|
-
export declare function fetchReport(reportId: string, client: QuillProviderClient, useReportTask?: boolean, filters?: any[], additionalProcessing?: AdditionalProcessing, dateBucket?: string, customFields?: any, rowsOnly?: boolean, rowCountOnly?: boolean): Promise<{
|
|
26
|
+
export declare function fetchReport(reportId: string, client: QuillProviderClient, useReportTask?: boolean, filters?: any[], additionalProcessing?: AdditionalProcessing, dateBucket?: string, customFields?: any, rowsOnly?: boolean, rowCountOnly?: boolean, abortSignal?: AbortSignal): Promise<{
|
|
27
27
|
report: QuillReportInternal;
|
|
28
28
|
error?: string;
|
|
29
29
|
}>;
|
|
30
|
-
export declare function fetchReportRowCount(reportId: string, client: QuillProviderClient, useReportTask?: boolean, filters?: any[], additionalProcessing?: AdditionalProcessing, customFields?: any): Promise<number | undefined>;
|
|
30
|
+
export declare function fetchReportRowCount(reportId: string, client: QuillProviderClient, useReportTask?: boolean, filters?: any[], additionalProcessing?: AdditionalProcessing, customFields?: any, abortSignal?: AbortSignal): Promise<number | undefined>;
|
|
31
31
|
export declare function saveReport({ report, dashboardItemId, client, }: {
|
|
32
32
|
report: any;
|
|
33
33
|
dashboardItemId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/utils/report.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAU,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EACL,kBAAkB,EAClB,KAAK,EACL,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAa1B,OAAO,EACL,oBAAoB,EAIrB,MAAM,mBAAmB,CAAC;AAI3B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE;QAAE,IAAI,EAAE,GAAG,EAAE,CAAC;QAAC,OAAO,EAAE,cAAc,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7D,aAAa,EAAE,GAAG,EAAE,CAAC;IACrB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,mBAAmB,CAAC;IAClC,UAAU,EAAE,kBAAkB,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,WAkB1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,E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B,UACnB,KAAK,qBACM,GAAG,iBACP,MAAM,qBACF;IACjB,aAAa,EAAE,mBAAmB,CAAC;IACnC,UAAU,EAAE,kBAAkB,CAAC;CAChC,WACQ,mBAAmB,iBACb,GAAG,qBACC,OAAO,iBACX,OAAO,eACT,oBAAoB,KAChC,QAAQ,iBAAiB,CAgK3B,CAAC"}
|
package/dist/esm/utils/report.js
CHANGED
|
@@ -61,7 +61,7 @@ function extractAllReportValuesFromQuillInternalReport(reportInternal) {
|
|
|
61
61
|
template: reportInternal.template,
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
export async function fetchReport(reportId, client, useReportTask = true, filters = [], additionalProcessing, dateBucket, customFields, rowsOnly, rowCountOnly) {
|
|
64
|
+
export async function fetchReport(reportId, client, useReportTask = true, filters = [], additionalProcessing, dateBucket, customFields, rowsOnly, rowCountOnly, abortSignal) {
|
|
65
65
|
let reportInfo = undefined;
|
|
66
66
|
let errorMessage = undefined;
|
|
67
67
|
try {
|
|
@@ -87,7 +87,7 @@ export async function fetchReport(reportId, client, useReportTask = true, filter
|
|
|
87
87
|
filters: filters,
|
|
88
88
|
useNewNodeSql: true,
|
|
89
89
|
};
|
|
90
|
-
const resp = await getData(client, 'itempost', 'omit', hostedBody, cloudBody, 'POST', 'fetch-data');
|
|
90
|
+
const resp = await getData(client, 'itempost', 'omit', hostedBody, cloudBody, 'POST', 'fetch-data', abortSignal);
|
|
91
91
|
processFilterErrorList(resp);
|
|
92
92
|
const dashboardItem = { ...resp, filtersApplied: filters };
|
|
93
93
|
if (resp.errorMessage) {
|
|
@@ -133,6 +133,9 @@ export async function fetchReport(reportId, client, useReportTask = true, filter
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
catch (error) {
|
|
136
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
136
139
|
if (error instanceof DataLoadError) {
|
|
137
140
|
if (error.data.useReportTask) {
|
|
138
141
|
internalLog('USING ITEM AS BACKUP');
|
|
@@ -163,7 +166,7 @@ export async function fetchReport(reportId, client, useReportTask = true, filter
|
|
|
163
166
|
}
|
|
164
167
|
return { report: reportInfo || EMPTY_INTERNAL_REPORT, error: errorMessage };
|
|
165
168
|
}
|
|
166
|
-
export async function fetchReportRowCount(reportId, client, useReportTask = true, filters = [], additionalProcessing, customFields) {
|
|
169
|
+
export async function fetchReportRowCount(reportId, client, useReportTask = true, filters = [], additionalProcessing, customFields, abortSignal) {
|
|
167
170
|
// Remove extra fields on each filter so we don't confuse the backend.
|
|
168
171
|
const hostedBody = {
|
|
169
172
|
metadata: {
|
|
@@ -185,7 +188,7 @@ export async function fetchReportRowCount(reportId, client, useReportTask = true
|
|
|
185
188
|
filters: filters,
|
|
186
189
|
useNewNodeSql: true,
|
|
187
190
|
};
|
|
188
|
-
const resp = await getData(client, 'itempost', 'omit', hostedBody, cloudBody, 'POST', 'fetch-data');
|
|
191
|
+
const resp = await getData(client, 'itempost', 'omit', hostedBody, cloudBody, 'POST', 'fetch-data', abortSignal);
|
|
189
192
|
return resp.rowCount;
|
|
190
193
|
}
|
|
191
194
|
export async function saveReport({ report, dashboardItemId, client, }) {
|
|
@@ -52,7 +52,7 @@ export declare const fetchResultsByQuery: (query: string, client: QuillProviderC
|
|
|
52
52
|
error?: string | undefined;
|
|
53
53
|
itemQuery?: string[] | undefined;
|
|
54
54
|
}>;
|
|
55
|
-
export declare const fetchResultsByReport: (reportId: string, client: QuillProviderClient, processing?: AdditionalProcessing, filters?: any, customFields?: any, rowsOnly?: boolean, rowCountOnly?: boolean) => Promise<{
|
|
55
|
+
export declare const fetchResultsByReport: (reportId: string, client: QuillProviderClient, processing?: AdditionalProcessing, filters?: any, customFields?: any, rowsOnly?: boolean, rowCountOnly?: boolean, abortSignal?: AbortSignal) => Promise<{
|
|
56
56
|
columns: Column[];
|
|
57
57
|
rows: any[];
|
|
58
58
|
rowCount?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3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IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAaA,CAAC;AAEF,eAAO,MAAM,mBAAmB,UACvB,MAAM,UACL,mBAAmB,eACd,oBAAoB,iBAClB,GAAG,YACR,eAAe,EAAE,cACf;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,aACxC,OAAO,iBACH,OAAO;aAEb,cAAc,EAAE;UACnB,GAAG,EAAE;;;;EA2DZ,CAAC;AAEF,eAAO,MAAM,oBAAoB,aACrB,MAAM,UACR,mBAAmB,eACd,oBAAoB,YACvB,GAAG,iBACE,GAAG,aACP,OAAO,iBACH,OAAO,gBACR,WAAW;aAEhB,MAAM,EAAE;UACX,GAAG,EAAE;;;EAyFZ,CAAC;AAEF,eAAO,MAAM,eAAe,QACrB,cAAc,MAAM,UACjB,mBAAmB,eACd,oBAAoB,iBAClB,GAAG,aACP,OAAO,iBACH,OAAO;aAEb,cAAc,EAAE;UACnB,GAAG,EAAE;;;;EAyDZ,CAAC;AAEF,eAAO,MAAM,+CAA+C,0BACnC,oBAAoB;;CAU5C,CAAC"}
|
|
@@ -296,7 +296,7 @@ export const fetchResultsByQuery = async (query, client, processing, customField
|
|
|
296
296
|
}
|
|
297
297
|
return { rows, columns, rowCount, error, itemQuery };
|
|
298
298
|
};
|
|
299
|
-
export const fetchResultsByReport = async (reportId, client, processing, filters, customFields, rowsOnly, rowCountOnly) => {
|
|
299
|
+
export const fetchResultsByReport = async (reportId, client, processing, filters, customFields, rowsOnly, rowCountOnly, abortSignal) => {
|
|
300
300
|
const updatedProcessing = { ...processing };
|
|
301
301
|
let rows = [];
|
|
302
302
|
let columns = [];
|
|
@@ -340,7 +340,7 @@ export const fetchResultsByReport = async (reportId, client, processing, filters
|
|
|
340
340
|
filters: [],
|
|
341
341
|
useNewNodeSql: true,
|
|
342
342
|
};
|
|
343
|
-
const resp = await getData(client, 'itempost', 'omit', hostedBody, cloudBody);
|
|
343
|
+
const resp = await getData(client, 'itempost', 'omit', hostedBody, cloudBody, undefined, undefined, abortSignal);
|
|
344
344
|
if (resp.errorMessage) {
|
|
345
345
|
throw new Error(resp.errorMessage);
|
|
346
346
|
}
|
|
@@ -361,6 +361,10 @@ export const fetchResultsByReport = async (reportId, client, processing, filters
|
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
catch (e) {
|
|
364
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
365
|
+
console.log('Aborted fetch results by report');
|
|
366
|
+
throw e;
|
|
367
|
+
}
|
|
364
368
|
rows = [];
|
|
365
369
|
columns = [];
|
|
366
370
|
rowCount = 0;
|