@quillsql/react 2.11.0 → 2.11.2
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportBuilder.d.ts","sourceRoot":"","sources":["../../src/ReportBuilder.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ReportBuilder.d.ts","sourceRoot":"","sources":["../../src/ReportBuilder.tsx"],"names":[],"mappings":";AAwGA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,IAAS,EACT,gBAAiC,EACjC,wBAA0C,EAC1C,oBAAgC,EAChC,aAAyB,EACzB,gBAAqB,EACrB,MAAoB,EACpB,eAAsC,EACtC,SAA0B,EAC1B,MAAoB,EACpB,KAA+B,EAC/B,OAAsB,EACtB,IAAgB,EAChB,QAA2B,EAC3B,OAAsB,EACtB,SAA2B,EAC3B,YAAgC,EAChC,YAAgC,EAChC,eAAsC,EACtC,kBAA4C,EAC5C,iBAA0C,EAC1C,cAAoC,EACpC,iBAA0C,EAC1C,aAAkC,GACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA,2CAwhGA"}
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
const axios_1 = __importDefault(require("axios"));
|
|
9
8
|
const UiComponents_1 = require("./components/UiComponents");
|
|
10
9
|
const core_1 = require("@dnd-kit/core");
|
|
11
10
|
const sortable_1 = require("@dnd-kit/sortable");
|
|
@@ -168,10 +167,18 @@ function ReportBuilder({ path = '', initialTableName = 'transactions', onAddToDa
|
|
|
168
167
|
};
|
|
169
168
|
const fetchSqlQuery = async () => {
|
|
170
169
|
try {
|
|
171
|
-
const response = await
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
170
|
+
const response = await fetch(`https://quill-344421.uc.r.appspot.com/sqlify`, {
|
|
171
|
+
method: 'POST',
|
|
172
|
+
headers: {
|
|
173
|
+
'Content-Type': 'application/json',
|
|
174
|
+
},
|
|
175
|
+
body: JSON.stringify({
|
|
176
|
+
ast: { ...baseAst, where: formData },
|
|
177
|
+
publicKey: client.publicKey,
|
|
178
|
+
}),
|
|
179
|
+
});
|
|
180
|
+
const data = await response.json();
|
|
181
|
+
setActiveQuery(data.query);
|
|
175
182
|
fetchUponChange();
|
|
176
183
|
}
|
|
177
184
|
catch (error) {
|
|
@@ -219,12 +226,23 @@ function ReportBuilder({ path = '', initialTableName = 'transactions', onAddToDa
|
|
|
219
226
|
const fetchDistinctHelper = async (column, table) => {
|
|
220
227
|
try {
|
|
221
228
|
const query = `SELECT DISTINCT ${column} FROM ${table};`;
|
|
222
|
-
const response = await
|
|
223
|
-
|
|
224
|
-
|
|
229
|
+
const response = await fetch(`https://quill-344421.uc.r.appspot.com/dashquery`, {
|
|
230
|
+
method: 'POST',
|
|
231
|
+
headers: {
|
|
232
|
+
'Content-Type': 'application/json',
|
|
233
|
+
},
|
|
234
|
+
body: JSON.stringify({
|
|
235
|
+
orgId: 2,
|
|
236
|
+
publicKey: client.publicKey,
|
|
237
|
+
query: query,
|
|
238
|
+
}),
|
|
239
|
+
});
|
|
240
|
+
const data = await response.json();
|
|
241
|
+
if (data.errorMessage) {
|
|
242
|
+
console.error(data.errorMessage);
|
|
225
243
|
return null;
|
|
226
244
|
}
|
|
227
|
-
const options =
|
|
245
|
+
const options = data.rows.map((r) => r[column]);
|
|
228
246
|
const newCheckboxValues = options.reduce((obj, col) => {
|
|
229
247
|
obj[col] = false;
|
|
230
248
|
return obj;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportBuilder.d.ts","sourceRoot":"","sources":["../../src/ReportBuilder.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ReportBuilder.d.ts","sourceRoot":"","sources":["../../src/ReportBuilder.tsx"],"names":[],"mappings":";AAwGA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,IAAS,EACT,gBAAiC,EACjC,wBAA0C,EAC1C,oBAAgC,EAChC,aAAyB,EACzB,gBAAqB,EACrB,MAAoB,EACpB,eAAsC,EACtC,SAA0B,EAC1B,MAAoB,EACpB,KAA+B,EAC/B,OAAsB,EACtB,IAAgB,EAChB,QAA2B,EAC3B,OAAsB,EACtB,SAA2B,EAC3B,YAAgC,EAChC,YAAgC,EAChC,eAAsC,EACtC,kBAA4C,EAC5C,iBAA0C,EAC1C,cAAoC,EACpC,iBAA0C,EAC1C,aAAkC,GACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA,2CAwhGA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useEffect, useState } from 'react';
|
|
3
|
-
import axios from 'axios';
|
|
4
3
|
import { MemoizedCheckbox } from './components/UiComponents';
|
|
5
4
|
import { DndContext, closestCenter, KeyboardSensor, PointerSensor, useSensor, useSensors, } from '@dnd-kit/core';
|
|
6
5
|
import { arrayMove, SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy, useSortable, } from '@dnd-kit/sortable';
|
|
@@ -163,10 +162,18 @@ export default function ReportBuilder({ path = '', initialTableName = 'transacti
|
|
|
163
162
|
};
|
|
164
163
|
const fetchSqlQuery = async () => {
|
|
165
164
|
try {
|
|
166
|
-
const response = await
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
const response = await fetch(`https://quill-344421.uc.r.appspot.com/sqlify`, {
|
|
166
|
+
method: 'POST',
|
|
167
|
+
headers: {
|
|
168
|
+
'Content-Type': 'application/json',
|
|
169
|
+
},
|
|
170
|
+
body: JSON.stringify({
|
|
171
|
+
ast: { ...baseAst, where: formData },
|
|
172
|
+
publicKey: client.publicKey,
|
|
173
|
+
}),
|
|
174
|
+
});
|
|
175
|
+
const data = await response.json();
|
|
176
|
+
setActiveQuery(data.query);
|
|
170
177
|
fetchUponChange();
|
|
171
178
|
}
|
|
172
179
|
catch (error) {
|
|
@@ -214,12 +221,23 @@ export default function ReportBuilder({ path = '', initialTableName = 'transacti
|
|
|
214
221
|
const fetchDistinctHelper = async (column, table) => {
|
|
215
222
|
try {
|
|
216
223
|
const query = `SELECT DISTINCT ${column} FROM ${table};`;
|
|
217
|
-
const response = await
|
|
218
|
-
|
|
219
|
-
|
|
224
|
+
const response = await fetch(`https://quill-344421.uc.r.appspot.com/dashquery`, {
|
|
225
|
+
method: 'POST',
|
|
226
|
+
headers: {
|
|
227
|
+
'Content-Type': 'application/json',
|
|
228
|
+
},
|
|
229
|
+
body: JSON.stringify({
|
|
230
|
+
orgId: 2,
|
|
231
|
+
publicKey: client.publicKey,
|
|
232
|
+
query: query,
|
|
233
|
+
}),
|
|
234
|
+
});
|
|
235
|
+
const data = await response.json();
|
|
236
|
+
if (data.errorMessage) {
|
|
237
|
+
console.error(data.errorMessage);
|
|
220
238
|
return null;
|
|
221
239
|
}
|
|
222
|
-
const options =
|
|
240
|
+
const options = data.rows.map((r) => r[column]);
|
|
223
241
|
const newCheckboxValues = options.reduce((obj, col) => {
|
|
224
242
|
obj[col] = false;
|
|
225
243
|
return obj;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quillsql/react",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.2",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"import": "./dist/esm/index.js",
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"pub": "rm -rf dist && tsc -p tsconfig.json && tsc -p tsconfig.esm.json && npm publish --access public"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"@dnd-kit/core": "^6.1.0",
|
|
22
|
+
"@dnd-kit/sortable": "^8.0.0",
|
|
23
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
21
24
|
"@monaco-editor/react": "^4.5.1",
|
|
22
25
|
"date-fns": "^2.29.3",
|
|
23
26
|
"date-fns-tz": "^2.0.0",
|