react-autoql 3.5.1 → 3.5.4

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.
@@ -7,7 +7,7 @@ import utc from 'dayjs/plugin/utc';
7
7
  import timezone from 'dayjs/plugin/timezone';
8
8
  import axios from 'axios';
9
9
  import _$1 from 'lodash';
10
- import React, { Fragment, Component } from 'react';
10
+ import React, { Fragment, Component, createRef } from 'react';
11
11
  import _regeneratorRuntime from '@babel/runtime/regenerator';
12
12
  import PropTypes, { shape, string, number, bool, oneOf, arrayOf, func, instanceOf, oneOfType, array } from 'prop-types';
13
13
  import { BsArrowBarDown, BsArrowBarUp } from 'react-icons/bs';
@@ -48,7 +48,6 @@ import { symbol, symbolCircle, pie, arc } from 'd3-shape';
48
48
  import { entries } from 'd3-collection';
49
49
  import 'd3-transition';
50
50
  import Drawer from 'rc-drawer';
51
- import 'lodash.includes';
52
51
  import _has from 'lodash.has';
53
52
  import { Scrollbars } from 'react-custom-scrollbars';
54
53
  import LocalizedStrings from 'react-localization';
@@ -1721,7 +1720,7 @@ var lang = new LocalizedStrings({
1721
1720
  queryPrompt: 'Type your queries here ',
1722
1721
  seeMore: 'See more',
1723
1722
  dataMessengerOptions: 'Options menu',
1724
- openFilterLocking: 'Open filter locking menu',
1723
+ openFilterLocking: 'Manage Filters',
1725
1724
  closeFilterLocking: 'Close filter menu',
1726
1725
  filterLockingTitle: 'Filter Locking',
1727
1726
  noFiltersLocked: 'No Filters are locked yet',
@@ -1761,7 +1760,7 @@ var lang = new LocalizedStrings({
1761
1760
  queryPrompt: 'Escribe tus consultas aquí',
1762
1761
  seeMore: 'Ver más',
1763
1762
  dataMessengerOptions: 'Menú de opciones',
1764
- openFilterLocking: 'Abrir menú de filtrar',
1763
+ openFilterLocking: 'Administrar filtros',
1765
1764
  closeFilterLocking: 'Cerrar menú de filtrar',
1766
1765
  filterLockingTitle: 'Menú de Filtro',
1767
1766
  noFiltersLocked: 'Ningún filtro está bloqueado todavía',
@@ -2804,7 +2803,7 @@ var runQueryOnly = function runQueryOnly() {
2804
2803
 
2805
2804
  var url = "".concat(domain, "/autoql/api/v1/query?key=").concat(apiKey);
2806
2805
  var finalUserSelection = transformUserSelection(userSelection);
2807
- var sessionConditions = JSON.parse(sessionStorage.getItem("conditions"));
2806
+ var sessionConditions = JSON.parse(sessionStorage.getItem('conditions'));
2808
2807
  var conditions = {};
2809
2808
 
2810
2809
  if (sessionConditions !== null) {
@@ -2916,9 +2915,6 @@ var runQuery = function runQuery() {
2916
2915
  source = _ref5.source,
2917
2916
  skipQueryValidation = _ref5.skipQueryValidation,
2918
2917
  AutoAEId = _ref5.AutoAEId;
2919
-
2920
- // Temp for demo: decode token to get project id
2921
- var id;
2922
2918
  var base64Url;
2923
2919
 
2924
2920
  if (token) {
@@ -2929,38 +2925,35 @@ var runQuery = function runQuery() {
2929
2925
  var buff = Buffer.from(base64, 'base64');
2930
2926
  var payloadinit = buff.toString('ascii');
2931
2927
  var payload = JSON.parse(payloadinit);
2932
- id = _get(payload, 'project_id');
2928
+ _get(payload, 'project_id');
2933
2929
  }
2934
- } // temp ignore validation for these projects
2930
+ }
2935
2931
 
2932
+ if (enableQueryValidation && !skipQueryValidation && !isQandA) {
2933
+ return runQueryValidation({
2934
+ text: query,
2935
+ domain: domain,
2936
+ apiKey: apiKey,
2937
+ token: token
2938
+ }).then(function (response) {
2939
+ if (failedValidation(response)) {
2940
+ return Promise.resolve(response);
2941
+ }
2936
2942
 
2937
- if (id !== 'accounting-demo' && id !== 'operational-demo' && id !== 'stockmarket-demo') {
2938
- if (enableQueryValidation && !skipQueryValidation && !isQandA) {
2939
- return runQueryValidation({
2940
- text: query,
2943
+ return runQueryOnly({
2944
+ query: query,
2945
+ userSelection: userSelection,
2946
+ debug: debug,
2947
+ test: test,
2941
2948
  domain: domain,
2942
2949
  apiKey: apiKey,
2943
- token: token
2944
- }).then(function (response) {
2945
- if (failedValidation(response)) {
2946
- return Promise.resolve(response);
2947
- }
2948
-
2949
- return runQueryOnly({
2950
- query: query,
2951
- userSelection: userSelection,
2952
- debug: debug,
2953
- test: test,
2954
- domain: domain,
2955
- apiKey: apiKey,
2956
- token: token,
2957
- source: source,
2958
- AutoAEId: AutoAEId
2959
- });
2960
- }).catch(function (error) {
2961
- return Promise.reject(error);
2950
+ token: token,
2951
+ source: source,
2952
+ AutoAEId: AutoAEId
2962
2953
  });
2963
- }
2954
+ }).catch(function (error) {
2955
+ return Promise.reject(error);
2956
+ });
2964
2957
  }
2965
2958
 
2966
2959
  return runQueryOnly({
@@ -3099,9 +3092,10 @@ var fetchConditions = function fetchConditions() {
3099
3092
  token = _ref10.token,
3100
3093
  domain = _ref10.domain;
3101
3094
 
3102
- // if (!domain || !apiKey || !token) {
3103
- // return Promise.reject(new Error('Unauthenticated'))
3104
- // }
3095
+ if (!domain || !apiKey || !token) {
3096
+ return Promise.reject(new Error('Unauthenticated'));
3097
+ }
3098
+
3105
3099
  var url = "".concat(domain, "/autoql/api/v1/query/condition-locking?key=").concat(apiKey);
3106
3100
  var config = {
3107
3101
  headers: {
@@ -3454,6 +3448,12 @@ var QueryInput = /*#__PURE__*/function (_React$Component) {
3454
3448
  if (!_isEqual(getThemeConfig(_this.props.themeConfig), getThemeConfig(prevProps.themeConfig))) {
3455
3449
  setCSSVars(getThemeConfig(_this.props.themeConfig));
3456
3450
  }
3451
+
3452
+ if (_this.props.inputValue !== prevProps.inputValue) {
3453
+ _this.setState({
3454
+ inputValue: _this.props.inputValue
3455
+ });
3456
+ }
3457
3457
  });
3458
3458
 
3459
3459
  _defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
@@ -3737,6 +3737,12 @@ var QueryInput = /*#__PURE__*/function (_React$Component) {
3737
3737
  queryText: _this.userSelectedValue
3738
3738
  });
3739
3739
  }
3740
+
3741
+ if (_this.props.isBackButtonClicked) {
3742
+ _this.setState({
3743
+ inputValue: ''
3744
+ });
3745
+ }
3740
3746
  });
3741
3747
 
3742
3748
  _defineProperty(_assertThisInitialized(_this), "moveCaretAtEnd", function (e) {
@@ -3774,7 +3780,9 @@ var QueryInput = /*#__PURE__*/function (_React$Component) {
3774
3780
  onFocus: _this.moveCaretAtEnd,
3775
3781
  autoFocus: true
3776
3782
  }
3777
- }) // <QueryInputWithValidation
3783
+ }) :
3784
+ /*#__PURE__*/
3785
+ // <QueryInputWithValidation
3778
3786
  // authentication={getAuthentication(this.props.authentication)}
3779
3787
  // themeConfig={getThemeConfig(this.props.themeConfig)}
3780
3788
  // ref={(ref) => (this.queryValidationInputRef = ref)}
@@ -3791,7 +3799,7 @@ var QueryInput = /*#__PURE__*/function (_React$Component) {
3791
3799
  // this.focus()
3792
3800
  // }}
3793
3801
  // />
3794
- : /*#__PURE__*/React.createElement("input", {
3802
+ React.createElement("input", {
3795
3803
  className: "react-autoql-chatbar-input".concat(_this.props.showChataIcon ? ' left-padding' : ''),
3796
3804
  placeholder: _this.props.placeholder || 'Type your queries here',
3797
3805
  value: _this.state.inputValue,
@@ -3848,7 +3856,8 @@ _defineProperty(QueryInput, "propTypes", {
3848
3856
  className: string,
3849
3857
  autoCompletePlacement: string,
3850
3858
  showLoadingDots: bool,
3851
- showChataIcon: bool
3859
+ showChataIcon: bool,
3860
+ inputValue: string
3852
3861
  });
3853
3862
 
3854
3863
  _defineProperty(QueryInput, "defaultProps", {
@@ -3862,6 +3871,8 @@ _defineProperty(QueryInput, "defaultProps", {
3862
3871
  className: null,
3863
3872
  showLoadingDots: true,
3864
3873
  showChataIcon: true,
3874
+ isBackButtonClicked: false,
3875
+ inputValue: undefined,
3865
3876
  source: [],
3866
3877
  onSubmit: function onSubmit() {},
3867
3878
  onResponseCallback: function onResponseCallback() {}
@@ -4876,9 +4887,9 @@ var ChataColumnChart = /*#__PURE__*/function (_Component) {
4876
4887
  numberColumnIndices = _this$props.numberColumnIndices,
4877
4888
  stringColumnIndices = _this$props.stringColumnIndices,
4878
4889
  onLegendTitleClick = _this$props.onLegendTitleClick,
4879
- bottomLegendMargin = _this$props.bottomLegendMargin;
4880
- _this$props.stringColumnIndex;
4881
- var numberColumnIndex = _this$props.numberColumnIndex,
4890
+ bottomLegendMargin = _this$props.bottomLegendMargin,
4891
+ stringColumnIndex = _this$props.stringColumnIndex,
4892
+ numberColumnIndex = _this$props.numberColumnIndex,
4882
4893
  numberAxisTitle = _this$props.numberAxisTitle,
4883
4894
  stringAxisTitle = _this$props.stringAxisTitle,
4884
4895
  dataFormatting = _this$props.dataFormatting,
@@ -4928,7 +4939,7 @@ var ChataColumnChart = /*#__PURE__*/function (_Component) {
4928
4939
  xScale: xScale,
4929
4940
  yScale: yScale
4930
4941
  },
4931
- xCol: columns[0],
4942
+ xCol: columns[stringColumnIndex],
4932
4943
  yCol: columns[numberColumnIndex],
4933
4944
  margins: {
4934
4945
  left: leftMargin,
@@ -7959,6 +7970,10 @@ var ChataChart = /*#__PURE__*/function (_Component) {
7959
7970
  });
7960
7971
  var leftMargin = Math.ceil(maxYLabelWidth) + 55; // margin to include axis label
7961
7972
 
7973
+ if (isNaN(leftMargin)) {
7974
+ leftMargin = 96; // if there is no yAxisLabels, set leftMargin to default value as 96
7975
+ }
7976
+
7962
7977
  if (xAxisBBox.width > _this.props.width) {
7963
7978
  leftMargin += xAxisBBox.width - _this.props.width;
7964
7979
  }
@@ -8014,7 +8029,11 @@ var ChataChart = /*#__PURE__*/function (_Component) {
8014
8029
  var xAxis = select(_this.chartRef).select('.axis-Bottom').node();
8015
8030
  var xAxisBBox = xAxis ? xAxis.getBBox() : {};
8016
8031
  var bottomMargin = Math.ceil(xAxisBBox.height) + bottomLegendMargin + 40; // margin to include axis label
8017
- // only for bar charts (vertical grid lines mess with the axis size)
8032
+
8033
+ if (xAxisBBox.height === 0) {
8034
+ bottomMargin = 463; // if no xAxisBBox available, set bottomMarigin to default as 463
8035
+ } // only for bar charts (vertical grid lines mess with the axis size)
8036
+
8018
8037
 
8019
8038
  if (_this.props.type === 'bar' || _this.props.type === 'stacked_bar') {
8020
8039
  var innerTickSize = _this.props.height - _this.state.topMargin - _this.state.bottomMargin;
@@ -8275,7 +8294,8 @@ var ChataChart = /*#__PURE__*/function (_Component) {
8275
8294
 
8276
8295
  _defineProperty(_assertThisInitialized(_this), "renderStringColumnSelectorContent", function () {
8277
8296
  return /*#__PURE__*/React.createElement("div", {
8278
- className: "axis-selector-container"
8297
+ className: "axis-selector-container",
8298
+ id: "string-column-selector-content"
8279
8299
  }, /*#__PURE__*/React.createElement("ul", {
8280
8300
  className: "axis-selector-content"
8281
8301
  }, _this.props.dataConfig.stringColumnIndices.map(function (colIndex, i) {
@@ -8298,7 +8318,9 @@ var ChataChart = /*#__PURE__*/function (_Component) {
8298
8318
  currencySelectorState = _this$state2.currencySelectorState,
8299
8319
  quantitySelectorState = _this$state2.quantitySelectorState,
8300
8320
  ratioSelectorState = _this$state2.ratioSelectorState;
8301
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
8321
+ return /*#__PURE__*/React.createElement("div", {
8322
+ id: "chata-chart-popover"
8323
+ }, /*#__PURE__*/React.createElement("div", {
8302
8324
  className: "axis-selector-container"
8303
8325
  }, !!currencySelectorState.length && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
8304
8326
  className: "number-selector-header"
@@ -8441,7 +8463,8 @@ var ChataChart = /*#__PURE__*/function (_Component) {
8441
8463
  }
8442
8464
 
8443
8465
  return /*#__PURE__*/React.createElement("div", {
8444
- className: "axis-selector-container"
8466
+ className: "axis-selector-container",
8467
+ id: "legend-selector-content"
8445
8468
  }, /*#__PURE__*/React.createElement("ul", {
8446
8469
  className: "axis-selector-content"
8447
8470
  }, _this.props.dataConfig.stringColumnIndices.map(function (colIndex, i) {
@@ -9430,6 +9453,20 @@ var QueryOutput = /*#__PURE__*/function (_React$Component) {
9430
9453
 
9431
9454
 
9432
9455
  if (!aDate || !bDate) {
9456
+ //If one is a YYYY-WW
9457
+ if (a.includes('W')) {
9458
+ var aDateYear = a.substring(0, 4);
9459
+ var bDateYear = b.substring(0, 4);
9460
+
9461
+ if (aDateYear !== bDateYear) {
9462
+ return bDateYear - aDateYear;
9463
+ } else {
9464
+ var aDateWeek = a.substring(6, 8);
9465
+ var bDateWeek = b.substring(6, 8);
9466
+ return bDateWeek - aDateWeek;
9467
+ }
9468
+ }
9469
+
9433
9470
  return b - a;
9434
9471
  }
9435
9472
 
@@ -10235,7 +10272,7 @@ var QueryOutput = /*#__PURE__*/function (_React$Component) {
10235
10272
  var formattedColumns = columns.map(function (col, i) {
10236
10273
  /**
10237
10274
  * EDIT:
10238
- * We no longer want to default to one over the other. Howeever,
10275
+ * We no longer want to default to one over the other. Howeever,
10239
10276
  * I would like to hang onto this code for now incase we do want to
10240
10277
  * include either/or in some cases in the future
10241
10278
  */
@@ -10279,8 +10316,8 @@ var QueryOutput = /*#__PURE__*/function (_React$Component) {
10279
10316
  // displayed differently than the data (ie. dates)
10280
10317
 
10281
10318
  col.headerFilterFunc = _this.setFilterFunction(col); // Allow proper chronological sorting for date strings
10282
-
10283
- col.sorter = _this.setSorterFunction(col); // Context menu when right clicking on column header
10319
+ // col.sorter = this.setSorterFunction(col)
10320
+ // Context menu when right clicking on column header
10284
10321
 
10285
10322
  col.headerContext = function (e, column) {
10286
10323
  // Do not show native context menu
@@ -10358,7 +10395,6 @@ var QueryOutput = /*#__PURE__*/function (_React$Component) {
10358
10395
  title: 'Month',
10359
10396
  name: 'Month',
10360
10397
  field: '0',
10361
- // sorter: 'date',
10362
10398
  frozen: true,
10363
10399
  visible: true
10364
10400
  }];
@@ -10675,13 +10711,11 @@ var QueryOutput = /*#__PURE__*/function (_React$Component) {
10675
10711
  });
10676
10712
 
10677
10713
  _defineProperty(_assertThisInitialized(_this), "renderChart", function (width, height, displayType) {
10678
- var _React$createElement;
10679
-
10680
10714
  if (!_this.chartData) {
10681
10715
  return 'Error: There was no data supplied for this chart';
10682
10716
  }
10683
10717
 
10684
- return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(ChataChart, (_React$createElement = {
10718
+ return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(ChataChart, {
10685
10719
  themeConfig: getThemeConfig(_this.props.themeConfig),
10686
10720
  ref: function ref(_ref8) {
10687
10721
  return _this.chartRef = _ref8;
@@ -10697,8 +10731,14 @@ var QueryOutput = /*#__PURE__*/function (_React$Component) {
10697
10731
  backgroundColor: _this.props.backgroundColor,
10698
10732
  activeChartElementKey: _this.props.activeChartElementKey,
10699
10733
  onLegendClick: _this.onLegendClick,
10700
- dataConfig: _cloneDeep(_this.dataConfig)
10701
- }, _defineProperty(_React$createElement, "themeConfig", getThemeConfig(_this.props.themeConfig)), _defineProperty(_React$createElement, "changeStringColumnIndex", _this.onChangeStringColumnIndex), _defineProperty(_React$createElement, "changeLegendColumnIndex", _this.onChangeLegendColumnIndex), _defineProperty(_React$createElement, "changeNumberColumnIndices", _this.onChangeNumberColumnIndices), _defineProperty(_React$createElement, "onChartClick", _this.onChartClick), _defineProperty(_React$createElement, "isResizing", _this.props.isResizing), _defineProperty(_React$createElement, "enableDynamicCharting", _this.props.enableDynamicCharting), _React$createElement)));
10734
+ dataConfig: _cloneDeep(_this.dataConfig),
10735
+ changeStringColumnIndex: _this.onChangeStringColumnIndex,
10736
+ changeLegendColumnIndex: _this.onChangeLegendColumnIndex,
10737
+ changeNumberColumnIndices: _this.onChangeNumberColumnIndices,
10738
+ onChartClick: _this.onChartClick,
10739
+ isResizing: _this.props.isResizing,
10740
+ enableDynamicCharting: _this.props.enableDynamicCharting
10741
+ }));
10702
10742
  });
10703
10743
 
10704
10744
  _defineProperty(_assertThisInitialized(_this), "renderHelpResponse", function () {
@@ -10975,9 +11015,9 @@ var QueryOutput = /*#__PURE__*/function (_React$Component) {
10975
11015
  var text = output.replace(/'/g, '');
10976
11016
 
10977
11017
  if (_get(queryResponse, 'data.data.persistent_locked_conditions').includes(text) || _get(queryResponse, 'data.data.session_locked_conditions').includes(text)) {
10978
- return "\n <a class=\"react-autoql-condition-link-filtered\">\n <span class=\"material-icons react-autoql-custom-icon\">lock</span>\n ".concat(' ', text, "\n </a>\n ");
11018
+ return "\n <a id=\"react-autoql-interpreted-value-label\" class=\"react-autoql-condition-link-filtered\">\n <span class=\"material-icons react-autoql-custom-icon\">lock</span>\n ".concat(' ', text, "\n </a>\n ");
10979
11019
  } else {
10980
- return "<a class=\"react-autoql-condition-link\">".concat(text, "</a>");
11020
+ return "<a id=\"react-autoql-interpreted-value-label\" class=\"react-autoql-condition-link\">".concat(text, "</a>");
10981
11021
  }
10982
11022
  }).replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/gi, function (output) {
10983
11023
  return moment.utc(output).format('ll').toString();
@@ -10991,13 +11031,13 @@ var QueryOutput = /*#__PURE__*/function (_React$Component) {
10991
11031
  float: 'left',
10992
11032
  minHeight: 20
10993
11033
  } // onClick={() => {
10994
- // this.setState({
10995
- // isShowingInterpretation: !this.state.isShowingInterpretation
11034
+ // this.setState({
11035
+ // isShowingInterpretation: !this.state.isShowingInterpretation
10996
11036
  // })
10997
11037
  // }}
10998
11038
 
10999
- }, /*#__PURE__*/React.createElement(Icon // type={this.state.isShowingInterpretation ? 'caret-down' : 'caret-right' }
11000
- // data-tip={this.state.isShowingInterpretation ? "Hide query interpretation" : "Show query interpretation" }
11039
+ }, /*#__PURE__*/React.createElement(Icon // type={this.state.isShowingInterpretation ? 'caret-down' : 'caret-right' }
11040
+ // data-tip={this.state.isShowingInterpretation ? "Hide query interpretation" : "Show query interpretation" }
11001
11041
  , {
11002
11042
  type: "info" // data-for="react-autoql-interpretation"
11003
11043
 
@@ -11005,9 +11045,9 @@ var QueryOutput = /*#__PURE__*/function (_React$Component) {
11005
11045
  onRest: _this.handleShowHide,
11006
11046
  isOpened: true // isOpened={this.state.isShowingInterpretation}
11007
11047
 
11008
- }, /*#__PURE__*/React.createElement("strong", null, "Interpreted as:", ' '), /*#__PURE__*/React.createElement("span", {
11009
- onClick: function onClick() {
11010
- return _this.props.onConditionClickCallback();
11048
+ }, /*#__PURE__*/React.createElement("strong", null, "Interpreted as: "), /*#__PURE__*/React.createElement("span", {
11049
+ onClick: function onClick(e) {
11050
+ return _this.props.onConditionClickCallback(e);
11011
11051
  },
11012
11052
  dangerouslySetInnerHTML: {
11013
11053
  __html: "".concat(reverseTranslation)
@@ -11574,7 +11614,7 @@ var fetchNotificationCount = function fetchNotificationCount(_ref2) {
11574
11614
  Authorization: "Bearer ".concat(token)
11575
11615
  }
11576
11616
  });
11577
- var url = "".concat(domain, "/autoql/api/v1/data-alerts/notifications/summary/poll?key=").concat(apiKey, "&unacknowledged=").concat(unacknowledged);
11617
+ var url = "".concat(domain, "/autoql/api/v1/data-alerts/notifications/summary?key=").concat(apiKey, "&unacknowledged=").concat(unacknowledged);
11578
11618
  var config = {
11579
11619
  timeout: 180000
11580
11620
  };
@@ -12121,6 +12161,8 @@ var NotificationIcon = /*#__PURE__*/function (_React$Component) {
12121
12161
  count: 0
12122
12162
  });
12123
12163
 
12164
+ _defineProperty(_assertThisInitialized(_this), "timerID", void 0);
12165
+
12124
12166
  _defineProperty(_assertThisInitialized(_this), "componentDidMount", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
12125
12167
  return _regeneratorRuntime.wrap(function _callee$(_context) {
12126
12168
  while (1) {
@@ -12150,6 +12192,7 @@ var NotificationIcon = /*#__PURE__*/function (_React$Component) {
12150
12192
 
12151
12193
  _defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
12152
12194
  _this._isMounted = false;
12195
+ clearInterval(_this.timerID);
12153
12196
  });
12154
12197
 
12155
12198
  _defineProperty(_assertThisInitialized(_this), "getNotificationCount", function (currentCount) {
@@ -12175,35 +12218,46 @@ var NotificationIcon = /*#__PURE__*/function (_React$Component) {
12175
12218
 
12176
12219
  _defineProperty(_assertThisInitialized(_this), "subscribeToNotificationCount", function (count) {
12177
12220
  if (_this._isMounted) {
12178
- _this.getNotificationCount(count).then(function (newCount) {
12179
- // Got a new count, now we want to reconnect
12180
- _this.subscribeToNotificationCount(newCount);
12221
+ /**
12222
+ * For short polling notifications, we needed to set the interval on FE side.
12223
+ * Interval set to trigger every 90 seconds.
12224
+ */
12225
+ if (_this.timerID) {
12226
+ clearInterval(_this.timerID);
12227
+ }
12181
12228
 
12182
- _this.FAILED_POLL_ATTEMPTS = 0;
12183
- }).catch(function (error) {
12184
- if (_this.FAILED_POLL_ATTEMPTS === 5) {
12185
- var _error = new Error('There were 5 failed attempts to poll for notifications. Unsubscribing from notification count.');
12229
+ _this.timerID = setInterval(function () {
12230
+ _this.getNotificationCount(count).then(function (newCount) {
12231
+ // Got a new count, now we want to reconnect
12232
+ _this.subscribeToNotificationCount(newCount);
12186
12233
 
12187
- console.error(_error);
12234
+ _this.FAILED_POLL_ATTEMPTS = 0;
12235
+ }).catch(function (error) {
12236
+ if (_this.FAILED_POLL_ATTEMPTS === 5) {
12237
+ var _error = new Error('There were 5 failed attempts to poll for notifications. Unsubscribing from notification count.');
12188
12238
 
12189
- _this.props.onErrorCallback(_error);
12239
+ console.error(_error);
12190
12240
 
12191
- return;
12192
- } else if (_get(error, 'response.status') == 504) {
12193
- // Timed out because there were no changes
12194
- // Let's connect again
12195
- _this.subscribeToNotificationCount();
12196
- } else {
12197
- // Something else went wrong, wait one second and reconnect
12198
- new Promise(function (resolve) {
12199
- return setTimeout(resolve, 1000);
12200
- }).then(function () {
12241
+ _this.props.onErrorCallback(_error);
12242
+
12243
+ clearInterval(_this.timerID);
12244
+ throw new Error(_error);
12245
+ } else if (_get(error, 'response.status') == 504) {
12246
+ // Timed out because there were no changes
12247
+ // Let's connect again
12201
12248
  _this.subscribeToNotificationCount();
12202
- });
12203
- }
12249
+ } else {
12250
+ // Something else went wrong, wait one second and reconnect
12251
+ new Promise(function (resolve) {
12252
+ return setTimeout(resolve, 1000);
12253
+ }).then(function () {
12254
+ _this.subscribeToNotificationCount();
12255
+ });
12256
+ }
12204
12257
 
12205
- _this.FAILED_POLL_ATTEMPTS += 1;
12206
- });
12258
+ _this.FAILED_POLL_ATTEMPTS += 1;
12259
+ });
12260
+ }, 90 * 1000);
12207
12261
  }
12208
12262
  });
12209
12263
 
@@ -13252,6 +13306,7 @@ var NotificationItem = /*#__PURE__*/function (_React$Component) {
13252
13306
  ref: function ref(r) {
13253
13307
  return _this.OUTPUT_REF = r;
13254
13308
  },
13309
+ isDashboardQuery: true,
13255
13310
  queryResponse: queryResponse,
13256
13311
  autoQLConfig: {
13257
13312
  enableDrilldowns: false
@@ -15067,6 +15122,8 @@ var DataAlerts = /*#__PURE__*/function (_React$Component) {
15067
15122
  }
15068
15123
  }
15069
15124
 
15125
+ _this.props.onSuccessAlert('Notification created!');
15126
+
15070
15127
  _this.setState({
15071
15128
  isEditModalVisible: false,
15072
15129
  customAlertsList: newDataAlertList
@@ -15255,7 +15312,7 @@ var DataAlerts = /*#__PURE__*/function (_React$Component) {
15255
15312
  className: "react-autoql-re-initialize-btn-text"
15256
15313
  }, /*#__PURE__*/React.createElement(Icon, {
15257
15314
  type: "warning-triangle"
15258
- }), ' ', " Resend")), /*#__PURE__*/React.createElement(Checkbox, {
15315
+ }), " Resend")), /*#__PURE__*/React.createElement(Checkbox, {
15259
15316
  themeConfig: getThemeConfig(_this.props.themeConfig),
15260
15317
  type: "switch",
15261
15318
  className: "react-autoql-notification-disable-checkbox"
@@ -15335,7 +15392,8 @@ _defineProperty(DataAlerts, "propTypes", {
15335
15392
  authentication: authenticationType,
15336
15393
  themeConfig: themeConfigType,
15337
15394
  onErrorCallback: PropTypes.func,
15338
- showCreateAlertBtn: PropTypes.bool
15395
+ showCreateAlertBtn: PropTypes.bool,
15396
+ onSuccessAlert: PropTypes.func
15339
15397
  });
15340
15398
 
15341
15399
  _defineProperty(DataAlerts, "defaultProps", {
@@ -15343,7 +15401,8 @@ _defineProperty(DataAlerts, "defaultProps", {
15343
15401
  themeConfig: themeConfigDefault,
15344
15402
  showCreateAlertBtn: false,
15345
15403
  onErrorCallback: function onErrorCallback() {},
15346
- onAlertInitializationCallback: function onAlertInitializationCallback() {}
15404
+ onAlertInitializationCallback: function onAlertInitializationCallback() {},
15405
+ onSuccessAlert: function onSuccessAlert() {}
15347
15406
  });
15348
15407
 
15349
15408
  var getInitialStateData$2 = function getInitialStateData(initialData) {
@@ -17347,7 +17406,8 @@ var Input = /*#__PURE__*/function (_React$Component) {
17347
17406
 
17348
17407
  _defineProperty(_assertThisInitialized(_this), "state", {
17349
17408
  isHideColumnsModalVisible: false,
17350
- isSettingColumnVisibility: false
17409
+ isSettingColumnVisibility: false,
17410
+ reportProblemMessage: undefined
17351
17411
  });
17352
17412
 
17353
17413
  _defineProperty(_assertThisInitialized(_this), "componentDidMount", function () {
@@ -17678,23 +17738,29 @@ var Input = /*#__PURE__*/function (_React$Component) {
17678
17738
  isVisible: _this.state.activeMenu === 'other-problem',
17679
17739
  onClose: function onClose() {
17680
17740
  _this.setState({
17681
- activeMenu: undefined
17741
+ activeMenu: undefined,
17742
+ reportProblemMessage: undefined
17682
17743
  });
17683
17744
  },
17684
17745
  onConfirm: function onConfirm() {
17685
- _this.reportQueryProblem(_this.reportProblemMessage);
17746
+ _this.reportQueryProblem(_this.state.reportProblemMessage);
17686
17747
 
17687
- _this.reportProblemMessage = undefined;
17748
+ _this.setState({
17749
+ reportProblemMessage: undefined
17750
+ });
17688
17751
  },
17689
17752
  confirmLoading: _this.state.isReportingProblem,
17690
17753
  title: "Report a Problem",
17691
17754
  enableBodyScroll: true,
17692
17755
  width: "600px",
17693
- confirmText: "Report"
17756
+ confirmText: "Report",
17757
+ confirmDisabled: _this.state.reportProblemMessage ? false : true
17694
17758
  }, "Please tell us more about the problem you are experiencing:", /*#__PURE__*/React.createElement("textarea", {
17695
17759
  className: "report-problem-text-area",
17696
17760
  onChange: function onChange(e) {
17697
- return _this.reportProblemMessage = e.target.value;
17761
+ return _this.setState({
17762
+ reportProblemMessage: e.target.value
17763
+ });
17698
17764
  }
17699
17765
  })));
17700
17766
  });
@@ -18290,8 +18356,8 @@ var ChatMessage = /*#__PURE__*/function (_React$Component) {
18290
18356
  });
18291
18357
  }
18292
18358
  },
18293
- onConditionClickCallback: function onConditionClickCallback() {
18294
- _this.props.onConditionClickCallback();
18359
+ onConditionClickCallback: function onConditionClickCallback(e) {
18360
+ _this.props.onConditionClickCallback(e);
18295
18361
  }
18296
18362
  }));
18297
18363
  }
@@ -18311,7 +18377,7 @@ var ChatMessage = /*#__PURE__*/function (_React$Component) {
18311
18377
 
18312
18378
  _this.scrollIntoView();
18313
18379
  } else {
18314
- messageElement.style.maxHeight = '85%';
18380
+ messageElement.style.maxHeight = '90%';
18315
18381
  messageElement.style.height = "".concat(messageElement.offsetHeights, "px");
18316
18382
  }
18317
18383
  } catch (error) {
@@ -18826,17 +18892,35 @@ _defineProperty(Cascader, "defaultProps", {
18826
18892
  onSeeMoreClick: undefined
18827
18893
  });
18828
18894
 
18895
+ function accentColorAssist(col, amt) {
18896
+ var usePound = false;
18897
+
18898
+ if (col[0] == "#") {
18899
+ col = col.slice(1);
18900
+ usePound = true;
18901
+ }
18902
+
18903
+ var num = parseInt(col, 16);
18904
+ var r = (num >> 16) + amt;
18905
+ if (r > 255) r = 255;else if (r < 0) r = 0;
18906
+ var b = (num >> 8 & 0x00FF) + amt;
18907
+ if (b > 255) b = 255;else if (b < 0) b = 0;
18908
+ var g = (num & 0x0000FF) + amt;
18909
+ if (g > 255) g = 255;else if (g < 0) g = 0;
18910
+ return (usePound ? "#" : "") + (g | b << 8 | r << 16).toString(16);
18911
+ }
18912
+
18829
18913
  var autoCompleteArray$1 = [];
18830
18914
 
18831
- var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
18832
- _inherits(ConditionLockMenu, _React$Component);
18915
+ var FilterLockMenu = /*#__PURE__*/function (_React$Component) {
18916
+ _inherits(FilterLockMenu, _React$Component);
18833
18917
 
18834
- var _super = _createSuper(ConditionLockMenu);
18918
+ var _super = _createSuper(FilterLockMenu);
18835
18919
 
18836
- function ConditionLockMenu() {
18920
+ function FilterLockMenu() {
18837
18921
  var _this;
18838
18922
 
18839
- _classCallCheck(this, ConditionLockMenu);
18923
+ _classCallCheck(this, FilterLockMenu);
18840
18924
 
18841
18925
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
18842
18926
  args[_key] = arguments[_key];
@@ -18846,6 +18930,10 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
18846
18930
 
18847
18931
  _defineProperty(_assertThisInitialized(_this), "UNIQUE_ID", uuid.v4());
18848
18932
 
18933
+ _defineProperty(_assertThisInitialized(_this), "mouseInfoRef", /*#__PURE__*/createRef());
18934
+
18935
+ _defineProperty(_assertThisInitialized(_this), "mouseSettingRef", /*#__PURE__*/createRef());
18936
+
18849
18937
  _defineProperty(_assertThisInitialized(_this), "state", {
18850
18938
  inputValue: '',
18851
18939
  lastQuery: '',
@@ -18897,20 +18985,46 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
18897
18985
  }
18898
18986
  }
18899
18987
 
18900
- _this.setState({
18901
- selectedConditions: array.sort(),
18902
- inputValue: '',
18903
- isFetchingConditions: false
18988
+ array.sort(function (a, b) {
18989
+ return a.keyword.toUpperCase() < b.keyword.toUpperCase() ? -1 : a.keyword > b.keyword ? 1 : 0;
18904
18990
  });
18991
+
18992
+ if (_this.props.initFilterText && _this.props.initFilterText !== '') {
18993
+ _this.setState({
18994
+ selectedConditions: array,
18995
+ isFetchingConditions: false
18996
+ });
18997
+
18998
+ for (var _i2 = 0; _i2 < array.length; _i2++) {
18999
+ if (array[_i2].keyword === _this.props.initFilterText) {
19000
+ _this.handleHighlightFilterRow(_i2);
19001
+
19002
+ return;
19003
+ }
19004
+ }
19005
+
19006
+ _this.animateInputTextAndSubmit(_this.props.initFilterText);
19007
+ } else {
19008
+ _this.setState({
19009
+ selectedConditions: array,
19010
+ inputValue: '',
19011
+ isFetchingConditions: false
19012
+ });
19013
+ }
18905
19014
  });
18906
19015
  } catch (error) {
18907
19016
  console.error(error);
18908
19017
  }
18909
19018
  });
18910
19019
 
19020
+ _defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps, predState) {
19021
+ if (!_isEqual(getThemeConfig(_this.props.themeConfig), getThemeConfig(prevProps.themeConfig))) {
19022
+ setCSSVars(getThemeConfig(_this.props.themeConfig));
19023
+ }
19024
+ });
19025
+
18911
19026
  _defineProperty(_assertThisInitialized(_this), "getSuggestionValue", function (suggestion) {
18912
19027
  var array = _this.state.selectedConditions;
18913
- var tempId = uuid.v4();
18914
19028
 
18915
19029
  if (array.some(function (item) {
18916
19030
  return item.key === suggestion.name.canonical && item.value === suggestion.name.keyword;
@@ -18918,7 +19032,6 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
18918
19032
  _this.handleShowMessage('warning', 'This condition has already been applied.');
18919
19033
  } else {
18920
19034
  array.push({
18921
- id: tempId,
18922
19035
  keyword: suggestion.name.keyword,
18923
19036
  value: suggestion.name.keyword,
18924
19037
  show_message: suggestion.name.show_message,
@@ -18928,13 +19041,16 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
18928
19041
  });
18929
19042
 
18930
19043
  _this.setState({
18931
- selectedConditions: array,
18932
19044
  inputValue: ''
18933
19045
  });
18934
19046
 
18935
19047
  setConditions(_objectSpread2(_objectSpread2({}, getAuthentication(_this.props.authentication)), {}, {
18936
19048
  conditions: array
18937
- }));
19049
+ })).then(function () {
19050
+ _this.handleShowMessage('lock', "".concat(suggestion.name.keyword, " has been locked"));
19051
+
19052
+ _this.handleFetchFilteredList();
19053
+ });
18938
19054
  }
18939
19055
  });
18940
19056
 
@@ -18971,11 +19087,7 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
18971
19087
  }
18972
19088
 
18973
19089
  var array = _this.state.selectedConditions;
18974
- array.splice(index, 1);
18975
-
18976
- _this.setState({
18977
- selectedConditions: array
18978
- });
19090
+ array.splice(index, 1); // this.setState({ selectedConditions: array })
18979
19091
 
18980
19092
  _this.handleShowMessage('unlock', 'Filter removed.');
18981
19093
 
@@ -18995,7 +19107,9 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
18995
19107
  }, function () {
18996
19108
  setConditions(_objectSpread2(_objectSpread2({}, getAuthentication(_this.props.authentication)), {}, {
18997
19109
  conditions: _this.state.selectedConditions
18998
- }));
19110
+ })).then(function () {
19111
+ _this.handleFetchFilteredList();
19112
+ });
18999
19113
 
19000
19114
  if (item.lock_flag === 0) {
19001
19115
  if (sessionConditions == null) sessionConditions = [];
@@ -19064,6 +19178,57 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
19064
19178
  });
19065
19179
  });
19066
19180
 
19181
+ _defineProperty(_assertThisInitialized(_this), "timer", void 0);
19182
+
19183
+ _defineProperty(_assertThisInitialized(_this), "onEnterFilterHeaderInfo", function () {
19184
+ var el = document.getElementById('react-autoql-filter-description-id');
19185
+ _this.timer = setTimeout(function () {
19186
+ el.className = 'show';
19187
+ }, 500);
19188
+ });
19189
+
19190
+ _defineProperty(_assertThisInitialized(_this), "onLeaveFilterHeaderInfo", function () {
19191
+ var el = document.getElementById('react-autoql-filter-description-id');
19192
+ el.className = el.className.replace('show', '');
19193
+ clearTimeout(_this.timer);
19194
+ });
19195
+
19196
+ _defineProperty(_assertThisInitialized(_this), "onEnterFilterSettingInfo", function () {
19197
+ var el = document.getElementById('react-autoql-filter-setting-info-card');
19198
+ _this.timer = setTimeout(function () {
19199
+ el.className = 'show';
19200
+ }, 500);
19201
+ });
19202
+
19203
+ _defineProperty(_assertThisInitialized(_this), "onLeaveFilterSettingInfo", function () {
19204
+ var el = document.getElementById('react-autoql-filter-setting-info-card');
19205
+ el.className = el.className.replace('show', '');
19206
+ clearTimeout(_this.timer);
19207
+ });
19208
+
19209
+ _defineProperty(_assertThisInitialized(_this), "animateInputTextAndSubmit", function (text) {
19210
+ if (typeof text === 'string' && _get(text, 'length')) {
19211
+ var _loop = function _loop(i) {
19212
+ setTimeout(function () {
19213
+ _this.setState({
19214
+ inputValue: text.slice(0, i)
19215
+ });
19216
+
19217
+ if (i === text.length) {
19218
+ setTimeout(function () {
19219
+ var input = document.querySelector('#react-autoql-filter-menu-input');
19220
+ input.focus();
19221
+ }, 300);
19222
+ }
19223
+ }, i * 50);
19224
+ };
19225
+
19226
+ for (var i = 1; i <= text.length; i++) {
19227
+ _loop(i);
19228
+ }
19229
+ }
19230
+ });
19231
+
19067
19232
  _defineProperty(_assertThisInitialized(_this), "renderShowMessage", function () {
19068
19233
  return /*#__PURE__*/React.createElement("div", {
19069
19234
  id: "react-autoql-condition-show-message"
@@ -19072,32 +19237,10 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
19072
19237
  }), " ", _this.state.showMessage.message);
19073
19238
  });
19074
19239
 
19075
- _defineProperty(_assertThisInitialized(_this), "renderAcceptConditionsButton", function () {
19076
- return /*#__PURE__*/React.createElement("div", {
19077
- key: "accept-conditions-btn",
19078
- className: "react-autoql-accept-conditions-button"
19079
- }, /*#__PURE__*/React.createElement("span", {
19080
- onClick: function onClick() {
19081
- setConditions(_objectSpread2(_objectSpread2({}, getAuthentication(_this.props.authentication)), {}, {
19082
- conditions: _this.state.selectedConditions
19083
- })).then(function () {
19084
- _this.props.onClose(true);
19085
- }).catch(function (e) {
19086
- //WIP showErrorMessage
19087
- console.error(e);
19088
- });
19089
- }
19090
- }, /*#__PURE__*/React.createElement(Icon, {
19091
- type: "lock",
19092
- style: {
19093
- verticalAlign: 'middle'
19094
- }
19095
- }), " Save"));
19096
- });
19097
-
19098
19240
  _defineProperty(_assertThisInitialized(_this), "render", function () {
19099
19241
  var containerWidth = _this.props.containerWidth;
19100
19242
  return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement("div", {
19243
+ "data-test": "react-autoql-filter-menu-container",
19101
19244
  className: "react-autoql-condition-lock-menu",
19102
19245
  style: {
19103
19246
  width: containerWidth
@@ -19110,18 +19253,9 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
19110
19253
  className: "react-autoql-filter-locking-title"
19111
19254
  }, lang.filterLockingTitle, " ", ' ', /*#__PURE__*/React.createElement(Icon, {
19112
19255
  type: "info",
19113
- onMouseEnter: function onMouseEnter() {
19114
- return setTimeout(function () {
19115
- _this.setState({
19116
- isShowingInfo: true
19117
- });
19118
- }, 300);
19119
- },
19120
- onMouseLeave: function onMouseLeave() {
19121
- return _this.setState({
19122
- isShowingInfo: false
19123
- });
19124
- }
19256
+ ref: _this.mouseInfoRef,
19257
+ onMouseEnter: _this.onEnterFilterHeaderInfo,
19258
+ onMouseLeave: _this.onLeaveFilterHeaderInfo
19125
19259
  })), /*#__PURE__*/React.createElement("button", {
19126
19260
  onClick: function onClick() {
19127
19261
  _this.props.onClose();
@@ -19133,84 +19267,81 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
19133
19267
  type: "close"
19134
19268
  }))), /*#__PURE__*/React.createElement("div", {
19135
19269
  className: "autoql-condition-locking-menu-container"
19136
- }, _this.state.isShowingInfo ? /*#__PURE__*/React.createElement("div", {
19137
- className: "react-autoql-filter-locking-empty-list"
19270
+ }, /*#__PURE__*/React.createElement("div", {
19271
+ id: "react-autoql-filter-description-id"
19138
19272
  }, /*#__PURE__*/React.createElement(Icon, {
19139
19273
  type: "info"
19140
- }), /*#__PURE__*/React.createElement("p", null, "Filters can be applied to narrow down your query results. Locking a filter ensures that only the specific data you wish to see is returned.")) : null, /*#__PURE__*/React.createElement(Autosuggest, {
19274
+ }), /*#__PURE__*/React.createElement("p", {
19275
+ className: "react-autoql-filter-info-text"
19276
+ }, "Filters can be applied to narrow down your query results. Locking a filter ensures that only the specific data you wish to see is returned.")), /*#__PURE__*/React.createElement(Autosuggest, {
19141
19277
  ref: function ref(_ref2) {
19142
19278
  _this.autoSuggest = _ref2;
19143
19279
  },
19280
+ id: "react-autoql-filter-menu-input",
19144
19281
  highlightFirstSuggestion: true,
19145
19282
  suggestions: _this.state.suggestions,
19146
19283
  onSuggestionsFetchRequested: _this.onSuggestionsFetchRequested,
19147
19284
  onSuggestionsClearRequested: _this.onSuggestionsClearRequested,
19148
19285
  getSuggestionValue: _this.getSuggestionValue,
19149
19286
  renderSuggestion: function renderSuggestion(suggestion) {
19150
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("table", {
19287
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
19288
+ id: "react-autoql-filter-table",
19151
19289
  className: "autoql-condition-locking-menu-list"
19152
- }, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
19290
+ }, /*#__PURE__*/React.createElement("tr", {
19291
+ id: "react-autoql-filter-table-row"
19292
+ }, /*#__PURE__*/React.createElement("td", {
19293
+ id: "react-autoql-filter-table-data",
19153
19294
  style: {
19154
19295
  width: 300
19155
19296
  }
19156
- }, suggestion.name.keyword), /*#__PURE__*/React.createElement("td", null, suggestion.name.show_message)))));
19297
+ }, suggestion.name.keyword), /*#__PURE__*/React.createElement("td", {
19298
+ id: "react-autoql-filter-table-data"
19299
+ }, suggestion.name.show_message))));
19157
19300
  },
19158
19301
  inputProps: {
19159
19302
  onChange: _this.onInputChange,
19160
19303
  value: _this.state.inputValue,
19161
19304
  disabled: _this.state.isFetchingConditions,
19162
19305
  placeholder: 'Search & select a filter',
19163
- className: 'react-autoql-condition-locking-input'
19306
+ className: 'react-autoql-condition-locking-input',
19307
+ id: 'react-autoql-filter-menu-input'
19164
19308
  }
19165
- }), _this.state.isShowingSettingInfo ? /*#__PURE__*/React.createElement("div", {
19166
- className: "react-autoql-filter-setting-info-card"
19167
- }, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(Icon, {
19309
+ }), /*#__PURE__*/React.createElement("div", {
19310
+ id: "react-autoql-filter-setting-info-card"
19311
+ }, /*#__PURE__*/React.createElement("p", {
19312
+ className: "react-autoql-filter-info-text"
19313
+ }, /*#__PURE__*/React.createElement(Icon, {
19168
19314
  type: "info"
19169
19315
  }), ' ', /*#__PURE__*/React.createElement("strong", null, "Persistent"), " filters remain locked at all times, unless the filter is removed.", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Icon, {
19170
19316
  type: "info"
19171
- }), ' ', /*#__PURE__*/React.createElement("strong", null, "Session"), " filters remain locked until you end your browser session.")) : null)), _this.state.isFetchingConditions ? /*#__PURE__*/React.createElement("div", {
19317
+ }), ' ', /*#__PURE__*/React.createElement("strong", null, "Session"), " filters remain locked until you end your browser session.")))), _this.state.isFetchingConditions ? /*#__PURE__*/React.createElement("div", {
19172
19318
  className: "react-autoql-condition-list-loading-container"
19173
19319
  }, /*#__PURE__*/React.createElement(LoadingDots, null)) : /*#__PURE__*/React.createElement("div", {
19174
19320
  className: "react-autoql-condition-list"
19175
19321
  }, _get(_this.state.selectedConditions, 'length') === 0 ? /*#__PURE__*/React.createElement("div", {
19176
19322
  className: "react-autoql-empty-condition-list"
19177
- }, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("i", null, lang.noFiltersLocked))) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
19178
- style: {
19179
- minHeight: 150
19180
- }
19181
- }, /*#__PURE__*/React.createElement("table", {
19323
+ }, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("i", null, lang.noFiltersLocked))) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("table", {
19182
19324
  className: "react-autoql-condition-table"
19183
- }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("th", {
19184
- scope: "col"
19185
- }, "Filter"), /*#__PURE__*/React.createElement("th", {
19186
- scope: "col",
19325
+ }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
19187
19326
  style: {
19188
- minWidth: 154
19327
+ width: '60%'
19189
19328
  }
19190
- }, "Settings", /*#__PURE__*/React.createElement(Icon, {
19329
+ }, "Filter"), /*#__PURE__*/React.createElement("th", null, "Settings", /*#__PURE__*/React.createElement(Icon, {
19191
19330
  type: "info",
19192
- onMouseEnter: function onMouseEnter() {
19193
- return setTimeout(function () {
19194
- _this.setState({
19195
- isShowingSettingInfo: true
19196
- });
19197
- }, 300);
19198
- },
19199
- onMouseLeave: function onMouseLeave() {
19200
- return _this.setState({
19201
- isShowingSettingInfo: false
19202
- });
19203
- }
19331
+ ref: _this.mouseSettingRef,
19332
+ onMouseEnter: _this.onEnterFilterSettingInfo,
19333
+ onMouseLeave: _this.onLeaveFilterSettingInfo
19204
19334
  })), /*#__PURE__*/React.createElement("th", {
19205
- scope: "col",
19206
19335
  style: {
19207
19336
  display: 'table-cell',
19208
19337
  verticalAlign: 'middle',
19209
- textAlign: 'right'
19338
+ textAlign: 'right',
19339
+ width: '35px'
19210
19340
  }
19211
- })), /*#__PURE__*/React.createElement("tbody", null, _this.state.selectedConditions.map(function (item, index) {
19341
+ }))), /*#__PURE__*/React.createElement("tbody", null, _this.state.selectedConditions.map(function (item, index) {
19212
19342
  return /*#__PURE__*/React.createElement("tr", {
19213
- key: index
19343
+ key: index,
19344
+ id: "react-autoql-condition-table-list-item-".concat(index)
19214
19345
  }, /*#__PURE__*/React.createElement("td", {
19215
19346
  className: "react-autoql-condition-table-list-item"
19216
19347
  }, item.keyword, ' ', "(".concat(item.show_message, ")")), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Switch, {
@@ -19218,8 +19349,8 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
19218
19349
  return _this.handlePersistConditionToggle(item, index);
19219
19350
  },
19220
19351
  checked: item.lock_flag,
19221
- onColor: "#86d3ff",
19222
- onHandleColor: "#2693e6",
19352
+ onColor: accentColorAssist(getThemeConfig(_this.props.themeConfig).accentColor, 180),
19353
+ onHandleColor: getThemeConfig(getThemeConfig(_this.props.themeConfig)).accentColor,
19223
19354
  uncheckedIcon: false,
19224
19355
  checkedIcon: false,
19225
19356
  boxShadow: "0px 1px 5px rgba(0, 0, 0, 0.6)",
@@ -19228,10 +19359,12 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
19228
19359
  height: 18,
19229
19360
  width: 34
19230
19361
  }), ' ', item.lock_flag ? 'Persistent' : 'Session')), /*#__PURE__*/React.createElement("td", {
19362
+ id: "react-autoql-remove-filter-container",
19231
19363
  style: {
19232
19364
  display: 'table-cell',
19233
19365
  verticalAlign: 'middle',
19234
- textAlign: 'right'
19366
+ textAlign: 'right',
19367
+ width: '35px'
19235
19368
  }
19236
19369
  }, /*#__PURE__*/React.createElement(ReactTooltip, {
19237
19370
  className: "react-autoql-chart-tooltip",
@@ -19239,9 +19372,11 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
19239
19372
  effect: "solid",
19240
19373
  html: true
19241
19374
  }), /*#__PURE__*/React.createElement(Icon, {
19375
+ id: "react-autoql-remove-filtered-condition-icon",
19242
19376
  style: {
19243
19377
  paddingLeft: 5,
19244
- color: 'red'
19378
+ color: 'red',
19379
+ cursor: 'pointer'
19245
19380
  },
19246
19381
  "data-tip": "Remove filter",
19247
19382
  "data-for": "react-autoql-remove-condition",
@@ -19264,7 +19399,61 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
19264
19399
  return _this;
19265
19400
  }
19266
19401
 
19267
- _createClass(ConditionLockMenu, [{
19402
+ _createClass(FilterLockMenu, [{
19403
+ key: "handleFetchFilteredList",
19404
+ value: function handleFetchFilteredList() {
19405
+ var _this2 = this;
19406
+
19407
+ fetchConditions(_objectSpread2({}, getAuthentication(this.props.authentication))).then(function (response) {
19408
+ var conditions = _get(response, 'data.data.data');
19409
+
19410
+ var array = [];
19411
+
19412
+ for (var i = 0; i < conditions.length; i++) {
19413
+ array.push({
19414
+ id: conditions[i].id,
19415
+ keyword: conditions[i].value,
19416
+ value: conditions[i].value,
19417
+ show_message: conditions[i].show_message,
19418
+ key: conditions[i].key,
19419
+ lock_flag: conditions[i].lock_flag
19420
+ });
19421
+ }
19422
+
19423
+ if (JSON.parse(sessionStorage.getItem("conditions")) !== null) {
19424
+ var sessionConditions = JSON.parse(sessionStorage.getItem("conditions"));
19425
+
19426
+ for (var _i3 = 0; _i3 < sessionConditions.length; _i3++) {
19427
+ array.push({
19428
+ id: sessionConditions[_i3].id,
19429
+ keyword: sessionConditions[_i3].value,
19430
+ value: sessionConditions[_i3].value,
19431
+ show_message: sessionConditions[_i3].show_message,
19432
+ key: sessionConditions[_i3].key,
19433
+ lock_flag: sessionConditions[_i3].lock_flag
19434
+ });
19435
+ }
19436
+ }
19437
+
19438
+ array.sort(function (a, b) {
19439
+ return a.keyword.toUpperCase() < b.keyword.toUpperCase() ? -1 : a.keyword > b.keyword ? 1 : 0;
19440
+ });
19441
+
19442
+ _this2.setState({
19443
+ selectedConditions: array,
19444
+ inputValue: '',
19445
+ isFetchingConditions: false
19446
+ });
19447
+ });
19448
+ }
19449
+ /**
19450
+ * When suggestion is clicked, Autosuggest populates the input
19451
+ * based on the clicked suggestion. Teach Autosuggest how to calculate the
19452
+ * input value for every given suggestion.
19453
+ * @param {*} suggestion
19454
+ */
19455
+
19456
+ }, {
19268
19457
  key: "handleShowMessage",
19269
19458
  value: function handleShowMessage(type, message) {
19270
19459
  var el = document.getElementById('react-autoql-condition-show-message');
@@ -19284,21 +19473,39 @@ var ConditionLockMenu = /*#__PURE__*/function (_React$Component) {
19284
19473
  }
19285
19474
  });
19286
19475
  }
19476
+ }, {
19477
+ key: "handleHighlightFilterRow",
19478
+ value: function handleHighlightFilterRow(index) {
19479
+ var el = document.getElementById("react-autoql-condition-table-list-item-".concat(index));
19480
+
19481
+ if (el) {
19482
+ el.className = 'react-autoql-highlight-row';
19483
+ setTimeout(function () {
19484
+ el.className = el.className.replace('react-autoql-highlight-row', '');
19485
+ }, 1800);
19486
+ }
19487
+ }
19287
19488
  }]);
19288
19489
 
19289
- return ConditionLockMenu;
19490
+ return FilterLockMenu;
19290
19491
  }(React.Component);
19291
19492
 
19292
- _defineProperty(ConditionLockMenu, "propTypes", {
19293
- containerWidth: PropTypes.number,
19493
+ _defineProperty(FilterLockMenu, "propTypes", {
19494
+ containerWidth: PropTypes.string,
19294
19495
  isOpen: PropTypes.bool,
19295
19496
  onClose: PropTypes.func,
19296
- authentication: authenticationType
19497
+ authentication: authenticationType,
19498
+ initFilterText: PropTypes.string,
19499
+ themeConfig: themeConfigType
19297
19500
  });
19298
19501
 
19299
- _defineProperty(ConditionLockMenu, "defaultProps", {
19502
+ _defineProperty(FilterLockMenu, "defaultProps", {
19300
19503
  containerWidth: undefined,
19301
- onClose: function onClose() {}
19504
+ onClose: function onClose() {},
19505
+ isOpen: false,
19506
+ authentication: undefined,
19507
+ initFilterText: undefined,
19508
+ themeConfig: themeConfigDefault
19302
19509
  });
19303
19510
 
19304
19511
  var DataMessenger = /*#__PURE__*/function (_React$Component) {
@@ -19325,7 +19532,8 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19325
19532
  isResizing: false,
19326
19533
  lastMessageId: undefined,
19327
19534
  isOptionsDropdownOpen: false,
19328
- isConditionLockingMenuOpen: false,
19535
+ isFilterLockingMenuOpen: false,
19536
+ selectedValueLabel: undefined,
19329
19537
  conditions: undefined,
19330
19538
  messages: [],
19331
19539
  queryTipsList: undefined,
@@ -19354,12 +19562,11 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19354
19562
  _this.setState({
19355
19563
  hasError: true
19356
19564
  });
19357
- } // WIP
19358
-
19565
+ }
19359
19566
 
19360
19567
  try {
19361
19568
  fetchConditions(_objectSpread2({}, getAuthentication(_this.props.authentication))).then(function (response) {
19362
- var sessionConditions = JSON.parse(sessionStorage.getItem("conditions"));
19569
+ var sessionConditions = JSON.parse(sessionStorage.getItem('conditions'));
19363
19570
 
19364
19571
  _this.setState({
19365
19572
  conditions: {
@@ -19401,9 +19608,9 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19401
19608
  setCSSVars(getThemeConfig(getThemeConfig(_this.props.themeConfig)));
19402
19609
  }
19403
19610
 
19404
- if (_this.state.isConditionLockingMenuOpen !== prevState.isConditionLockingMenuOpen) {
19611
+ if (_this.state.isFilterLockingMenuOpen !== prevState.isFilterLockingMenuOpen) {
19405
19612
  fetchConditions(_objectSpread2({}, getAuthentication(_this.props.authentication))).then(function (response) {
19406
- var sessionConditions = JSON.parse(sessionStorage.getItem("conditions"));
19613
+ var sessionConditions = JSON.parse(sessionStorage.getItem('conditions'));
19407
19614
 
19408
19615
  _this.setState({
19409
19616
  conditions: {
@@ -19416,7 +19623,8 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19416
19623
 
19417
19624
  if (_this.state.activePage !== prevState.activePage) {
19418
19625
  _this.setState({
19419
- isConditionLockingMenuOpen: false
19626
+ isFilterLockingMenuOpen: false,
19627
+ selectedValueLabel: undefined
19420
19628
  });
19421
19629
  }
19422
19630
  } catch (error) {
@@ -19537,7 +19745,7 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19537
19745
  messages: introMessages,
19538
19746
  lastMessageId: introMessages[introMessages.length - 1].id,
19539
19747
  isOptionsDropdownOpen: false,
19540
- isConditionLockingMenuOpen: false
19748
+ isFilterLockingMenuOpen: false
19541
19749
  });
19542
19750
  });
19543
19751
 
@@ -19599,11 +19807,10 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19599
19807
  }
19600
19808
 
19601
19809
  if (_this.props.onMaskClick) {
19602
- _this.props.onMaskClick();
19603
-
19604
19810
  _this.setState({
19605
- isConditionLockingMenuOpen: false
19606
- });
19811
+ isFilterLockingMenuOpen: false,
19812
+ selectedValueLabel: undefined
19813
+ }, _this.props.onMaskClick());
19607
19814
  }
19608
19815
 
19609
19816
  if (_this.props.onHandleClick) {
@@ -19883,7 +20090,7 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19883
20090
  }
19884
20091
  });
19885
20092
 
19886
- _defineProperty(_assertThisInitialized(_this), "getConditionMenuPosition", function () {
20093
+ _defineProperty(_assertThisInitialized(_this), "getFilterMenuPosition", function () {
19887
20094
  switch (_this.getPlacementProp()) {
19888
20095
  case 'right':
19889
20096
  return {
@@ -19992,24 +20199,24 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19992
20199
  _defineProperty(_assertThisInitialized(_this), "renderOptionsDropdown", function () {
19993
20200
  if (_this.state.activePage === 'data-messenger') {
19994
20201
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
19995
- id: "condition-dropdown",
20202
+ id: "react-autoql-filter-menu-dropdown",
19996
20203
  style: {
19997
20204
  justifyContent: 'left',
19998
20205
  position: 'absolute',
19999
20206
  right: 30
20000
20207
  }
20001
20208
  }, getAutoQLConfig$1(getAutoQLConfig$1(_this.props.autoQLConfig)).enableFilterLocking ? /*#__PURE__*/React.createElement("button", {
20002
- id: "condition-dropdown",
20209
+ id: "react-autoql-filter-menu-dropdown-button",
20003
20210
  onClick: function onClick() {
20004
20211
  _this.setState({
20005
- isConditionLockingMenuOpen: !_this.state.isConditionLockingMenuOpen
20212
+ isFilterLockingMenuOpen: !_this.state.isFilterLockingMenuOpen
20006
20213
  });
20007
20214
  },
20008
20215
  className: "react-autoql-drawer-header-btn clear-all",
20009
20216
  "data-tip": lang.openFilterLocking,
20010
20217
  "data-for": "react-autoql-header-tooltip"
20011
20218
  }, /*#__PURE__*/React.createElement(Icon, {
20012
- type: _get(_this.state.conditions, 'persistent.length') > 0 || _get(_this.state.conditions, 'session.length') > 0 ? "lock" : "unlock"
20219
+ type: _get(_this.state.conditions, 'persistent.length') > 0 || _get(_this.state.conditions, 'session.length') > 0 ? 'lock' : 'unlock'
20013
20220
  })) : /*#__PURE__*/React.createElement("span", null)), /*#__PURE__*/React.createElement(Popover, {
20014
20221
  isOpen: _this.state.isOptionsDropdownOpen,
20015
20222
  onClickOutside: function onClickOutside() {
@@ -20090,10 +20297,6 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
20090
20297
  className: "react-autoql-header-left-container"
20091
20298
  }, /*#__PURE__*/React.createElement("button", {
20092
20299
  onClick: function onClick() {
20093
- _this.setState({
20094
- isConditionLockingMenuOpen: false
20095
- });
20096
-
20097
20300
  _this.props.onHandleClick();
20098
20301
  },
20099
20302
  className: "react-autoql-drawer-header-btn close",
@@ -20101,11 +20304,25 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
20101
20304
  "data-for": "react-autoql-header-tooltip"
20102
20305
  }, /*#__PURE__*/React.createElement(Icon, {
20103
20306
  type: "close"
20104
- }))), !getAutoQLConfig$1(getAutoQLConfig$1(_this.props.autoQLConfig)).enableFilterLocking ? /*#__PURE__*/React.createElement("div", {
20307
+ }))), !getAutoQLConfig$1(getAutoQLConfig$1(_this.props.autoQLConfig)).enableFilterLocking && _this.state.isFilterLockingMenuOpen ? /*#__PURE__*/React.createElement("div", {
20105
20308
  className: "react-autoql-header-center-container"
20106
20309
  }, _this.renderHeaderTitle()) : /*#__PURE__*/React.createElement(Popover, {
20107
- containerStyle: _this.getConditionMenuPosition(),
20108
- isOpen: _this.state.isConditionLockingMenuOpen,
20310
+ containerStyle: _this.getFilterMenuPosition(),
20311
+ isOpen: _this.state.isFilterLockingMenuOpen,
20312
+ onClickOutside: function onClickOutside(e) {
20313
+ /**
20314
+ * Because the popover anchor is over the header title instead of the button,
20315
+ * the button is considered part of an "outside" event. This also includes
20316
+ * some elements inside of the popover as well for some reason.
20317
+ *
20318
+ * This is a hacky solution, but it works.
20319
+ */
20320
+ if (_get(e, 'target.id') !== 'react-autoql-interpreted-value-label' && _get(e, 'target.parentElement.parentElement.parentElement.id') !== 'react-autoql-filter-menu-dropdown-button' && _get(e, 'target.parentElement.parentElement.parentElement.id') !== 'react-autoql-filter-menu-dropdown' && _get(e, 'target.parentElement.id') !== 'react-autoql-filter-table-row' && _get(e, 'target.parentElement.id') !== 'react-autoql-remove-filtered-condition-icon' && _get(e, 'target.parentElement.parentElement.id') !== 'react-autoql-remove-filtered-condition-icon' && _get(e, 'target.parentElement.id') !== 'react-autoql-remove-filter-container' && !_get(e, 'target.classList.value').includes('react-autoql-drawer-resize-handle')) {
20321
+ _this.setState({
20322
+ isFilterLockingMenuOpen: false
20323
+ });
20324
+ }
20325
+ },
20109
20326
  position: "bottom",
20110
20327
  padding: 2,
20111
20328
  align: "center",
@@ -20114,13 +20331,18 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
20114
20331
  style: {
20115
20332
  display: 'block'
20116
20333
  }
20117
- }, /*#__PURE__*/React.createElement(ConditionLockMenu, {
20334
+ }, /*#__PURE__*/React.createElement(FilterLockMenu, {
20335
+ "data-test": "react-autoql-filter-menu",
20336
+ id: "react-autoql-filter-menu",
20118
20337
  authentication: getAuthentication(getAuthentication(_this.props.authentication)),
20119
20338
  containerWidth: _this.getDrawerWidth(),
20120
- isOpen: _this.state.isConditionLockingMenuOpen,
20339
+ isOpen: _this.state.isFilterLockingMenuOpen,
20340
+ themeConfig: getThemeConfig(getThemeConfig(_this.props.themeConfig)),
20341
+ initFilterText: _this.state.selectedValueLabel,
20121
20342
  onClose: function onClose() {
20122
20343
  _this.setState({
20123
- isConditionLockingMenuOpen: false
20344
+ isFilterLockingMenuOpen: false,
20345
+ selectedValueLabel: undefined
20124
20346
  });
20125
20347
  }
20126
20348
  }))
@@ -20210,9 +20432,15 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
20210
20432
  enableDynamicCharting: _this.props.enableDynamicCharting,
20211
20433
  onNoneOfTheseClick: _this.onNoneOfTheseClick,
20212
20434
  autoChartAggregations: _this.props.autoChartAggregations,
20213
- onConditionClickCallback: function onConditionClickCallback() {
20435
+ onConditionClickCallback: function onConditionClickCallback(e) {
20436
+ if (_get(e, 'target.classList.value').includes('react-autoql-condition-link')) {
20437
+ _this.setState({
20438
+ selectedValueLabel: _get(e, 'target.innerText').replace('lock ', '').trim()
20439
+ });
20440
+ }
20441
+
20214
20442
  _this.setState({
20215
- isConditionLockingMenuOpen: !_this.state.isConditionLockingMenuOpen
20443
+ isFilterLockingMenuOpen: true
20216
20444
  });
20217
20445
  }
20218
20446
  });
@@ -20560,7 +20788,12 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
20560
20788
  width: _this.getDrawerWidth(),
20561
20789
  height: _this.getDrawerHeight(),
20562
20790
  onMaskClick: _this.handleMaskClick,
20563
- onHandleClick: _this.props.onHandleClick,
20791
+ onHandleClick: function onHandleClick() {
20792
+ _this.setState({
20793
+ isFilterLockingMenuOpen: false,
20794
+ selectedValueLabel: undefined
20795
+ }, _this.props.onHandleClick);
20796
+ },
20564
20797
  afterVisibleChange: _this.props.onVisibleChange,
20565
20798
  handler: _this.getHandlerProp(),
20566
20799
  level: _this.props.shiftScreen ? 'all' : null,
@@ -20621,12 +20854,12 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
20621
20854
  value:
20622
20855
  /**
20623
20856
  * For some indiscernible reason, the Data Messenger drawer duplicates itself in the DOM.
20624
- * three times when first opened, then a number more times with each and every query
20857
+ * three times when first opened, then a number more times with each and every query
20625
20858
  * being made.
20626
- *
20859
+ *
20627
20860
  * This function removes unnecessary duplicate instances of the Data Messenger Drawer
20628
20861
  * and should help improve performance a bit by reducing the amount of renders.
20629
- *
20862
+ *
20630
20863
  * https://stackoverflow.com/questions/57946748/remove-duplicate-dom-element-javascript-not-jquery
20631
20864
  */
20632
20865
  function removeDuplicateMessengerInstance() {
@@ -20714,7 +20947,7 @@ _defineProperty(DataMessenger, "defaultProps", {
20714
20947
  maxMessages: undefined,
20715
20948
  introMessage: undefined,
20716
20949
  enableExploreQueriesTab: true,
20717
- enableNotificationsTab: true,
20950
+ enableNotificationsTab: false,
20718
20951
  resizable: true,
20719
20952
  inputPlaceholder: undefined,
20720
20953
  queryQuickStartTopics: undefined,
@@ -21571,6 +21804,8 @@ var DashboardTile = /*#__PURE__*/function (_React$Component) {
21571
21804
  });
21572
21805
 
21573
21806
  _defineProperty(_assertThisInitialized(_this), "renderQueryOutput", function (_ref12) {
21807
+ var _extends2;
21808
+
21574
21809
  var _ref12$queryOutputPro = _ref12.queryOutputProps,
21575
21810
  queryOutputProps = _ref12$queryOutputPro === void 0 ? {} : _ref12$queryOutputPro,
21576
21811
  _ref12$vizToolbarProp = _ref12.vizToolbarProps,
@@ -21592,25 +21827,24 @@ var DashboardTile = /*#__PURE__*/function (_React$Component) {
21592
21827
  }, !queryOutputProps.queryResponse || isExecuting || _this.props.isUnExecuted ? _this.renderContentPlaceholder({
21593
21828
  isExecuting: isExecuting,
21594
21829
  isExecuted: isExecuted
21595
- }) : /*#__PURE__*/React.createElement(Fragment, null, _this.getIsSuggestionResponse(queryOutputProps.queryResponse) && _this.renderSuggestionMessage(customMessage), !customMessage && /*#__PURE__*/React.createElement(QueryOutput, _extends({
21830
+ }) : /*#__PURE__*/React.createElement(Fragment, null, _this.getIsSuggestionResponse(queryOutputProps.queryResponse) && _this.renderSuggestionMessage(customMessage), !customMessage && /*#__PURE__*/React.createElement(QueryOutput, _extends((_extends2 = {
21596
21831
  authentication: getAuthentication(_this.props.authentication),
21597
21832
  themeConfig: getThemeConfig(_this.props.themeConfig),
21598
21833
  autoQLConfig: getAutoQLConfig$1(_this.props.autoQLConfig),
21599
21834
  dataFormatting: getDataFormatting(_this.props.dataFormatting),
21600
21835
  renderTooltips: false,
21601
21836
  autoSelectQueryValidationSuggestion: false,
21837
+ isDashboardQuery: true,
21602
21838
  autoChartAggregations: _this.props.autoChartAggregations,
21603
21839
  renderSuggestionsAsDropdown: _this.props.tile.h < 4,
21604
21840
  enableDynamicCharting: _this.props.enableDynamicCharting,
21605
- backgroundColor: document.documentElement.style.getPropertyValue('--react-autoql-background-color-primary'),
21606
- isDashboardQuery: true,
21607
- onDisplayTypeUpdate: function onDisplayTypeUpdate() {
21608
- // This is necessary to update the toolbar with the newly rendered QueryOutput
21609
- setTimeout(function () {
21610
- _this.forceUpdate();
21611
- }, 0);
21612
- }
21613
- }, queryOutputProps)), _this.renderDataLimitWarning()), _this.props.isEditing && /*#__PURE__*/React.createElement("div", {
21841
+ backgroundColor: document.documentElement.style.getPropertyValue('--react-autoql-background-color-primary')
21842
+ }, _defineProperty(_extends2, "isDashboardQuery", true), _defineProperty(_extends2, "onDisplayTypeUpdate", function onDisplayTypeUpdate() {
21843
+ // This is necessary to update the toolbar with the newly rendered QueryOutput
21844
+ setTimeout(function () {
21845
+ _this.forceUpdate();
21846
+ }, 0);
21847
+ }), _extends2), queryOutputProps)), _this.renderDataLimitWarning()), _this.props.isEditing && /*#__PURE__*/React.createElement("div", {
21614
21848
  className: "dashboard-tile-viz-toolbar-container"
21615
21849
  }, _this.props.isEditing && showSplitViewBtn && _this.renderSplitViewBtn(), /*#__PURE__*/React.createElement(VizToolbar$1, _extends({
21616
21850
  themeConfig: getThemeConfig(_this.props.themeConfig)
@@ -21684,6 +21918,11 @@ var DashboardTile = /*#__PURE__*/function (_React$Component) {
21684
21918
  _defineProperty(_assertThisInitialized(_this), "renderBottomResponse", function () {
21685
21919
  var queryResponse = _this.props.tile.secondQueryResponse || _this.props.queryResponse;
21686
21920
  var displayType = isDisplayTypeValid(queryResponse, _this.props.secondDisplayType) ? _this.props.secondDisplayType : getDefaultDisplayType(queryResponse, _this.props.autoChartAggregations);
21921
+
21922
+ _this.props.setParamsForTile({
21923
+ secondDisplayType: displayType
21924
+ }, _this.props.tile.i);
21925
+
21687
21926
  return _this.renderQueryOutput({
21688
21927
  queryOutputProps: {
21689
21928
  key: "dashboard-tile-query-bottom-".concat(_this.COMPONENT_KEY),
@@ -22759,4 +22998,4 @@ _defineProperty(SpeechToTextBtn, "defaultProps", {
22759
22998
  themeConfig: themeConfigDefault
22760
22999
  });
22761
23000
 
22762
- export { Dashboard, DashboardTile, DataAlertModal, DataAlerts, DataMessenger, ExpressionBuilder, ExpressionBuilderSimple, Icon, LoadingDots, NotificationFeed, NotificationIcon, NotificationItem, QueryInput, QueryOutput, ScheduleBuilder, SpeechToTextBtn as SpeechToTextButton, SpeechToTextButtonBrowser, executeDashboard, fetchQueryTips, getDefaultDisplayType, getSupportedDisplayTypes, isDisplayTypeValid, unExecuteDashboard };
23001
+ export { Dashboard, DashboardTile, DataAlertModal, DataAlerts, DataMessenger, ExpressionBuilder, ExpressionBuilderSimple, FilterLockMenu, Icon, LoadingDots, NotificationFeed, NotificationIcon, NotificationItem, QueryInput, QueryOutput, ScheduleBuilder, SpeechToTextBtn as SpeechToTextButton, SpeechToTextButtonBrowser, executeDashboard, fetchQueryTips, getDefaultDisplayType, getSupportedDisplayTypes, isDisplayTypeValid, unExecuteDashboard };