@quillsql/react 2.16.42 → 2.16.44
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 +114 -87
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +114 -87
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -16952,7 +16952,7 @@ async function generatePivotWithSQL({
|
|
|
16952
16952
|
client,
|
|
16953
16953
|
task: "pivot-template",
|
|
16954
16954
|
metadata: {
|
|
16955
|
-
clientId: client.
|
|
16955
|
+
clientId: client.id,
|
|
16956
16956
|
pivot: pivotConfig,
|
|
16957
16957
|
reportId: report?.id !== "__quillTempReport" ? report?.id : void 0,
|
|
16958
16958
|
itemQuery: reportBuilderState ? void 0 : report?.queryString,
|
|
@@ -18778,7 +18778,7 @@ var init_tableProcessing = __esm({
|
|
|
18778
18778
|
metadata: {
|
|
18779
18779
|
reportBuilderState,
|
|
18780
18780
|
stringColumns: stringColumns.map((col) => col.field),
|
|
18781
|
-
clientId: client.
|
|
18781
|
+
clientId: client.id,
|
|
18782
18782
|
databaseType: client.databaseType?.toLowerCase() || "postgresql",
|
|
18783
18783
|
customFields,
|
|
18784
18784
|
filters: void 0,
|
|
@@ -18969,7 +18969,7 @@ var init_tableProcessing = __esm({
|
|
|
18969
18969
|
metadata: {
|
|
18970
18970
|
reportBuilderState,
|
|
18971
18971
|
columns: stringNames,
|
|
18972
|
-
clientId: client.
|
|
18972
|
+
clientId: client.id,
|
|
18973
18973
|
databaseType: client.databaseType,
|
|
18974
18974
|
customFieldsByTable: customFields,
|
|
18975
18975
|
useNewNodeSql: true,
|
|
@@ -18984,7 +18984,7 @@ var init_tableProcessing = __esm({
|
|
|
18984
18984
|
task: "query",
|
|
18985
18985
|
metadata: {
|
|
18986
18986
|
query: countQuery,
|
|
18987
|
-
clientId: client.
|
|
18987
|
+
clientId: client.id,
|
|
18988
18988
|
databaseType: client.databaseType,
|
|
18989
18989
|
customFieldsByTable: customFields,
|
|
18990
18990
|
useNewNodeSql: true,
|
|
@@ -19044,7 +19044,7 @@ var init_tableProcessing = __esm({
|
|
|
19044
19044
|
metadata: {
|
|
19045
19045
|
reportBuilderState,
|
|
19046
19046
|
stringColumns: columns,
|
|
19047
|
-
clientId: client.
|
|
19047
|
+
clientId: client.id,
|
|
19048
19048
|
databaseType: client.databaseType?.toLowerCase() || "postgresql",
|
|
19049
19049
|
customFields,
|
|
19050
19050
|
filters,
|
|
@@ -19094,7 +19094,7 @@ var init_tableProcessing = __esm({
|
|
|
19094
19094
|
task: "query",
|
|
19095
19095
|
metadata: {
|
|
19096
19096
|
query,
|
|
19097
|
-
clientId: client.
|
|
19097
|
+
clientId: client.id,
|
|
19098
19098
|
databaseType: client.databaseType,
|
|
19099
19099
|
customFieldsByTable: customFields,
|
|
19100
19100
|
useNewNodeSql: true,
|
|
@@ -19206,7 +19206,7 @@ var init_tableProcessing = __esm({
|
|
|
19206
19206
|
task: "query",
|
|
19207
19207
|
metadata: {
|
|
19208
19208
|
query,
|
|
19209
|
-
clientId: client.
|
|
19209
|
+
clientId: client.id,
|
|
19210
19210
|
databaseType: client.databaseType,
|
|
19211
19211
|
customFieldsByTable: customFields,
|
|
19212
19212
|
useNewNodeSql: true,
|
|
@@ -19316,7 +19316,7 @@ var init_tableProcessing = __esm({
|
|
|
19316
19316
|
metadata: {
|
|
19317
19317
|
query,
|
|
19318
19318
|
filterMap,
|
|
19319
|
-
clientId: client.
|
|
19319
|
+
clientId: client.id,
|
|
19320
19320
|
databaseType: client?.databaseType,
|
|
19321
19321
|
customFieldsByTable: customFields,
|
|
19322
19322
|
additionalProcessing: processing,
|
|
@@ -19351,7 +19351,7 @@ var init_tableProcessing = __esm({
|
|
|
19351
19351
|
task: "log-broken-query",
|
|
19352
19352
|
metadata: {
|
|
19353
19353
|
query,
|
|
19354
|
-
clientId: client.
|
|
19354
|
+
clientId: client.id,
|
|
19355
19355
|
error: parsingError
|
|
19356
19356
|
},
|
|
19357
19357
|
getToken
|
|
@@ -19459,7 +19459,7 @@ var init_tableProcessing = __esm({
|
|
|
19459
19459
|
metadata: {
|
|
19460
19460
|
dashboardItemId: reportId,
|
|
19461
19461
|
filters: minimalFilters,
|
|
19462
|
-
clientId: client?.
|
|
19462
|
+
clientId: client?.id,
|
|
19463
19463
|
databaseType: client?.databaseType,
|
|
19464
19464
|
additionalProcessing: updatedProcessing,
|
|
19465
19465
|
forcePagination: true,
|
|
@@ -19533,7 +19533,7 @@ var init_tableProcessing = __esm({
|
|
|
19533
19533
|
rowCountOnly,
|
|
19534
19534
|
customFields,
|
|
19535
19535
|
tenants,
|
|
19536
|
-
clientId: client.
|
|
19536
|
+
clientId: client.id,
|
|
19537
19537
|
databaseType: client.databaseType?.toLowerCase() || "postgresql",
|
|
19538
19538
|
dashboardName
|
|
19539
19539
|
},
|
|
@@ -19674,7 +19674,7 @@ async function testSqlViewState(client, referencedTables, getToken) {
|
|
|
19674
19674
|
task: "test-view",
|
|
19675
19675
|
metadata: {
|
|
19676
19676
|
tables: [table],
|
|
19677
|
-
clientId: client.
|
|
19677
|
+
clientId: client.id
|
|
19678
19678
|
},
|
|
19679
19679
|
getToken
|
|
19680
19680
|
});
|
|
@@ -19683,7 +19683,7 @@ async function testSqlViewState(client, referencedTables, getToken) {
|
|
|
19683
19683
|
metadata: {
|
|
19684
19684
|
table,
|
|
19685
19685
|
task: "set-broken-view",
|
|
19686
|
-
clientId: client.
|
|
19686
|
+
clientId: client.id
|
|
19687
19687
|
}
|
|
19688
19688
|
};
|
|
19689
19689
|
quillFetch({
|
|
@@ -19793,7 +19793,7 @@ async function* quillStream({
|
|
|
19793
19793
|
body: JSON.stringify({
|
|
19794
19794
|
metadata: {
|
|
19795
19795
|
task,
|
|
19796
|
-
clientId: client.
|
|
19796
|
+
clientId: client.id,
|
|
19797
19797
|
...metadata
|
|
19798
19798
|
}
|
|
19799
19799
|
}),
|
|
@@ -20020,7 +20020,7 @@ async function getData(client, cloudQueryEndpoint, noCred, hostedRequestBody, cl
|
|
|
20020
20020
|
body: method === "POST" ? JSON.stringify({
|
|
20021
20021
|
...cloudRequestBody,
|
|
20022
20022
|
...{
|
|
20023
|
-
publicKey: client?.
|
|
20023
|
+
publicKey: client?.id
|
|
20024
20024
|
}
|
|
20025
20025
|
}) : null,
|
|
20026
20026
|
signal: abortSignal
|
|
@@ -20049,7 +20049,7 @@ async function fetchSqlQuery(ast, client, getToken, formData) {
|
|
|
20049
20049
|
client,
|
|
20050
20050
|
task: "sqlify",
|
|
20051
20051
|
metadata: {
|
|
20052
|
-
clientId: client.
|
|
20052
|
+
clientId: client.id,
|
|
20053
20053
|
useNewNodeSql: true,
|
|
20054
20054
|
ast: { ...ast, where }
|
|
20055
20055
|
},
|
|
@@ -20070,7 +20070,7 @@ async function fetchSqlQueryFromState(reportBuilderState, client, getToken, data
|
|
|
20070
20070
|
client,
|
|
20071
20071
|
task: "sqlify",
|
|
20072
20072
|
metadata: {
|
|
20073
|
-
clientId: client.
|
|
20073
|
+
clientId: client.id,
|
|
20074
20074
|
useNewNodeSql: true,
|
|
20075
20075
|
ast
|
|
20076
20076
|
},
|
|
@@ -20087,7 +20087,7 @@ async function fetchQueryDateRangesFromState(reportBuilderState, columns, client
|
|
|
20087
20087
|
client,
|
|
20088
20088
|
task: "report-builder-date-ranges",
|
|
20089
20089
|
metadata: {
|
|
20090
|
-
clientId: client.
|
|
20090
|
+
clientId: client.id,
|
|
20091
20091
|
reportBuilderState,
|
|
20092
20092
|
dateColumns: columns,
|
|
20093
20093
|
databaseType: databaseType || "postgresql",
|
|
@@ -20178,7 +20178,7 @@ var init_dataFetcher = __esm({
|
|
|
20178
20178
|
body: JSON.stringify({
|
|
20179
20179
|
metadata: {
|
|
20180
20180
|
task,
|
|
20181
|
-
clientId: client.clientId,
|
|
20181
|
+
clientId: client.id ?? client.clientId,
|
|
20182
20182
|
...metadata
|
|
20183
20183
|
}
|
|
20184
20184
|
}),
|
|
@@ -21158,7 +21158,7 @@ async function getDashboard(dashboardName, client, getToken, tenants, flags) {
|
|
|
21158
21158
|
task: "dashboard",
|
|
21159
21159
|
metadata: {
|
|
21160
21160
|
name: dashboardName,
|
|
21161
|
-
clientId: client.
|
|
21161
|
+
clientId: client.id,
|
|
21162
21162
|
databaseType: client.databaseType,
|
|
21163
21163
|
useNewNodeSql: true,
|
|
21164
21164
|
tenants,
|
|
@@ -21377,7 +21377,7 @@ async function fetchReportRows({
|
|
|
21377
21377
|
task: "report",
|
|
21378
21378
|
metadata: {
|
|
21379
21379
|
reportId,
|
|
21380
|
-
clientId: client.
|
|
21380
|
+
clientId: client.id,
|
|
21381
21381
|
databaseType: client.databaseType,
|
|
21382
21382
|
filters: filters.map((filter) => ({ ...filter, options: void 0 })),
|
|
21383
21383
|
useNewNodeSql: true,
|
|
@@ -21426,7 +21426,7 @@ async function fetchReport({
|
|
|
21426
21426
|
metadata: {
|
|
21427
21427
|
reportId,
|
|
21428
21428
|
dashboardItemId: reportId,
|
|
21429
|
-
clientId: client.
|
|
21429
|
+
clientId: client.id,
|
|
21430
21430
|
databaseType: client.databaseType,
|
|
21431
21431
|
filters: filters.map((filter) => ({ ...filter, options: void 0 })),
|
|
21432
21432
|
customFields,
|
|
@@ -21559,7 +21559,7 @@ async function fetchReportRowCount(reportId, client, getToken, tenants, flags, u
|
|
|
21559
21559
|
metadata: {
|
|
21560
21560
|
reportId,
|
|
21561
21561
|
dashboardItemId: reportId,
|
|
21562
|
-
clientId: client.
|
|
21562
|
+
clientId: client.id,
|
|
21563
21563
|
databaseType: client.databaseType,
|
|
21564
21564
|
filters: filters.map((filter) => ({ ...filter, options: void 0 })),
|
|
21565
21565
|
customFields,
|
|
@@ -21588,7 +21588,7 @@ async function saveReport({
|
|
|
21588
21588
|
eventTracking,
|
|
21589
21589
|
tenants
|
|
21590
21590
|
}) {
|
|
21591
|
-
const {
|
|
21591
|
+
const { id, databaseType } = client;
|
|
21592
21592
|
const {
|
|
21593
21593
|
reportBuilderState,
|
|
21594
21594
|
queryString,
|
|
@@ -21615,7 +21615,7 @@ async function saveReport({
|
|
|
21615
21615
|
dashboardItemId,
|
|
21616
21616
|
...dashboardItemId ? { reportId: dashboardItemId } : {},
|
|
21617
21617
|
// Remove useNewNodeSql since backend will handle conversion
|
|
21618
|
-
clientId:
|
|
21618
|
+
clientId: id,
|
|
21619
21619
|
tenants,
|
|
21620
21620
|
// Only include adminMode for 'create' task, not 'create-report'
|
|
21621
21621
|
...isCreateTask && { adminMode },
|
|
@@ -22420,7 +22420,6 @@ var getSchemaInfo = async ({
|
|
|
22420
22420
|
getToken,
|
|
22421
22421
|
eventTracking
|
|
22422
22422
|
}) => {
|
|
22423
|
-
const { publicKey } = client;
|
|
22424
22423
|
let customFieldsByTableUnique = null;
|
|
22425
22424
|
if (client.featureFlags?.customFieldsEnabled && tenants && tenants[0] !== "QUILL_ALL_TENANTS" && tenants.length === 1 && (typeof tenants[0] !== "object" || tenants[0].tenantIds?.[0] !== "QUILL_ALL_TENANTS" && tenants[0].tenantIds?.length === 1)) {
|
|
22426
22425
|
try {
|
|
@@ -22439,13 +22438,13 @@ var getSchemaInfo = async ({
|
|
|
22439
22438
|
client,
|
|
22440
22439
|
task: "schema",
|
|
22441
22440
|
metadata: {
|
|
22442
|
-
clientId:
|
|
22441
|
+
clientId: client.id,
|
|
22443
22442
|
removeCustomerField: true,
|
|
22444
22443
|
removeCustomFieldRef: true,
|
|
22445
22444
|
tableIds,
|
|
22446
22445
|
customFieldsByTable: customFieldsByTableUnique,
|
|
22447
22446
|
useNewCustomFields: true,
|
|
22448
|
-
gatherSchemaData: "665610862cf7a3000be66453" ===
|
|
22447
|
+
gatherSchemaData: "665610862cf7a3000be66453" === client.id ? true : false,
|
|
22449
22448
|
// TODO: this should be a feature flag on the client
|
|
22450
22449
|
tenants
|
|
22451
22450
|
},
|
|
@@ -23539,7 +23538,7 @@ var CacheCab = class {
|
|
|
23539
23538
|
task: "report",
|
|
23540
23539
|
metadata: {
|
|
23541
23540
|
reportId,
|
|
23542
|
-
clientId: client.
|
|
23541
|
+
clientId: client.id,
|
|
23543
23542
|
databaseType: client.databaseType,
|
|
23544
23543
|
filters: adjusted,
|
|
23545
23544
|
additionalProcessing: { page: { rowsPerPage: 1e3, rowsPerRequest: 1e5 } },
|
|
@@ -23678,7 +23677,7 @@ var CacheCab = class {
|
|
|
23678
23677
|
);
|
|
23679
23678
|
const keyParts = [
|
|
23680
23679
|
reportId,
|
|
23681
|
-
client.
|
|
23680
|
+
client.id,
|
|
23682
23681
|
client.databaseType,
|
|
23683
23682
|
hashString(stableStringify(canonicalizeForKey(tenants ?? null))),
|
|
23684
23683
|
hashString(stableStringify(canonicalizeForKey(flags ?? null))),
|
|
@@ -24316,12 +24315,11 @@ var ContextProvider = ({
|
|
|
24316
24315
|
typeof window !== "undefined" && sessionStorage ? JSON.parse(sessionStorage.getItem("quill-client") ?? "null") : null
|
|
24317
24316
|
);
|
|
24318
24317
|
const populatedClient = (0, import_react.useMemo)(() => {
|
|
24319
|
-
if (!client || client.
|
|
24318
|
+
if (!client || client.id !== publicKey) return null;
|
|
24320
24319
|
return {
|
|
24321
24320
|
...client,
|
|
24322
|
-
publicKey,
|
|
24323
|
-
_id: publicKey,
|
|
24324
24321
|
id: publicKey,
|
|
24322
|
+
clientId: publicKey,
|
|
24325
24323
|
queryHeaders,
|
|
24326
24324
|
queryEndpoint,
|
|
24327
24325
|
streamEndpoint,
|
|
@@ -24482,7 +24480,7 @@ var ContextProvider = ({
|
|
|
24482
24480
|
try {
|
|
24483
24481
|
const result = await quillFetch({
|
|
24484
24482
|
client: {
|
|
24485
|
-
|
|
24483
|
+
id: publicKey,
|
|
24486
24484
|
queryEndpoint,
|
|
24487
24485
|
queryHeaders,
|
|
24488
24486
|
withCredentials: !!withCredentials
|
|
@@ -24604,7 +24602,7 @@ var ContextProvider = ({
|
|
|
24604
24602
|
try {
|
|
24605
24603
|
const resp = await quillFetch({
|
|
24606
24604
|
client: {
|
|
24607
|
-
|
|
24605
|
+
id: publicKey,
|
|
24608
24606
|
queryEndpoint,
|
|
24609
24607
|
queryHeaders,
|
|
24610
24608
|
withCredentials: !!withCredentials
|
|
@@ -24612,7 +24610,7 @@ var ContextProvider = ({
|
|
|
24612
24610
|
task: fetchRows ? "report" : "report-info",
|
|
24613
24611
|
metadata: {
|
|
24614
24612
|
reportId,
|
|
24615
|
-
clientId: populatedClient.
|
|
24613
|
+
clientId: populatedClient.id,
|
|
24616
24614
|
useNewNodeSql: true,
|
|
24617
24615
|
filters: filters?.map((f) => ({ ...f, options: void 0 })),
|
|
24618
24616
|
additionalProcessing,
|
|
@@ -24795,7 +24793,7 @@ var ContextProvider = ({
|
|
|
24795
24793
|
try {
|
|
24796
24794
|
const result = await quillFetch({
|
|
24797
24795
|
client: {
|
|
24798
|
-
|
|
24796
|
+
id: publicKey,
|
|
24799
24797
|
queryEndpoint,
|
|
24800
24798
|
queryHeaders,
|
|
24801
24799
|
withCredentials: !!withCredentials
|
|
@@ -25004,7 +25002,7 @@ var ContextProvider = ({
|
|
|
25004
25002
|
});
|
|
25005
25003
|
return curDashboardConfig;
|
|
25006
25004
|
}
|
|
25007
|
-
if (!populatedClient || !populatedClient.
|
|
25005
|
+
if (!populatedClient || !populatedClient.id) {
|
|
25008
25006
|
return curDashboardConfig;
|
|
25009
25007
|
}
|
|
25010
25008
|
if (dashboardName === null || dashboardName === void 0)
|
|
@@ -25158,7 +25156,7 @@ var ContextProvider = ({
|
|
|
25158
25156
|
try {
|
|
25159
25157
|
const result = await quillFetch({
|
|
25160
25158
|
client: {
|
|
25161
|
-
|
|
25159
|
+
id: publicKey2,
|
|
25162
25160
|
queryEndpoint,
|
|
25163
25161
|
queryHeaders,
|
|
25164
25162
|
withCredentials: !!withCredentials
|
|
@@ -25701,8 +25699,7 @@ var ContextProvider = ({
|
|
|
25701
25699
|
withCredentials: withCredentials ?? false,
|
|
25702
25700
|
databaseType: envClient.databaseType,
|
|
25703
25701
|
name: envClient.name,
|
|
25704
|
-
|
|
25705
|
-
publicKey: publicKey2,
|
|
25702
|
+
id: publicKey2,
|
|
25706
25703
|
featureFlags: envClient.featureFlags,
|
|
25707
25704
|
clerkOrgId: envClient.clerkOrgId,
|
|
25708
25705
|
allTenantTypes: hydratedTenantTypes
|
|
@@ -25774,16 +25771,16 @@ var ContextProvider = ({
|
|
|
25774
25771
|
}, [publicKey]);
|
|
25775
25772
|
(0, import_react.useEffect)(() => {
|
|
25776
25773
|
if (!hasHandledInitialPopulatedClient.current) {
|
|
25777
|
-
if (!populatedClient?.
|
|
25774
|
+
if (!populatedClient?.id && !populatedClient?.currentTenants) {
|
|
25778
25775
|
return;
|
|
25779
25776
|
}
|
|
25780
25777
|
hasHandledInitialPopulatedClient.current = true;
|
|
25781
|
-
currentPublicKey.current = populatedClient?.
|
|
25778
|
+
currentPublicKey.current = populatedClient?.id ?? null;
|
|
25782
25779
|
currentTenant.current = populatedClient?.currentTenants ?? null;
|
|
25783
25780
|
return;
|
|
25784
25781
|
}
|
|
25785
25782
|
let publicKeyChanged = false;
|
|
25786
|
-
if (populatedClient?.
|
|
25783
|
+
if (populatedClient?.id && currentPublicKey.current !== populatedClient?.id) {
|
|
25787
25784
|
publicKeyChanged = true;
|
|
25788
25785
|
dispatch({ type: "CLEAR_DASHBOARDS" });
|
|
25789
25786
|
dashboardFiltersDispatch({ type: "CLEAR_DASHBOARD_FILTERS" });
|
|
@@ -25792,7 +25789,7 @@ var ContextProvider = ({
|
|
|
25792
25789
|
backfilledDashboards.current.clear();
|
|
25793
25790
|
if (isAdmin) {
|
|
25794
25791
|
setIsDashboardsLoading(true);
|
|
25795
|
-
fetchDashboards(populatedClient?.
|
|
25792
|
+
fetchDashboards(populatedClient?.id);
|
|
25796
25793
|
} else {
|
|
25797
25794
|
setIsDashboardsLoading(false);
|
|
25798
25795
|
}
|
|
@@ -25824,17 +25821,17 @@ var ContextProvider = ({
|
|
|
25824
25821
|
})
|
|
25825
25822
|
);
|
|
25826
25823
|
}
|
|
25827
|
-
if (populatedClient?.currentTenants && populatedClient?.
|
|
25824
|
+
if (populatedClient?.currentTenants && populatedClient?.id) {
|
|
25828
25825
|
const tenant = typeof populatedClient?.currentTenants[0] === "object" ? populatedClient?.currentTenants[0]?.tenantField : void 0;
|
|
25829
25826
|
const tenantIds = tenant && typeof populatedClient?.currentTenants[0] === "object" ? populatedClient?.currentTenants[0]?.tenantIds : populatedClient?.currentTenants;
|
|
25830
25827
|
eventTracking?.setUser?.({
|
|
25831
|
-
clientId: populatedClient.
|
|
25828
|
+
clientId: populatedClient.id,
|
|
25832
25829
|
clerkOrgId: populatedClient.clerkOrgId,
|
|
25833
25830
|
tenant,
|
|
25834
25831
|
tenantIds
|
|
25835
25832
|
});
|
|
25836
25833
|
}
|
|
25837
|
-
}, [populatedClient?.currentTenants, populatedClient?.
|
|
25834
|
+
}, [populatedClient?.currentTenants, populatedClient?.id]);
|
|
25838
25835
|
if (!theme) {
|
|
25839
25836
|
return null;
|
|
25840
25837
|
}
|
|
@@ -26142,7 +26139,7 @@ var useDashboardInternal = (dashboardName, customFilters) => {
|
|
|
26142
26139
|
});
|
|
26143
26140
|
const body = {
|
|
26144
26141
|
task: "set-section-order",
|
|
26145
|
-
clientId: client.
|
|
26142
|
+
clientId: client.id,
|
|
26146
26143
|
dashboardName,
|
|
26147
26144
|
sectionOrder
|
|
26148
26145
|
};
|
|
@@ -26370,7 +26367,7 @@ var useDashboards = () => {
|
|
|
26370
26367
|
dateFilter,
|
|
26371
26368
|
name: name2.trim(),
|
|
26372
26369
|
task: "edit-dashboard",
|
|
26373
|
-
clientId: clientId ?? client.
|
|
26370
|
+
clientId: clientId ?? client.id,
|
|
26374
26371
|
tenantKeys: dashboardOwners
|
|
26375
26372
|
};
|
|
26376
26373
|
try {
|
|
@@ -26445,7 +26442,7 @@ var useDashboards = () => {
|
|
|
26445
26442
|
initialCacheDateRange,
|
|
26446
26443
|
name: name2.trim(),
|
|
26447
26444
|
task: "edit-dashboard",
|
|
26448
|
-
clientId: clientId ?? client.
|
|
26445
|
+
clientId: clientId ?? client.id,
|
|
26449
26446
|
tenantKeys
|
|
26450
26447
|
};
|
|
26451
26448
|
try {
|
|
@@ -26623,7 +26620,7 @@ var useDashboards = () => {
|
|
|
26623
26620
|
client,
|
|
26624
26621
|
task: "delete-dashboard",
|
|
26625
26622
|
metadata: {
|
|
26626
|
-
clientId: client.
|
|
26623
|
+
clientId: client.id,
|
|
26627
26624
|
databaseType: client.databaseType,
|
|
26628
26625
|
name: name2
|
|
26629
26626
|
}
|
|
@@ -27467,7 +27464,7 @@ async function getExportData(client, dashboardFilters, reportId, getToken, event
|
|
|
27467
27464
|
metadata: {
|
|
27468
27465
|
reportId,
|
|
27469
27466
|
dashboardItemId: reportId,
|
|
27470
|
-
clientId: client.
|
|
27467
|
+
clientId: client.id,
|
|
27471
27468
|
databaseType: client?.databaseType,
|
|
27472
27469
|
filters: minimalFilters,
|
|
27473
27470
|
useNewNodeSql: true,
|
|
@@ -30534,7 +30531,8 @@ var getLegendLabel = (entry) => {
|
|
|
30534
30531
|
var LegendItem = ({
|
|
30535
30532
|
entry,
|
|
30536
30533
|
index,
|
|
30537
|
-
theme
|
|
30534
|
+
theme,
|
|
30535
|
+
onClick
|
|
30538
30536
|
}) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
30539
30537
|
"div",
|
|
30540
30538
|
{
|
|
@@ -30543,6 +30541,7 @@ var LegendItem = ({
|
|
|
30543
30541
|
alignItems: "baseline",
|
|
30544
30542
|
marginRight: "1rem"
|
|
30545
30543
|
},
|
|
30544
|
+
onClick: () => onClick ? onClick(entry) : void 0,
|
|
30546
30545
|
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
30547
30546
|
"div",
|
|
30548
30547
|
{
|
|
@@ -30586,7 +30585,8 @@ var getOuterWidth = (element) => {
|
|
|
30586
30585
|
};
|
|
30587
30586
|
var RenderLegend = ({
|
|
30588
30587
|
payload,
|
|
30589
|
-
limit
|
|
30588
|
+
limit,
|
|
30589
|
+
onClickLegendElement
|
|
30590
30590
|
}) => {
|
|
30591
30591
|
const [theme] = (0, import_react12.useContext)(ThemeContext);
|
|
30592
30592
|
const [isOpen, setIsOpen] = (0, import_react12.useState)(false);
|
|
@@ -30663,7 +30663,6 @@ var RenderLegend = ({
|
|
|
30663
30663
|
visibility: "hidden",
|
|
30664
30664
|
height: 0,
|
|
30665
30665
|
overflow: "hidden",
|
|
30666
|
-
pointerEvents: "none",
|
|
30667
30666
|
display: "flex",
|
|
30668
30667
|
alignItems: "center",
|
|
30669
30668
|
flexWrap: "nowrap",
|
|
@@ -30687,7 +30686,15 @@ var RenderLegend = ({
|
|
|
30687
30686
|
ref: (element) => {
|
|
30688
30687
|
itemRefs.current[index] = element;
|
|
30689
30688
|
},
|
|
30690
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
30689
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
30690
|
+
LegendItem,
|
|
30691
|
+
{
|
|
30692
|
+
entry,
|
|
30693
|
+
index,
|
|
30694
|
+
theme,
|
|
30695
|
+
onClick: onClickLegendElement
|
|
30696
|
+
}
|
|
30697
|
+
)
|
|
30691
30698
|
},
|
|
30692
30699
|
`legend-measure-${index}`
|
|
30693
30700
|
))
|
|
@@ -30728,7 +30735,8 @@ var RenderLegend = ({
|
|
|
30728
30735
|
{
|
|
30729
30736
|
entry,
|
|
30730
30737
|
index,
|
|
30731
|
-
theme
|
|
30738
|
+
theme,
|
|
30739
|
+
onClick: onClickLegendElement
|
|
30732
30740
|
},
|
|
30733
30741
|
`legend-${index}`
|
|
30734
30742
|
))
|
|
@@ -30775,7 +30783,8 @@ var RenderLegend = ({
|
|
|
30775
30783
|
{
|
|
30776
30784
|
entry,
|
|
30777
30785
|
index,
|
|
30778
|
-
theme
|
|
30786
|
+
theme,
|
|
30787
|
+
onClick: onClickLegendElement
|
|
30779
30788
|
},
|
|
30780
30789
|
`legend-popover-${index}`
|
|
30781
30790
|
))
|
|
@@ -31047,6 +31056,7 @@ var PieChartWrapper = import_react13.default.forwardRef(
|
|
|
31047
31056
|
containerStyle,
|
|
31048
31057
|
theme,
|
|
31049
31058
|
onClickChartElement,
|
|
31059
|
+
onClickLegendElement,
|
|
31050
31060
|
yAxisFields,
|
|
31051
31061
|
showLegend = false,
|
|
31052
31062
|
...other
|
|
@@ -31143,7 +31153,13 @@ var PieChartWrapper = import_react13.default.forwardRef(
|
|
|
31143
31153
|
paddingBottom: 20,
|
|
31144
31154
|
fontFamily: theme?.fontFamily
|
|
31145
31155
|
},
|
|
31146
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
31156
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
31157
|
+
RenderLegend,
|
|
31158
|
+
{
|
|
31159
|
+
limit: 5,
|
|
31160
|
+
onClickLegendElement
|
|
31161
|
+
}
|
|
31162
|
+
)
|
|
31147
31163
|
}
|
|
31148
31164
|
),
|
|
31149
31165
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
@@ -32439,6 +32455,8 @@ function LineChart({
|
|
|
32439
32455
|
cartesianGridLineColor,
|
|
32440
32456
|
onClickChartElement = () => {
|
|
32441
32457
|
},
|
|
32458
|
+
onClickLegendElement = () => {
|
|
32459
|
+
},
|
|
32442
32460
|
dateFilter,
|
|
32443
32461
|
referenceLines,
|
|
32444
32462
|
showLegend = false
|
|
@@ -32535,7 +32553,7 @@ function LineChart({
|
|
|
32535
32553
|
paddingBottom: 20,
|
|
32536
32554
|
fontFamily: theme?.fontFamily
|
|
32537
32555
|
},
|
|
32538
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RenderLegend, {})
|
|
32556
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RenderLegend, { onClickLegendElement })
|
|
32539
32557
|
}
|
|
32540
32558
|
),
|
|
32541
32559
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
@@ -32757,6 +32775,8 @@ function RadarChart({
|
|
|
32757
32775
|
isAnimationActive = true,
|
|
32758
32776
|
onClickChartElement = () => {
|
|
32759
32777
|
},
|
|
32778
|
+
onClickLegendElement = () => {
|
|
32779
|
+
},
|
|
32760
32780
|
dateFilter,
|
|
32761
32781
|
showLegend = false
|
|
32762
32782
|
}) {
|
|
@@ -32850,7 +32870,7 @@ function RadarChart({
|
|
|
32850
32870
|
paddingBottom: 20,
|
|
32851
32871
|
fontFamily: theme?.fontFamily
|
|
32852
32872
|
},
|
|
32853
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RenderLegend, {})
|
|
32873
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RenderLegend, { onClickLegendElement })
|
|
32854
32874
|
}
|
|
32855
32875
|
),
|
|
32856
32876
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
@@ -33112,6 +33132,7 @@ function BarChart({
|
|
|
33112
33132
|
hideYAxis = false,
|
|
33113
33133
|
hideCartesianGrid = false,
|
|
33114
33134
|
onClickChartElement,
|
|
33135
|
+
onClickLegendElement,
|
|
33115
33136
|
dateFilter,
|
|
33116
33137
|
referenceLines,
|
|
33117
33138
|
showLegend = false,
|
|
@@ -33205,9 +33226,7 @@ function BarChart({
|
|
|
33205
33226
|
{
|
|
33206
33227
|
data: data ?? [],
|
|
33207
33228
|
layout,
|
|
33208
|
-
onClick: (event) => onClickChartElement ? onClickChartElement(
|
|
33209
|
-
event?.activePayload ? event.activePayload[0].payload : void 0
|
|
33210
|
-
) : void 0,
|
|
33229
|
+
onClick: (event) => onClickChartElement ? onClickChartElement(event) : void 0,
|
|
33211
33230
|
children: [
|
|
33212
33231
|
!hideCartesianGrid && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
33213
33232
|
import_recharts4.CartesianGrid,
|
|
@@ -33227,7 +33246,7 @@ function BarChart({
|
|
|
33227
33246
|
wrapperStyle: {
|
|
33228
33247
|
paddingBottom: 20
|
|
33229
33248
|
},
|
|
33230
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(RenderLegend, {})
|
|
33249
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(RenderLegend, { onClickLegendElement })
|
|
33231
33250
|
}
|
|
33232
33251
|
),
|
|
33233
33252
|
isHorizontalBars ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
@@ -38931,6 +38950,7 @@ var ChartDisplay = ({
|
|
|
38931
38950
|
onPageChange,
|
|
38932
38951
|
onSortChange,
|
|
38933
38952
|
onClickChartElement,
|
|
38953
|
+
onClickLegendElement,
|
|
38934
38954
|
overrideTheme,
|
|
38935
38955
|
referenceLines,
|
|
38936
38956
|
showLegend,
|
|
@@ -38999,6 +39019,7 @@ var ChartDisplay = ({
|
|
|
38999
39019
|
theme: overrideTheme ?? theme,
|
|
39000
39020
|
colorMap,
|
|
39001
39021
|
onClickChartElement,
|
|
39022
|
+
onClickLegendElement,
|
|
39002
39023
|
yAxisFields: config?.yAxisFields,
|
|
39003
39024
|
showLegend: resolvedShowLegend
|
|
39004
39025
|
}
|
|
@@ -39072,6 +39093,7 @@ var ChartDisplay = ({
|
|
|
39072
39093
|
hideCartesianGrid,
|
|
39073
39094
|
colorMap,
|
|
39074
39095
|
onClickChartElement,
|
|
39096
|
+
onClickLegendElement,
|
|
39075
39097
|
dateFilter: !hideDateRangeFilter ? dateFilter : void 0,
|
|
39076
39098
|
referenceLines,
|
|
39077
39099
|
showLegend: resolvedShowLegend
|
|
@@ -39099,6 +39121,7 @@ var ChartDisplay = ({
|
|
|
39099
39121
|
hideCartesianGrid,
|
|
39100
39122
|
colorMap,
|
|
39101
39123
|
onClickChartElement,
|
|
39124
|
+
onClickLegendElement,
|
|
39102
39125
|
dateFilter: !hideDateRangeFilter ? dateFilter : void 0,
|
|
39103
39126
|
referenceLines,
|
|
39104
39127
|
showLegend: resolvedShowLegend,
|
|
@@ -39255,6 +39278,7 @@ var ChartDisplay = ({
|
|
|
39255
39278
|
className,
|
|
39256
39279
|
isAnimationActive,
|
|
39257
39280
|
onClickChartElement,
|
|
39281
|
+
onClickLegendElement,
|
|
39258
39282
|
dateFilter: !hideDateRangeFilter ? dateFilter : void 0,
|
|
39259
39283
|
showLegend: resolvedShowLegend
|
|
39260
39284
|
}
|
|
@@ -39285,6 +39309,7 @@ var ChartDisplay = ({
|
|
|
39285
39309
|
comparisonLineStyle: comparisonLineStyle ?? "solid",
|
|
39286
39310
|
cartesianGridLineColor,
|
|
39287
39311
|
onClickChartElement,
|
|
39312
|
+
onClickLegendElement,
|
|
39288
39313
|
dateFilter: !hideDateRangeFilter ? dateFilter : void 0,
|
|
39289
39314
|
referenceLines,
|
|
39290
39315
|
showLegend: resolvedShowLegend
|
|
@@ -41343,7 +41368,7 @@ function DashboardLegacy({
|
|
|
41343
41368
|
const [filterValues, setFilterValues] = (0, import_react40.useState)({});
|
|
41344
41369
|
const prevNameRef = (0, import_react40.useRef)(name2);
|
|
41345
41370
|
const prevFlagsRef = (0, import_react40.useRef)(flags);
|
|
41346
|
-
const prevClientRef = (0, import_react40.useRef)(client?.
|
|
41371
|
+
const prevClientRef = (0, import_react40.useRef)(client?.id ?? "");
|
|
41347
41372
|
const addFilterPopoverButtonRef = (0, import_react40.useRef)(null);
|
|
41348
41373
|
const viewFiltersPopoverButtonRef = (0, import_react40.useRef)(null);
|
|
41349
41374
|
const previousFilters = (0, import_react40.useRef)(filters);
|
|
@@ -41399,15 +41424,15 @@ function DashboardLegacy({
|
|
|
41399
41424
|
});
|
|
41400
41425
|
}, [flags]);
|
|
41401
41426
|
(0, import_react40.useEffect)(() => {
|
|
41402
|
-
if (prevClientRef.current === client?.
|
|
41427
|
+
if (prevClientRef.current === client?.id) {
|
|
41403
41428
|
return;
|
|
41404
41429
|
}
|
|
41405
|
-
const isInitialKeySet = !prevClientRef.current && client?.
|
|
41430
|
+
const isInitialKeySet = !prevClientRef.current && client?.id;
|
|
41406
41431
|
if (isInitialKeySet && Object.values(data?.sections ?? {}).flat().length) {
|
|
41407
|
-
prevClientRef.current = client?.
|
|
41432
|
+
prevClientRef.current = client?.id ?? "";
|
|
41408
41433
|
return;
|
|
41409
41434
|
}
|
|
41410
|
-
prevClientRef.current = client?.
|
|
41435
|
+
prevClientRef.current = client?.id ?? "";
|
|
41411
41436
|
if (isClientLoading) {
|
|
41412
41437
|
return;
|
|
41413
41438
|
}
|
|
@@ -41419,7 +41444,7 @@ function DashboardLegacy({
|
|
|
41419
41444
|
prevFlagsRef.current = flags;
|
|
41420
41445
|
isInitialLoadOfDashboardRef.current = false;
|
|
41421
41446
|
});
|
|
41422
|
-
}, [client?.
|
|
41447
|
+
}, [client?.id]);
|
|
41423
41448
|
(0, import_react40.useEffect)(() => {
|
|
41424
41449
|
setFilterValues(
|
|
41425
41450
|
Object.values(populatedDashboardFilters ?? {}).reduce((acc, f) => {
|
|
@@ -42402,6 +42427,7 @@ function StaticChart(props) {
|
|
|
42402
42427
|
const {
|
|
42403
42428
|
reportId,
|
|
42404
42429
|
onClickChartElement,
|
|
42430
|
+
onClickLegendElement,
|
|
42405
42431
|
containerStyle,
|
|
42406
42432
|
showLegend,
|
|
42407
42433
|
className
|
|
@@ -42454,6 +42480,7 @@ function StaticChart(props) {
|
|
|
42454
42480
|
reportId,
|
|
42455
42481
|
config,
|
|
42456
42482
|
onClickChartElement,
|
|
42483
|
+
onClickLegendElement,
|
|
42457
42484
|
loading,
|
|
42458
42485
|
className,
|
|
42459
42486
|
containerStyle: safeContainerStyle,
|
|
@@ -47468,7 +47495,7 @@ function ChartBuilder({
|
|
|
47468
47495
|
task: "dashboard",
|
|
47469
47496
|
metadata: {
|
|
47470
47497
|
name: dashboardName,
|
|
47471
|
-
clientId: client.
|
|
47498
|
+
clientId: client.id,
|
|
47472
47499
|
databaseType: client.databaseType,
|
|
47473
47500
|
useNewNodeSql: true,
|
|
47474
47501
|
tenants
|
|
@@ -47528,11 +47555,11 @@ function ChartBuilder({
|
|
|
47528
47555
|
const getReferencedTables = async (client2, dbTables, sqlQuery, reportBuilderState2, skipStar) => {
|
|
47529
47556
|
const metadata = reportBuilderState2 ? {
|
|
47530
47557
|
reportBuilderState: reportBuilderState2,
|
|
47531
|
-
clientId: client2.
|
|
47558
|
+
clientId: client2.id,
|
|
47532
47559
|
useNewNodeSql: true
|
|
47533
47560
|
} : {
|
|
47534
47561
|
query: sqlQuery,
|
|
47535
|
-
clientId: client2.
|
|
47562
|
+
clientId: client2.id,
|
|
47536
47563
|
useNewNodeSql: true
|
|
47537
47564
|
};
|
|
47538
47565
|
try {
|
|
@@ -47758,7 +47785,7 @@ function ChartBuilder({
|
|
|
47758
47785
|
client,
|
|
47759
47786
|
task: "dashnames",
|
|
47760
47787
|
metadata: {
|
|
47761
|
-
clientId: client.
|
|
47788
|
+
clientId: client.id
|
|
47762
47789
|
}
|
|
47763
47790
|
});
|
|
47764
47791
|
dashNames = resp.dashboardNames;
|
|
@@ -51303,7 +51330,7 @@ function SQLEditor({
|
|
|
51303
51330
|
setColumns([]);
|
|
51304
51331
|
setDisplayTable(false);
|
|
51305
51332
|
}
|
|
51306
|
-
}, [client?.
|
|
51333
|
+
}, [client?.id]);
|
|
51307
51334
|
(0, import_react50.useEffect)(() => {
|
|
51308
51335
|
if (isChartBuilderOpen === false) {
|
|
51309
51336
|
onCloseChartBuilder && onCloseChartBuilder();
|
|
@@ -51562,7 +51589,7 @@ function SQLEditor({
|
|
|
51562
51589
|
task: "astify",
|
|
51563
51590
|
metadata: {
|
|
51564
51591
|
query: sqlQuery,
|
|
51565
|
-
clientId: client2.
|
|
51592
|
+
clientId: client2.id,
|
|
51566
51593
|
useNewNodeSql: true
|
|
51567
51594
|
}
|
|
51568
51595
|
});
|
|
@@ -51755,7 +51782,7 @@ function SQLEditor({
|
|
|
51755
51782
|
query: query || "",
|
|
51756
51783
|
schema: filteredSchema,
|
|
51757
51784
|
databaseType: client?.databaseType ?? "postgresql",
|
|
51758
|
-
clientName: client?.
|
|
51785
|
+
clientName: client?.id || "",
|
|
51759
51786
|
setQuery,
|
|
51760
51787
|
handleRunQuery: () => {
|
|
51761
51788
|
handleRunQuery(currentProcessing, true);
|
|
@@ -53909,7 +53936,7 @@ var useReportBuilderInternal = ({
|
|
|
53909
53936
|
!client.featureFlags?.["recommendedPivotsDisabled"]
|
|
53910
53937
|
);
|
|
53911
53938
|
}
|
|
53912
|
-
if (!initialTableName && !reportId && client.
|
|
53939
|
+
if (!initialTableName && !reportId && client.id) {
|
|
53913
53940
|
clearAllState();
|
|
53914
53941
|
}
|
|
53915
53942
|
}, [client]);
|
|
@@ -58872,11 +58899,11 @@ function Chat({
|
|
|
58872
58899
|
setIsLoading(false);
|
|
58873
58900
|
};
|
|
58874
58901
|
const submitDefaultMessage = async (nextMessages, abortController) => {
|
|
58875
|
-
const clientId = client.
|
|
58902
|
+
const clientId = client.id;
|
|
58876
58903
|
let responseBuffer = "";
|
|
58877
58904
|
for await (const chunk of quillStream({
|
|
58878
58905
|
client: {
|
|
58879
|
-
clientId,
|
|
58906
|
+
id: clientId,
|
|
58880
58907
|
queryEndpoint: client.queryEndpoint,
|
|
58881
58908
|
streamEndpoint: client.streamEndpoint,
|
|
58882
58909
|
queryHeaders: client.queryHeaders,
|
|
@@ -58960,12 +58987,12 @@ function Chat({
|
|
|
58960
58987
|
}
|
|
58961
58988
|
};
|
|
58962
58989
|
const submitAgentMessage = async (nextMessages, abortController) => {
|
|
58963
|
-
const clientId = client.
|
|
58990
|
+
const clientId = client.id;
|
|
58964
58991
|
let updatedMessages = [...nextMessages];
|
|
58965
58992
|
for await (const event of quillAgentStream({
|
|
58966
58993
|
endpoint: `${agentEndpoint}/agent/chat`,
|
|
58967
58994
|
messages: updatedMessages,
|
|
58968
|
-
sourceClientId: clientId,
|
|
58995
|
+
sourceClientId: clientId ?? "<unknown>",
|
|
58969
58996
|
getToken,
|
|
58970
58997
|
abortSignal: abortController.signal
|
|
58971
58998
|
})) {
|
|
@@ -59033,7 +59060,7 @@ function Chat({
|
|
|
59033
59060
|
setIsLoading(true);
|
|
59034
59061
|
const abortController = new AbortController();
|
|
59035
59062
|
abortControllerRef.current = abortController;
|
|
59036
|
-
const clientId = client.
|
|
59063
|
+
const clientId = client.id;
|
|
59037
59064
|
if (!clientId) {
|
|
59038
59065
|
setInputError("No client selected.");
|
|
59039
59066
|
setIsLoading(false);
|
|
@@ -59923,7 +59950,7 @@ var useVirtualTables = () => {
|
|
|
59923
59950
|
};
|
|
59924
59951
|
};
|
|
59925
59952
|
const handleRefreshSome = async (client, tables) => {
|
|
59926
|
-
if (!client.
|
|
59953
|
+
if (!client.id) return schemaData;
|
|
59927
59954
|
setLoadingTables({
|
|
59928
59955
|
...loadingTables,
|
|
59929
59956
|
...tables.reduce((acc, table) => {
|
|
@@ -59941,7 +59968,7 @@ var useVirtualTables = () => {
|
|
|
59941
59968
|
name: table.name,
|
|
59942
59969
|
customFieldInfo: table.customFieldInfo,
|
|
59943
59970
|
id: table._id,
|
|
59944
|
-
clientId: client.
|
|
59971
|
+
clientId: client.id,
|
|
59945
59972
|
runQueryConfig: { getColumns: true },
|
|
59946
59973
|
databaseType: client.databaseType,
|
|
59947
59974
|
useNewNodeSql: true
|