@quillsql/react 1.5.3 → 1.5.5
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/lib/Chart.d.ts +2 -1
- package/lib/Chart.js +81 -34
- package/lib/Chart.js.map +1 -1
- package/lib/Context.d.ts +3 -1
- package/lib/Context.js +13 -2
- package/lib/Context.js.map +1 -1
- package/lib/Dashboard.js +1 -1
- package/lib/Dashboard.js.map +1 -1
- package/lib/QuillProvider.d.ts +3 -1
- package/lib/QuillProvider.js +2 -2
- package/lib/QuillProvider.js.map +1 -1
- package/lib/ReportBuilder.d.ts +21 -0
- package/lib/ReportBuilder.js +1534 -0
- package/lib/ReportBuilder.js.map +1 -0
- package/lib/SQLEditor.d.ts +11 -0
- package/lib/SQLEditor.js +597 -0
- package/lib/SQLEditor.js.map +1 -0
- package/lib/hooks/useQuill.js +42 -12
- package/lib/hooks/useQuill.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/package.json +4 -2
- package/src/Chart.tsx +127 -52
- package/src/Context.tsx +14 -1
- package/src/Dashboard.tsx +1 -0
- package/src/QuillProvider.tsx +4 -0
- package/src/ReportBuilder.tsx +2208 -0
- package/src/SQLEditor.tsx +841 -0
- package/src/hooks/useQuill.ts +49 -16
- package/src/index.ts +2 -0
package/src/hooks/useQuill.ts
CHANGED
|
@@ -68,24 +68,57 @@ export const useQuill = (
|
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
70
|
// @ts-ignore
|
|
71
|
-
const {
|
|
71
|
+
const {
|
|
72
|
+
publicKey,
|
|
73
|
+
customerId,
|
|
74
|
+
environment,
|
|
75
|
+
queryEndpoint,
|
|
76
|
+
queryHeaders,
|
|
77
|
+
} = client;
|
|
72
78
|
try {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
if (queryEndpoint) {
|
|
80
|
+
const resp = await axios.get(
|
|
81
|
+
'https://quill-344421.uc.r.appspot.com/selfhostitem',
|
|
82
|
+
{
|
|
83
|
+
params: {
|
|
84
|
+
id: chartId,
|
|
85
|
+
orgId: customerId,
|
|
86
|
+
publicKey: publicKey,
|
|
87
|
+
},
|
|
82
88
|
environment: environment || undefined,
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const resp1 = await axios.post(
|
|
93
|
+
queryEndpoint,
|
|
94
|
+
{ query: resp.data.queryString },
|
|
95
|
+
{ headers: queryHeaders }
|
|
96
|
+
);
|
|
97
|
+
setLoading(false);
|
|
98
|
+
setData({
|
|
99
|
+
...resp.data,
|
|
100
|
+
rows: resp1.data.rows,
|
|
101
|
+
fields: resp1.data.fields,
|
|
102
|
+
});
|
|
103
|
+
dispatch({ type: 'UPDATE_DASHBOARD_ITEM', id, data: resp.data });
|
|
104
|
+
} else {
|
|
105
|
+
const resp = await axios.get(
|
|
106
|
+
'https://quill-344421.uc.r.appspot.com/item',
|
|
107
|
+
{
|
|
108
|
+
params: {
|
|
109
|
+
id: chartId,
|
|
110
|
+
orgId: customerId,
|
|
111
|
+
publicKey: publicKey,
|
|
112
|
+
},
|
|
113
|
+
headers: {
|
|
114
|
+
environment: environment || undefined,
|
|
115
|
+
},
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
setLoading(false);
|
|
119
|
+
setData(resp.data);
|
|
120
|
+
dispatch({ type: 'UPDATE_DASHBOARD_ITEM', id, data: resp.data });
|
|
121
|
+
}
|
|
89
122
|
} catch (e) {
|
|
90
123
|
if (typeof e === 'string' || (typeof e === 'object' && e !== null)) {
|
|
91
124
|
setError(stringifyIfObject(e));
|
package/src/index.ts
CHANGED
|
@@ -3,4 +3,6 @@ export { default as Dashboard } from './Dashboard';
|
|
|
3
3
|
export { default as QuillProvider } from './QuillProvider';
|
|
4
4
|
export { default as Chart } from './Chart';
|
|
5
5
|
export { default as Table } from './Table';
|
|
6
|
+
export { default as SQLEditor } from './SQLEditor';
|
|
7
|
+
export { default as ReportBuilder } from './ReportBuilder';
|
|
6
8
|
export { useQuill } from './hooks/useQuill';
|