@quillsql/react 2.13.47 → 2.13.49
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 +2 -2
- package/dist/cjs/Chart.d.ts.map +1 -1
- package/dist/cjs/Chart.js +56 -49
- package/dist/cjs/ChartBuilder.d.ts +3 -2
- package/dist/cjs/ChartBuilder.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.js +172 -138
- package/dist/cjs/ChartEditor.d.ts +2 -2
- package/dist/cjs/ChartEditor.d.ts.map +1 -1
- package/dist/cjs/ChartEditor.js +5 -2
- package/dist/cjs/Context.d.ts +121 -41
- package/dist/cjs/Context.d.ts.map +1 -1
- package/dist/cjs/Context.js +449 -261
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/Dashboard.js +26 -25
- package/dist/cjs/DateRangePicker/QuillDateRangePicker.js +0 -3
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.d.ts +24 -10
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.js +472 -96
- package/dist/cjs/QuillProvider.d.ts +3 -1
- package/dist/cjs/QuillProvider.d.ts.map +1 -1
- package/dist/cjs/QuillProvider.js +2 -2
- package/dist/cjs/ReportBuilder.d.ts.map +1 -1
- package/dist/cjs/ReportBuilder.js +25 -14
- package/dist/cjs/SQLEditor.d.ts +1 -1
- package/dist/cjs/SQLEditor.d.ts.map +1 -1
- package/dist/cjs/SQLEditor.js +51 -16
- package/dist/cjs/Table.d.ts.map +1 -1
- package/dist/cjs/Table.js +85 -14
- package/dist/cjs/assets/ExclamationFilledIcon.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarChart.js +2 -1
- package/dist/cjs/components/Chart/CustomReferenceLine.d.ts +1 -1
- package/dist/cjs/components/Chart/CustomReferenceLine.d.ts.map +1 -1
- package/dist/cjs/components/Chart/CustomReferenceLine.js +7 -6
- package/dist/cjs/components/Chart/GaugeChart.d.ts +1 -1
- package/dist/cjs/components/Chart/GaugeChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/GaugeChart.js +63 -36
- package/dist/cjs/components/Chart/InternalChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/InternalChart.js +30 -33
- package/dist/cjs/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/LineChart.js +3 -1
- package/dist/cjs/components/Chart/MapChart.d.ts +3 -3
- package/dist/cjs/components/Chart/MapChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/MapChart.js +62 -34
- package/dist/cjs/components/Chart/PieChart.d.ts +3 -1
- package/dist/cjs/components/Chart/PieChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/PieChart.js +80 -39
- package/dist/cjs/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DashboardFilter.js +4 -20
- package/dist/cjs/components/Dashboard/DashboardTemplate.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DashboardTemplate.js +2 -1
- package/dist/cjs/components/Dashboard/DataLoader.d.ts +4 -4
- package/dist/cjs/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DataLoader.js +101 -65
- package/dist/cjs/components/Dashboard/MetricComponent.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/MetricComponent.js +2 -2
- package/dist/cjs/components/Dashboard/util.d.ts +1 -1
- package/dist/cjs/components/Dashboard/util.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/util.js +7 -6
- package/dist/cjs/components/QuillMultiSelectSectionList.d.ts.map +1 -1
- package/dist/cjs/components/QuillMultiSelectSectionList.js +32 -22
- package/dist/cjs/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/cjs/components/QuillMultiSelectWithCombo.js +186 -159
- package/dist/cjs/components/QuillSelect.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelect.js +83 -75
- package/dist/cjs/components/QuillSelectWithCombo.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelectWithCombo.js +18 -11
- package/dist/cjs/components/QuillTable.d.ts.map +1 -1
- package/dist/cjs/components/QuillTable.js +59 -61
- package/dist/cjs/components/ReportBuilder/FilterStack.d.ts +2 -1
- package/dist/cjs/components/ReportBuilder/FilterStack.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/FilterStack.js +3 -4
- package/dist/cjs/components/ReportBuilder/ui.d.ts +2 -2
- package/dist/cjs/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ui.js +4 -7
- package/dist/cjs/components/UiComponents.d.ts +1 -1
- package/dist/cjs/hooks/useAskQuill.d.ts.map +1 -1
- package/dist/cjs/hooks/useAskQuill.js +5 -1
- package/dist/cjs/hooks/useDashboard.d.ts +2 -2
- package/dist/cjs/hooks/useDashboard.d.ts.map +1 -1
- package/dist/cjs/hooks/useDashboard.js +160 -69
- package/dist/cjs/hooks/useExport.d.ts.map +1 -1
- package/dist/cjs/hooks/useExport.js +29 -15
- package/dist/cjs/hooks/useOnClickOutside.d.ts.map +1 -1
- package/dist/cjs/hooks/useQuill.d.ts +1 -0
- package/dist/cjs/hooks/useQuill.d.ts.map +1 -1
- package/dist/cjs/hooks/useQuill.js +22 -12
- package/dist/cjs/hooks/useReport.d.ts +2 -2
- package/dist/cjs/hooks/useReport.d.ts.map +1 -1
- package/dist/cjs/hooks/useReport.js +3 -4
- package/dist/cjs/hooks/useVirtualTables.d.ts.map +1 -1
- package/dist/cjs/hooks/useVirtualTables.js +16 -22
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts +2 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.js +19 -7
- package/dist/cjs/models/Client.d.ts +0 -1
- package/dist/cjs/models/Client.d.ts.map +1 -1
- package/dist/cjs/models/Data.d.ts +20 -0
- package/dist/cjs/models/Data.d.ts.map +1 -0
- package/dist/cjs/models/Data.js +2 -0
- package/dist/cjs/models/Filter.d.ts +42 -4
- package/dist/cjs/models/Filter.d.ts.map +1 -1
- package/dist/cjs/models/Pivot.d.ts.map +1 -1
- package/dist/cjs/utils/astProcessing.d.ts +3 -2
- package/dist/cjs/utils/astProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/astProcessing.js +28 -37
- package/dist/cjs/utils/client.d.ts +3 -2
- package/dist/cjs/utils/client.d.ts.map +1 -1
- package/dist/cjs/utils/client.js +38 -39
- package/dist/cjs/utils/columnProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/columnProcessing.js +14 -3
- package/dist/cjs/utils/constants.d.ts +1 -0
- package/dist/cjs/utils/constants.d.ts.map +1 -1
- package/dist/cjs/utils/constants.js +2 -1
- package/dist/cjs/utils/dashboard.d.ts +3 -2
- package/dist/cjs/utils/dashboard.d.ts.map +1 -1
- package/dist/cjs/utils/dashboard.js +30 -12
- package/dist/cjs/utils/dataFetcher.d.ts +8 -5
- package/dist/cjs/utils/dataFetcher.d.ts.map +1 -1
- package/dist/cjs/utils/dataFetcher.js +189 -65
- package/dist/cjs/utils/filterProcessing.d.ts +2 -1
- package/dist/cjs/utils/filterProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/filterProcessing.js +24 -38
- package/dist/cjs/utils/getDomain.d.ts.map +1 -1
- package/dist/cjs/utils/paginationProcessing.d.ts +1 -0
- package/dist/cjs/utils/paginationProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/paginationProcessing.js +6 -1
- package/dist/cjs/utils/pivotConstructor.d.ts +2 -1
- package/dist/cjs/utils/pivotConstructor.d.ts.map +1 -1
- package/dist/cjs/utils/pivotConstructor.js +15 -9
- package/dist/cjs/utils/pivotProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/pivotProcessing.js +3 -5
- package/dist/cjs/utils/queryConstructor.js +1 -1
- package/dist/cjs/utils/report.d.ts +10 -7
- package/dist/cjs/utils/report.d.ts.map +1 -1
- package/dist/cjs/utils/report.js +52 -60
- package/dist/cjs/utils/schema.d.ts +4 -3
- package/dist/cjs/utils/schema.d.ts.map +1 -1
- package/dist/cjs/utils/schema.js +30 -44
- package/dist/cjs/utils/tableProcessing.d.ts +16 -10
- package/dist/cjs/utils/tableProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/tableProcessing.js +92 -90
- package/dist/cjs/utils/textProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/textProcessing.js +2 -1
- package/dist/cjs/utils/ui.d.ts.map +1 -1
- package/dist/esm/Chart.d.ts +2 -2
- package/dist/esm/Chart.d.ts.map +1 -1
- package/dist/esm/Chart.js +60 -53
- package/dist/esm/ChartBuilder.d.ts +3 -2
- package/dist/esm/ChartBuilder.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.js +173 -139
- package/dist/esm/ChartEditor.d.ts +2 -2
- package/dist/esm/ChartEditor.d.ts.map +1 -1
- package/dist/esm/ChartEditor.js +6 -3
- package/dist/esm/Context.d.ts +121 -41
- package/dist/esm/Context.d.ts.map +1 -1
- package/dist/esm/Context.js +450 -262
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/Dashboard.js +28 -27
- package/dist/esm/DateRangePicker/QuillDateRangePicker.js +0 -3
- package/dist/esm/DateRangePicker/dateRangePickerUtils.d.ts +24 -10
- package/dist/esm/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/esm/DateRangePicker/dateRangePickerUtils.js +471 -95
- package/dist/esm/QuillProvider.d.ts +3 -1
- package/dist/esm/QuillProvider.d.ts.map +1 -1
- package/dist/esm/QuillProvider.js +2 -2
- package/dist/esm/ReportBuilder.d.ts.map +1 -1
- package/dist/esm/ReportBuilder.js +28 -17
- package/dist/esm/SQLEditor.d.ts +1 -1
- package/dist/esm/SQLEditor.d.ts.map +1 -1
- package/dist/esm/SQLEditor.js +54 -19
- package/dist/esm/Table.d.ts.map +1 -1
- package/dist/esm/Table.js +88 -17
- package/dist/esm/assets/ExclamationFilledIcon.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarChart.js +2 -1
- package/dist/esm/components/Chart/CustomReferenceLine.d.ts +1 -1
- package/dist/esm/components/Chart/CustomReferenceLine.d.ts.map +1 -1
- package/dist/esm/components/Chart/CustomReferenceLine.js +8 -7
- package/dist/esm/components/Chart/GaugeChart.d.ts +1 -1
- package/dist/esm/components/Chart/GaugeChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/GaugeChart.js +65 -38
- package/dist/esm/components/Chart/InternalChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/InternalChart.js +32 -35
- package/dist/esm/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/LineChart.js +3 -1
- package/dist/esm/components/Chart/MapChart.d.ts +3 -3
- package/dist/esm/components/Chart/MapChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/MapChart.js +67 -39
- package/dist/esm/components/Chart/PieChart.d.ts +3 -1
- package/dist/esm/components/Chart/PieChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/PieChart.js +80 -39
- package/dist/esm/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DashboardFilter.js +5 -21
- package/dist/esm/components/Dashboard/DashboardSection.js +2 -2
- package/dist/esm/components/Dashboard/DashboardTemplate.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DashboardTemplate.js +3 -2
- package/dist/esm/components/Dashboard/DataLoader.d.ts +4 -4
- package/dist/esm/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DataLoader.js +102 -66
- package/dist/esm/components/Dashboard/MetricComponent.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/MetricComponent.js +2 -2
- package/dist/esm/components/Dashboard/util.d.ts +1 -1
- package/dist/esm/components/Dashboard/util.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/util.js +8 -7
- package/dist/esm/components/QuillMultiSelectSectionList.d.ts.map +1 -1
- package/dist/esm/components/QuillMultiSelectSectionList.js +32 -22
- package/dist/esm/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/esm/components/QuillMultiSelectWithCombo.js +187 -160
- package/dist/esm/components/QuillSelect.d.ts.map +1 -1
- package/dist/esm/components/QuillSelect.js +85 -77
- package/dist/esm/components/QuillSelectWithCombo.d.ts.map +1 -1
- package/dist/esm/components/QuillSelectWithCombo.js +18 -11
- package/dist/esm/components/QuillTable.d.ts.map +1 -1
- package/dist/esm/components/QuillTable.js +59 -61
- package/dist/esm/components/ReportBuilder/FilterStack.d.ts +2 -1
- package/dist/esm/components/ReportBuilder/FilterStack.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/FilterStack.js +3 -4
- package/dist/esm/components/ReportBuilder/ui.d.ts +2 -2
- package/dist/esm/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ui.js +4 -7
- package/dist/esm/components/UiComponents.d.ts +1 -1
- package/dist/esm/hooks/useAskQuill.d.ts.map +1 -1
- package/dist/esm/hooks/useAskQuill.js +6 -2
- package/dist/esm/hooks/useDashboard.d.ts +2 -2
- package/dist/esm/hooks/useDashboard.d.ts.map +1 -1
- package/dist/esm/hooks/useDashboard.js +162 -71
- package/dist/esm/hooks/useExport.d.ts.map +1 -1
- package/dist/esm/hooks/useExport.js +31 -17
- package/dist/esm/hooks/useOnClickOutside.d.ts.map +1 -1
- package/dist/esm/hooks/useQuill.d.ts +1 -0
- package/dist/esm/hooks/useQuill.d.ts.map +1 -1
- package/dist/esm/hooks/useQuill.js +23 -13
- package/dist/esm/hooks/useReport.d.ts +2 -2
- package/dist/esm/hooks/useReport.d.ts.map +1 -1
- package/dist/esm/hooks/useReport.js +4 -5
- package/dist/esm/hooks/useVirtualTables.d.ts.map +1 -1
- package/dist/esm/hooks/useVirtualTables.js +17 -23
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts +2 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.js +20 -8
- package/dist/esm/models/Client.d.ts +0 -1
- package/dist/esm/models/Client.d.ts.map +1 -1
- package/dist/esm/models/Data.d.ts +20 -0
- package/dist/esm/models/Data.d.ts.map +1 -0
- package/dist/esm/models/Data.js +1 -0
- package/dist/esm/models/Filter.d.ts +42 -4
- package/dist/esm/models/Filter.d.ts.map +1 -1
- package/dist/esm/models/Pivot.d.ts.map +1 -1
- package/dist/esm/utils/astProcessing.d.ts +3 -2
- package/dist/esm/utils/astProcessing.d.ts.map +1 -1
- package/dist/esm/utils/astProcessing.js +28 -37
- package/dist/esm/utils/client.d.ts +3 -2
- package/dist/esm/utils/client.d.ts.map +1 -1
- package/dist/esm/utils/client.js +38 -39
- package/dist/esm/utils/columnProcessing.d.ts.map +1 -1
- package/dist/esm/utils/columnProcessing.js +14 -3
- package/dist/esm/utils/constants.d.ts +1 -0
- package/dist/esm/utils/constants.d.ts.map +1 -1
- package/dist/esm/utils/constants.js +1 -0
- package/dist/esm/utils/dashboard.d.ts +3 -2
- package/dist/esm/utils/dashboard.d.ts.map +1 -1
- package/dist/esm/utils/dashboard.js +31 -13
- package/dist/esm/utils/dataFetcher.d.ts +8 -5
- package/dist/esm/utils/dataFetcher.d.ts.map +1 -1
- package/dist/esm/utils/dataFetcher.js +187 -65
- package/dist/esm/utils/filterProcessing.d.ts +2 -1
- package/dist/esm/utils/filterProcessing.d.ts.map +1 -1
- package/dist/esm/utils/filterProcessing.js +25 -39
- package/dist/esm/utils/getDomain.d.ts.map +1 -1
- package/dist/esm/utils/paginationProcessing.d.ts +1 -0
- package/dist/esm/utils/paginationProcessing.d.ts.map +1 -1
- package/dist/esm/utils/paginationProcessing.js +5 -0
- package/dist/esm/utils/pivotConstructor.d.ts +2 -1
- package/dist/esm/utils/pivotConstructor.d.ts.map +1 -1
- package/dist/esm/utils/pivotConstructor.js +16 -10
- package/dist/esm/utils/pivotProcessing.d.ts.map +1 -1
- package/dist/esm/utils/pivotProcessing.js +5 -7
- package/dist/esm/utils/queryConstructor.js +1 -1
- package/dist/esm/utils/report.d.ts +10 -7
- package/dist/esm/utils/report.d.ts.map +1 -1
- package/dist/esm/utils/report.js +53 -61
- package/dist/esm/utils/schema.d.ts +4 -3
- package/dist/esm/utils/schema.d.ts.map +1 -1
- package/dist/esm/utils/schema.js +30 -44
- package/dist/esm/utils/tableProcessing.d.ts +16 -10
- package/dist/esm/utils/tableProcessing.d.ts.map +1 -1
- package/dist/esm/utils/tableProcessing.js +94 -92
- package/dist/esm/utils/textProcessing.d.ts.map +1 -1
- package/dist/esm/utils/textProcessing.js +2 -1
- package/dist/esm/utils/ui.d.ts.map +1 -1
- package/package.json +2 -1
package/dist/cjs/Context.js
CHANGED
|
@@ -3,18 +3,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ContextProvider = exports.TenantContext = exports.DashboardFiltersContext = exports.ReportFiltersContext = exports.ReportsContext = exports.DashboardConfigContext = exports.DashboardContext = exports.ClientContext = exports.ThemeContext = exports.SchemaDataContext = void 0;
|
|
6
|
+
exports.ContextProvider = exports.FetchContext = exports.TenantContext = exports.DashboardFiltersContext = exports.ReportFiltersContext = exports.ReportsContext = exports.DashboardConfigContext = exports.DashboardContext = exports.ClientContext = exports.ThemeContext = exports.SchemaDataContext = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
9
|
const react_1 = require("react");
|
|
9
|
-
const
|
|
10
|
-
const client_1 = require("./utils/client");
|
|
10
|
+
const dateRangePickerUtils_1 = require("./DateRangePicker/dateRangePickerUtils");
|
|
11
11
|
const Filter_1 = require("./models/Filter");
|
|
12
|
+
const client_1 = require("./utils/client");
|
|
12
13
|
const dashboard_1 = require("./utils/dashboard");
|
|
13
|
-
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
14
|
-
const dateRangePickerUtils_1 = require("./DateRangePicker/dateRangePickerUtils");
|
|
15
|
-
const report_1 = require("./utils/report");
|
|
16
|
-
const filterProcessing_1 = require("./utils/filterProcessing");
|
|
17
14
|
const dataFetcher_1 = require("./utils/dataFetcher");
|
|
15
|
+
const filterProcessing_1 = require("./utils/filterProcessing");
|
|
16
|
+
const report_1 = require("./utils/report");
|
|
17
|
+
const schema_1 = require("./utils/schema");
|
|
18
18
|
const dummySetter = () => { };
|
|
19
19
|
exports.SchemaDataContext = (0, react_1.createContext)([
|
|
20
20
|
{
|
|
@@ -182,6 +182,8 @@ const reportsReducer = (state = {}, action) => {
|
|
|
182
182
|
...action.data,
|
|
183
183
|
},
|
|
184
184
|
};
|
|
185
|
+
case 'CLEAR_REPORTS':
|
|
186
|
+
return {};
|
|
185
187
|
default:
|
|
186
188
|
return state;
|
|
187
189
|
}
|
|
@@ -191,6 +193,24 @@ exports.ReportsContext = (0, react_1.createContext)({
|
|
|
191
193
|
reportsDispatch: dummySetter,
|
|
192
194
|
fetchIndividualReport: async () => { },
|
|
193
195
|
});
|
|
196
|
+
const customReportFiltersReducer = (state, action) => {
|
|
197
|
+
switch (action.type) {
|
|
198
|
+
case 'ADD_CUSTOM_REPORT_FILTERS':
|
|
199
|
+
if (!action.data) {
|
|
200
|
+
const newState = { ...state };
|
|
201
|
+
delete newState[action.reportId];
|
|
202
|
+
return newState;
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
...state,
|
|
206
|
+
[action.reportId]: action.data,
|
|
207
|
+
};
|
|
208
|
+
case 'DELETE_CUSTOM_REPORT_FILTERS':
|
|
209
|
+
return Object.fromEntries(Object.entries(state).filter(([key]) => key !== action.reportId));
|
|
210
|
+
default:
|
|
211
|
+
return state;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
194
214
|
const reportFiltersReducer = (state = {}, action) => {
|
|
195
215
|
switch (action.type) {
|
|
196
216
|
case 'ADD_REPORT_FILTERS':
|
|
@@ -230,10 +250,30 @@ const reportFiltersReducer = (state = {}, action) => {
|
|
|
230
250
|
};
|
|
231
251
|
exports.ReportFiltersContext = (0, react_1.createContext)({
|
|
232
252
|
reportFilters: {},
|
|
253
|
+
customReportFilters: {},
|
|
233
254
|
reportFiltersDispatch: dummySetter,
|
|
255
|
+
customReportFiltersDispatch: dummySetter,
|
|
234
256
|
loadFiltersForReport: async () => { },
|
|
235
257
|
abortLoadingFilters: () => { },
|
|
236
258
|
});
|
|
259
|
+
const customDashboardFiltersReducer = (state, action) => {
|
|
260
|
+
switch (action.type) {
|
|
261
|
+
case 'ADD_CUSTOM_DASHBOARD_FILTERS':
|
|
262
|
+
if (!action.data) {
|
|
263
|
+
const newState = { ...state };
|
|
264
|
+
delete newState[action.dashboardName];
|
|
265
|
+
return newState;
|
|
266
|
+
}
|
|
267
|
+
return {
|
|
268
|
+
...state,
|
|
269
|
+
[action.dashboardName]: action.data,
|
|
270
|
+
};
|
|
271
|
+
case 'DELETE_CUSTOM_DASHBOARD_FILTERS':
|
|
272
|
+
return Object.fromEntries(Object.entries(state).filter(([key]) => key !== action.dashboardName));
|
|
273
|
+
default:
|
|
274
|
+
return state;
|
|
275
|
+
}
|
|
276
|
+
};
|
|
237
277
|
const dashboardFiltersReducer = (state, action) => {
|
|
238
278
|
switch (action.type) {
|
|
239
279
|
case 'SET_INITIAL_DASHBOARD_FILTERS':
|
|
@@ -273,12 +313,18 @@ const dashboardFiltersReducer = (state, action) => {
|
|
|
273
313
|
};
|
|
274
314
|
exports.DashboardFiltersContext = (0, react_1.createContext)({
|
|
275
315
|
dashboardFilters: {},
|
|
316
|
+
dashboardCustomFilters: {},
|
|
276
317
|
dispatch: dummySetter,
|
|
318
|
+
customFilterDispatch: dummySetter,
|
|
277
319
|
loadFiltersForDashboard: async () => { },
|
|
278
320
|
});
|
|
279
321
|
exports.TenantContext = (0, react_1.createContext)({});
|
|
322
|
+
exports.FetchContext = (0, react_1.createContext)({
|
|
323
|
+
getToken: async () => '',
|
|
324
|
+
quillFetchWithToken: async () => ({ data: null }),
|
|
325
|
+
});
|
|
280
326
|
// TODO: track errors per dashboard in the same way as loading state
|
|
281
|
-
const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, queryHeaders, withCredentials, tenants, flags, }) => {
|
|
327
|
+
const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, queryHeaders, withCredentials, tenants, flags, isAdmin, getAuthorizationToken = async () => '', }) => {
|
|
282
328
|
// get client from session storage
|
|
283
329
|
const [client, setClient] = (0, react_1.useState)(typeof window !== 'undefined' && sessionStorage
|
|
284
330
|
? JSON.parse(sessionStorage.getItem('quill-client') ?? 'null')
|
|
@@ -320,6 +366,8 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
320
366
|
const [dashboard, dispatch] = (0, react_1.useReducer)(dashboardReducer, {});
|
|
321
367
|
const [dashboardConfig, dashboardConfigDispatch] = (0, react_1.useReducer)(dashboardConfigReducer, {});
|
|
322
368
|
const [dashboardFilters, dashboardFiltersDispatch] = (0, react_1.useReducer)(dashboardFiltersReducer, {});
|
|
369
|
+
const [dashboardCustomFilters, customFilterDispatch] = (0, react_1.useReducer)(customDashboardFiltersReducer, {});
|
|
370
|
+
const [customReportFilters, customReportFiltersDispatch] = (0, react_1.useReducer)(customReportFiltersReducer, {});
|
|
323
371
|
const filterOptionsAbortControllers = (0, react_1.useRef)(new Set());
|
|
324
372
|
const [reportFilters, reportFiltersDispatch] = (0, react_1.useReducer)(reportFiltersReducer, {});
|
|
325
373
|
const reportFilterOptionsAbortControllers = (0, react_1.useRef)({});
|
|
@@ -327,6 +375,8 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
327
375
|
const reportsAbortControllers = (0, react_1.useRef)({});
|
|
328
376
|
const fetchSchemaAbortController = (0, react_1.useRef)(null);
|
|
329
377
|
const fetchSchemaProcessId = (0, react_1.useRef)(0);
|
|
378
|
+
const currentTenant = (0, react_1.useRef)(null);
|
|
379
|
+
const currentPublicKey = (0, react_1.useRef)(null);
|
|
330
380
|
// SETS INITIAL THEME
|
|
331
381
|
(0, react_1.useEffect)(() => {
|
|
332
382
|
if (!theme) {
|
|
@@ -354,7 +404,7 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
354
404
|
// id: reportId,
|
|
355
405
|
// });
|
|
356
406
|
}
|
|
357
|
-
async function loadFiltersForReport(reportId, initiator, filters, updatedFilterLabel, customFilters,
|
|
407
|
+
async function loadFiltersForReport(reportId, initiator, filters, updatedFilterLabel, customFilters, dashboardName) {
|
|
358
408
|
// Abort all previous fetch requests
|
|
359
409
|
reportFilterOptionsAbortControllers.current[reportId]?.requests.forEach((controller) => controller.abort());
|
|
360
410
|
reportFilterOptionsAbortControllers.current[reportId] = {
|
|
@@ -399,56 +449,54 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
399
449
|
const filterOptionsAbortController = new AbortController();
|
|
400
450
|
reportFilterOptionsAbortControllers.current[reportId]?.requests.add(filterOptionsAbortController);
|
|
401
451
|
try {
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
452
|
+
const result = await (0, dataFetcher_1.quillFetch)({
|
|
453
|
+
client: {
|
|
454
|
+
clientId: publicKey,
|
|
455
|
+
queryEndpoint,
|
|
456
|
+
queryHeaders,
|
|
457
|
+
withCredentials: !!withCredentials,
|
|
407
458
|
},
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
459
|
+
task: 'filter-options',
|
|
460
|
+
metadata: {
|
|
461
|
+
clientId: publicKey,
|
|
462
|
+
publicKey: publicKey,
|
|
463
|
+
reportId: dashboardName ? undefined : reportId,
|
|
464
|
+
name: dashboardName,
|
|
465
|
+
useNewNodeSql: true,
|
|
466
|
+
filter: {
|
|
467
|
+
...filter,
|
|
468
|
+
query: undefined,
|
|
469
|
+
options: undefined,
|
|
470
|
+
},
|
|
471
|
+
appliedFilters: filters
|
|
472
|
+
.filter((f) => f.label !== filter.label)
|
|
473
|
+
.map((f) => ({
|
|
474
|
+
...f,
|
|
475
|
+
query: undefined,
|
|
476
|
+
options: undefined,
|
|
477
|
+
})),
|
|
478
|
+
customFilters: customFilters?.filter((f) => f.filterType !== Filter_1.InternalFilterType.DateCustomFilter &&
|
|
479
|
+
f.filterType !== Filter_1.InternalFilterType.DateFilter &&
|
|
480
|
+
f.filterType !== Filter_1.InternalFilterType.DateComparisonFilter),
|
|
481
|
+
tenants,
|
|
482
|
+
},
|
|
483
|
+
abortSignal: filterOptionsAbortController?.signal,
|
|
484
|
+
getToken: getAuthorizationToken,
|
|
485
|
+
});
|
|
486
|
+
const filterOptions = result.data?.filters[0]?.options ?? [];
|
|
487
|
+
if (!filterOptionsAbortController.signal.aborted) {
|
|
488
|
+
reportFiltersDispatch({
|
|
489
|
+
type: 'UPDATE_REPORT_FILTER',
|
|
490
|
+
id: reportId,
|
|
491
|
+
data: {
|
|
416
492
|
filter: {
|
|
417
493
|
...filter,
|
|
418
|
-
options:
|
|
494
|
+
options: filterOptions,
|
|
419
495
|
},
|
|
420
|
-
|
|
421
|
-
.filter((f) => f.label !== filter.label)
|
|
422
|
-
.map((f) => ({
|
|
423
|
-
...f,
|
|
424
|
-
query: undefined,
|
|
425
|
-
options: undefined,
|
|
426
|
-
})),
|
|
427
|
-
customFilters: customFilters?.filter((f) => f.filterType !== Filter_1.InternalFilterType.DateCustomFilter &&
|
|
428
|
-
f.filterType !== Filter_1.InternalFilterType.DateFilter &&
|
|
429
|
-
f.filterType !== Filter_1.InternalFilterType.DateComparisonFilter),
|
|
430
|
-
tenants,
|
|
496
|
+
loading: false,
|
|
431
497
|
},
|
|
432
|
-
})
|
|
433
|
-
|
|
434
|
-
credentials: withCredentials ? 'include' : 'omit',
|
|
435
|
-
});
|
|
436
|
-
return response.json().then((result) => {
|
|
437
|
-
const filterOptions = result.data?.filters[0]?.options ?? [];
|
|
438
|
-
if (reportFilters[reportId]?.[filter.label]) {
|
|
439
|
-
reportFiltersDispatch({
|
|
440
|
-
type: 'UPDATE_REPORT_FILTER',
|
|
441
|
-
id: reportId,
|
|
442
|
-
data: {
|
|
443
|
-
filter: {
|
|
444
|
-
...filter,
|
|
445
|
-
options: filterOptions,
|
|
446
|
-
},
|
|
447
|
-
loading: false,
|
|
448
|
-
},
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
|
-
});
|
|
498
|
+
});
|
|
499
|
+
}
|
|
452
500
|
}
|
|
453
501
|
catch (error) {
|
|
454
502
|
if (error instanceof Error && error.name === 'AbortError') {
|
|
@@ -471,7 +519,7 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
471
519
|
delete reportFilterOptionsAbortControllers.current[reportId];
|
|
472
520
|
}
|
|
473
521
|
}
|
|
474
|
-
async function fetchIndividualReport({ reportId, initiator, fetchRows = true, dashboardFilters, customFilters, additionalProcessing, dateBucket, reportAbortController, customFields,
|
|
522
|
+
async function fetchIndividualReport({ reportId, initiator, fetchRows = true, dashboardFilters, customFilters, additionalProcessing, dateBucket, reportAbortController, customFields, propagateChanges, }) {
|
|
475
523
|
if (!populatedClient) {
|
|
476
524
|
return;
|
|
477
525
|
}
|
|
@@ -479,7 +527,8 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
479
527
|
const currentRequest = reportsAbortControllers.current[reportId];
|
|
480
528
|
if (currentRequest) {
|
|
481
529
|
// Chart requests override useQuill and useExport requests
|
|
482
|
-
if (initiator === 'Chart'
|
|
530
|
+
if (initiator === 'Chart' ||
|
|
531
|
+
(currentRequest.initiator !== 'Chart' && initiator === 'Table')) {
|
|
483
532
|
currentRequest.request.abort();
|
|
484
533
|
}
|
|
485
534
|
else {
|
|
@@ -492,55 +541,33 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
492
541
|
request: abortController,
|
|
493
542
|
};
|
|
494
543
|
try {
|
|
495
|
-
const
|
|
544
|
+
const resp = await (0, dataFetcher_1.quillFetch)({
|
|
545
|
+
client: {
|
|
546
|
+
clientId: publicKey,
|
|
547
|
+
queryEndpoint,
|
|
548
|
+
queryHeaders,
|
|
549
|
+
withCredentials: !!withCredentials,
|
|
550
|
+
},
|
|
551
|
+
task: fetchRows ? 'report' : 'report-info',
|
|
496
552
|
metadata: {
|
|
497
553
|
reportId,
|
|
498
|
-
dashboardItemId: reportId,
|
|
499
554
|
clientId: populatedClient.publicKey,
|
|
500
|
-
task: 'report',
|
|
501
|
-
databaseType: populatedClient.databaseType,
|
|
502
|
-
filters: filters.map((filter) => ({ ...filter, options: undefined })),
|
|
503
|
-
additionalProcessing,
|
|
504
555
|
useNewNodeSql: true,
|
|
505
|
-
|
|
556
|
+
filters: filters?.map((f) => ({ ...f, options: undefined })),
|
|
557
|
+
additionalProcessing,
|
|
558
|
+
dateBucket,
|
|
559
|
+
databaseType: populatedClient.databaseType,
|
|
506
560
|
tenants,
|
|
507
561
|
flags,
|
|
508
562
|
customFields,
|
|
509
563
|
},
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
? await (0, dataFetcher_1.getData)(populatedClient, 'itempost', 'omit', hostedBody, cloudBody, 'POST', 'fetch-data', abortController.signal)
|
|
518
|
-
: await fetch(`${queryEndpoint}`, {
|
|
519
|
-
method: 'POST',
|
|
520
|
-
headers: {
|
|
521
|
-
'Content-Type': 'application/json',
|
|
522
|
-
...queryHeaders,
|
|
523
|
-
},
|
|
524
|
-
body: JSON.stringify({
|
|
525
|
-
metadata: {
|
|
526
|
-
task: fetchRows ? 'report' : 'report-info',
|
|
527
|
-
reportId,
|
|
528
|
-
clientId: populatedClient.publicKey,
|
|
529
|
-
useNewNodeSql: true,
|
|
530
|
-
filters: filters?.map((f) => ({ ...f, options: undefined })),
|
|
531
|
-
getDefaultDashboardFilters: !filters.length,
|
|
532
|
-
additionalProcessing,
|
|
533
|
-
dateBucket,
|
|
534
|
-
databaseType: populatedClient.databaseType,
|
|
535
|
-
tenants,
|
|
536
|
-
flags,
|
|
537
|
-
customFields,
|
|
538
|
-
},
|
|
539
|
-
}),
|
|
540
|
-
signal: abortController.signal,
|
|
541
|
-
credentials: withCredentials ? 'include' : 'omit',
|
|
542
|
-
});
|
|
543
|
-
const results = fetchRows ? resp : await resp.json();
|
|
564
|
+
abortSignal: abortController.signal,
|
|
565
|
+
getToken: getAuthorizationToken,
|
|
566
|
+
urlParameters: `caller=fetchReport&task=report`,
|
|
567
|
+
});
|
|
568
|
+
const results = fetchRows
|
|
569
|
+
? await (0, dataFetcher_1.parseFetchResponse)(populatedClient, 'report', resp, getAuthorizationToken)
|
|
570
|
+
: resp;
|
|
544
571
|
if (results.error) {
|
|
545
572
|
console.error('Error fetching report:', results.error);
|
|
546
573
|
return;
|
|
@@ -554,6 +581,7 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
554
581
|
dateBucket,
|
|
555
582
|
additionalProcessing,
|
|
556
583
|
customFields,
|
|
584
|
+
getToken: getAuthorizationToken,
|
|
557
585
|
});
|
|
558
586
|
reportsDispatch({
|
|
559
587
|
type: 'ADD_REPORT',
|
|
@@ -565,7 +593,7 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
565
593
|
},
|
|
566
594
|
});
|
|
567
595
|
// If the report matches the active dashboard, update the dashboard state
|
|
568
|
-
if (
|
|
596
|
+
if (propagateChanges) {
|
|
569
597
|
if (dashboard[report.dashboardName]) {
|
|
570
598
|
dispatch({
|
|
571
599
|
type: 'UPDATE_DASHBOARD_ITEM',
|
|
@@ -583,7 +611,26 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
583
611
|
const returnedFilters = !fetchRows
|
|
584
612
|
? results.data.filters
|
|
585
613
|
: results.filters;
|
|
586
|
-
|
|
614
|
+
let dateFilterTemplate = returnedFilters.find((f) => f.filterType === 'date_range');
|
|
615
|
+
if (dateFilterTemplate) {
|
|
616
|
+
dateFilterTemplate = {
|
|
617
|
+
...dateFilterTemplate,
|
|
618
|
+
presetOptions: dateFilterTemplate?.presetOptions?.map((preset) => ({
|
|
619
|
+
...preset,
|
|
620
|
+
loopStart: preset.loopStart
|
|
621
|
+
? new Date(preset.loopStart)
|
|
622
|
+
: undefined,
|
|
623
|
+
loopEnd: preset.loopEnd ? new Date(preset.loopEnd) : undefined,
|
|
624
|
+
})),
|
|
625
|
+
defaultPresetRanges: dateFilterTemplate?.defaultPresetRanges?.map((preset) => ({
|
|
626
|
+
...preset,
|
|
627
|
+
loopStart: preset.loopStart
|
|
628
|
+
? new Date(preset.loopStart)
|
|
629
|
+
: undefined,
|
|
630
|
+
loopEnd: preset.loopEnd ? new Date(preset.loopEnd) : undefined,
|
|
631
|
+
})),
|
|
632
|
+
};
|
|
633
|
+
}
|
|
587
634
|
const dateFilter = dateFilterTemplate
|
|
588
635
|
? (0, filterProcessing_1.createDefaultDateFilter)(dateFilterTemplate, [report], report.dashboardName)
|
|
589
636
|
: undefined;
|
|
@@ -592,14 +639,6 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
592
639
|
...(dateFilter ? [dateFilter] : []),
|
|
593
640
|
...stringFilters,
|
|
594
641
|
];
|
|
595
|
-
reportFiltersDispatch({
|
|
596
|
-
type: 'ADD_REPORT_FILTERS',
|
|
597
|
-
id: reportId,
|
|
598
|
-
data: allFilters.map((filter) => ({
|
|
599
|
-
filter,
|
|
600
|
-
loading: filter.filterType !== 'date_range',
|
|
601
|
-
})),
|
|
602
|
-
});
|
|
603
642
|
loadFiltersForReport(reportId, initiator, allFilters, undefined, customFilters);
|
|
604
643
|
}
|
|
605
644
|
}
|
|
@@ -659,64 +698,63 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
659
698
|
const filterOptionsAbortController = new AbortController();
|
|
660
699
|
filterOptionsAbortControllers.current.add(filterOptionsAbortController);
|
|
661
700
|
try {
|
|
662
|
-
const
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
701
|
+
const result = await (0, dataFetcher_1.quillFetch)({
|
|
702
|
+
client: {
|
|
703
|
+
clientId: publicKey,
|
|
704
|
+
queryEndpoint,
|
|
705
|
+
queryHeaders,
|
|
706
|
+
withCredentials: !!withCredentials,
|
|
667
707
|
},
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
filter
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
},
|
|
679
|
-
appliedFilters: filters
|
|
680
|
-
.filter((f) => f.label !== filter.label)
|
|
681
|
-
.map((f) => ({
|
|
682
|
-
...f,
|
|
683
|
-
query: undefined,
|
|
684
|
-
options: undefined,
|
|
685
|
-
})),
|
|
686
|
-
customFilters,
|
|
687
|
-
tenants: tenants,
|
|
708
|
+
task: 'filter-options',
|
|
709
|
+
metadata: {
|
|
710
|
+
clientId: publicKey,
|
|
711
|
+
publicKey,
|
|
712
|
+
name: dashboardName,
|
|
713
|
+
useNewNodeSql: true,
|
|
714
|
+
filter: {
|
|
715
|
+
...filter,
|
|
716
|
+
query: undefined,
|
|
717
|
+
options: undefined,
|
|
688
718
|
},
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
719
|
+
appliedFilters: filters
|
|
720
|
+
.filter((f) => f.label !== filter.label)
|
|
721
|
+
.map((f) => ({
|
|
722
|
+
...f,
|
|
723
|
+
query: undefined,
|
|
724
|
+
options: undefined,
|
|
725
|
+
})),
|
|
726
|
+
customFilters,
|
|
727
|
+
tenants,
|
|
728
|
+
},
|
|
729
|
+
abortSignal: filterOptionsAbortController?.signal,
|
|
730
|
+
getToken: getAuthorizationToken,
|
|
692
731
|
});
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
filter
|
|
701
|
-
|
|
702
|
-
options: filterOptions,
|
|
703
|
-
},
|
|
704
|
-
loading: false,
|
|
732
|
+
const filterOptions = result.data?.filters[0]?.options ?? [];
|
|
733
|
+
dashboardFiltersDispatch({
|
|
734
|
+
type: 'UPDATE_DASHBOARD_FILTER',
|
|
735
|
+
dashboardName,
|
|
736
|
+
filterName: filter.label,
|
|
737
|
+
data: {
|
|
738
|
+
filter: {
|
|
739
|
+
...filter,
|
|
740
|
+
options: filterOptions,
|
|
705
741
|
},
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
742
|
+
loading: false,
|
|
743
|
+
},
|
|
744
|
+
});
|
|
745
|
+
// Should we be updating the filters for all attached reports when the dashboard filters change?
|
|
746
|
+
reportFiltersDispatch({
|
|
747
|
+
type: 'UPDATE_REPORT_FILTER',
|
|
748
|
+
id: filter.label,
|
|
749
|
+
data: {
|
|
750
|
+
filter: {
|
|
751
|
+
...filter,
|
|
752
|
+
options: filterOptions,
|
|
753
|
+
},
|
|
754
|
+
loading: false,
|
|
755
|
+
},
|
|
719
756
|
});
|
|
757
|
+
return null;
|
|
720
758
|
}
|
|
721
759
|
catch (error) {
|
|
722
760
|
if (error instanceof Error && error.name === 'AbortError') {
|
|
@@ -739,6 +777,8 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
739
777
|
}));
|
|
740
778
|
}
|
|
741
779
|
async function loadDashboard(dashboardName, fetchFromServer = false, reportAction) {
|
|
780
|
+
if (!client)
|
|
781
|
+
return;
|
|
742
782
|
let curDashboardConfig = dashboardConfig[dashboardName]?.config;
|
|
743
783
|
if (!fetchFromServer && curDashboardConfig?.sections) {
|
|
744
784
|
if (reportAction?.action === 'delete') {
|
|
@@ -756,7 +796,6 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
756
796
|
});
|
|
757
797
|
dispatch({
|
|
758
798
|
type: 'REMOVE_DASHBOARD_ITEM',
|
|
759
|
-
dashboard: dashboardName,
|
|
760
799
|
id: reportAction.report.id,
|
|
761
800
|
});
|
|
762
801
|
}
|
|
@@ -773,12 +812,75 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
773
812
|
},
|
|
774
813
|
});
|
|
775
814
|
}
|
|
815
|
+
let newSectionOrder = curDashboardConfig.sectionOrder;
|
|
816
|
+
if (newSectionOrder) {
|
|
817
|
+
newSectionOrder = newSectionOrder.map((section) => {
|
|
818
|
+
if (section.section === report.section &&
|
|
819
|
+
!section.reportOrder.includes(report.id)) {
|
|
820
|
+
section.reportOrder.push(report.id);
|
|
821
|
+
}
|
|
822
|
+
else if (section.section !== report.section &&
|
|
823
|
+
section.reportOrder.includes(report.id)) {
|
|
824
|
+
section.reportOrder = section.reportOrder.filter((id) => id !== report.id);
|
|
825
|
+
}
|
|
826
|
+
return section;
|
|
827
|
+
});
|
|
828
|
+
const newSections = newSectionOrder.reduce((acc, section) => {
|
|
829
|
+
acc[section.section] = section.reportOrder
|
|
830
|
+
.map((id, index) => {
|
|
831
|
+
if (id === report.id) {
|
|
832
|
+
return { ...report, id: id, order: index };
|
|
833
|
+
}
|
|
834
|
+
return dashboard?.[dashboardName]?.[id]
|
|
835
|
+
? { ...dashboard[dashboardName][id], id: id, order: index }
|
|
836
|
+
: null;
|
|
837
|
+
})
|
|
838
|
+
.filter((r) => r);
|
|
839
|
+
return acc;
|
|
840
|
+
}, {});
|
|
841
|
+
dashboardConfigDispatch({
|
|
842
|
+
type: 'UPDATE_DASHBOARD',
|
|
843
|
+
id: dashboardName,
|
|
844
|
+
data: {
|
|
845
|
+
config: {
|
|
846
|
+
...curDashboardConfig,
|
|
847
|
+
sections: newSections,
|
|
848
|
+
sectionOrder: newSectionOrder?.map((section) => ({
|
|
849
|
+
...section,
|
|
850
|
+
_id: section._id ?? 'temp_section_id_' + Date.now().toString(),
|
|
851
|
+
})) ?? [],
|
|
852
|
+
},
|
|
853
|
+
loading: false,
|
|
854
|
+
},
|
|
855
|
+
});
|
|
856
|
+
if ((curDashboardConfig.sectionOrder?.find((section) => section.reportOrder?.includes(report?.id ?? ''))?.section ?? '') !== report.section) {
|
|
857
|
+
const body = {
|
|
858
|
+
task: 'set-section-order',
|
|
859
|
+
clientId: client?.clientId,
|
|
860
|
+
dashboardName,
|
|
861
|
+
sectionOrder: newSectionOrder,
|
|
862
|
+
};
|
|
863
|
+
try {
|
|
864
|
+
await (0, dataFetcher_1.quillFetch)({
|
|
865
|
+
client,
|
|
866
|
+
task: 'set-section-order',
|
|
867
|
+
metadata: body,
|
|
868
|
+
getToken: getAuthorizationToken,
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
catch (e) {
|
|
872
|
+
console.error(e);
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
if (reportAction?.action !== 'upsert') {
|
|
878
|
+
dashboardConfigDispatch({
|
|
879
|
+
type: 'UPDATE_DASHBOARD',
|
|
880
|
+
id: dashboardName,
|
|
881
|
+
data: { config: curDashboardConfig, loading: false },
|
|
882
|
+
});
|
|
776
883
|
}
|
|
777
|
-
dashboardConfigDispatch({
|
|
778
|
-
type: 'UPDATE_DASHBOARD',
|
|
779
|
-
id: dashboardName,
|
|
780
|
-
data: { config: curDashboardConfig, loading: false },
|
|
781
|
-
});
|
|
782
884
|
return curDashboardConfig;
|
|
783
885
|
}
|
|
784
886
|
if (!fetchFromServer &&
|
|
@@ -802,7 +904,7 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
802
904
|
id: dashboardName,
|
|
803
905
|
data: true,
|
|
804
906
|
});
|
|
805
|
-
const resp = await (0, dashboard_1.getDashboard)(dashboardName, populatedClient, tenants, flags);
|
|
907
|
+
const resp = await (0, dashboard_1.getDashboard)(dashboardName, populatedClient, getAuthorizationToken, tenants, flags);
|
|
806
908
|
// if dashboard has changed
|
|
807
909
|
if (!(0, fast_deep_equal_1.default)(resp, curDashboardConfig)) {
|
|
808
910
|
dashboardConfigDispatch({
|
|
@@ -850,6 +952,7 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
850
952
|
tenants,
|
|
851
953
|
caller,
|
|
852
954
|
abortSignal: fetchSchemaAbortController.current.signal,
|
|
955
|
+
getToken: getAuthorizationToken,
|
|
853
956
|
});
|
|
854
957
|
if (currentProcessId === fetchSchemaProcessId.current) {
|
|
855
958
|
setSchemaData({
|
|
@@ -883,74 +986,112 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
883
986
|
fetchDashboardsAbortController.current = new AbortController();
|
|
884
987
|
dashboardConfigDispatch({ type: 'CLEAR_DASHBOARDS' });
|
|
885
988
|
try {
|
|
886
|
-
const
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
989
|
+
const result = await (0, dataFetcher_1.quillFetch)({
|
|
990
|
+
client: {
|
|
991
|
+
clientId: publicKey,
|
|
992
|
+
queryEndpoint,
|
|
993
|
+
queryHeaders,
|
|
994
|
+
withCredentials: !!withCredentials,
|
|
891
995
|
},
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
}),
|
|
900
|
-
credentials: withCredentials ? 'include' : 'omit',
|
|
901
|
-
signal: fetchDashboardsAbortController.current.signal,
|
|
996
|
+
task: 'dashboards',
|
|
997
|
+
metadata: {
|
|
998
|
+
clientId: publicKey,
|
|
999
|
+
// getSections: true, // skip fetching reports since 'dashboard' always does anyway
|
|
1000
|
+
},
|
|
1001
|
+
abortSignal: fetchDashboardsAbortController.current.signal,
|
|
1002
|
+
getToken: getAuthorizationToken,
|
|
902
1003
|
});
|
|
903
|
-
const result = await response.json();
|
|
904
1004
|
dashboardConfigDispatch({
|
|
905
1005
|
type: 'SET_DASHBOARD_DATA',
|
|
906
1006
|
data: result.data.dashboards.map((dashboard) => ({
|
|
907
1007
|
...dashboard,
|
|
1008
|
+
dateFilter: dashboard.dateFilter
|
|
1009
|
+
? {
|
|
1010
|
+
...dashboard.dateFilter,
|
|
1011
|
+
presetOptions: dashboard.dateFilter.presetOptions?.map((preset) => ({
|
|
1012
|
+
...preset,
|
|
1013
|
+
loopStart: preset.loopStart
|
|
1014
|
+
? new Date(preset.loopStart)
|
|
1015
|
+
: undefined,
|
|
1016
|
+
loopEnd: preset.loopEnd
|
|
1017
|
+
? new Date(preset.loopEnd)
|
|
1018
|
+
: undefined,
|
|
1019
|
+
})),
|
|
1020
|
+
defaultPresetRanges: dashboard.dateFilter.defaultPresetRanges?.map((preset) => ({
|
|
1021
|
+
...preset,
|
|
1022
|
+
loopStart: preset.loopStart
|
|
1023
|
+
? new Date(preset.loopStart)
|
|
1024
|
+
: undefined,
|
|
1025
|
+
loopEnd: preset.loopEnd
|
|
1026
|
+
? new Date(preset.loopEnd)
|
|
1027
|
+
: undefined,
|
|
1028
|
+
})),
|
|
1029
|
+
}
|
|
1030
|
+
: undefined,
|
|
908
1031
|
createdAt: new Date(dashboard.createdAt),
|
|
909
1032
|
})),
|
|
910
1033
|
});
|
|
911
1034
|
dashboardFiltersDispatch({
|
|
912
1035
|
type: 'SET_INITIAL_DASHBOARD_FILTERS',
|
|
913
1036
|
data: result.data.dashboards.reduce((acc, dashboard) => {
|
|
914
|
-
let
|
|
915
|
-
if (dashboard.dateFilter?.
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
});
|
|
1037
|
+
let presetOptions = dateRangePickerUtils_1.defaultOptionsV2;
|
|
1038
|
+
if (dashboard.dateFilter?.presetOptions ||
|
|
1039
|
+
dashboard.dateFilter?.defaultPresetRanges) {
|
|
1040
|
+
presetOptions = (0, dateRangePickerUtils_1.convertPresetOptionsToSelectableList)((dashboard.dateFilter.presetOptions ?? []).map((preset) => ({
|
|
1041
|
+
...preset,
|
|
1042
|
+
loopStart: preset.loopStart
|
|
1043
|
+
? new Date(preset.loopStart)
|
|
1044
|
+
: undefined,
|
|
1045
|
+
loopEnd: preset.loopEnd
|
|
1046
|
+
? new Date(preset.loopEnd)
|
|
1047
|
+
: undefined,
|
|
1048
|
+
})), (dashboard.dateFilter.defaultPresetRanges ?? []).map((preset) => ({
|
|
1049
|
+
...preset,
|
|
1050
|
+
loopStart: preset.loopStart
|
|
1051
|
+
? new Date(preset.loopStart)
|
|
1052
|
+
: undefined,
|
|
1053
|
+
loopEnd: preset.loopEnd
|
|
1054
|
+
? new Date(preset.loopEnd)
|
|
1055
|
+
: undefined,
|
|
1056
|
+
})));
|
|
934
1057
|
}
|
|
935
|
-
acc[dashboard.name] =
|
|
936
|
-
acc[filter.label] = {
|
|
937
|
-
filter: { ...filter, options: undefined },
|
|
938
|
-
loading: true,
|
|
939
|
-
};
|
|
940
|
-
return acc;
|
|
941
|
-
}, {});
|
|
1058
|
+
acc[dashboard.name] = {};
|
|
942
1059
|
if (dashboard.dateFilter) {
|
|
943
1060
|
dashboard.dateFilter = {
|
|
944
1061
|
...dashboard.dateFilter,
|
|
945
|
-
startDate:
|
|
946
|
-
endDate:
|
|
1062
|
+
startDate: presetOptions.find((elem) => elem.value === dashboard.dateFilter.primaryRange?.value)?.startDate,
|
|
1063
|
+
endDate: presetOptions.find((elem) => elem.value === dashboard.dateFilter.primaryRange?.value)?.endDate,
|
|
947
1064
|
filterType: 'date_range',
|
|
1065
|
+
presetOptions: dashboard.dateFilter.presetOptions?.map((preset) => ({
|
|
1066
|
+
...preset,
|
|
1067
|
+
loopStart: preset.loopStart
|
|
1068
|
+
? new Date(preset.loopStart)
|
|
1069
|
+
: undefined,
|
|
1070
|
+
loopEnd: preset.loopEnd
|
|
1071
|
+
? new Date(preset.loopEnd)
|
|
1072
|
+
: undefined,
|
|
1073
|
+
})),
|
|
1074
|
+
defaultPresetRanges: dashboard.dateFilter.defaultPresetRanges?.map((preset) => ({
|
|
1075
|
+
...preset,
|
|
1076
|
+
loopStart: preset.loopStart
|
|
1077
|
+
? new Date(preset.loopStart)
|
|
1078
|
+
: undefined,
|
|
1079
|
+
loopEnd: preset.loopEnd
|
|
1080
|
+
? new Date(preset.loopEnd)
|
|
1081
|
+
: undefined,
|
|
1082
|
+
})),
|
|
948
1083
|
};
|
|
949
1084
|
acc[dashboard.name][dashboard.dateFilter.label] = {
|
|
950
1085
|
filter: dashboard.dateFilter,
|
|
951
1086
|
loading: true,
|
|
952
1087
|
};
|
|
953
1088
|
}
|
|
1089
|
+
dashboard.filters.forEach((filter) => {
|
|
1090
|
+
acc[dashboard.name][filter.label] = {
|
|
1091
|
+
filter: { ...filter, options: undefined },
|
|
1092
|
+
loading: true,
|
|
1093
|
+
};
|
|
1094
|
+
});
|
|
954
1095
|
return acc;
|
|
955
1096
|
}, {}),
|
|
956
1097
|
});
|
|
@@ -969,6 +1110,33 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
969
1110
|
}
|
|
970
1111
|
}
|
|
971
1112
|
}
|
|
1113
|
+
async function quillFetchWithToken({ client, task, method = 'POST', metadata, abortSignal, credentials = 'omit', urlParameters, includeFlags = false, includeTenants = false, adminMode, }) {
|
|
1114
|
+
try {
|
|
1115
|
+
const result = await (0, dataFetcher_1.quillFetch)({
|
|
1116
|
+
client,
|
|
1117
|
+
task,
|
|
1118
|
+
method,
|
|
1119
|
+
metadata: {
|
|
1120
|
+
flags: includeFlags ? flags : undefined,
|
|
1121
|
+
tenants: includeTenants ? tenants : undefined,
|
|
1122
|
+
adminMode,
|
|
1123
|
+
...metadata,
|
|
1124
|
+
},
|
|
1125
|
+
abortSignal,
|
|
1126
|
+
credentials,
|
|
1127
|
+
urlParameters,
|
|
1128
|
+
getToken: getAuthorizationToken,
|
|
1129
|
+
});
|
|
1130
|
+
return result;
|
|
1131
|
+
}
|
|
1132
|
+
catch (e) {
|
|
1133
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
1134
|
+
throw e;
|
|
1135
|
+
}
|
|
1136
|
+
console.error('Failed to fetch:', e);
|
|
1137
|
+
return { error: 'Failed to fetch data' };
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
972
1140
|
(0, react_1.useEffect)(() => {
|
|
973
1141
|
async function updateClientAndSchema(publicKey) {
|
|
974
1142
|
if (populatedClient?.clientId === publicKey &&
|
|
@@ -976,8 +1144,8 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
976
1144
|
return;
|
|
977
1145
|
setIsClientLoading(true);
|
|
978
1146
|
setSchemaData({ ...schemaData, isSchemaLoading: true });
|
|
979
|
-
const newClient = await (0, client_1.fetchClient)(publicKey, queryEndpoint, withCredentials, queryHeaders);
|
|
980
|
-
if (!newClient.allTenantTypes?.every((t) => t.defaultId)) {
|
|
1147
|
+
const newClient = await (0, client_1.fetchClient)(publicKey, queryEndpoint, withCredentials, getAuthorizationToken, queryHeaders, isAdmin);
|
|
1148
|
+
if (!newClient.allTenantTypes?.every((t) => t.defaultId || t.scope === 'database')) {
|
|
981
1149
|
console.error('Default organization not found. Please select a default organization for ', newClient.allTenantTypes?.find((t) => !t.defaultId));
|
|
982
1150
|
}
|
|
983
1151
|
setClient({
|
|
@@ -992,70 +1160,90 @@ const ContextProvider = ({ children, initialTheme, publicKey, queryEndpoint, que
|
|
|
992
1160
|
featureFlags: newClient.featureFlags,
|
|
993
1161
|
domainName: newClient.domainName,
|
|
994
1162
|
allTenantTypes: newClient.allTenantTypes,
|
|
995
|
-
// @ts-ignore
|
|
996
|
-
maintenanceMode: newClient?.maintenanceMode || false,
|
|
997
1163
|
});
|
|
998
1164
|
setIsClientLoading(false);
|
|
999
1165
|
}
|
|
1000
1166
|
updateClientAndSchema(publicKey);
|
|
1001
1167
|
}, [publicKey]);
|
|
1002
1168
|
(0, react_1.useEffect)(() => {
|
|
1003
|
-
if (populatedClient
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1169
|
+
if (populatedClient?.publicKey &&
|
|
1170
|
+
currentPublicKey.current !== populatedClient?.publicKey) {
|
|
1171
|
+
// CLEAR ALL DASHBOARD DATA AND REPORTS AND THEIR FILTERS
|
|
1172
|
+
dispatch({ type: 'CLEAR_DASHBOARDS' });
|
|
1173
|
+
dashboardFiltersDispatch({ type: 'CLEAR_DASHBOARD_FILTERS' });
|
|
1174
|
+
reportFiltersDispatch({ type: 'CLEAR_REPORT_FILTERS' });
|
|
1175
|
+
reportsDispatch({ type: 'CLEAR_REPORTS' });
|
|
1176
|
+
// TODO: this is yet another unfortunate hack where the answer is to unify the admin and react state
|
|
1177
|
+
// currently, we fetch the dashboards twice if both the client and default org change
|
|
1178
|
+
// because if we didn't, we would fetch 0 times if the client changed but the org didn't
|
|
1179
|
+
if (isAdmin) {
|
|
1180
|
+
setIsDashboardsLoading(true);
|
|
1181
|
+
fetchDashboards(populatedClient?.publicKey);
|
|
1182
|
+
}
|
|
1183
|
+
else {
|
|
1184
|
+
setIsDashboardsLoading(false);
|
|
1185
|
+
}
|
|
1186
|
+
if (typeof window !== 'undefined' && sessionStorage) {
|
|
1187
|
+
sessionStorage.setItem('quill-client', JSON.stringify({
|
|
1188
|
+
...populatedClient,
|
|
1189
|
+
allTenantTypes: undefined,
|
|
1190
|
+
}));
|
|
1191
|
+
}
|
|
1192
|
+
currentPublicKey.current = publicKey;
|
|
1011
1193
|
}
|
|
1012
|
-
}, [populatedClient?.publicKey
|
|
1013
|
-
// FIXME: fetchDashboards needs to rerun every time the tenant changes so that we filter reports on their flags
|
|
1194
|
+
}, [populatedClient?.publicKey]);
|
|
1014
1195
|
(0, react_1.useEffect)(() => {
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1196
|
+
if (populatedClient?.currentTenants &&
|
|
1197
|
+
!(0, fast_deep_equal_1.default)(currentTenant.current, populatedClient?.currentTenants)) {
|
|
1198
|
+
dispatch({ type: 'CLEAR_DASHBOARDS' });
|
|
1199
|
+
dashboardFiltersDispatch({ type: 'CLEAR_DASHBOARD_FILTERS' });
|
|
1200
|
+
reportFiltersDispatch({ type: 'CLEAR_REPORT_FILTERS' });
|
|
1201
|
+
reportsDispatch({ type: 'CLEAR_REPORTS' });
|
|
1202
|
+
if (populatedClient) {
|
|
1203
|
+
fetchSchema({
|
|
1204
|
+
client: populatedClient,
|
|
1205
|
+
tenants: populatedClient.currentTenants,
|
|
1206
|
+
caller: 'context',
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
currentTenant.current = populatedClient?.currentTenants ?? null;
|
|
1210
|
+
}
|
|
1211
|
+
}, [populatedClient?.currentTenants]);
|
|
1025
1212
|
if (!theme) {
|
|
1026
1213
|
return null;
|
|
1027
1214
|
}
|
|
1028
1215
|
if (!tenants) {
|
|
1029
1216
|
throw new Error('Quill Error: QuillProvider prop organizationId is deprecated. Please use QuillProvider tenants prop instead');
|
|
1030
1217
|
}
|
|
1031
|
-
if (populatedClient?.maintenanceMode) {
|
|
1032
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { children: "Dashboard is currently in maintenance mode" }), (0, jsx_runtime_1.jsx)("p", { children: "Please check back later or contact your administrator for more information." })] }));
|
|
1033
|
-
}
|
|
1034
1218
|
return ((0, jsx_runtime_1.jsx)(exports.ClientContext.Provider, { value: [
|
|
1035
1219
|
isClientLoading || !populatedClient ? null : populatedClient,
|
|
1036
1220
|
isClientLoading,
|
|
1037
1221
|
setClient,
|
|
1038
|
-
], children: (0, jsx_runtime_1.jsx)(exports.ThemeContext.Provider, { value: [theme, setTheme], children: (0, jsx_runtime_1.jsx)(exports.SchemaDataContext.Provider, { value: [schemaData, setSchemaData], children: (0, jsx_runtime_1.jsx)(exports.DashboardContext.Provider, { value: [dashboard, dispatch], children: (0, jsx_runtime_1.jsx)(exports.DashboardConfigContext.Provider, { value: {
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
}, children: (0, jsx_runtime_1.jsx)(exports.
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1222
|
+
], children: (0, jsx_runtime_1.jsx)(exports.ThemeContext.Provider, { value: [theme, setTheme], children: (0, jsx_runtime_1.jsx)(exports.FetchContext.Provider, { value: { getToken: getAuthorizationToken, quillFetchWithToken }, children: (0, jsx_runtime_1.jsx)(exports.SchemaDataContext.Provider, { value: [schemaData, setSchemaData], children: (0, jsx_runtime_1.jsx)(exports.DashboardContext.Provider, { value: [dashboard, dispatch], children: (0, jsx_runtime_1.jsx)(exports.DashboardConfigContext.Provider, { value: {
|
|
1223
|
+
dashboardConfig: isDashboardsLoading ? {} : dashboardConfig,
|
|
1224
|
+
isLoading: isDashboardsLoading,
|
|
1225
|
+
dashboardConfigDispatch,
|
|
1226
|
+
loadDashboard,
|
|
1227
|
+
}, children: (0, jsx_runtime_1.jsx)(exports.DashboardFiltersContext.Provider, { value: {
|
|
1228
|
+
dashboardFilters,
|
|
1229
|
+
dashboardCustomFilters,
|
|
1230
|
+
customFilterDispatch,
|
|
1231
|
+
dispatch: dashboardFiltersDispatch,
|
|
1232
|
+
loadFiltersForDashboard,
|
|
1233
|
+
}, children: (0, jsx_runtime_1.jsx)(exports.ReportFiltersContext.Provider, { value: {
|
|
1234
|
+
reportFilters,
|
|
1235
|
+
customReportFilters,
|
|
1236
|
+
reportFiltersDispatch,
|
|
1237
|
+
customReportFiltersDispatch,
|
|
1238
|
+
loadFiltersForReport,
|
|
1239
|
+
abortLoadingFilters,
|
|
1240
|
+
}, children: (0, jsx_runtime_1.jsx)(exports.ReportsContext.Provider, { value: {
|
|
1241
|
+
reports,
|
|
1242
|
+
reportsDispatch,
|
|
1243
|
+
fetchIndividualReport,
|
|
1244
|
+
}, children: (0, jsx_runtime_1.jsx)(exports.TenantContext.Provider, { value: {
|
|
1245
|
+
tenants: populatedClient?.currentTenants ?? tenants,
|
|
1246
|
+
flags: populatedClient?.currentFlags ?? flags,
|
|
1247
|
+
}, children: children }) }) }) }) }) }) }) }) }) }));
|
|
1060
1248
|
};
|
|
1061
1249
|
exports.ContextProvider = ContextProvider;
|