@quillsql/react 2.12.45 → 2.12.47
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/Chart.d.ts.map +1 -1
- package/dist/cjs/Chart.js +16 -7
- package/dist/cjs/ChartBuilder.d.ts +10 -11
- package/dist/cjs/ChartBuilder.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.js +78 -81
- package/dist/cjs/ChartEditor.d.ts +3 -1
- package/dist/cjs/ChartEditor.d.ts.map +1 -1
- package/dist/cjs/ChartEditor.js +26 -10
- package/dist/cjs/Context.d.ts +2 -3
- package/dist/cjs/Context.d.ts.map +1 -1
- package/dist/cjs/Context.js +42 -28
- package/dist/cjs/Dashboard.d.ts +12 -12
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/Dashboard.js +61 -69
- package/dist/cjs/QuillProvider.d.ts +2 -0
- package/dist/cjs/QuillProvider.d.ts.map +1 -1
- package/dist/cjs/QuillProvider.js +1 -15
- package/dist/cjs/ReportBuilder.d.ts +9 -9
- package/dist/cjs/ReportBuilder.d.ts.map +1 -1
- package/dist/cjs/ReportBuilder.js +116 -179
- package/dist/cjs/SQLEditor.d.ts +20 -11
- package/dist/cjs/SQLEditor.d.ts.map +1 -1
- package/dist/cjs/SQLEditor.js +157 -90
- package/dist/cjs/Table.js +3 -3
- package/dist/cjs/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarChart.js +6 -25
- package/dist/cjs/components/Chart/BarList.js +1 -1
- package/dist/cjs/components/Chart/ChartError.d.ts +5 -2
- package/dist/cjs/components/Chart/ChartError.d.ts.map +1 -1
- package/dist/cjs/components/Chart/ChartError.js +7 -10
- package/dist/cjs/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/LineChart.js +16 -1
- package/dist/cjs/components/Chart/PieChart.js +1 -1
- package/dist/cjs/components/Dashboard/ChartComponent.d.ts +1 -1
- package/dist/cjs/components/Dashboard/ChartComponent.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/ChartComponent.js +46 -47
- package/dist/cjs/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DashboardFilter.js +2 -1
- package/dist/cjs/components/Dashboard/DataLoader.d.ts +2 -2
- package/dist/cjs/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DataLoader.js +19 -13
- package/dist/cjs/components/Dashboard/MetricComponent.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/MetricComponent.js +16 -26
- package/dist/cjs/components/Dashboard/TableComponent.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/TableComponent.js +16 -25
- package/dist/cjs/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/cjs/components/QuillMultiSelectWithCombo.js +31 -1
- package/dist/cjs/components/QuillSelect.js +1 -1
- package/dist/cjs/components/QuillTable.d.ts +1 -1
- package/dist/cjs/components/QuillTable.d.ts.map +1 -1
- package/dist/cjs/components/QuillTable.js +115 -105
- package/dist/cjs/components/ReportBuilder/AddColumnModal.d.ts +3 -3
- package/dist/cjs/components/ReportBuilder/AddColumnModal.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddColumnModal.js +2 -2
- package/dist/cjs/components/ReportBuilder/AddLimitPopover.d.ts +2 -2
- package/dist/cjs/components/ReportBuilder/AddLimitPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddLimitPopover.js +28 -9
- package/dist/cjs/components/ReportBuilder/FilterModal.d.ts +1 -1
- package/dist/cjs/components/ReportBuilder/FilterModal.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/FilterModal.js +178 -114
- package/dist/cjs/components/ReportBuilder/convert.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/convert.js +1 -2
- package/dist/cjs/components/ReportBuilder/ui.d.ts +9 -1
- package/dist/cjs/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ui.js +37 -3
- package/dist/cjs/components/ReportBuilder/util.d.ts +5 -1
- package/dist/cjs/components/ReportBuilder/util.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/util.js +26 -12
- package/dist/cjs/components/UiComponents.d.ts +17 -3
- package/dist/cjs/components/UiComponents.d.ts.map +1 -1
- package/dist/cjs/components/UiComponents.js +160 -29
- package/dist/cjs/hooks/useAskQuill.d.ts.map +1 -1
- package/dist/cjs/hooks/useAskQuill.js +7 -7
- package/dist/cjs/hooks/useAstToFilterTree.d.ts +4 -1
- package/dist/cjs/hooks/useAstToFilterTree.d.ts.map +1 -1
- package/dist/cjs/hooks/useAstToFilterTree.js +4 -1
- package/dist/cjs/hooks/useDashboard.d.ts +5 -1
- package/dist/cjs/hooks/useDashboard.d.ts.map +1 -1
- package/dist/cjs/hooks/useDashboard.js +28 -4
- package/dist/cjs/hooks/useOnClickOutside.js +2 -2
- package/dist/cjs/hooks/useQuill.js +4 -4
- package/dist/cjs/hooks/useVirtualTables.d.ts +10 -0
- package/dist/cjs/hooks/useVirtualTables.d.ts.map +1 -0
- package/dist/cjs/hooks/useVirtualTables.js +29 -0
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.js +45 -21
- package/dist/cjs/models/Client.d.ts +3 -0
- package/dist/cjs/models/Client.d.ts.map +1 -1
- package/dist/cjs/models/Report.d.ts +2 -0
- package/dist/cjs/models/Report.d.ts.map +1 -1
- package/dist/cjs/models/Schema.d.ts +7 -0
- package/dist/cjs/models/Schema.d.ts.map +1 -0
- package/dist/cjs/models/Schema.js +2 -0
- package/dist/cjs/models/Tables.d.ts +2 -0
- package/dist/cjs/models/Tables.d.ts.map +1 -1
- package/dist/cjs/utils/astFilterProcessing.d.ts +4 -0
- package/dist/cjs/utils/astFilterProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/astFilterProcessing.js +47 -44
- package/dist/cjs/utils/astProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/astProcessing.js +8 -8
- package/dist/cjs/utils/client.d.ts.map +1 -1
- package/dist/cjs/utils/client.js +1 -0
- package/dist/cjs/utils/columnProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/columnProcessing.js +88 -5
- package/dist/cjs/utils/dataFetcher.d.ts.map +1 -1
- package/dist/cjs/utils/dataFetcher.js +7 -3
- package/dist/cjs/utils/filterProcessing.d.ts +25 -0
- package/dist/cjs/utils/filterProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/filterProcessing.js +121 -1
- package/dist/cjs/utils/paginationProcessing.js +2 -2
- package/dist/cjs/utils/pivotConstructor.d.ts.map +1 -1
- package/dist/cjs/utils/pivotConstructor.js +10 -6
- package/dist/cjs/utils/queryConstructor.d.ts +1 -0
- package/dist/cjs/utils/queryConstructor.d.ts.map +1 -1
- package/dist/cjs/utils/queryConstructor.js +37 -11
- package/dist/cjs/utils/report.d.ts +5 -0
- package/dist/cjs/utils/report.d.ts.map +1 -1
- package/dist/cjs/utils/report.js +63 -9
- package/dist/cjs/utils/schema.js +22 -20
- package/dist/cjs/utils/tableProcessing.d.ts +1 -0
- package/dist/cjs/utils/tableProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/tableProcessing.js +22 -1
- package/dist/cjs/utils/validation.d.ts.map +1 -1
- package/dist/cjs/utils/validation.js +4 -0
- package/dist/esm/Chart.d.ts.map +1 -1
- package/dist/esm/Chart.js +17 -8
- package/dist/esm/ChartBuilder.d.ts +10 -11
- package/dist/esm/ChartBuilder.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.js +81 -84
- package/dist/esm/ChartEditor.d.ts +3 -1
- package/dist/esm/ChartEditor.d.ts.map +1 -1
- package/dist/esm/ChartEditor.js +27 -11
- package/dist/esm/Context.d.ts +2 -3
- package/dist/esm/Context.d.ts.map +1 -1
- package/dist/esm/Context.js +42 -28
- package/dist/esm/Dashboard.d.ts +12 -12
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/Dashboard.js +63 -71
- package/dist/esm/QuillProvider.d.ts +2 -0
- package/dist/esm/QuillProvider.d.ts.map +1 -1
- package/dist/esm/QuillProvider.js +2 -16
- package/dist/esm/ReportBuilder.d.ts +9 -9
- package/dist/esm/ReportBuilder.d.ts.map +1 -1
- package/dist/esm/ReportBuilder.js +122 -185
- package/dist/esm/SQLEditor.d.ts +20 -11
- package/dist/esm/SQLEditor.d.ts.map +1 -1
- package/dist/esm/SQLEditor.js +160 -93
- package/dist/esm/Table.js +4 -4
- package/dist/esm/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarChart.js +7 -26
- package/dist/esm/components/Chart/BarList.js +1 -1
- package/dist/esm/components/Chart/ChartError.d.ts +5 -2
- package/dist/esm/components/Chart/ChartError.d.ts.map +1 -1
- package/dist/esm/components/Chart/ChartError.js +7 -10
- package/dist/esm/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/LineChart.js +16 -1
- package/dist/esm/components/Chart/PieChart.js +1 -1
- package/dist/esm/components/Dashboard/ChartComponent.d.ts +1 -1
- package/dist/esm/components/Dashboard/ChartComponent.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/ChartComponent.js +46 -47
- package/dist/esm/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DashboardFilter.js +2 -1
- package/dist/esm/components/Dashboard/DataLoader.d.ts +2 -2
- package/dist/esm/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DataLoader.js +20 -14
- package/dist/esm/components/Dashboard/MetricComponent.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/MetricComponent.js +16 -26
- package/dist/esm/components/Dashboard/TableComponent.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/TableComponent.js +16 -25
- package/dist/esm/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/esm/components/QuillMultiSelectWithCombo.js +31 -1
- package/dist/esm/components/QuillSelect.js +1 -1
- package/dist/esm/components/QuillTable.d.ts +1 -1
- package/dist/esm/components/QuillTable.d.ts.map +1 -1
- package/dist/esm/components/QuillTable.js +115 -105
- package/dist/esm/components/ReportBuilder/AddColumnModal.d.ts +3 -3
- package/dist/esm/components/ReportBuilder/AddColumnModal.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddColumnModal.js +2 -2
- package/dist/esm/components/ReportBuilder/AddLimitPopover.d.ts +2 -2
- package/dist/esm/components/ReportBuilder/AddLimitPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddLimitPopover.js +28 -9
- package/dist/esm/components/ReportBuilder/FilterModal.d.ts +1 -1
- package/dist/esm/components/ReportBuilder/FilterModal.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/FilterModal.js +178 -114
- package/dist/esm/components/ReportBuilder/convert.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/convert.js +1 -2
- package/dist/esm/components/ReportBuilder/ui.d.ts +9 -1
- package/dist/esm/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ui.js +38 -4
- package/dist/esm/components/ReportBuilder/util.d.ts +5 -1
- package/dist/esm/components/ReportBuilder/util.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/util.js +26 -12
- package/dist/esm/components/UiComponents.d.ts +17 -3
- package/dist/esm/components/UiComponents.d.ts.map +1 -1
- package/dist/esm/components/UiComponents.js +158 -28
- package/dist/esm/hooks/useAskQuill.d.ts.map +1 -1
- package/dist/esm/hooks/useAskQuill.js +8 -8
- package/dist/esm/hooks/useAstToFilterTree.d.ts +4 -1
- package/dist/esm/hooks/useAstToFilterTree.d.ts.map +1 -1
- package/dist/esm/hooks/useAstToFilterTree.js +4 -1
- package/dist/esm/hooks/useDashboard.d.ts +5 -1
- package/dist/esm/hooks/useDashboard.d.ts.map +1 -1
- package/dist/esm/hooks/useDashboard.js +28 -5
- package/dist/esm/hooks/useOnClickOutside.js +2 -2
- package/dist/esm/hooks/useQuill.js +5 -5
- package/dist/esm/hooks/useVirtualTables.d.ts +10 -0
- package/dist/esm/hooks/useVirtualTables.d.ts.map +1 -0
- package/dist/esm/hooks/useVirtualTables.js +25 -0
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.js +44 -23
- package/dist/esm/models/Client.d.ts +3 -0
- package/dist/esm/models/Client.d.ts.map +1 -1
- package/dist/esm/models/Report.d.ts +2 -0
- package/dist/esm/models/Report.d.ts.map +1 -1
- package/dist/esm/models/Schema.d.ts +7 -0
- package/dist/esm/models/Schema.d.ts.map +1 -0
- package/dist/esm/models/Schema.js +1 -0
- package/dist/esm/models/Tables.d.ts +2 -0
- package/dist/esm/models/Tables.d.ts.map +1 -1
- package/dist/esm/utils/astFilterProcessing.d.ts +4 -0
- package/dist/esm/utils/astFilterProcessing.d.ts.map +1 -1
- package/dist/esm/utils/astFilterProcessing.js +45 -43
- package/dist/esm/utils/astProcessing.d.ts.map +1 -1
- package/dist/esm/utils/astProcessing.js +8 -8
- package/dist/esm/utils/client.d.ts.map +1 -1
- package/dist/esm/utils/client.js +1 -0
- package/dist/esm/utils/columnProcessing.d.ts.map +1 -1
- package/dist/esm/utils/columnProcessing.js +88 -5
- package/dist/esm/utils/dataFetcher.d.ts.map +1 -1
- package/dist/esm/utils/dataFetcher.js +7 -3
- package/dist/esm/utils/filterProcessing.d.ts +25 -0
- package/dist/esm/utils/filterProcessing.d.ts.map +1 -1
- package/dist/esm/utils/filterProcessing.js +116 -0
- package/dist/esm/utils/paginationProcessing.js +2 -2
- package/dist/esm/utils/pivotConstructor.d.ts.map +1 -1
- package/dist/esm/utils/pivotConstructor.js +10 -6
- package/dist/esm/utils/queryConstructor.d.ts +1 -0
- package/dist/esm/utils/queryConstructor.d.ts.map +1 -1
- package/dist/esm/utils/queryConstructor.js +35 -10
- package/dist/esm/utils/report.d.ts +5 -0
- package/dist/esm/utils/report.d.ts.map +1 -1
- package/dist/esm/utils/report.js +61 -8
- package/dist/esm/utils/schema.js +22 -20
- package/dist/esm/utils/tableProcessing.d.ts +1 -0
- package/dist/esm/utils/tableProcessing.d.ts.map +1 -1
- package/dist/esm/utils/tableProcessing.js +21 -1
- package/dist/esm/utils/validation.d.ts.map +1 -1
- package/dist/esm/utils/validation.js +4 -0
- package/package.json +3 -1
|
@@ -31,7 +31,6 @@ const pivotProcessing_1 = require("./utils/pivotProcessing");
|
|
|
31
31
|
const tableProcessing_1 = require("./utils/tableProcessing");
|
|
32
32
|
const astProcessing_1 = require("./utils/astProcessing");
|
|
33
33
|
const PivotForm_1 = __importDefault(require("./internals/ReportBuilder/PivotForm"));
|
|
34
|
-
const schema_1 = require("./utils/schema");
|
|
35
34
|
const dates_1 = require("./utils/dates");
|
|
36
35
|
const FilterModal_1 = __importDefault(require("./components/ReportBuilder/FilterModal"));
|
|
37
36
|
const astFilterProcessing_1 = require("./utils/astFilterProcessing");
|
|
@@ -40,6 +39,7 @@ const filterProcessing_1 = require("./utils/filterProcessing");
|
|
|
40
39
|
const QuillMultiSelectWithCombo_1 = require("./components/QuillMultiSelectWithCombo");
|
|
41
40
|
const paginationProcessing_1 = require("./utils/paginationProcessing");
|
|
42
41
|
const report_1 = require("./utils/report");
|
|
42
|
+
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
43
43
|
exports.QUILL_SERVER = (typeof process !== 'undefined' && process?.env?.QUILL_SERVER_HOST) ||
|
|
44
44
|
'https://quill-344421.uc.r.appspot.com';
|
|
45
45
|
/**
|
|
@@ -73,11 +73,11 @@ exports.QUILL_SERVER = (typeof process !== 'undefined' && process?.env?.QUILL_SE
|
|
|
73
73
|
* ### Report Builder API
|
|
74
74
|
* @see https://docs.quillsql.com/components/report-builder
|
|
75
75
|
*/
|
|
76
|
-
function ReportBuilder({ initialTableName = '', onSubmitEditReport = () => void null, onSubmitCreateReport = () => void null, destinationDashboard = undefined, organizationName = '', ButtonComponent = UiComponents_1.MemoizedButton, SecondaryButtonComponent = UiComponents_1.MemoizedSecondaryButton, DeleteButtonComponent = UiComponents_1.MemoizedDeleteButton, ModalComponent = UiComponents_1.MemoizedModal, TextInputComponent = UiComponents_2.QuillTextInput, SelectComponent = QuillSelect_1.QuillSelectComponent, MultiSelectComponent = QuillMultiSelectWithCombo_1.QuillMultiSelectComponentWithCombo, TableComponent = UiComponents_1.QuillTableSQLEditorComponent, PopoverComponent = UiComponents_1.MemoizedPopover, TabsComponent = UiComponents_1.QuillTabs,
|
|
76
|
+
function ReportBuilder({ initialTableName = '', onSubmitEditReport = () => void null, onSubmitCreateReport = () => void null, onDiscardChanges = undefined, onSaveChanges = undefined, destinationDashboard = undefined, organizationName = '', ButtonComponent = UiComponents_1.MemoizedButton, SecondaryButtonComponent = UiComponents_1.MemoizedSecondaryButton, DeleteButtonComponent = UiComponents_1.MemoizedDeleteButton, ModalComponent = UiComponents_1.MemoizedModal, TextInputComponent = UiComponents_2.QuillTextInput, SelectComponent = QuillSelect_1.QuillSelectComponent, MultiSelectComponent = QuillMultiSelectWithCombo_1.QuillMultiSelectComponentWithCombo, TableComponent = UiComponents_1.QuillTableSQLEditorComponent, PopoverComponent = UiComponents_1.MemoizedPopover, TabsComponent = UiComponents_1.QuillTabs,
|
|
77
77
|
// CheckboxComponent = MemoizedCheckbox,
|
|
78
78
|
SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer, SelectColumnComponent = ui_1.QuillSelectColumn, DraggableColumnComponent = ui_1.QuillDraggableColumn, SidebarHeadingComponent = ui_1.QuillSidebarHeading, FilterPopoverComponent = ui_1.QuillFilterPopover, SortPopoverComponent = ui_1.QuillSortPopover, LimitPopoverComponent = ui_1.QuillLimitPopover, CardComponent = QuillCard_1.QuillCard, LabelComponent = UiComponents_1.MemoizedLabel, HeaderComponent = UiComponents_1.MemoizedHeader, SubHeaderComponent = UiComponents_1.MemoizedSubHeader, TextComponent = UiComponents_1.MemoizedText, ErrorMessageComponent = UiComponents_1.QuillErrorMessageComponent, ChartBuilderInputRowContainer = UiComponents_1.QuillChartBuilderInputRowContainer, ChartBuilderInputColumnContainer = UiComponents_1.QuillChartBuilderInputColumnContainer, PivotRowContainer = UiComponents_1.QuillPivotRowContainer, PivotColumnContainer = UiComponents_1.QuillPivotColumnContainer, LoadingComponent = UiComponents_1.QuillLoadingComponent, ColumnSearchEmptyState = UiComponents_1.QuillColumnSearchEmptyState, ChartBuilderFormContainer = UiComponents_1.QuillChartBuilderFormContainer, ChartBuilderModalComponent = UiComponents_1.MemoizedModal, isAdminEnabled = false, isAIEnabled = true, showChartBuilderTableFormatOptions = true, containerStyle, className, pivotRecommendationsEnabled = true, reportId, hideCopySQL = true, isChartBuilderHorizontalView = true, onClickChartElement, }) {
|
|
79
79
|
const [dashboard] = (0, react_1.useContext)(Context_1.DashboardContext);
|
|
80
|
-
const [
|
|
80
|
+
const [schemaData] = (0, react_1.useContext)(Context_1.SchemaDataContext);
|
|
81
81
|
const [reportInfo, setReportInfo] = (0, react_1.useState)(null);
|
|
82
82
|
const [aiPrompt, setAiPrompt] = (0, react_1.useState)('');
|
|
83
83
|
const [errorMessage, setErrorMessage] = (0, react_1.useState)('');
|
|
@@ -91,7 +91,6 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
91
91
|
const [activePath, setActivePath] = (0, react_1.useState)(null);
|
|
92
92
|
const [openPopover, setOpenPopover] = (0, react_1.useState)(null);
|
|
93
93
|
const [loading, setLoading] = (0, react_1.useState)(!!initialTableName);
|
|
94
|
-
const [loadingSchema, setLoadingSchema] = (0, react_1.useState)(false);
|
|
95
94
|
const [isChartBuilderOpen, setIsChartBuilderOpen] = (0, react_1.useState)(false);
|
|
96
95
|
const [, setIsPending] = (0, react_1.useState)(false);
|
|
97
96
|
const [isCopying, setIsCopying] = (0, react_1.useState)(false);
|
|
@@ -127,9 +126,10 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
127
126
|
const [client] = (0, react_1.useContext)(Context_1.ClientContext);
|
|
128
127
|
// JANK: This is temp and stupid
|
|
129
128
|
const [overrideRecommendations, setOverrideRecommendations] = (0, react_1.useState)(true);
|
|
130
|
-
const [customFields, setCustomFields] = (0, react_1.useContext)(Context_1.CustomFieldContext);
|
|
131
129
|
const [fieldValuesMap, setFieldValuesMap] = (0, react_1.useState)({}); // Mapping of unique values per field, used in string filter 'in' and 'not in'
|
|
132
|
-
const
|
|
130
|
+
const [globalUniqueValues, setGlobalUniqueValues] = (0, react_1.useState)({});
|
|
131
|
+
const { filterTree, filterStack } = (0, useAstToFilterTree_1.default)(formData, client); // Stores the state of filters
|
|
132
|
+
const [removingFilter, setRemovingFilter] = (0, react_1.useState)(false);
|
|
133
133
|
(0, react_1.useEffect)(() => {
|
|
134
134
|
if (!client) {
|
|
135
135
|
return;
|
|
@@ -137,8 +137,8 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
137
137
|
if (client.publicKey === '663416663aa9bc716e59a89d') {
|
|
138
138
|
setOverrideRecommendations(false);
|
|
139
139
|
}
|
|
140
|
-
if (!
|
|
141
|
-
|
|
140
|
+
if (!initialLoad && client.publicKey) {
|
|
141
|
+
clearAllState();
|
|
142
142
|
}
|
|
143
143
|
}, [client]);
|
|
144
144
|
(0, react_1.useEffect)(() => {
|
|
@@ -204,7 +204,7 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
204
204
|
label: pivot.columnField,
|
|
205
205
|
format: 'string',
|
|
206
206
|
},
|
|
207
|
-
], activeQuery, [], client, customFields);
|
|
207
|
+
], activeQuery, [], client, schemaData.customFields ?? []);
|
|
208
208
|
}
|
|
209
209
|
const pivotedData = await (0, PivotModal_1.generatePivotTable)(pivot, rows, undefined, false, -1, undefined, dateBucket, tempReport, client, distinctValuesForQuery);
|
|
210
210
|
setPivotData(pivotedData || []);
|
|
@@ -253,14 +253,19 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
253
253
|
setRecommendedPivots([]);
|
|
254
254
|
}, 0);
|
|
255
255
|
};
|
|
256
|
+
const fetchGlobalUniqueValues = async (columns, currentTable, client) => {
|
|
257
|
+
const global = await (0, tableProcessing_1.getUniqueStringValues)(columns, currentTable, client);
|
|
258
|
+
setGlobalUniqueValues((0, filterProcessing_1.uniqueValuesToStringMap)(global));
|
|
259
|
+
};
|
|
260
|
+
const uniqueValuesDependenciesRef = (0, react_1.useRef)({ client, columns, currentTable });
|
|
261
|
+
const memoizedFetchGlobalUniqueValues = (0, react_1.useCallback)(fetchGlobalUniqueValues, []);
|
|
256
262
|
(0, react_1.useEffect)(() => {
|
|
257
|
-
|
|
258
|
-
|
|
263
|
+
const hasChanged = !(0, fast_deep_equal_1.default)({ client, columns, currentTable }, uniqueValuesDependenciesRef.current);
|
|
264
|
+
if (hasChanged && client && columns && currentTable) {
|
|
265
|
+
memoizedFetchGlobalUniqueValues(columns, currentTable, client);
|
|
266
|
+
uniqueValuesDependenciesRef.current = { client, columns, currentTable };
|
|
259
267
|
}
|
|
260
|
-
|
|
261
|
-
clearAllState();
|
|
262
|
-
}
|
|
263
|
-
}, [client]);
|
|
268
|
+
}, [client, columns, currentTable, memoizedFetchGlobalUniqueValues]);
|
|
264
269
|
const formatRows = (rows, columns, pivot, aggregationType) => {
|
|
265
270
|
const copiedRows = (0, util_1.deepCopy)(rows);
|
|
266
271
|
if (pivot) {
|
|
@@ -359,18 +364,6 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
359
364
|
console.error(error);
|
|
360
365
|
}
|
|
361
366
|
};
|
|
362
|
-
const getUniqueStringValues = async (columns, tableName) => {
|
|
363
|
-
const convertedStringColumns = columns.filter((column) => {
|
|
364
|
-
return (0, ast_1.isTextColumnType)(column.fieldType);
|
|
365
|
-
});
|
|
366
|
-
const stringNames = convertedStringColumns.map((column) => column.field);
|
|
367
|
-
const smallStringColumns = await (0, tableProcessing_1.getCountsByColumns)(convertedStringColumns, `Select ${stringNames.join(', ')} from ${tableName}`, client, customFields);
|
|
368
|
-
const smallStringNames = smallStringColumns.map((column) => column.field);
|
|
369
|
-
const newUniqueValues = await (0, tableProcessing_1.getUniqueValuesByColumns)(smallStringColumns, `Select ${smallStringNames.join(', ')} from ${tableName}`, [], client, customFields);
|
|
370
|
-
const joinedUniqueValues = (0, util_1.deepCopy)(uniqueValues);
|
|
371
|
-
joinedUniqueValues[tableName] = newUniqueValues;
|
|
372
|
-
return joinedUniqueValues;
|
|
373
|
-
};
|
|
374
367
|
const getDateRanges = async (columns, tableName) => {
|
|
375
368
|
const dateColumns = columns.filter((column) => {
|
|
376
369
|
return column.fieldType === 'date';
|
|
@@ -381,7 +374,7 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
381
374
|
const dateColumnNames = dateColumns.map((column) => {
|
|
382
375
|
return column.field;
|
|
383
376
|
});
|
|
384
|
-
const dateRanges = await (0, tableProcessing_1.getDateRangeByColumns)(dateColumns, `Select ${dateColumnNames.join(', ')} from ${tableName}`, client, customFields);
|
|
377
|
+
const dateRanges = await (0, tableProcessing_1.getDateRangeByColumns)(dateColumns, `Select ${dateColumnNames.join(', ')} from ${tableName}`, client, schemaData.customFields ?? []);
|
|
385
378
|
return dateRanges;
|
|
386
379
|
};
|
|
387
380
|
// It's just like getColumnsInPivot but we expand the columnField
|
|
@@ -405,12 +398,12 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
405
398
|
return result.filter(Boolean);
|
|
406
399
|
};
|
|
407
400
|
const loadTable = async (tables) => {
|
|
408
|
-
if (!tables)
|
|
401
|
+
if (!tables?.length || !schemaData.schema?.length)
|
|
409
402
|
return;
|
|
410
403
|
setLoading(true);
|
|
411
404
|
const tableInfo = tables.find((tableInfo) => tableInfo.name === initialTableName);
|
|
412
405
|
if (tableInfo) {
|
|
413
|
-
const newUniqueValues = await getUniqueStringValues(tableInfo.columns, initialTableName);
|
|
406
|
+
const newUniqueValues = await (0, tableProcessing_1.getUniqueStringValues)(tableInfo.columns, initialTableName, client, schemaData.customFields, uniqueValues);
|
|
414
407
|
if ((0, crypto_1.hashCode)(uniqueValues) !== (0, crypto_1.hashCode)(newUniqueValues)) {
|
|
415
408
|
setUniqueValues(newUniqueValues);
|
|
416
409
|
updateFieldValuesMap(newUniqueValues, initialTableName);
|
|
@@ -439,13 +432,9 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
439
432
|
await fetchAstFromPromptHelper(`get ${columnsForTable} from ${initialTableName}`);
|
|
440
433
|
setInitialLoad(false);
|
|
441
434
|
};
|
|
442
|
-
const
|
|
435
|
+
const onSchemaChange = async () => {
|
|
443
436
|
try {
|
|
444
|
-
|
|
445
|
-
const { schemaData, customFieldsByTable } = await (0, schema_1.getSchemaInfoWithCustomFields)(client, 'rb');
|
|
446
|
-
setCustomFields(customFieldsByTable);
|
|
447
|
-
setSchema(schemaData ?? []);
|
|
448
|
-
setOrderedColumnNames((schemaData ?? []).flatMap((table) => table.columns
|
|
437
|
+
setOrderedColumnNames((schemaData.schema ?? []).flatMap((table) => table.columns
|
|
449
438
|
.map((c) => `${table.name}.${c.field}`)
|
|
450
439
|
.sort((a, b) => {
|
|
451
440
|
const aIsId = a.endsWith('.id') ||
|
|
@@ -463,11 +452,9 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
463
452
|
return 0;
|
|
464
453
|
})));
|
|
465
454
|
if (initialTableName) {
|
|
466
|
-
await loadTable(schemaData);
|
|
455
|
+
await loadTable(schemaData.schema);
|
|
467
456
|
}
|
|
468
|
-
setLoadingSchema(false);
|
|
469
457
|
setInitialLoad(false);
|
|
470
|
-
return schemaData;
|
|
471
458
|
}
|
|
472
459
|
catch (error) {
|
|
473
460
|
console.error(error);
|
|
@@ -484,11 +471,13 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
484
471
|
if (!report || report.referencedTables?.length !== 1) {
|
|
485
472
|
throw new Error('Report not found');
|
|
486
473
|
}
|
|
487
|
-
const { ast: newAst, pivot: newPivot, schema: curSchema, } = await (0, astProcessing_1.fetchASTFromQuillReport)(report, client, schema);
|
|
474
|
+
const { ast: newAst, pivot: newPivot, schema: curSchema, } = await (0, astProcessing_1.fetchASTFromQuillReport)(report, client, schemaData.schema);
|
|
488
475
|
setBaseAst({ ...newAst, where: null });
|
|
489
476
|
await fetchReportFromASTHelper({ ...newAst, where: null }, newAst.where, newPivot, curSchema, report);
|
|
490
|
-
await
|
|
477
|
+
await onSchemaChange();
|
|
491
478
|
setReportInfo(report);
|
|
479
|
+
const query = await fetchSqlQuery(newAst, null, false);
|
|
480
|
+
setActiveQuery(query);
|
|
492
481
|
}
|
|
493
482
|
catch (err) {
|
|
494
483
|
setInitialChartLoad(false);
|
|
@@ -497,10 +486,8 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
497
486
|
loadChart();
|
|
498
487
|
}, [dashboard[reportId || '']]);
|
|
499
488
|
(0, react_1.useEffect)(() => {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
}
|
|
503
|
-
}, [schema, initialTableName, reportId]);
|
|
489
|
+
onSchemaChange();
|
|
490
|
+
}, [schemaData.schema, initialTableName, reportId]);
|
|
504
491
|
const updateFormData = (updates, { isDeletion = false, isInsertion = false, isReplaceSubtree = false, isAddVariant = false, isDeleteVariant = false, topLevelBinOp = 'OR', isCondition = undefined, }) => {
|
|
505
492
|
// Function to immutably update or delete nodes based on their path
|
|
506
493
|
// TODO: fix the following horible code
|
|
@@ -518,7 +505,7 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
518
505
|
...constants_1.defaultAST,
|
|
519
506
|
...baseAst,
|
|
520
507
|
...(!baseAst?.columns && {
|
|
521
|
-
columns: (0, astProcessing_1.getAllPossibleColumns)(baseAst, schema).map((c) => {
|
|
508
|
+
columns: (0, astProcessing_1.getAllPossibleColumns)(baseAst, schemaData.schema).map((c) => {
|
|
522
509
|
const newColumn = (0, util_1.deepCopy)(constants_1.defaultColumn);
|
|
523
510
|
newColumn.expr.column = c.field;
|
|
524
511
|
return newColumn;
|
|
@@ -538,7 +525,7 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
538
525
|
...constants_1.defaultAST,
|
|
539
526
|
...baseAst,
|
|
540
527
|
...(!baseAst?.columns && {
|
|
541
|
-
columns: (0, astProcessing_1.getAllPossibleColumns)(baseAst, schema).map((c) => {
|
|
528
|
+
columns: (0, astProcessing_1.getAllPossibleColumns)(baseAst, schemaData.schema).map((c) => {
|
|
542
529
|
const newColumn = (0, util_1.deepCopy)(constants_1.defaultColumn);
|
|
543
530
|
newColumn.expr.column = c.field;
|
|
544
531
|
return newColumn;
|
|
@@ -639,7 +626,7 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
639
626
|
...constants_1.defaultAST,
|
|
640
627
|
...baseAst,
|
|
641
628
|
...(!baseAst?.columns && {
|
|
642
|
-
columns: (0, astProcessing_1.getAllPossibleColumns)(baseAst, schema).map((c) => {
|
|
629
|
+
columns: (0, astProcessing_1.getAllPossibleColumns)(baseAst, schemaData.schema).map((c) => {
|
|
643
630
|
const newColumn = (0, util_1.deepCopy)(constants_1.defaultColumn);
|
|
644
631
|
newColumn.expr.column = c.field;
|
|
645
632
|
return newColumn;
|
|
@@ -730,7 +717,7 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
730
717
|
try {
|
|
731
718
|
setErrorMessage('');
|
|
732
719
|
setTableLoading(true);
|
|
733
|
-
const tableInfo = await (0, tableProcessing_1.fetchTableByQuery)(activeQuery, client, processing, customFields);
|
|
720
|
+
const tableInfo = await (0, tableProcessing_1.fetchTableByQuery)(activeQuery, client, processing, schemaData.customFields);
|
|
734
721
|
if (tableInfo.error) {
|
|
735
722
|
throw new Error(tableInfo.error);
|
|
736
723
|
}
|
|
@@ -758,75 +745,7 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
758
745
|
return;
|
|
759
746
|
}
|
|
760
747
|
};
|
|
761
|
-
|
|
762
|
-
* @param filterTree
|
|
763
|
-
* Returns a list of filters to be displayed
|
|
764
|
-
* Replaces the functionality of renderNodes in the context of filters
|
|
765
|
-
*/
|
|
766
|
-
const renderFilters = (filterTree) => {
|
|
767
|
-
let tree = filterTree;
|
|
768
|
-
let filterStack = [];
|
|
769
|
-
/**
|
|
770
|
-
* Function that takes in a FilterTree and flattens it into an array using in order traversal
|
|
771
|
-
*/
|
|
772
|
-
function traverseTree(node) {
|
|
773
|
-
if (!node) {
|
|
774
|
-
return;
|
|
775
|
-
}
|
|
776
|
-
if (node.leaf) {
|
|
777
|
-
filterStack.push(node);
|
|
778
|
-
}
|
|
779
|
-
else {
|
|
780
|
-
traverseTree(node.leftNode);
|
|
781
|
-
filterStack.push(node);
|
|
782
|
-
traverseTree(node.rightNode);
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
/**
|
|
786
|
-
* Given an array of Filters (presumed to be in in-order state), generate
|
|
787
|
-
* the corresponding Filter tree. Essentially the reverse of what traverseTree does
|
|
788
|
-
*/
|
|
789
|
-
function filterStackToFilterTree(stack) {
|
|
790
|
-
function buildTree(i) {
|
|
791
|
-
const newNode = {
|
|
792
|
-
leaf: false,
|
|
793
|
-
operator: null,
|
|
794
|
-
leftNode: null,
|
|
795
|
-
rightNode: null,
|
|
796
|
-
};
|
|
797
|
-
if (i >= stack.length) {
|
|
798
|
-
return null;
|
|
799
|
-
}
|
|
800
|
-
else if (stack[i].leaf) {
|
|
801
|
-
if (i < stack.length - 1) {
|
|
802
|
-
// more nodes later
|
|
803
|
-
newNode.operator = stack[i + 1].operator;
|
|
804
|
-
newNode.leftNode = {
|
|
805
|
-
leaf: true,
|
|
806
|
-
leftNode: null,
|
|
807
|
-
rightNode: null,
|
|
808
|
-
operator: null,
|
|
809
|
-
value: stack[i].value,
|
|
810
|
-
};
|
|
811
|
-
newNode.rightNode = buildTree(i + 2);
|
|
812
|
-
}
|
|
813
|
-
else {
|
|
814
|
-
newNode.leaf = true;
|
|
815
|
-
newNode.value = stack[i].value;
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
return newNode;
|
|
819
|
-
}
|
|
820
|
-
return buildTree(0);
|
|
821
|
-
}
|
|
822
|
-
traverseTree(tree);
|
|
823
|
-
// Remove null (invalid) filters from filter stack
|
|
824
|
-
filterStack = filterStack.filter((filter) => {
|
|
825
|
-
return ((!filter.leaf &&
|
|
826
|
-
filter.rightNode &&
|
|
827
|
-
(!filter.rightNode.leaf || filter.rightNode.value)) ||
|
|
828
|
-
(filter.leaf && filter.value));
|
|
829
|
-
});
|
|
748
|
+
const renderFilters = () => {
|
|
830
749
|
// Render filterStack
|
|
831
750
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
832
751
|
display: 'flex',
|
|
@@ -846,14 +765,14 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
846
765
|
item.operator = 'and';
|
|
847
766
|
}
|
|
848
767
|
let newFormData = null;
|
|
849
|
-
if (
|
|
850
|
-
newFormData = (0, astFilterProcessing_1.filterTreeToAst)(
|
|
768
|
+
if (filterTree) {
|
|
769
|
+
newFormData = (0, astFilterProcessing_1.filterTreeToAst)(filterTree, client.databaseType.toLowerCase());
|
|
851
770
|
}
|
|
852
771
|
const newAst = (0, util_1.deepCopy)({
|
|
853
772
|
...constants_1.defaultAST,
|
|
854
773
|
...baseAst,
|
|
855
774
|
...(!baseAst?.columns && {
|
|
856
|
-
columns: (0, astProcessing_1.getAllPossibleColumns)(baseAst, schema).map((c) => {
|
|
775
|
+
columns: (0, astProcessing_1.getAllPossibleColumns)(baseAst, schemaData.schema).map((c) => {
|
|
857
776
|
const newColumn = (0, util_1.deepCopy)(constants_1.defaultColumn);
|
|
858
777
|
newColumn.expr.column = c.field;
|
|
859
778
|
return newColumn;
|
|
@@ -869,18 +788,18 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
869
788
|
fetchSqlQuery(newAst, newFormData);
|
|
870
789
|
} }) }, index));
|
|
871
790
|
}
|
|
872
|
-
else {
|
|
873
|
-
return ((0, jsx_runtime_1.jsx)(ui_1.FilterPopoverWrapper, { schema: schema.find((s) => s.name === currentTable || s.displayName === currentTable) ?? schema[0], filter: item.value, filterLabel: item.value ? (0, filterProcessing_1.filterSentence)(item.value) : '', index: index, FilterTagComponent: FilterPopoverComponent, FilterModal: FilterModal_1.default, fieldValuesMap:
|
|
791
|
+
else if (item.value) {
|
|
792
|
+
return ((0, jsx_runtime_1.jsx)(ui_1.FilterPopoverWrapper, { schema: schemaData.schema.find((s) => s.name === currentTable || s.displayName === currentTable) ?? schemaData.schema[0], filter: item.value, filterLabel: item.value ? (0, filterProcessing_1.filterSentence)(item.value) : '', index: index, FilterTagComponent: FilterPopoverComponent, FilterModal: FilterModal_1.default, fieldValuesMap: globalUniqueValues, priorFilters: filterStack.slice(0, index > 0 ? index - 1 : 0), columns: columns, client: client, customFields: schemaData.customFields, baseAst: baseAst, endpoint: exports.QUILL_SERVER, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, SelectComponent: SelectComponent, TextInputComponent: TextInputComponent, MultiSelectComponent: MultiSelectComponent, handleFilterSave: (filter) => {
|
|
874
793
|
item.value = filter;
|
|
875
794
|
let newFormData = null;
|
|
876
|
-
if (
|
|
877
|
-
newFormData = (0, astFilterProcessing_1.filterTreeToAst)(
|
|
795
|
+
if (filterTree) {
|
|
796
|
+
newFormData = (0, astFilterProcessing_1.filterTreeToAst)(filterTree, client.databaseType.toLowerCase());
|
|
878
797
|
}
|
|
879
798
|
const newAst = (0, util_1.deepCopy)({
|
|
880
799
|
...constants_1.defaultAST,
|
|
881
800
|
...baseAst,
|
|
882
801
|
...(!baseAst?.columns && {
|
|
883
|
-
columns: (0, astProcessing_1.getAllPossibleColumns)(baseAst, schema).map((c) => {
|
|
802
|
+
columns: (0, astProcessing_1.getAllPossibleColumns)(baseAst, schemaData.schema).map((c) => {
|
|
884
803
|
const newColumn = (0, util_1.deepCopy)(constants_1.defaultColumn);
|
|
885
804
|
newColumn.expr.column = c.field;
|
|
886
805
|
return newColumn;
|
|
@@ -895,41 +814,46 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
895
814
|
setFormData(newFormData);
|
|
896
815
|
fetchSqlQuery(newAst, newFormData);
|
|
897
816
|
}, handleFilterDelete: (i) => {
|
|
898
|
-
if (
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
filterStack.splice(i, 2);
|
|
817
|
+
if (!removingFilter) {
|
|
818
|
+
setRemovingFilter(true);
|
|
819
|
+
const newStack = filterStack;
|
|
820
|
+
if (i > 0) {
|
|
821
|
+
newStack.splice(i - 1, 2);
|
|
904
822
|
}
|
|
905
823
|
else {
|
|
906
|
-
filterStack.
|
|
824
|
+
if (filterStack.length > 1) {
|
|
825
|
+
newStack.splice(i, 2);
|
|
826
|
+
}
|
|
827
|
+
else {
|
|
828
|
+
newStack.splice(i, 1);
|
|
829
|
+
}
|
|
907
830
|
}
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
831
|
+
const tree = (0, filterProcessing_1.filterStackToFilterTree)(newStack);
|
|
832
|
+
let newFormData = null;
|
|
833
|
+
if (tree) {
|
|
834
|
+
newFormData = (0, astFilterProcessing_1.filterTreeToAst)(tree, client.databaseType.toLowerCase());
|
|
835
|
+
}
|
|
836
|
+
const newAst = (0, util_1.deepCopy)({
|
|
837
|
+
...constants_1.defaultAST,
|
|
838
|
+
...baseAst,
|
|
839
|
+
...(!baseAst?.columns && {
|
|
840
|
+
columns: (0, astProcessing_1.getAllPossibleColumns)(baseAst, schemaData.schema).map((c) => {
|
|
841
|
+
const newColumn = (0, util_1.deepCopy)(constants_1.defaultColumn);
|
|
842
|
+
newColumn.expr.column = c.field;
|
|
843
|
+
return newColumn;
|
|
844
|
+
}),
|
|
922
845
|
}),
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
846
|
+
...(!baseAst?.from && {
|
|
847
|
+
from: [{ ...constants_1.defaultTable, table: initialTableName }],
|
|
848
|
+
}),
|
|
849
|
+
where: newFormData,
|
|
850
|
+
});
|
|
851
|
+
setBaseAst(newAst);
|
|
852
|
+
setFormData(newFormData);
|
|
853
|
+
fetchSqlQuery(newAst, newFormData);
|
|
854
|
+
setRemovingFilter(false);
|
|
855
|
+
}
|
|
856
|
+
} }, `filter_${index}_${item.value ? (0, filterProcessing_1.filterSentence)(item.value) : ''}`));
|
|
933
857
|
}
|
|
934
858
|
}) }));
|
|
935
859
|
};
|
|
@@ -961,7 +885,7 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
961
885
|
let reportBuilderInfo = undefined;
|
|
962
886
|
try {
|
|
963
887
|
setLoading(true);
|
|
964
|
-
reportBuilderInfo = await (0, report_1.fetchReportBuilderDataFromAST)(baseAst, curFormData, curSchema ?? schema, client, curPivot ?? pivot, formData, currentTable, { uniqueStrings: uniqueValues, dateRanges: dateRanges ?? {} }, previousReport ?? reportInfo ?? undefined, customFields);
|
|
888
|
+
reportBuilderInfo = await (0, report_1.fetchReportBuilderDataFromAST)(baseAst, curFormData, curSchema ?? schemaData.schema, client, curPivot ?? pivot, formData, currentTable, { uniqueStrings: uniqueValues, dateRanges: dateRanges ?? {} }, previousReport ?? reportInfo ?? undefined, schemaData.customFields);
|
|
965
889
|
if (reportBuilderInfo.error) {
|
|
966
890
|
throw new Error(reportBuilderInfo.error);
|
|
967
891
|
}
|
|
@@ -1016,7 +940,7 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
1016
940
|
}
|
|
1017
941
|
try {
|
|
1018
942
|
setLoading(true);
|
|
1019
|
-
astInfo = await (0, astProcessing_1.fetchAndProcessASTFromPrompt)(prompt, schema, client, pivot, activeQuery);
|
|
943
|
+
astInfo = await (0, astProcessing_1.fetchAndProcessASTFromPrompt)(prompt, schemaData.schema, client, pivot, activeQuery);
|
|
1020
944
|
if (astInfo.error) {
|
|
1021
945
|
throw new Error(astInfo.error);
|
|
1022
946
|
}
|
|
@@ -1028,10 +952,16 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
1028
952
|
}
|
|
1029
953
|
return;
|
|
1030
954
|
}
|
|
955
|
+
// parse the whereAst first
|
|
956
|
+
const filterTree = (0, astFilterProcessing_1.astToFilterTree)(astInfo.whereAST, client.databaseType?.toLowerCase());
|
|
957
|
+
const cleanAst = filterTree
|
|
958
|
+
? (0, astFilterProcessing_1.filterTreeToAst)(filterTree, client.databaseType?.toLowerCase())
|
|
959
|
+
: null;
|
|
960
|
+
setFormData(cleanAst);
|
|
961
|
+
astInfo.ast.where = cleanAst;
|
|
1031
962
|
setBaseAst(astInfo.ast);
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
await fetchReportFromASTHelper(astInfo.ast, astInfo.whereAST, astInfo.pivot);
|
|
963
|
+
fetchSqlQuery(astInfo.ast, cleanAst, false);
|
|
964
|
+
await fetchReportFromASTHelper(astInfo.ast, cleanAst, astInfo.pivot);
|
|
1035
965
|
};
|
|
1036
966
|
const handleDeleteColumn = (name) => {
|
|
1037
967
|
if (!baseAst || !baseAst.columns.length || selectedColumns.length === 1) {
|
|
@@ -1142,6 +1072,7 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
1142
1072
|
gap: 8,
|
|
1143
1073
|
}, children: [columnNamesInAst.map((name) => ((0, jsx_runtime_1.jsx)(DraggableItem, { id: name, label: name, onDelete: () => handleDeleteColumn(name) }, name))), columnNamesInAst?.length > 0 && (0, jsx_runtime_1.jsx)("div", { style: { height: 6 } })] }) }) }));
|
|
1144
1074
|
}
|
|
1075
|
+
// TODO: Refactor this part
|
|
1145
1076
|
if (loading || initialChartLoad) {
|
|
1146
1077
|
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
1147
1078
|
display: 'flex',
|
|
@@ -1169,12 +1100,12 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
1169
1100
|
}, orderedColumnNames: orderedColumnNames, setOrderedColumnNames: setOrderedColumnNames, selectedColumns: selectedColumns, setSelectedColumns: setSelectedColumns, isSelectedAllColumns: isSelectedAllColumns, clearAllState: clearAllState, nameToColumn: nameToColumn, baseAst: baseAst, setBaseAst: (ast) => {
|
|
1170
1101
|
setBaseAst(ast);
|
|
1171
1102
|
fetchSqlQuery(ast);
|
|
1172
|
-
}, pivot: pivot, initialTableName: initialTableName, defaultAST: constants_1.defaultAST, defaultTable: constants_1.defaultTable, setPivot: setPivot,
|
|
1103
|
+
}, pivot: pivot, initialTableName: initialTableName, defaultAST: constants_1.defaultAST, defaultTable: constants_1.defaultTable, setPivot: setPivot, TextInputComponent: TextInputComponent, SelectColumn: SelectColumnComponent, SecondaryButton: SecondaryButtonComponent, Button: ButtonComponent, ColumnSearchEmptyState: ColumnSearchEmptyState, LoadingComponent: LoadingComponent }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: { width: '100%' }, children: [(0, jsx_runtime_1.jsx)(SidebarHeadingComponent, { label: "Filters" }), formData && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
1173
1104
|
display: 'flex',
|
|
1174
1105
|
flexDirection: 'column',
|
|
1175
1106
|
gap: 8,
|
|
1176
1107
|
marginBottom: 12,
|
|
1177
|
-
}, children:
|
|
1108
|
+
}, children: renderFilters() })), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
1178
1109
|
display: 'flex',
|
|
1179
1110
|
flexDirection: 'column',
|
|
1180
1111
|
alignItems: 'flex-start',
|
|
@@ -1215,8 +1146,8 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
1215
1146
|
setActiveEditItem(null);
|
|
1216
1147
|
}, 300);
|
|
1217
1148
|
}
|
|
1218
|
-
}, popoverTitle: 'Add filter', popoverChildren: (0, jsx_runtime_1.jsx)(FilterModal_1.default, { schema: schema.find((s) => s.name === currentTable ||
|
|
1219
|
-
s.displayName === currentTable) ?? schema[0], fieldValuesMap: uniqueValues[(0, ast_1.getTableNames)(baseAst).length === 1
|
|
1149
|
+
}, popoverTitle: 'Add filter', popoverChildren: (0, jsx_runtime_1.jsx)(FilterModal_1.default, { schema: schemaData.schema.find((s) => s.name === currentTable ||
|
|
1150
|
+
s.displayName === currentTable) ?? schemaData.schema[0], fieldValuesMap: uniqueValues[(0, ast_1.getTableNames)(baseAst).length === 1
|
|
1220
1151
|
? (0, ast_1.getTableNames)(baseAst)[0]
|
|
1221
1152
|
: initialTableName], onSubmitFilter: (filter) => {
|
|
1222
1153
|
setOpenPopover(null);
|
|
@@ -1359,7 +1290,7 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
1359
1290
|
setActivePath(null);
|
|
1360
1291
|
setOpenPopover(null);
|
|
1361
1292
|
}
|
|
1362
|
-
}, popoverTitle: "Add limit", popoverChildren: (0, jsx_runtime_1.jsx)(AddLimitPopover_1.AddLimitPopover, {
|
|
1293
|
+
}, popoverTitle: "Add limit", popoverChildren: (0, jsx_runtime_1.jsx)(AddLimitPopover_1.AddLimitPopover, { TextInputComponent: TextInputComponent, Button: ButtonComponent, SecondaryButton: SecondaryButtonComponent, onSave: () => { } }) })] }))] })] }), (0, jsx_runtime_1.jsxs)(ContainerComponent, { children: [isAIEnabled && ((0, jsx_runtime_1.jsx)("form", { ref: askAILoadingContainerRef, onSubmit: (event) => {
|
|
1363
1294
|
event.preventDefault();
|
|
1364
1295
|
}, style: {
|
|
1365
1296
|
display: 'flex',
|
|
@@ -1374,11 +1305,13 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
1374
1305
|
? askAIInputWidth
|
|
1375
1306
|
: askAILoadingContainerWidth, value: aiPrompt, onChange: () => { } }), (0, jsx_runtime_1.jsx)(ButtonComponent, { onClick: () => { }, label: "Ask AI" }), ((baseAst && dataDisplayed) ||
|
|
1376
1307
|
initialLoad ||
|
|
1377
|
-
initialChartLoad) &&
|
|
1308
|
+
initialChartLoad) &&
|
|
1309
|
+
!reportId && ((0, jsx_runtime_1.jsx)(SecondaryButtonComponent, { onClick: () => { }, label: "New report" }))] }) })), (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TableComponent, { isLoading: true, rows: [], columns: [] }), baseAst && dataDisplayed && !initialChartLoad && ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
1378
1310
|
display: 'flex',
|
|
1379
1311
|
flexDirection: 'row',
|
|
1380
1312
|
gap: '12px',
|
|
1381
|
-
|
|
1313
|
+
marginTop: 'auto',
|
|
1314
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: { width: '100%' } }), onDiscardChanges && ((0, jsx_runtime_1.jsx)(SecondaryButtonComponent, { onClick: onDiscardChanges, label: "Discard changes" })), !hideCopySQL && ((0, jsx_runtime_1.jsx)(SecondaryButtonComponent, { onClick: () => copySQLToClipboard(), label: isCopying ? 'Copied' : 'Copy SQL' })), (0, jsx_runtime_1.jsx)(ButtonComponent, { label: reportInfo ? 'Save changes' : 'Add to dashboard', onClick: () => { } })] }))] })] }), (0, jsx_runtime_1.jsx)("style", { children: `body{margin:0;}` })] }));
|
|
1382
1315
|
}
|
|
1383
1316
|
return ((0, jsx_runtime_1.jsxs)("div", { style: { backgroundColor: theme?.backgroundColor, ...containerStyle }, className: className, children: [(!isChartBuilderHorizontalView ||
|
|
1384
1317
|
(isChartBuilderHorizontalView && !isChartBuilderOpen)) && ((0, jsx_runtime_1.jsxs)("div", { ref: parentRef, style: {
|
|
@@ -1412,12 +1345,12 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
1412
1345
|
}, orderedColumnNames: orderedColumnNames, setOrderedColumnNames: setOrderedColumnNames, selectedColumns: selectedColumns, setSelectedColumns: setSelectedColumns, isSelectedAllColumns: isSelectedAllColumns, clearAllState: clearAllState, nameToColumn: nameToColumn, baseAst: baseAst, setBaseAst: (ast) => {
|
|
1413
1346
|
setBaseAst(ast);
|
|
1414
1347
|
fetchSqlQuery(ast);
|
|
1415
|
-
}, pivot: pivot, initialTableName: initialTableName, defaultAST: constants_1.defaultAST, defaultTable: constants_1.defaultTable, schemaLoading:
|
|
1348
|
+
}, pivot: pivot, initialTableName: initialTableName, defaultAST: constants_1.defaultAST, defaultTable: constants_1.defaultTable, schemaLoading: schemaData.isSchemaLoading, setPivot: setPivot, TextInputComponent: TextInputComponent, SelectColumn: SelectColumnComponent, SecondaryButton: SecondaryButtonComponent, Button: ButtonComponent, ColumnSearchEmptyState: ColumnSearchEmptyState, LoadingComponent: LoadingComponent }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: { width: '100%' }, children: [(0, jsx_runtime_1.jsx)(SidebarHeadingComponent, { label: "Filters" }), formData && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
1416
1349
|
display: 'flex',
|
|
1417
1350
|
flexDirection: 'column',
|
|
1418
1351
|
gap: 8,
|
|
1419
1352
|
marginBottom: 12,
|
|
1420
|
-
}, children:
|
|
1353
|
+
}, children: renderFilters() })), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
1421
1354
|
display: 'flex',
|
|
1422
1355
|
flexDirection: 'column',
|
|
1423
1356
|
alignItems: 'flex-start',
|
|
@@ -1459,8 +1392,8 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
1459
1392
|
setActiveEditItem(null);
|
|
1460
1393
|
}, 300);
|
|
1461
1394
|
}
|
|
1462
|
-
}, popoverTitle: "Add filter", popoverChildren: (0, jsx_runtime_1.jsx)(FilterModal_1.default, { schema: schema.find((s) => s.name === currentTable ||
|
|
1463
|
-
s.displayName === currentTable) ?? schema[0], fieldValuesMap: fieldValuesMap, onSubmitFilter: (filter) => {
|
|
1395
|
+
}, popoverTitle: "Add filter", popoverChildren: (0, jsx_runtime_1.jsx)(FilterModal_1.default, { schema: schemaData.schema.find((s) => s.name === currentTable ||
|
|
1396
|
+
s.displayName === currentTable) ?? schemaData.schema[0], fieldValuesMap: fieldValuesMap, onSubmitFilter: (filter) => {
|
|
1464
1397
|
setOpenPopover(null);
|
|
1465
1398
|
setIsPending(false);
|
|
1466
1399
|
const item = (0, astFilterProcessing_1.filterToAst)(filter, client.databaseType.toLowerCase());
|
|
@@ -1733,7 +1666,7 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
1733
1666
|
setActivePath(null);
|
|
1734
1667
|
setOpenPopover(null);
|
|
1735
1668
|
}
|
|
1736
|
-
}, popoverTitle: "Add limit", popoverChildren: (0, jsx_runtime_1.jsx)(AddLimitPopover_1.AddLimitPopover, {
|
|
1669
|
+
}, popoverTitle: "Add limit", popoverChildren: (0, jsx_runtime_1.jsx)(AddLimitPopover_1.AddLimitPopover, { TextInputComponent: TextInputComponent, Button: ButtonComponent, SecondaryButton: SecondaryButtonComponent, onSave: (limit) => {
|
|
1737
1670
|
const newAst = { ...baseAst };
|
|
1738
1671
|
newAst.limit = {
|
|
1739
1672
|
seperator: '',
|
|
@@ -1762,20 +1695,23 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
1762
1695
|
? 'Ask a follow-up question...'
|
|
1763
1696
|
: 'Ask a question...' }), (0, jsx_runtime_1.jsx)(ButtonComponent, { onClick: () => {
|
|
1764
1697
|
fetchAstFromPromptHelper();
|
|
1765
|
-
}, label: 'Ask AI' }), ((baseAst && dataDisplayed) || initialLoad) && ((0, jsx_runtime_1.jsx)(SecondaryButtonComponent, { label: 'New report', onClick: clearAllState }))] }) })), baseAst && ((0, jsx_runtime_1.jsx)(TableComponent, { isLoading: tableLoading ||
|
|
1698
|
+
}, label: 'Ask AI' }), ((baseAst && dataDisplayed) || initialLoad) && !reportId && ((0, jsx_runtime_1.jsx)(SecondaryButtonComponent, { label: 'New report', onClick: clearAllState }))] }) })), baseAst && ((0, jsx_runtime_1.jsx)(TableComponent, { isLoading: tableLoading ||
|
|
1766
1699
|
(loading && errorMessage.length === 0) ||
|
|
1767
|
-
initialChartLoad, rows: formattedRows, rowCount: pivot ? undefined : numberOfRows, columns: pivot
|
|
1700
|
+
initialChartLoad, rows: formattedRows, rowCount: pivot ? undefined : numberOfRows, rowsPerPage: 20, columns: pivot
|
|
1768
1701
|
? pivotData?.columns || emptyPivotColumns()
|
|
1769
1702
|
: enforceOrderOnColumns(Object.keys(rows[0] ?? {})).map((c) => {
|
|
1770
1703
|
return {
|
|
1771
1704
|
label: (0, textProcessing_1.snakeAndCamelCaseToTitleCase)(c),
|
|
1772
1705
|
field: c,
|
|
1773
1706
|
};
|
|
1774
|
-
}), onPageChange: onPageChange, onSortChange: onSortChange
|
|
1707
|
+
}), onPageChange: onPageChange, onSortChange: onSortChange, containerStyle: {
|
|
1708
|
+
maxHeight: Math.max(window.innerHeight - 290, 75 + Math.min(Math.max(10, rows.length), 20) * 37),
|
|
1709
|
+
} })), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
1775
1710
|
display: 'flex',
|
|
1776
1711
|
flexDirection: 'row',
|
|
1777
1712
|
gap: '12px',
|
|
1778
1713
|
width: '100%',
|
|
1714
|
+
marginTop: 'auto',
|
|
1779
1715
|
}, children: [errorMessage ? ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
1780
1716
|
display: 'flex',
|
|
1781
1717
|
flexDirection: 'row',
|
|
@@ -1785,7 +1721,8 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
1785
1721
|
alignItems: 'center',
|
|
1786
1722
|
}, children: [(0, jsx_runtime_1.jsx)(ErrorMessageComponent, { errorMessage: errorMessage }), (0, jsx_runtime_1.jsx)(SecondaryButtonComponent, { onClick: () => {
|
|
1787
1723
|
fetchAstFromPromptHelper();
|
|
1788
|
-
}, label: 'Retry' })] })) : ((0, jsx_runtime_1.jsx)("div", { style: { width: '100%' } })), baseAst && dataDisplayed && !initialChartLoad && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!hideCopySQL && ((0, jsx_runtime_1.jsx)(SecondaryButtonComponent, { label: isCopying ? '
|
|
1724
|
+
}, label: 'Retry' })] })) : ((0, jsx_runtime_1.jsx)("div", { style: { width: '100%' } })), baseAst && dataDisplayed && !initialChartLoad && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [onDiscardChanges && ((0, jsx_runtime_1.jsx)(SecondaryButtonComponent, { onClick: onDiscardChanges, label: "Discard changes" })), !hideCopySQL && ((0, jsx_runtime_1.jsx)(SecondaryButtonComponent, { label: isCopying ? 'Copied' : 'Copy SQL', onClick: () => copySQLToClipboard() })), (0, jsx_runtime_1.jsx)(ButtonComponent, { onClick: () => {
|
|
1725
|
+
onSaveChanges && onSaveChanges();
|
|
1789
1726
|
setIsChartBuilderOpen(true);
|
|
1790
1727
|
}, disabled: !!errorMessage, label: reportId ? 'Save changes' : 'Add to dashboard' })] }))] })] }), (0, jsx_runtime_1.jsx)("style", { children: `body{margin:0;}` })] })), (!isChartBuilderHorizontalView || isChartBuilderOpen) && ((0, jsx_runtime_1.jsx)(ChartBuilder_1.ChartBuilderWithModal, { report: reportInfo
|
|
1791
1728
|
? {
|
|
@@ -1801,6 +1738,6 @@ SidebarComponent = ui_1.QuillSidebar, ContainerComponent = ui_1.CustomContainer,
|
|
|
1801
1738
|
queryString: activeQuery,
|
|
1802
1739
|
rows: rows,
|
|
1803
1740
|
}
|
|
1804
|
-
: tempReport, rows: rows, columns: columns, pivot: pivot, query: activeQuery, showTableFormatOptions: showChartBuilderTableFormatOptions, showDateFieldOptions: isAdminEnabled, showAccessControlOptions: isAdminEnabled, title: reportId ? 'Save changes' : 'Add to dashboard', isHorizontalView: true, isOpen: isChartBuilderOpen, setIsOpen: setIsChartBuilderOpen, onAddToDashboardComplete: reportId ? onSubmitEditReport : onSubmitCreateReport, destinationDashboard: destinationDashboard, organizationName: organizationName, pivotData: pivotData, initialUniqueValues: uniqueValues[currentTable], pivotRecommendationsEnabled: pivotRecommendationsEnabled && overrideRecommendations, SelectComponent: SelectComponent, TextInputComponent: TextInputComponent, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, HeaderComponent: HeaderComponent, SubHeaderComponent: SubHeaderComponent, LabelComponent: LabelComponent, TextComponent: TextComponent, CardComponent: CardComponent, ModalComponent: ChartBuilderModalComponent, PopoverComponent: PopoverComponent, TableComponent: TableComponent, DeleteButtonComponent: DeleteButtonComponent, LoadingComponent: LoadingComponent, ChartBuilderInputRowContainer: ChartBuilderInputRowContainer, ChartBuilderInputColumnContainer: ChartBuilderInputColumnContainer, FormContainer: ChartBuilderFormContainer, hideDateRangeFilter: true, buttonLabel: !!reportId ? 'Save changes' : 'Add to dashboard', onClickChartElement: onClickChartElement, rowCount: numberOfRows, onPageChange: onPageChange, onSortChange: onSortChange, isLoading: tableLoading }))] }));
|
|
1741
|
+
: tempReport, rows: rows, columns: columns, pivot: pivot, query: activeQuery, showTableFormatOptions: showChartBuilderTableFormatOptions, showDateFieldOptions: isAdminEnabled, showAccessControlOptions: isAdminEnabled, isAdmin: isAdminEnabled, title: reportId ? 'Save changes' : 'Add to dashboard', isHorizontalView: true, isOpen: isChartBuilderOpen, setIsOpen: setIsChartBuilderOpen, onAddToDashboardComplete: reportId ? onSubmitEditReport : onSubmitCreateReport, destinationDashboard: destinationDashboard, organizationName: organizationName, pivotData: pivotData, initialUniqueValues: uniqueValues[currentTable], pivotRecommendationsEnabled: pivotRecommendationsEnabled && overrideRecommendations, SelectComponent: SelectComponent, TextInputComponent: TextInputComponent, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, HeaderComponent: HeaderComponent, SubHeaderComponent: SubHeaderComponent, LabelComponent: LabelComponent, TextComponent: TextComponent, CardComponent: CardComponent, ModalComponent: ChartBuilderModalComponent, PopoverComponent: PopoverComponent, TableComponent: TableComponent, DeleteButtonComponent: DeleteButtonComponent, LoadingComponent: LoadingComponent, ChartBuilderInputRowContainer: ChartBuilderInputRowContainer, ChartBuilderInputColumnContainer: ChartBuilderInputColumnContainer, FormContainer: ChartBuilderFormContainer, hideDateRangeFilter: true, buttonLabel: !!reportId ? 'Save changes' : 'Add to dashboard', onClickChartElement: onClickChartElement, rowCount: numberOfRows, onPageChange: onPageChange, onSortChange: onSortChange, isLoading: tableLoading, isEditingMode: true }))] }));
|
|
1805
1742
|
}
|
|
1806
1743
|
exports.default = ReportBuilder;
|