react-autoql 3.4.7 → 3.4.8
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/autoql.esm.css +2076 -2076
- package/dist/autoql.esm.js +40 -25
- package/package.json +1 -1
package/dist/autoql.esm.js
CHANGED
|
@@ -479,7 +479,8 @@ var autoQLConfigDefault = {
|
|
|
479
479
|
enableDrilldowns: true,
|
|
480
480
|
enableNotifications: false,
|
|
481
481
|
enableSlackSharing: true,
|
|
482
|
-
enableTeamsSharing: true
|
|
482
|
+
enableTeamsSharing: true,
|
|
483
|
+
enableCSVDownload: false
|
|
483
484
|
};
|
|
484
485
|
var themeConfigDefault = {
|
|
485
486
|
theme: 'light',
|
|
@@ -923,7 +924,9 @@ var formatChartLabel = function formatChartLabel(_ref) {
|
|
|
923
924
|
case 'PERCENT':
|
|
924
925
|
{
|
|
925
926
|
if (Number(d)) {
|
|
926
|
-
|
|
927
|
+
var p = Number(d) / 100;
|
|
928
|
+
console.log(p);
|
|
929
|
+
formattedLabel = Numbro(p).format({
|
|
927
930
|
output: 'percent',
|
|
928
931
|
mantissa: 0
|
|
929
932
|
});
|
|
@@ -1050,7 +1053,8 @@ var formatElement = function formatElement(_ref2) {
|
|
|
1050
1053
|
case 'PERCENT':
|
|
1051
1054
|
{
|
|
1052
1055
|
if (Number(element)) {
|
|
1053
|
-
|
|
1056
|
+
var p = Number(element) / 100;
|
|
1057
|
+
formattedElement = Numbro(p).format('0.00%');
|
|
1054
1058
|
|
|
1055
1059
|
if (htmlElement) {
|
|
1056
1060
|
htmlElement.classList.add("comparison-value-".concat(element < 0 ? 'negative' : 'positive'));
|
|
@@ -7516,6 +7520,7 @@ var Button = /*#__PURE__*/function (_React$Component) {
|
|
|
7516
7520
|
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement("button", {
|
|
7517
7521
|
className: "react-autoql-btn\n ".concat(_this.props.className || '', "\n ").concat(type, "\n ").concat(size, "\n ").concat(isDisabled ? ' disabled' : ''),
|
|
7518
7522
|
"data-test": "react-autoql-btn",
|
|
7523
|
+
"data-multiline": _this.props.multiline,
|
|
7519
7524
|
style: _objectSpread2({}, _this.props.style),
|
|
7520
7525
|
onClick: _this.props.onClick,
|
|
7521
7526
|
"data-tip": _this.props.tooltip,
|
|
@@ -7543,6 +7548,7 @@ _defineProperty(Button, "propTypes", {
|
|
|
7543
7548
|
onClick: PropTypes.func,
|
|
7544
7549
|
loading: PropTypes.bool,
|
|
7545
7550
|
disabled: PropTypes.bool,
|
|
7551
|
+
multiline: PropTypes.bool,
|
|
7546
7552
|
tooltip: PropTypes.string
|
|
7547
7553
|
});
|
|
7548
7554
|
|
|
@@ -7551,6 +7557,7 @@ _defineProperty(Button, "defaultProps", {
|
|
|
7551
7557
|
loading: false,
|
|
7552
7558
|
size: 'large',
|
|
7553
7559
|
disabled: false,
|
|
7560
|
+
multiline: false,
|
|
7554
7561
|
tooltip: undefined,
|
|
7555
7562
|
onClick: function onClick() {}
|
|
7556
7563
|
});
|
|
@@ -10260,11 +10267,22 @@ var QueryOutput = /*#__PURE__*/function (_React$Component) {
|
|
|
10260
10267
|
}
|
|
10261
10268
|
|
|
10262
10269
|
var formattedColumns = columns.map(function (col, i) {
|
|
10270
|
+
/**
|
|
10271
|
+
* EDIT:
|
|
10272
|
+
* We no longer want to default to one over the other. Howeever,
|
|
10273
|
+
* I would like to hang onto this code for now incase we do want to
|
|
10274
|
+
* include either/or in some cases in the future
|
|
10275
|
+
*/
|
|
10263
10276
|
// Regardless of the BE response, we want to default to percent
|
|
10264
|
-
if (
|
|
10265
|
-
|
|
10266
|
-
|
|
10267
|
-
|
|
10277
|
+
// if (
|
|
10278
|
+
// (col.type === 'RATIO' || col.type === 'NUMBER') &&
|
|
10279
|
+
// _get(
|
|
10280
|
+
// getDataFormatting(this.props.dataFormatting),
|
|
10281
|
+
// 'comparisonDisplay'
|
|
10282
|
+
// ) === 'PERCENT'
|
|
10283
|
+
// ) {
|
|
10284
|
+
// col.type = 'PERCENT'
|
|
10285
|
+
// }
|
|
10268
10286
|
col.field = "".concat(i);
|
|
10269
10287
|
col.title = col.display_name;
|
|
10270
10288
|
col.id = uuid.v4();
|
|
@@ -15173,14 +15191,19 @@ var DataAlerts = /*#__PURE__*/function (_React$Component) {
|
|
|
15173
15191
|
type: "hour-glass"
|
|
15174
15192
|
}), _this.hasError(notification) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
15175
15193
|
type: "primary",
|
|
15194
|
+
tooltip: "This Alert is no longer active. <br /> Click to re-initialze it.",
|
|
15195
|
+
multiline: true,
|
|
15176
15196
|
className: "react-autoql-re-initialize-btn",
|
|
15177
|
-
tooltip: "Please re-initialize data alert",
|
|
15178
15197
|
onClick: function onClick() {
|
|
15179
|
-
|
|
15198
|
+
_this.props.onAlertInitializationCallback(notification, _this.props.selectedDemoProjectId, _this.props.authentication);
|
|
15199
|
+
|
|
15200
|
+
_this.getDataAlerts();
|
|
15180
15201
|
}
|
|
15181
15202
|
}, /*#__PURE__*/React.createElement("span", {
|
|
15182
15203
|
className: "react-autoql-re-initialize-btn-text"
|
|
15183
|
-
},
|
|
15204
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
15205
|
+
type: "warning-triangle"
|
|
15206
|
+
}), ' ', " Resend")), /*#__PURE__*/React.createElement(Checkbox, {
|
|
15184
15207
|
themeConfig: getThemeConfig(_this.props.themeConfig),
|
|
15185
15208
|
type: "switch",
|
|
15186
15209
|
className: "react-autoql-notification-disable-checkbox"
|
|
@@ -15267,7 +15290,8 @@ _defineProperty(DataAlerts, "defaultProps", {
|
|
|
15267
15290
|
authentication: authenticationDefault,
|
|
15268
15291
|
themeConfig: themeConfigDefault,
|
|
15269
15292
|
showCreateAlertBtn: false,
|
|
15270
|
-
onErrorCallback: function onErrorCallback() {}
|
|
15293
|
+
onErrorCallback: function onErrorCallback() {},
|
|
15294
|
+
onAlertInitializationCallback: function onAlertInitializationCallback() {}
|
|
15271
15295
|
});
|
|
15272
15296
|
|
|
15273
15297
|
var getInitialStateData$2 = function getInitialStateData(initialData) {
|
|
@@ -17884,30 +17908,21 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
17884
17908
|
});
|
|
17885
17909
|
|
|
17886
17910
|
_defineProperty(_assertThisInitialized(_this), "renderToolbar", function () {
|
|
17911
|
+
var _shouldShowButton;
|
|
17912
|
+
|
|
17887
17913
|
var displayType = _get(_this.props.responseRef, 'state.displayType');
|
|
17888
17914
|
|
|
17889
17915
|
var response = _get(_this.props.responseRef, 'props.queryResponse');
|
|
17890
17916
|
|
|
17891
17917
|
var isDataResponse = _get(response, 'data.data.display_type') === 'data';
|
|
17892
|
-
var shouldShowButton = {
|
|
17918
|
+
var shouldShowButton = (_shouldShowButton = {
|
|
17893
17919
|
showFilterButton: isTableResponse(response, displayType) && !_this.areAllColumnsHidden() && _get(response, 'data.data.rows.length') > 1,
|
|
17894
17920
|
showCopyButton: isTableResponse(response, displayType) && !_this.areAllColumnsHidden() && !!_get(response, 'data.data.rows.length'),
|
|
17895
17921
|
showSaveAsCSVButton: isTableResponse(response, displayType) && !_this.areAllColumnsHidden() && !!_get(response, 'data.data.rows.length'),
|
|
17896
17922
|
showSaveAsPNGButton: CHART_TYPES.includes(displayType),
|
|
17897
17923
|
showHideColumnsButton: getAutoQLConfig$1(_this.props.autoQLConfig).enableColumnVisibilityManager && isTableResponse(response, displayType) && displayType !== 'pivot_table' && _get(response, 'data.data.columns.length') > 0,
|
|
17898
|
-
showSQLButton: isDataResponse && getAutoQLConfig$1(_this.props.autoQLConfig).debug
|
|
17899
|
-
|
|
17900
|
-
showReportProblemButton: !!_get(response, 'data.data.query_id'),
|
|
17901
|
-
showCreateNotificationIcon: isDataResponse && getAutoQLConfig$1(_this.props.autoQLConfig).enableNotifications && !_this.isDrilldownResponse(),
|
|
17902
|
-
showShareToSlackButton: false,
|
|
17903
|
-
// This feature is disabled indefinitely
|
|
17904
|
-
// isDataResponse &&
|
|
17905
|
-
// getAutoQLConfig(this.props.autoQLConfig).enableSlackSharing,
|
|
17906
|
-
showShareToTeamsButton: false // This feature is disabled indefinitely
|
|
17907
|
-
// isDataResponse &&
|
|
17908
|
-
// getAutoQLConfig(this.props.autoQLConfig).enableTeamsSharing,
|
|
17909
|
-
|
|
17910
|
-
};
|
|
17924
|
+
showSQLButton: isDataResponse && getAutoQLConfig$1(_this.props.autoQLConfig).debug
|
|
17925
|
+
}, _defineProperty(_shouldShowButton, "showSaveAsCSVButton", isDataResponse && getAutoQLConfig$1(_this.props.autoQLConfig).enableCSVDownload), _defineProperty(_shouldShowButton, "showDeleteButton", _this.props.enableDeleteBtn), _defineProperty(_shouldShowButton, "showReportProblemButton", !!_get(response, 'data.data.query_id')), _defineProperty(_shouldShowButton, "showCreateNotificationIcon", isDataResponse && getAutoQLConfig$1(_this.props.autoQLConfig).enableNotifications && !_this.isDrilldownResponse()), _defineProperty(_shouldShowButton, "showShareToSlackButton", false), _defineProperty(_shouldShowButton, "showShareToTeamsButton", false), _shouldShowButton);
|
|
17911
17926
|
shouldShowButton.showMoreOptionsButton = shouldShowButton.showCopyButton || shouldShowButton.showSQLButton || shouldShowButton.showCreateNotificationIcon || shouldShowButton.showSaveAsCSVButton || shouldShowButton.showSaveAsPNGButton || shouldShowButton.showShareToSlackButton || shouldShowButton.showShareToTeamsButton; // If there is nothing to put in the toolbar, don't render it
|
|
17912
17927
|
|
|
17913
17928
|
if (!Object.values(shouldShowButton).find(function (showButton) {
|