@quillsql/react 2.8.8 → 2.8.9
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/AddToDashboardModal.js +146 -181
- package/dist/BarList.js +36 -44
- package/dist/Chart.d.ts +0 -5
- package/dist/Chart.d.ts.map +1 -1
- package/dist/Chart.js +94 -276
- package/dist/ChartBuilder.d.ts +1 -0
- package/dist/ChartBuilder.d.ts.map +1 -1
- package/dist/ChartBuilder.js +96 -93
- package/dist/ChartEditor.d.ts +2 -1
- package/dist/ChartEditor.d.ts.map +1 -1
- package/dist/ChartEditor.js +14 -21
- package/dist/Context.js +52 -57
- package/dist/Dashboard.d.ts.map +1 -1
- package/dist/Dashboard.js +181 -213
- package/dist/DateRangePicker/Calendar.js +41 -46
- package/dist/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/DateRangePicker/DateRangePicker.js +33 -62
- package/dist/DateRangePicker/DateRangePickerButton.js +14 -17
- package/dist/DateRangePicker/dateRangePickerUtils.js +76 -90
- package/dist/DateRangePicker/index.js +1 -9
- package/dist/PieChart.js +35 -70
- package/dist/QuillProvider.js +4 -7
- package/dist/ReportBuilder.js +120 -129
- package/dist/SQLEditor.d.ts +5 -1
- package/dist/SQLEditor.d.ts.map +1 -1
- package/dist/SQLEditor.js +82 -89
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +64 -66
- package/dist/TableChart.js +17 -45
- package/dist/assets/ArrowDownHeadIcon.js +3 -6
- package/dist/assets/ArrowDownIcon.js +3 -6
- package/dist/assets/ArrowDownRightIcon.js +3 -6
- package/dist/assets/ArrowLeftHeadIcon.js +3 -6
- package/dist/assets/ArrowRightHeadIcon.js +3 -6
- package/dist/assets/ArrowRightIcon.js +3 -6
- package/dist/assets/ArrowUpHeadIcon.js +3 -6
- package/dist/assets/ArrowUpIcon.js +3 -6
- package/dist/assets/ArrowUpRightIcon.js +3 -6
- package/dist/assets/CalendarIcon.js +3 -6
- package/dist/assets/CalendarNormalIcon.js +3 -6
- package/dist/assets/DoubleArrowLeftHeadIcon.js +3 -6
- package/dist/assets/DoubleArrowRightHeadIcon.js +3 -6
- package/dist/assets/ExclamationFilledIcon.js +3 -6
- package/dist/assets/FilterIcon.js +3 -6
- package/dist/assets/LoadingSpinner.js +3 -6
- package/dist/assets/RefreshIcon.js +3 -6
- package/dist/assets/SearchIcon.js +3 -6
- package/dist/assets/UpLeftArrowsIcon.js +3 -6
- package/dist/assets/XCircleIcon.js +3 -6
- package/dist/assets/XIcon.js +3 -6
- package/dist/assets/index.js +21 -49
- package/dist/components/Banner/index.d.ts +3 -0
- package/dist/components/Banner/index.d.ts.map +1 -0
- package/dist/components/Banner/index.js +24 -0
- package/dist/components/BigModal/BigModal.js +13 -39
- package/dist/components/Dropdown/Dropdown.js +24 -53
- package/dist/components/Dropdown/DropdownItem.js +9 -35
- package/dist/components/Dropdown/index.js +2 -11
- package/dist/components/Modal/Modal.js +13 -39
- package/dist/components/Modal/index.js +1 -9
- package/dist/components/QuillCard.js +8 -13
- package/dist/components/ReportBuilder/ColumnSelector.d.ts +19 -0
- package/dist/components/ReportBuilder/ColumnSelector.d.ts.map +1 -0
- package/dist/components/ReportBuilder/ColumnSelector.js +87 -0
- package/dist/components/SqlTextEditor.d.ts.map +1 -1
- package/dist/components/SqlTextEditor.js +30 -13
- package/dist/components/UiComponents.d.ts.map +1 -1
- package/dist/components/UiComponents.js +40 -53
- package/dist/components/selectUtils.js +6 -17
- package/dist/contexts/BaseColorContext.js +3 -6
- package/dist/contexts/HoveredValueContext.js +3 -6
- package/dist/contexts/RootStylesContext.js +3 -6
- package/dist/contexts/SelectedValueContext.js +3 -6
- package/dist/contexts/index.js +4 -15
- package/dist/hooks/index.js +4 -15
- package/dist/hooks/useDashboard.js +10 -15
- package/dist/hooks/useInternalState.js +3 -6
- package/dist/hooks/useOnClickOutside.js +3 -6
- package/dist/hooks/useOnWindowResize.js +4 -7
- package/dist/hooks/useQuill.js +11 -16
- package/dist/hooks/useSelectOnKeyDown.js +4 -7
- package/dist/index.js +13 -33
- package/dist/internals/ReportBuilder/PivotList.js +14 -20
- package/dist/internals/ReportBuilder/PivotModal.d.ts +2 -2
- package/dist/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/internals/ReportBuilder/PivotModal.js +116 -119
- package/dist/internals/ReportBuilder/PivotModal.spec.js +70 -73
- package/dist/lib/font.js +2 -6
- package/dist/lib/index.js +3 -20
- package/dist/lib/inputTypes.js +1 -3
- package/dist/lib/utils.js +8 -19
- package/dist/test-data/tables.d.ts +2 -0
- package/dist/test-data/tables.d.ts.map +1 -0
- package/dist/test-data/tables.js +621 -0
- package/dist/utils/aggregate.js +28 -35
- package/dist/utils/axisFormatter.d.ts +20 -0
- package/dist/utils/axisFormatter.d.ts.map +1 -0
- package/dist/utils/axisFormatter.js +185 -0
- package/dist/utils/colorToHex.js +1 -5
- package/dist/utils/dataFetcher.js +2 -8
- package/dist/utils/downloadCSV.js +1 -6
- package/dist/utils/schema.d.ts +22 -0
- package/dist/utils/schema.d.ts.map +1 -0
- package/dist/utils/schema.js +134 -0
- package/dist/utils/textFormatting.d.ts +4 -0
- package/dist/utils/textFormatting.d.ts.map +1 -0
- package/dist/utils/textFormatting.js +38 -0
- package/dist/utils/valueFormatter.d.ts +17 -0
- package/dist/utils/valueFormatter.d.ts.map +1 -0
- package/dist/utils/valueFormatter.js +166 -0
- package/dist/utils/valueFormatterCSV.d.ts +17 -0
- package/dist/utils/valueFormatterCSV.d.ts.map +1 -0
- package/dist/utils/valueFormatterCSV.js +90 -0
- package/package.json +1 -2
|
@@ -1,43 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.formatDateBuckets = exports.isArrayOfValidDates = exports.isValidDate = exports.ChartForm = void 0;
|
|
30
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
31
2
|
// @ts-nocheck
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
3
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
4
|
+
import { sub, startOfToday } from 'date-fns';
|
|
5
|
+
import { getData, getDataFromCloud } from './utils/dataFetcher';
|
|
6
|
+
import { ClientContext, SchemaContext, ThemeContext, DateFilterContext, DashboardContext, DashboardFiltersContext, } from './Context';
|
|
7
|
+
import { differenceInDays, differenceInHours, differenceInMonths, differenceInYears, startOfDay, startOfHour, startOfMonth, startOfYear, } from 'date-fns';
|
|
8
|
+
import Chart from './Chart';
|
|
9
|
+
import { getPostgresBasicType } from './ReportBuilder';
|
|
10
|
+
import { aggregate } from './utils/aggregate';
|
|
11
|
+
import { ArrowDownHeadIcon } from './assets';
|
|
41
12
|
function convertPostgresColumn(column) {
|
|
42
13
|
let format;
|
|
43
14
|
switch (column.dataTypeID) {
|
|
@@ -83,7 +54,7 @@ function updateLabels(yAxisFields, values) {
|
|
|
83
54
|
});
|
|
84
55
|
}
|
|
85
56
|
const DefaultSelectComponent = function DefaultSelect({ onChange, value, options, form, field, theme, }) {
|
|
86
|
-
return ((
|
|
57
|
+
return (_jsxs("div", { style: { position: 'relative' }, children: [_jsx("select", { onChange: event => onChange(event.target.value), value: value, id: 'reportbuilderdropdown', style: {
|
|
87
58
|
width: 200,
|
|
88
59
|
outline: 'none',
|
|
89
60
|
textAlign: 'left',
|
|
@@ -102,7 +73,7 @@ const DefaultSelectComponent = function DefaultSelect({ onChange, value, options
|
|
|
102
73
|
color: theme.primaryTextColor,
|
|
103
74
|
boxShadow: '0 1px 2px 0 rgba(0,0,0,.05)',
|
|
104
75
|
fontFamily: theme.fontFamily,
|
|
105
|
-
}, children: options.map((option, index) => ((
|
|
76
|
+
}, children: options.map((option, index) => (_jsx("option", { value: option.value, children: option.label }, option.label + index))) }), _jsx(ArrowDownHeadIcon, { style: {
|
|
106
77
|
height: '20px',
|
|
107
78
|
width: '20px',
|
|
108
79
|
flex: 'none',
|
|
@@ -112,9 +83,9 @@ const DefaultSelectComponent = function DefaultSelect({ onChange, value, options
|
|
|
112
83
|
color: theme?.secondaryTextColor,
|
|
113
84
|
}, "aria-hidden": "true" })] }));
|
|
114
85
|
};
|
|
115
|
-
const MemoizedDefaultSelectComponent =
|
|
86
|
+
const MemoizedDefaultSelectComponent = React.memo(DefaultSelectComponent);
|
|
116
87
|
const DefaultTextInputComponent = function DefaultText({ onChange, value, id, theme, placeholder, }) {
|
|
117
|
-
return ((
|
|
88
|
+
return (_jsx("input", { style: {
|
|
118
89
|
outline: 'none',
|
|
119
90
|
textAlign: 'left',
|
|
120
91
|
whiteSpace: 'nowrap',
|
|
@@ -138,21 +109,21 @@ const DefaultTextInputComponent = function DefaultText({ onChange, value, id, th
|
|
|
138
109
|
fontFamily: theme.fontFamily,
|
|
139
110
|
}, id: id, onChange: onChange, value: value, placeholder: placeholder }));
|
|
140
111
|
};
|
|
141
|
-
const MemoizedDefaultTextInputComponent =
|
|
142
|
-
function AddToDashboardModal({ isOpen, setIsOpen, SelectComponent, TextInputComponent, ButtonComponent, SecondaryButtonComponent, rows, columns, query, report, ModalComponent, formHeaderStyle, formLabelStyle, showTableFormatOptions = false, showDateFieldOptions = false, showAccessControlOptions = false, onAddToDashboardComplete, fields, }) {
|
|
143
|
-
const [theme] =
|
|
144
|
-
const [client] =
|
|
145
|
-
const [schema, setSchema] =
|
|
112
|
+
const MemoizedDefaultTextInputComponent = React.memo(DefaultTextInputComponent);
|
|
113
|
+
export default function AddToDashboardModal({ isOpen, setIsOpen, SelectComponent, TextInputComponent, ButtonComponent, SecondaryButtonComponent, rows, columns, query, report, ModalComponent, formHeaderStyle, formLabelStyle, showTableFormatOptions = false, showDateFieldOptions = false, showAccessControlOptions = false, onAddToDashboardComplete, fields, }) {
|
|
114
|
+
const [theme] = useContext(ThemeContext);
|
|
115
|
+
const [client] = useContext(ClientContext);
|
|
116
|
+
const [schema, setSchema] = useContext(SchemaContext);
|
|
146
117
|
// const [organization, setOrganization] = useState([]);
|
|
147
|
-
const { dispatch } =
|
|
118
|
+
const { dispatch } = useContext(DashboardContext);
|
|
148
119
|
// showTableFormatOptions = false;
|
|
149
120
|
// showDateFieldOptions = false;
|
|
150
121
|
// showAccessControlOptions = false;3
|
|
151
|
-
|
|
122
|
+
useEffect(() => {
|
|
152
123
|
let isSubscribed = true;
|
|
153
124
|
async function getSchema() {
|
|
154
125
|
if (!schema || !schema.length) {
|
|
155
|
-
const resp = await
|
|
126
|
+
const resp = await getDataFromCloud(client, `schema2/${client.publicKey}/`, null, 'GET');
|
|
156
127
|
if (isSubscribed) {
|
|
157
128
|
setSchema(resp.tables);
|
|
158
129
|
}
|
|
@@ -347,7 +318,7 @@ function AddToDashboardModal({ isOpen, setIsOpen, SelectComponent, TextInputComp
|
|
|
347
318
|
customerId: customerId,
|
|
348
319
|
}
|
|
349
320
|
: { clientId: publicKey }).toString();
|
|
350
|
-
const resp = await
|
|
321
|
+
const resp = await getData(client, `dashedit2?${searchParams}`, 'same-origin', hostedBody, cloudBody);
|
|
351
322
|
if (resp) {
|
|
352
323
|
dispatch({
|
|
353
324
|
type: 'UPDATE_DASHBOARD_ITEM',
|
|
@@ -369,13 +340,12 @@ function AddToDashboardModal({ isOpen, setIsOpen, SelectComponent, TextInputComp
|
|
|
369
340
|
};
|
|
370
341
|
return (
|
|
371
342
|
// <BigModal theme={theme} showModal={isOpen} setShowModal={setIsOpen}>
|
|
372
|
-
(
|
|
343
|
+
_jsx(_Fragment, { children: ModalComponent ? (_jsx(ModalComponent, { isOpen: isOpen, title: 'Add to dashboard', onClose: () => setIsOpen(false), children: _jsx(ChartForm, { editChart: editChart, theme: theme, schema: schema, data: rows, fields: columns, report: report, query: query, client: client,
|
|
373
344
|
// organizationName={organization?.name}
|
|
374
|
-
SelectComponent: SelectComponent, TextInputComponent: TextInputComponent, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, formHeaderStyle: formHeaderStyle, formLabelStyle: formLabelStyle, showTableFormatOptions: showTableFormatOptions, showDateFieldOptions: showDateFieldOptions, showAccessControlOptions: showAccessControlOptions, newFields: fields }) })) : ((
|
|
345
|
+
SelectComponent: SelectComponent, TextInputComponent: TextInputComponent, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, formHeaderStyle: formHeaderStyle, formLabelStyle: formLabelStyle, showTableFormatOptions: showTableFormatOptions, showDateFieldOptions: showDateFieldOptions, showAccessControlOptions: showAccessControlOptions, newFields: fields }) })) : (_jsx(QuillModal, { isOpen: isOpen, onClose: () => setIsOpen(false), title: 'Add to dashboard', children: _jsx(ChartForm, { editChart: editChart, theme: theme, schema: schema, data: rows, fields: columns, report: report, client: client, query: query,
|
|
375
346
|
// organizationName={organization?.name}
|
|
376
347
|
SelectComponent: SelectComponent, TextInputComponent: TextInputComponent, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, formHeaderStyle: formHeaderStyle, formLabelStyle: formLabelStyle, showTableFormatOptions: showTableFormatOptions, showDateFieldOptions: showDateFieldOptions, showAccessControlOptions: showAccessControlOptions, newFields: fields }) })) }));
|
|
377
348
|
}
|
|
378
|
-
exports.default = AddToDashboardModal;
|
|
379
349
|
function QuillModal({ isOpen, onClose, setIsOpen, title, children }) {
|
|
380
350
|
const scrollPosition = 0;
|
|
381
351
|
// useEffect(() => {
|
|
@@ -397,7 +367,7 @@ function QuillModal({ isOpen, onClose, setIsOpen, title, children }) {
|
|
|
397
367
|
if (!isOpen) {
|
|
398
368
|
return null;
|
|
399
369
|
}
|
|
400
|
-
return ((
|
|
370
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { style: {
|
|
401
371
|
position: 'fixed',
|
|
402
372
|
top: '0',
|
|
403
373
|
right: '0',
|
|
@@ -406,7 +376,7 @@ function QuillModal({ isOpen, onClose, setIsOpen, title, children }) {
|
|
|
406
376
|
zIndex: '50',
|
|
407
377
|
backgroundColor: 'rgba(255, 255, 255, 0.8)',
|
|
408
378
|
backdropFilter: 'blur(5px)',
|
|
409
|
-
}, onClick: onClose }), (
|
|
379
|
+
}, onClick: onClose }), _jsx("div", { style: {
|
|
410
380
|
// position: "absolute",
|
|
411
381
|
position: 'fixed',
|
|
412
382
|
left: '50%',
|
|
@@ -426,7 +396,7 @@ function QuillModal({ isOpen, onClose, setIsOpen, title, children }) {
|
|
|
426
396
|
borderColor: '#e7e7e7',
|
|
427
397
|
overflow: 'hidden',
|
|
428
398
|
// zIndex: 1000,
|
|
429
|
-
}, children: (
|
|
399
|
+
}, children: _jsxs("div", { style: {
|
|
430
400
|
// width: "80%",
|
|
431
401
|
maxHeight: '90vh',
|
|
432
402
|
overflowY: 'scroll',
|
|
@@ -437,7 +407,7 @@ function QuillModal({ isOpen, onClose, setIsOpen, title, children }) {
|
|
|
437
407
|
display: 'flex',
|
|
438
408
|
flexDirection: 'column',
|
|
439
409
|
alignItems: 'center',
|
|
440
|
-
}, children: [(
|
|
410
|
+
}, children: [_jsx("h2", { style: {
|
|
441
411
|
marginLeft: 35,
|
|
442
412
|
marginTop: 25,
|
|
443
413
|
fontSize: 18,
|
|
@@ -446,7 +416,7 @@ function QuillModal({ isOpen, onClose, setIsOpen, title, children }) {
|
|
|
446
416
|
textAlign: 'left',
|
|
447
417
|
}, children: title }), children] }) })] }));
|
|
448
418
|
}
|
|
449
|
-
function ChartForm({ data, fields, theme, saveVisualization, report, editChart, schema, query, organizationName, SelectComponent, TextInputComponent, client, ButtonComponent, SecondaryButtonComponent, formHeaderStyle, formLabelStyle, showTableFormatOptions, showDateFieldOptions, showAccessControlOptions, newFields, }) {
|
|
419
|
+
export function ChartForm({ data, fields, theme, saveVisualization, report, editChart, schema, query, organizationName, SelectComponent, TextInputComponent, client, ButtonComponent, SecondaryButtonComponent, formHeaderStyle, formLabelStyle, showTableFormatOptions, showDateFieldOptions, showAccessControlOptions, newFields, }) {
|
|
450
420
|
if (report) {
|
|
451
421
|
newFields = report.fields;
|
|
452
422
|
}
|
|
@@ -461,16 +431,16 @@ function ChartForm({ data, fields, theme, saveVisualization, report, editChart,
|
|
|
461
431
|
}));
|
|
462
432
|
const xAxisOptions = data?.length
|
|
463
433
|
? Object.keys(data[0])
|
|
464
|
-
.filter(option =>
|
|
465
|
-
|
|
434
|
+
.filter(option => getPostgresBasicType(newFields.find(field => field.name === option)) === 'date' ||
|
|
435
|
+
getPostgresBasicType(newFields.find(field => field.name === option)) === 'string')
|
|
466
436
|
.map(field => ({
|
|
467
437
|
value: field,
|
|
468
438
|
label: field,
|
|
469
439
|
}))
|
|
470
440
|
: fields
|
|
471
441
|
.filter(option => {
|
|
472
|
-
return (
|
|
473
|
-
|
|
442
|
+
return (getPostgresBasicType(newFields.find(field => field.name === option.field)) === 'date' ||
|
|
443
|
+
getPostgresBasicType(newFields.find(field => field.name === option.field)) === 'string');
|
|
474
444
|
})
|
|
475
445
|
.map(field => ({
|
|
476
446
|
value: field.field,
|
|
@@ -478,22 +448,22 @@ function ChartForm({ data, fields, theme, saveVisualization, report, editChart,
|
|
|
478
448
|
}));
|
|
479
449
|
const yAxisOptions = data?.length
|
|
480
450
|
? Object.keys(data[0])
|
|
481
|
-
.filter(option =>
|
|
451
|
+
.filter(option => getPostgresBasicType(newFields.find(field => field.name === option)) === 'number')
|
|
482
452
|
.map(field => ({
|
|
483
453
|
value: field,
|
|
484
454
|
label: field,
|
|
485
455
|
}))
|
|
486
456
|
: fields
|
|
487
457
|
.filter(option => {
|
|
488
|
-
return (
|
|
458
|
+
return (getPostgresBasicType(newFields.find(field => field.name === option.field)) === 'number');
|
|
489
459
|
})
|
|
490
460
|
.map(field => ({
|
|
491
461
|
value: field.field,
|
|
492
462
|
label: field.field,
|
|
493
463
|
}));
|
|
494
|
-
const [dateFieldOptions, setDateFieldOptions] =
|
|
495
|
-
const [formValues, setFormValues] =
|
|
496
|
-
|
|
464
|
+
const [dateFieldOptions, setDateFieldOptions] = useState([]);
|
|
465
|
+
const [formValues, setFormValues] = useState({});
|
|
466
|
+
useEffect(() => {
|
|
497
467
|
const fetchReferencedTables = async () => {
|
|
498
468
|
if (!query) {
|
|
499
469
|
return;
|
|
@@ -503,7 +473,7 @@ function ChartForm({ data, fields, theme, saveVisualization, report, editChart,
|
|
|
503
473
|
};
|
|
504
474
|
fetchReferencedTables();
|
|
505
475
|
}, [query, schema]);
|
|
506
|
-
return ((
|
|
476
|
+
return (_jsx(FormikForm, { data: data, xAxisOptions: xAxisOptions, yAxisOptions: yAxisOptions, fieldOptions: fieldOptions, dateFieldOptions: dateFieldOptions, theme: theme, saveVisualization: saveVisualization, report: report, editChart: editChart, client: client, fields: fields, newFields: newFields, query: query, showTableFormatOptions: showTableFormatOptions, showDateFieldOptions: showDateFieldOptions, showAccessControlOptions: showAccessControlOptions, organizationName: organizationName, SelectComponent: SelectComponent
|
|
507
477
|
? ({ onChange, value, options, form, field, }) => {
|
|
508
478
|
const handleChange = async (option) => {
|
|
509
479
|
if (onChange) {
|
|
@@ -513,14 +483,14 @@ function ChartForm({ data, fields, theme, saveVisualization, report, editChart,
|
|
|
513
483
|
await form.setFieldValue(field.name, option);
|
|
514
484
|
form.setFieldTouched(field.name, true);
|
|
515
485
|
};
|
|
516
|
-
return ((
|
|
486
|
+
return (_jsx(SelectComponent, { onChange: event => handleChange(event.target.value), value: value, options: options }));
|
|
517
487
|
}
|
|
518
488
|
: MemoizedDefaultSelectComponent, TextInputComponent: TextInputComponent
|
|
519
489
|
? TextInputComponent
|
|
520
490
|
: MemoizedDefaultTextInputComponent, ButtonComponent: ButtonComponent
|
|
521
491
|
? ButtonComponent
|
|
522
492
|
: ({ onClick, label }) => {
|
|
523
|
-
return ((
|
|
493
|
+
return (_jsx("div", { style: {
|
|
524
494
|
height: 38,
|
|
525
495
|
background: theme.primaryButtonColor,
|
|
526
496
|
color: theme.backgroundColor,
|
|
@@ -538,7 +508,7 @@ function ChartForm({ data, fields, theme, saveVisualization, report, editChart,
|
|
|
538
508
|
}, SecondaryButtonComponent: ButtonComponent
|
|
539
509
|
? ButtonComponent
|
|
540
510
|
: ({ onClick, label }) => {
|
|
541
|
-
return ((
|
|
511
|
+
return (_jsx("div", { style: {
|
|
542
512
|
height: 38,
|
|
543
513
|
background: theme.backgroundColor,
|
|
544
514
|
borderWidth: theme.borderWidth,
|
|
@@ -556,65 +526,61 @@ function ChartForm({ data, fields, theme, saveVisualization, report, editChart,
|
|
|
556
526
|
}, onClick: onClick, children: label }));
|
|
557
527
|
}, formHeaderStyle: formHeaderStyle, formLabelStyle: formLabelStyle }));
|
|
558
528
|
}
|
|
559
|
-
|
|
560
|
-
function isValidDate(d) {
|
|
529
|
+
export function isValidDate(d) {
|
|
561
530
|
return d instanceof Date && !isNaN(d);
|
|
562
531
|
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
exports.isArrayOfValidDates = isArrayOfValidDates;
|
|
566
|
-
function formatDateBuckets(startDate, endDate) {
|
|
532
|
+
export const isArrayOfValidDates = (arr, field) => arr.every(d => new Date(d[field]) instanceof Date && !isNaN(new Date(d[field])));
|
|
533
|
+
export function formatDateBuckets(startDate, endDate) {
|
|
567
534
|
// Calculate the distance in hours
|
|
568
|
-
const distanceInHours = Math.abs(
|
|
535
|
+
const distanceInHours = Math.abs(differenceInHours(endDate, startDate));
|
|
569
536
|
// Check if the distance is less than or equal to one hour
|
|
570
537
|
if (distanceInHours <= 1) {
|
|
571
538
|
return {
|
|
572
539
|
unit: 'hour',
|
|
573
540
|
format: 'h a',
|
|
574
|
-
startOf:
|
|
541
|
+
startOf: startOfHour,
|
|
575
542
|
};
|
|
576
543
|
}
|
|
577
544
|
// Calculate the distance in days
|
|
578
|
-
const distanceInDays = Math.abs(
|
|
545
|
+
const distanceInDays = Math.abs(differenceInDays(endDate, startDate));
|
|
579
546
|
// Check if the distance is less than or equal to one day
|
|
580
547
|
if (distanceInDays <= 1) {
|
|
581
548
|
return {
|
|
582
549
|
unit: 'day',
|
|
583
550
|
format: 'MMM d',
|
|
584
|
-
startOf:
|
|
551
|
+
startOf: startOfDay,
|
|
585
552
|
};
|
|
586
553
|
}
|
|
587
554
|
// Calculate the distance in months
|
|
588
|
-
const distanceInMonths = Math.abs(
|
|
555
|
+
const distanceInMonths = Math.abs(differenceInMonths(endDate, startDate));
|
|
589
556
|
// Check if the distance is less than or equal to one month
|
|
590
557
|
if (distanceInMonths <= 1) {
|
|
591
558
|
return {
|
|
592
559
|
unit: 'month',
|
|
593
560
|
format: 'MMM yyyy',
|
|
594
|
-
startOf:
|
|
561
|
+
startOf: startOfMonth,
|
|
595
562
|
};
|
|
596
563
|
}
|
|
597
564
|
// Calculate the distance in years
|
|
598
|
-
const distanceInYears = Math.abs(
|
|
565
|
+
const distanceInYears = Math.abs(differenceInYears(endDate, startDate));
|
|
599
566
|
// Check if the distance is less than or equal to one year
|
|
600
567
|
if (distanceInYears <= 1) {
|
|
601
568
|
return {
|
|
602
569
|
unit: 'year',
|
|
603
570
|
format: 'yyyy',
|
|
604
|
-
startOf:
|
|
571
|
+
startOf: startOfYear,
|
|
605
572
|
};
|
|
606
573
|
}
|
|
607
574
|
// Otherwise, the distance is more than one year
|
|
608
575
|
return {
|
|
609
576
|
unit: 'year',
|
|
610
577
|
format: 'yyyy',
|
|
611
|
-
startOf:
|
|
578
|
+
startOf: startOfYear,
|
|
612
579
|
};
|
|
613
580
|
}
|
|
614
|
-
exports.formatDateBuckets = formatDateBuckets;
|
|
615
581
|
const FormTextInput = ({ field, form, ...props }) => {
|
|
616
582
|
const { theme, wider } = props;
|
|
617
|
-
return ((
|
|
583
|
+
return (_jsx("input", { className: `px-[12px] text-sm h-[38px] py-1.5 shadow-sm w-[245px] border-[#E7E7E7] ${'text-[#212121]'} border-[1px] bg-[white] rounded-md`, type: "text", ...field, ...props }));
|
|
618
584
|
};
|
|
619
585
|
const POSTGRES_DATE_TYPES = [
|
|
620
586
|
'timestamp',
|
|
@@ -627,7 +593,7 @@ async function getReferencedTables(client, sqlQuery, dbTables) {
|
|
|
627
593
|
// const parser = new Parser();
|
|
628
594
|
const tables = [];
|
|
629
595
|
const withAliases = [];
|
|
630
|
-
const resp = await
|
|
596
|
+
const resp = await getDataFromCloud(client, `astify`, { query: sqlQuery });
|
|
631
597
|
let ast = resp.ast;
|
|
632
598
|
ast = ast.length ? ast[0] : ast;
|
|
633
599
|
if (ast.with && ast.with.length) {
|
|
@@ -678,7 +644,7 @@ const Y_FORMAT_OPTIONS = [
|
|
|
678
644
|
{ value: 'string', label: 'string' },
|
|
679
645
|
];
|
|
680
646
|
const handleBucketData = (dashboardItem, bucketFields, dateFilter) => {
|
|
681
|
-
return
|
|
647
|
+
return aggregate(dashboardItem, bucketFields, dateFilter);
|
|
682
648
|
};
|
|
683
649
|
function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldOptions, theme, report, editChart, fields, newFields, query, client, SelectComponent, TextInputComponent, ButtonComponent, SecondaryButtonComponent, organizationName, formHeaderStyle, formLabelStyle, showTableFormatOptions, showDateFieldOptions, showAccessControlOptions, }) {
|
|
684
650
|
// fieldOptions.sort((a, b) => {
|
|
@@ -701,24 +667,24 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
701
667
|
return 1;
|
|
702
668
|
return 0;
|
|
703
669
|
});
|
|
704
|
-
const { dashboardFilters, dashboardFiltersDispatch } =
|
|
705
|
-
const [rows, setRows] =
|
|
706
|
-
const [isSubmitting, setIsSubmitting] =
|
|
707
|
-
const [xAxisField, setXAxisField] =
|
|
670
|
+
const { dashboardFilters, dashboardFiltersDispatch } = useContext(DashboardFiltersContext);
|
|
671
|
+
const [rows, setRows] = useState(null);
|
|
672
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
673
|
+
const [xAxisField, setXAxisField] = useState(report?.xAxisField ||
|
|
708
674
|
(xAxisOptions && xAxisOptions.length && xAxisOptions[0].value) ||
|
|
709
675
|
'');
|
|
710
|
-
const [xAxisLabel, setXAxisLabel] =
|
|
711
|
-
const [xAxisFormat, setXAxisFormat] =
|
|
676
|
+
const [xAxisLabel, setXAxisLabel] = useState(report?.xAxisLabel || '');
|
|
677
|
+
const [xAxisFormat, setXAxisFormat] = useState(report?.xAxisFormat ||
|
|
712
678
|
(X_FORMAT_OPTIONS.length && X_FORMAT_OPTIONS[0].value) ||
|
|
713
679
|
'');
|
|
714
|
-
const [chartName, setChartName] =
|
|
715
|
-
const [chartType, setChartType] =
|
|
716
|
-
const [dateFieldTable, setDateFieldTable] =
|
|
717
|
-
const [dateField, setDateField] =
|
|
718
|
-
const [template, setTemplate] =
|
|
719
|
-
const [chartConfig, setChartConfig] =
|
|
720
|
-
const { dateFilter, setDateFilter } =
|
|
721
|
-
const [yAxisFields, setYAxisFields] =
|
|
680
|
+
const [chartName, setChartName] = useState(report?.name || '');
|
|
681
|
+
const [chartType, setChartType] = useState(report?.chartType || 'column');
|
|
682
|
+
const [dateFieldTable, setDateFieldTable] = useState((dateFieldOptions.length && dateFieldOptions[0].name) || '');
|
|
683
|
+
const [dateField, setDateField] = useState((dateFieldOptions.length && dateFieldOptions[0].columns[0].name) || '');
|
|
684
|
+
const [template, setTemplate] = useState(report?.template || false);
|
|
685
|
+
const [chartConfig, setChartConfig] = useState({});
|
|
686
|
+
const { dateFilter, setDateFilter } = useContext(DateFilterContext);
|
|
687
|
+
const [yAxisFields, setYAxisFields] = useState(report
|
|
722
688
|
? report.yAxisFields
|
|
723
689
|
: [
|
|
724
690
|
{
|
|
@@ -729,8 +695,8 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
729
695
|
format: 'whole_number',
|
|
730
696
|
},
|
|
731
697
|
]);
|
|
732
|
-
const [bucketFields, setBucketFields] =
|
|
733
|
-
const [columns, setColumns] =
|
|
698
|
+
const [bucketFields, setBucketFields] = useState((report && report.buckets) || []);
|
|
699
|
+
const [columns, setColumns] = useState(report && report.columns.length
|
|
734
700
|
? report.columns
|
|
735
701
|
: fields?.length
|
|
736
702
|
? fields.map(field => convertPostgresColumn(field))
|
|
@@ -785,7 +751,7 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
785
751
|
]);
|
|
786
752
|
};
|
|
787
753
|
const handleAddBucket = () => {
|
|
788
|
-
const bucketPossibilities = xAxisOptions.filter(option =>
|
|
754
|
+
const bucketPossibilities = xAxisOptions.filter(option => getPostgresBasicType(newFields.find(field => field.name === option.value)) === 'date');
|
|
789
755
|
if (!bucketPossibilities.length) {
|
|
790
756
|
alert('No possible buckets');
|
|
791
757
|
return;
|
|
@@ -801,12 +767,12 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
801
767
|
setXAxisFormat('dynamic');
|
|
802
768
|
}
|
|
803
769
|
else {
|
|
804
|
-
setXAxisFormat(postgresFormatMap(
|
|
770
|
+
setXAxisFormat(postgresFormatMap(getPostgresBasicType(newFields.find(field => field.name === bucketPossibilities[0].value))));
|
|
805
771
|
}
|
|
806
772
|
};
|
|
807
|
-
const [dashboardOptions, setDashboardOptions] =
|
|
808
|
-
const [dashboardName, setDashboardName] =
|
|
809
|
-
|
|
773
|
+
const [dashboardOptions, setDashboardOptions] = useState([]);
|
|
774
|
+
const [dashboardName, setDashboardName] = useState(report?.dashboardName || dashboardOptions[0]);
|
|
775
|
+
useEffect(() => {
|
|
810
776
|
if (!report && dashboardOptions && dashboardOptions.length) {
|
|
811
777
|
setDashboardName(dashboardOptions[0].value);
|
|
812
778
|
}
|
|
@@ -821,8 +787,8 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
821
787
|
dateFieldTable,
|
|
822
788
|
dateField,
|
|
823
789
|
};
|
|
824
|
-
const [selectedTabIndex, setSelectedTabIndex] =
|
|
825
|
-
|
|
790
|
+
const [selectedTabIndex, setSelectedTabIndex] = useState(report && report.template ? 1 : 0);
|
|
791
|
+
React.useEffect(() => {
|
|
826
792
|
async function getDashboards() {
|
|
827
793
|
const { publicKey, customerId, queryEndpoint } = client;
|
|
828
794
|
if (customerId || queryEndpoint) {
|
|
@@ -839,16 +805,16 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
839
805
|
? { orgId: customerId, name, task: 'config' }
|
|
840
806
|
: { name: dashboardName, task: 'config' },
|
|
841
807
|
};
|
|
842
|
-
const resp = await
|
|
808
|
+
const resp = await getData(client, `dashconfig?${searchParams}`, 'omit', hostedBody, null, 'GET');
|
|
843
809
|
const bigFilterObj = {};
|
|
844
810
|
if (resp.dateFilter && Object.keys(resp.dateFilter).length) {
|
|
845
811
|
if (resp.dateFilter.initialRange === 'LAST_90_DAYS') {
|
|
846
812
|
const filter = {
|
|
847
|
-
startDate:
|
|
813
|
+
startDate: sub(startOfToday(), { days: 90 }),
|
|
848
814
|
endDate: new Date(),
|
|
849
815
|
filterType: 'date_range',
|
|
850
816
|
selectedValue: [
|
|
851
|
-
|
|
817
|
+
sub(startOfToday(), { days: 90 }),
|
|
852
818
|
new Date(),
|
|
853
819
|
'90d',
|
|
854
820
|
],
|
|
@@ -867,11 +833,11 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
867
833
|
}
|
|
868
834
|
else if (resp.dateFilter.initialRange === 'LAST_30_DAYS') {
|
|
869
835
|
const filter = {
|
|
870
|
-
startDate:
|
|
836
|
+
startDate: sub(startOfToday(), { days: 30 }),
|
|
871
837
|
endDate: new Date(),
|
|
872
838
|
filterType: 'date_range',
|
|
873
839
|
selectedValue: [
|
|
874
|
-
|
|
840
|
+
sub(startOfToday(), { days: 30 }),
|
|
875
841
|
new Date(),
|
|
876
842
|
't',
|
|
877
843
|
],
|
|
@@ -892,10 +858,10 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
892
858
|
}
|
|
893
859
|
else if (resp.dateFilter.initialRange === 'CURRENT_MONTH') {
|
|
894
860
|
const filter = {
|
|
895
|
-
startDate:
|
|
861
|
+
startDate: startOfMonth(new Date()),
|
|
896
862
|
endDate: new Date(),
|
|
897
863
|
filterType: 'date_range',
|
|
898
|
-
selectedValue: [
|
|
864
|
+
selectedValue: [startOfMonth(new Date()), new Date(), 'm'],
|
|
899
865
|
options: options,
|
|
900
866
|
field: 'date_range',
|
|
901
867
|
label: 'Date',
|
|
@@ -912,11 +878,11 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
912
878
|
}
|
|
913
879
|
else {
|
|
914
880
|
const filter = {
|
|
915
|
-
startDate:
|
|
881
|
+
startDate: sub(startOfToday(), { days: 90 }),
|
|
916
882
|
endDate: new Date(),
|
|
917
883
|
filterType: 'date_range',
|
|
918
884
|
selectedValue: [
|
|
919
|
-
|
|
885
|
+
sub(startOfToday(), { days: 90 }),
|
|
920
886
|
new Date(),
|
|
921
887
|
'90d',
|
|
922
888
|
],
|
|
@@ -959,16 +925,16 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
959
925
|
}
|
|
960
926
|
getDashboards();
|
|
961
927
|
}, [dashboardName, client]);
|
|
962
|
-
|
|
928
|
+
useEffect(() => {
|
|
963
929
|
async function getDashNames() {
|
|
964
|
-
const resp = await
|
|
930
|
+
const resp = await getDataFromCloud(client, `dashnames/${client.publicKey}/`, null, 'GET');
|
|
965
931
|
setDashboardOptions(resp.dashboardNames
|
|
966
932
|
.filter(elem => elem !== null)
|
|
967
933
|
.map(key => ({ label: key, value: key })));
|
|
968
934
|
}
|
|
969
935
|
getDashNames();
|
|
970
936
|
}, []);
|
|
971
|
-
|
|
937
|
+
useEffect(() => {
|
|
972
938
|
// if (!dateField) {
|
|
973
939
|
// return;
|
|
974
940
|
// }
|
|
@@ -986,7 +952,7 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
986
952
|
return;
|
|
987
953
|
}
|
|
988
954
|
}, [chartType, dateField]);
|
|
989
|
-
|
|
955
|
+
useEffect(() => {
|
|
990
956
|
if (dateFieldOptions.length) {
|
|
991
957
|
setDateFieldTable(dateFieldOptions[0].name);
|
|
992
958
|
setDateField(dateFieldOptions[0].columns[0].name);
|
|
@@ -1012,7 +978,7 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1012
978
|
setXAxisFormat('dynamic');
|
|
1013
979
|
}
|
|
1014
980
|
else {
|
|
1015
|
-
setXAxisFormat(postgresFormatMap(
|
|
981
|
+
setXAxisFormat(postgresFormatMap(getPostgresBasicType(newFields.find(field => field.name === value))));
|
|
1016
982
|
}
|
|
1017
983
|
};
|
|
1018
984
|
const handleXAxisFieldChange = value => {
|
|
@@ -1030,7 +996,7 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1030
996
|
setXAxisFormat('dynamic');
|
|
1031
997
|
}
|
|
1032
998
|
else {
|
|
1033
|
-
setXAxisFormat(postgresFormatMap(
|
|
999
|
+
setXAxisFormat(postgresFormatMap(getPostgresBasicType(newFields.find(field => field.name === value))));
|
|
1034
1000
|
}
|
|
1035
1001
|
if (bucketFields.length > 0) {
|
|
1036
1002
|
const newBucketFields = [...bucketFields];
|
|
@@ -1072,7 +1038,7 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1072
1038
|
newColumns[index] = { ...newColumns[index], label: value };
|
|
1073
1039
|
setColumns(newColumns);
|
|
1074
1040
|
};
|
|
1075
|
-
|
|
1041
|
+
useEffect(() => {
|
|
1076
1042
|
const now = new Date();
|
|
1077
1043
|
if (!dateFilter ||
|
|
1078
1044
|
(dateFilter && dateFilter.startDate && dateFilter.endDate)) {
|
|
@@ -1107,15 +1073,15 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1107
1073
|
columns,
|
|
1108
1074
|
dateFilter,
|
|
1109
1075
|
]);
|
|
1110
|
-
return ((
|
|
1076
|
+
return (_jsx("div", { style: { display: 'inline-block' }, children: _jsxs("div", { style: {
|
|
1111
1077
|
display: 'flex',
|
|
1112
1078
|
flexDirection: 'column',
|
|
1113
1079
|
paddingLeft: 25,
|
|
1114
1080
|
paddingRight: chartConfig.chartType === 'pie' ? 25 : undefined,
|
|
1115
|
-
}, children: [(
|
|
1081
|
+
}, children: [_jsxs("div", { style: {
|
|
1116
1082
|
display: 'flex',
|
|
1117
1083
|
flexDirection: 'column',
|
|
1118
|
-
}, children: [(
|
|
1084
|
+
}, children: [_jsx("div", { style: { height: 20 } }), _jsx("div", { style: {
|
|
1119
1085
|
marginRight: chartConfig.chartType === 'pie' ||
|
|
1120
1086
|
chartConfig.chartType === 'table'
|
|
1121
1087
|
? undefined
|
|
@@ -1124,36 +1090,36 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1124
1090
|
chartConfig.chartType === 'table'
|
|
1125
1091
|
? undefined
|
|
1126
1092
|
: -25,
|
|
1127
|
-
}, children: Object.keys(chartConfig).length > 0 && ((
|
|
1093
|
+
}, children: Object.keys(chartConfig).length > 0 && (_jsx(Chart, { config: chartConfig, colors: theme.chartColors, containerStyle: {
|
|
1128
1094
|
width: chartConfig.chartType === 'table'
|
|
1129
1095
|
? 640
|
|
1130
1096
|
: 'calc(100% - 24px)',
|
|
1131
1097
|
height: 300,
|
|
1132
|
-
} })) }), (
|
|
1098
|
+
} })) }), _jsx("div", { style: { height: 40 } }), showTableFormatOptions || showDateFieldOptions ? (_jsx(_Fragment, { children: _jsx("div", { style: formHeaderStyle || {
|
|
1133
1099
|
fontFamily: theme.fontFamily,
|
|
1134
1100
|
color: theme.primaryTextColor,
|
|
1135
1101
|
fontSize: theme.fontSize + 2,
|
|
1136
1102
|
fontWeight: 600,
|
|
1137
|
-
}, children: 'Chart' }) })) : null, (
|
|
1103
|
+
}, children: 'Chart' }) })) : null, _jsxs("div", { style: {
|
|
1138
1104
|
display: 'flex',
|
|
1139
1105
|
flexDirection: 'row',
|
|
1140
1106
|
alignItems: 'center',
|
|
1141
|
-
}, children: [(
|
|
1107
|
+
}, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', marginTop: 8 }, children: [_jsx("div", { style: formLabelStyle || {
|
|
1142
1108
|
color: theme.secondaryTextColor,
|
|
1143
1109
|
fontFamily: theme?.fontFamily,
|
|
1144
1110
|
fontSize: theme?.fontSize || '14px',
|
|
1145
1111
|
fontWeight: theme.labelFontWeight || '600',
|
|
1146
|
-
}, children: "Name" }), (
|
|
1112
|
+
}, children: "Name" }), _jsx("div", { style: { minWidth: 200, marginTop: 6 }, children: _jsx(TextInputComponent, { onChange: e => setChartName(e.target.value), value: chartName, theme: theme, placeholder: 'Enter a chart name' }) })] }), _jsx("div", { style: { width: 20 } }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', marginTop: 8 }, children: [_jsx("div", { style: formLabelStyle || {
|
|
1147
1113
|
color: theme.secondaryTextColor,
|
|
1148
1114
|
fontFamily: theme?.fontFamily,
|
|
1149
1115
|
fontSize: theme?.fontSize || '14px',
|
|
1150
1116
|
fontWeight: theme.labelFontWeight || '600',
|
|
1151
|
-
}, children: "Dashboard name" }), (
|
|
1117
|
+
}, children: "Dashboard name" }), _jsx("div", { style: { minWidth: 200, marginTop: 6 }, children: _jsx(SelectComponent, { onChange: value => setDashboardName(value), value: dashboardName, theme: theme, options: dashboardOptions }) })] }), _jsx("div", { style: { width: 20 } }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', marginTop: 8 }, children: [_jsx("div", { style: formLabelStyle || {
|
|
1152
1118
|
color: theme.secondaryTextColor,
|
|
1153
1119
|
fontFamily: theme?.fontFamily,
|
|
1154
1120
|
fontSize: theme?.fontSize || '14px',
|
|
1155
1121
|
fontWeight: theme.labelFontWeight || '600',
|
|
1156
|
-
}, children: "Chart type" }), (
|
|
1122
|
+
}, children: "Chart type" }), _jsx("div", { style: { minWidth: 200, marginTop: 6 }, children: _jsx(SelectComponent, { onChange: e => setChartType(e), value: chartType, options: [
|
|
1157
1123
|
{ label: 'column', value: 'column' },
|
|
1158
1124
|
{ label: 'bar', value: 'bar' },
|
|
1159
1125
|
{ label: 'line', value: 'line' },
|
|
@@ -1162,29 +1128,29 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1162
1128
|
{ label: 'table', value: 'table' },
|
|
1163
1129
|
], theme: theme }) })] })] })] }), chartType !== 'table' &&
|
|
1164
1130
|
chartType !== 'metric' &&
|
|
1165
|
-
chartType !== 'pie' && ((
|
|
1131
|
+
chartType !== 'pie' && (_jsxs("div", { style: {
|
|
1166
1132
|
display: 'flex',
|
|
1167
1133
|
flexDirection: 'column',
|
|
1168
1134
|
marginTop: 20,
|
|
1169
1135
|
maxWidth: 200,
|
|
1170
|
-
}, children: [(
|
|
1136
|
+
}, children: [_jsx("div", { style: formLabelStyle || {
|
|
1171
1137
|
color: theme.secondaryTextColor,
|
|
1172
1138
|
fontFamily: theme?.fontFamily,
|
|
1173
1139
|
fontSize: theme?.fontSize || '14px',
|
|
1174
1140
|
fontWeight: theme.labelFontWeight || '600',
|
|
1175
|
-
}, children: "Buckets" }), (
|
|
1141
|
+
}, children: "Buckets" }), _jsx("div", { style: {
|
|
1176
1142
|
maxWidth: 200,
|
|
1177
1143
|
// marginTop: 6,
|
|
1178
1144
|
display: 'flex',
|
|
1179
1145
|
flexDirection: 'column',
|
|
1180
|
-
}, children: bucketFields.map((bucketField, index) => ((
|
|
1146
|
+
}, children: bucketFields.map((bucketField, index) => (_jsxs("div", { style: {
|
|
1181
1147
|
display: 'flex',
|
|
1182
1148
|
flexDirection: 'row',
|
|
1183
1149
|
alignItems: 'center',
|
|
1184
1150
|
marginTop: index === 0 ? 6 : 10,
|
|
1185
|
-
}, children: [(
|
|
1151
|
+
}, children: [_jsx("div", { style: { minWidth: 200 }, children: _jsx(SelectComponent, { onChange: option => handleBucketFieldChange(index, option), value: bucketField.field,
|
|
1186
1152
|
// TODO: PROB FILTER OUT NUMBERS LMAO (SO DATE AND STRING ONLY)
|
|
1187
|
-
options: xAxisOptions, theme: theme }) }), (
|
|
1153
|
+
options: xAxisOptions, theme: theme }) }), _jsx("div", { onClick: () => handleDeleteBucketField(index), style: {
|
|
1188
1154
|
cursor: 'pointer',
|
|
1189
1155
|
paddingLeft: 6,
|
|
1190
1156
|
paddingTop: 9,
|
|
@@ -1194,28 +1160,28 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1194
1160
|
display: 'flex',
|
|
1195
1161
|
alignItems: 'center',
|
|
1196
1162
|
justifyContent: 'center',
|
|
1197
|
-
}, children: (
|
|
1163
|
+
}, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: theme?.secondaryTextColor, height: "20", width: "20", children: _jsx("path", { fillRule: "evenodd", d: "M5.47 5.47a.75.75 0 011.06 0L12 10.94l5.47-5.47a.75.75 0 111.06 1.06L13.06 12l5.47 5.47a.75.75 0 11-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 01-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 010-1.06z", clipRule: "evenodd" }) }) })] }, `bucketField-${index}`))) }), !bucketFields.length && (_jsx("div", { style: { marginTop: 12 }, children: _jsx(SecondaryButtonComponent, { onClick: handleAddBucket, label: "Add bucket +" }) }))] })), _jsx("div", { style: {
|
|
1198
1164
|
display: 'flex',
|
|
1199
1165
|
flexDirection: 'row',
|
|
1200
1166
|
alignItems: 'center',
|
|
1201
1167
|
// justifyContent: 'space-between',
|
|
1202
1168
|
marginTop: 20,
|
|
1203
|
-
}, children: chartType !== 'table' && ((
|
|
1169
|
+
}, children: chartType !== 'table' && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: formLabelStyle || {
|
|
1204
1170
|
color: theme.secondaryTextColor,
|
|
1205
1171
|
fontFamily: theme?.fontFamily,
|
|
1206
1172
|
fontSize: theme?.fontSize || '14px',
|
|
1207
1173
|
fontWeight: theme.labelFontWeight || '600',
|
|
1208
|
-
}, children: chartType === 'pie' ? 'Category column' : 'x-axis column' }), (
|
|
1174
|
+
}, children: chartType === 'pie' ? 'Category column' : 'x-axis column' }), _jsx("div", { style: { height: 6 } }), _jsxs("div", { style: {
|
|
1209
1175
|
display: 'flex',
|
|
1210
1176
|
flexDirection: 'row',
|
|
1211
1177
|
alignItems: 'center',
|
|
1212
|
-
}, children: [(
|
|
1178
|
+
}, children: [_jsx("div", { style: { minWidth: 200 }, children: _jsx(SelectComponent, { onChange: e => handleXAxisFieldChange(e), value: xAxisField, options: xAxisOptions, theme: theme }) }), _jsx("div", { style: { width: 20 } }), _jsx("div", { style: { minWidth: 200 }, children: _jsx(TextInputComponent, { onChange: e => setXAxisLabel(e.target.value), value: xAxisLabel, theme: theme, placeholder: 'Enter a label' }) }), _jsx("div", { style: { width: 20 } }), _jsx("div", { style: { minWidth: 200 }, children: _jsx(SelectComponent, { onChange: e => setXAxisFormat(e), value: xAxisFormat, options: X_FORMAT_OPTIONS, theme: theme }) })] })] })) }), _jsxs("div", { style: {
|
|
1213
1179
|
display: 'flex',
|
|
1214
1180
|
flexDirection: 'row',
|
|
1215
1181
|
alignItems: 'flex-start',
|
|
1216
1182
|
// justifyContent: 'space-between',
|
|
1217
1183
|
marginTop: 20,
|
|
1218
|
-
}, children: [(
|
|
1184
|
+
}, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: formLabelStyle || {
|
|
1219
1185
|
color: theme.secondaryTextColor,
|
|
1220
1186
|
fontFamily: theme?.fontFamily,
|
|
1221
1187
|
fontSize: theme?.fontSize || '14px',
|
|
@@ -1224,32 +1190,32 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1224
1190
|
? 'Columns'
|
|
1225
1191
|
: chartType === 'pie'
|
|
1226
1192
|
? 'Quantity column'
|
|
1227
|
-
: 'y-axis columns' }), (
|
|
1193
|
+
: 'y-axis columns' }), _jsxs("div", { style: {
|
|
1228
1194
|
display: 'flex',
|
|
1229
1195
|
flexDirection: 'column',
|
|
1230
|
-
}, children: [yAxisFields.map((yAxisField, index) => ((
|
|
1196
|
+
}, children: [yAxisFields.map((yAxisField, index) => (_jsx("div", { style: {
|
|
1231
1197
|
display: 'flex',
|
|
1232
1198
|
flexDirection: 'row',
|
|
1233
1199
|
alignItems: 'center',
|
|
1234
1200
|
marginTop: index === 0 ? 6 : 10,
|
|
1235
|
-
}, children: (
|
|
1201
|
+
}, children: _jsx("div", { style: { minWidth: 200 }, children: _jsx(SelectComponent, { onChange: option => handleYAxisFieldChange(index, option), value: yAxisField.field, options: chartType === 'table' ? fieldOptions : yAxisOptions, theme: theme }) }) }, `yAxisField-${index}`))), chartType !== 'pie' && (_jsx("div", { style: { marginTop: 12 }, children: _jsx(SecondaryButtonComponent, { onClick: handleAddYAxisField, label: "Add column +" }) })), _jsx("div", { style: { height: 10 } })] })] }), _jsx("div", { style: { width: 20 } }), _jsxs("div", { style: {
|
|
1236
1202
|
display: 'flex',
|
|
1237
1203
|
flexDirection: 'column',
|
|
1238
1204
|
justifyContent: 'flex-start',
|
|
1239
|
-
}, children: [(
|
|
1205
|
+
}, children: [_jsx("div", { style: formLabelStyle || {
|
|
1240
1206
|
color: 'transparent',
|
|
1241
1207
|
fontFamily: theme?.fontFamily,
|
|
1242
1208
|
fontSize: theme?.fontSize || '14px',
|
|
1243
1209
|
fontWeight: theme.labelFontWeight || '600',
|
|
1244
1210
|
}, children: "y-axis label" }), chartType !== 'pie' &&
|
|
1245
|
-
yAxisFields.map((yAxisField, index) => ((
|
|
1211
|
+
yAxisFields.map((yAxisField, index) => (_jsxs("div", { style: {
|
|
1246
1212
|
display: 'flex',
|
|
1247
1213
|
flexDirection: 'row',
|
|
1248
1214
|
// alignItems: 'center',
|
|
1249
1215
|
marginTop: index === 0 ? 6 : 10,
|
|
1250
|
-
}, children: [(
|
|
1216
|
+
}, children: [_jsx("div", { style: { minWidth: 200 }, children: _jsx(TextInputComponent, { value: yAxisFields[index].label, onChange: e => {
|
|
1251
1217
|
handleYAxisLabelChange(index, e.target.value);
|
|
1252
|
-
}, theme: theme, placeholder: 'Enter a label' }) }), (
|
|
1218
|
+
}, theme: theme, placeholder: 'Enter a label' }) }), _jsx("div", { style: { width: 20 } }), _jsx("div", { style: { minWidth: 200 }, children: _jsx(SelectComponent, { onChange: value => handleYAxisFieldFormatChange(index, value), value: yAxisField.format, options: Y_FORMAT_OPTIONS, theme: theme }) }), _jsx("div", { onClick: () => index > 0 ? handleDeleteYAxisField(index) : undefined, style: {
|
|
1253
1219
|
cursor: index > 0 ? 'pointer' : undefined,
|
|
1254
1220
|
paddingLeft: 6,
|
|
1255
1221
|
paddingTop: 12,
|
|
@@ -1259,68 +1225,68 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1259
1225
|
display: 'flex',
|
|
1260
1226
|
alignItems: 'center',
|
|
1261
1227
|
justifyContent: 'center',
|
|
1262
|
-
}, children: (
|
|
1228
|
+
}, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: index > 0 ? theme?.secondaryTextColor : 'rgba(0,0,0,0)', height: "20", width: "20", children: _jsx("path", { fillRule: "evenodd", d: "M5.47 5.47a.75.75 0 011.06 0L12 10.94l5.47-5.47a.75.75 0 111.06 1.06L13.06 12l5.47 5.47a.75.75 0 11-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 01-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 010-1.06z", clipRule: "evenodd" }) }) })] }, `yAxisField-${index}`)))] })] }), _jsx("div", { style: { height: 20 } }), showTableFormatOptions && (_jsxs(_Fragment, { children: [_jsx("div", { style: formHeaderStyle || {
|
|
1263
1229
|
fontFamily: theme.fontFamily,
|
|
1264
1230
|
color: theme.primaryTextColor,
|
|
1265
1231
|
fontSize: theme.fontSize + 2,
|
|
1266
1232
|
fontWeight: 600,
|
|
1267
1233
|
// marginTop: 20,
|
|
1268
|
-
}, children: 'Table' }), (
|
|
1234
|
+
}, children: 'Table' }), _jsx("div", { style: { height: 8 } })] })), showTableFormatOptions && chartType !== 'table' && (_jsx("div", { style: formLabelStyle || {
|
|
1269
1235
|
color: theme.secondaryTextColor,
|
|
1270
1236
|
fontFamily: theme?.fontFamily,
|
|
1271
1237
|
fontSize: theme?.fontSize || '14px',
|
|
1272
1238
|
fontWeight: theme.labelFontWeight || '600',
|
|
1273
|
-
}, children: 'Columns' })), showTableFormatOptions && chartType !== 'table' && ((
|
|
1239
|
+
}, children: 'Columns' })), showTableFormatOptions && chartType !== 'table' && (_jsxs("div", { style: {
|
|
1274
1240
|
display: 'flex',
|
|
1275
1241
|
flexDirection: 'row',
|
|
1276
1242
|
alignItems: 'flex-start',
|
|
1277
1243
|
marginTop: 6,
|
|
1278
1244
|
// justifyContent: 'space-between',
|
|
1279
1245
|
// marginTop: 8,
|
|
1280
|
-
}, children: [(
|
|
1246
|
+
}, children: [_jsx("div", { style: { display: 'flex', flexDirection: 'column' }, children: _jsxs("div", { style: {
|
|
1281
1247
|
display: 'flex',
|
|
1282
1248
|
flexDirection: 'column',
|
|
1283
|
-
}, children: [columns.map((yAxisField, index) => ((
|
|
1249
|
+
}, children: [columns.map((yAxisField, index) => (_jsx("div", { style: {
|
|
1284
1250
|
display: 'flex',
|
|
1285
1251
|
flexDirection: 'row',
|
|
1286
1252
|
alignItems: 'center',
|
|
1287
1253
|
marginTop: index === 0 ? 6 : 10,
|
|
1288
|
-
}, children: (
|
|
1254
|
+
}, children: _jsx("div", { style: { minWidth: 200 }, children: _jsx(SelectComponent, { value: yAxisField.field, onChange: option => {
|
|
1289
1255
|
handleColumnFieldChange(index, option);
|
|
1290
|
-
}, options: fieldOptions, theme: theme }) }) }, `column-${index}`))), (
|
|
1256
|
+
}, options: fieldOptions, theme: theme }) }) }, `column-${index}`))), _jsx("div", { style: { height: 10 } })] }) }), _jsx("div", { style: { width: 20 } }), _jsx("div", { style: {
|
|
1291
1257
|
display: 'flex',
|
|
1292
1258
|
flexDirection: 'column',
|
|
1293
1259
|
justifyContent: 'flex-start',
|
|
1294
|
-
}, children: columns.map((yAxisField, index) => ((
|
|
1260
|
+
}, children: columns.map((yAxisField, index) => (_jsxs("div", { style: {
|
|
1295
1261
|
display: 'flex',
|
|
1296
1262
|
flexDirection: 'row',
|
|
1297
1263
|
alignItems: 'center',
|
|
1298
1264
|
marginTop: index === 0 ? 6 : 10,
|
|
1299
|
-
}, children: [(
|
|
1265
|
+
}, children: [_jsx("div", { style: { minWidth: 200 }, children: _jsx(TextInputComponent, { theme: theme, placeholder: "Enter column label", value: yAxisField.label, onChange: event => handleColumnLabelChange(index, event.target.value) }) }), _jsx("div", { style: { width: 20 } }), _jsx("div", { style: { minWidth: 200 }, children: _jsx(SelectComponent, { value: yAxisField.format, onChange: option => handleColumnFormatChange(index, option), options: Y_FORMAT_OPTIONS, theme: theme }) })] }, `column-${index}`))) })] })), showDateFieldOptions && _jsx("div", { style: { height: 20 } }), showDateFieldOptions && (_jsxs(_Fragment, { children: [_jsx("div", { style: formHeaderStyle || {
|
|
1300
1266
|
fontFamily: theme.fontFamily,
|
|
1301
1267
|
color: theme.primaryTextColor,
|
|
1302
1268
|
fontSize: theme.fontSize + 2,
|
|
1303
1269
|
fontWeight: 600,
|
|
1304
1270
|
// marginTop: 20,
|
|
1305
|
-
}, children: 'Filters' }), (
|
|
1271
|
+
}, children: 'Filters' }), _jsx("div", { style: { height: 8 } })] })), showDateFieldOptions && (_jsxs("div", { style: {
|
|
1306
1272
|
display: 'flex',
|
|
1307
1273
|
flexDirection: 'row',
|
|
1308
1274
|
alignItems: 'center',
|
|
1309
|
-
}, children: [(
|
|
1275
|
+
}, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: formLabelStyle || {
|
|
1310
1276
|
color: theme.secondaryTextColor,
|
|
1311
1277
|
fontFamily: theme?.fontFamily,
|
|
1312
1278
|
fontSize: theme?.fontSize || '14px',
|
|
1313
1279
|
fontWeight: theme.labelFontWeight || '600',
|
|
1314
|
-
}, children: "Date field table" }), (
|
|
1280
|
+
}, children: "Date field table" }), _jsx("div", { style: { minWidth: 200, marginTop: 6 }, children: _jsx(SelectComponent, { options: !dateFieldOptions.length
|
|
1315
1281
|
? [{ label: '', value: '' }]
|
|
1316
1282
|
: dateFieldOptions.map(elem => {
|
|
1317
1283
|
return { label: elem.name, value: elem.name };
|
|
1318
|
-
}), onChange: e => setDateFieldTable(e), value: dateFieldTable, theme: theme }) })] }), (
|
|
1284
|
+
}), onChange: e => setDateFieldTable(e), value: dateFieldTable, theme: theme }) })] }), _jsx("div", { style: { width: 20 } }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: formLabelStyle || {
|
|
1319
1285
|
color: theme.secondaryTextColor,
|
|
1320
1286
|
fontFamily: theme?.fontFamily,
|
|
1321
1287
|
fontSize: theme?.fontSize || '14px',
|
|
1322
1288
|
fontWeight: theme.labelFontWeight || '600',
|
|
1323
|
-
}, children: "Date field" }), (
|
|
1289
|
+
}, children: "Date field" }), _jsx("div", { style: { minWidth: 200, marginTop: 6 }, children: _jsx(SelectComponent, { options: !dateFieldOptions.length
|
|
1324
1290
|
? [{ label: '', value: '' }]
|
|
1325
1291
|
: dateFieldOptions.filter(elem => elem.name === dateFieldTable // Replace `values.dateFieldTable` with your state variable or prop
|
|
1326
1292
|
).length
|
|
@@ -1329,17 +1295,17 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1329
1295
|
.columns.map(elem => {
|
|
1330
1296
|
return { label: elem.name, value: elem.name };
|
|
1331
1297
|
})
|
|
1332
|
-
: [{ label: '', value: '' }], onChange: value => setDateField(value), value: dateField, theme: theme }) })] })] })), showAccessControlOptions && ((
|
|
1298
|
+
: [{ label: '', value: '' }], onChange: value => setDateField(value), value: dateField, theme: theme }) })] })] })), showAccessControlOptions && (_jsxs("div", { style: {
|
|
1333
1299
|
display: 'flex',
|
|
1334
1300
|
flexDirection: 'column',
|
|
1335
1301
|
marginTop: 40,
|
|
1336
1302
|
marginBottom: 40,
|
|
1337
|
-
}, children: [(
|
|
1303
|
+
}, children: [_jsx("div", { style: {
|
|
1338
1304
|
fontFamily: theme.fontFamily,
|
|
1339
1305
|
color: theme.primaryTextColor,
|
|
1340
1306
|
fontSize: theme.fontSize + 2,
|
|
1341
1307
|
fontWeight: 600,
|
|
1342
|
-
}, children: 'Access Control' }), (
|
|
1308
|
+
}, children: 'Access Control' }), _jsx("div", { style: { height: 12 } }), _jsxs("div", { style: {
|
|
1343
1309
|
padding: '1px',
|
|
1344
1310
|
display: 'flex',
|
|
1345
1311
|
flexDirection: 'row',
|
|
@@ -1350,7 +1316,7 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1350
1316
|
color: '#212121',
|
|
1351
1317
|
backgroundColor: 'rgba(33, 33, 33, 0.03)',
|
|
1352
1318
|
borderRadius: '6px',
|
|
1353
|
-
}, children: [(
|
|
1319
|
+
}, children: [_jsx("div", { onClick: () => {
|
|
1354
1320
|
setSelectedTabIndex(0);
|
|
1355
1321
|
setTemplate(false);
|
|
1356
1322
|
}, style: {
|
|
@@ -1377,7 +1343,7 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1377
1343
|
? '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)'
|
|
1378
1344
|
: undefined, // Shadow when selected
|
|
1379
1345
|
outline: 'none', // focus:outline-none
|
|
1380
|
-
}, children: `This Organization${organizationName ? ` (${organizationName})` : ``}` }), (
|
|
1346
|
+
}, children: `This Organization${organizationName ? ` (${organizationName})` : ``}` }), _jsx("div", { onClick: () => {
|
|
1381
1347
|
setSelectedTabIndex(1);
|
|
1382
1348
|
setTemplate(true);
|
|
1383
1349
|
}, style: {
|
|
@@ -1404,7 +1370,7 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1404
1370
|
? '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)'
|
|
1405
1371
|
: undefined, // Shadow when selected
|
|
1406
1372
|
outline: 'none', // focus:outline-none
|
|
1407
|
-
}, children: 'Global (All Organizations)' })] })] })), (
|
|
1373
|
+
}, children: 'Global (All Organizations)' })] })] })), _jsx("div", { style: { paddingRight: 25 }, children: _jsx(ButtonComponent, { onClick: () => {
|
|
1408
1374
|
const { xAxisField, xAxisLabel, xAxisFormat, chartName, chartType, dashboardName, dateFieldTable, dateField, template, } = chartConfig;
|
|
1409
1375
|
if (isSubmitting === false) {
|
|
1410
1376
|
editChart({
|
|
@@ -1428,6 +1394,5 @@ function FormikForm({ data, xAxisOptions, yAxisOptions, fieldOptions, dateFieldO
|
|
|
1428
1394
|
showTableFormatOptions,
|
|
1429
1395
|
});
|
|
1430
1396
|
}
|
|
1431
|
-
}, label: report ? 'Save changes' : 'Add to dashboard' }) }), (
|
|
1397
|
+
}, label: report ? 'Save changes' : 'Add to dashboard' }) }), _jsx("div", { style: { height: 20 } })] }) }));
|
|
1432
1398
|
}
|
|
1433
|
-
//# sourceMappingURL=AddToDashboardModal.js.map
|