@bigbinary/neeto-rules-frontend 2.9.0 → 2.9.1

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.
@@ -11,7 +11,7 @@ import { isNotEmpty, toLabelAndValue, removeBy, findBy, isPresent, isNot, noop }
11
11
  import Container from '@bigbinary/neeto-molecules/v2/Container';
12
12
  import Header from '@bigbinary/neeto-molecules/v2/Header';
13
13
  import { useTranslation } from 'react-i18next';
14
- import { r as useHasFieldChanged, s as areValuesEqual, t as useResetSaveAsTemplateOnHide, v as SelectTemplateField, E as EditorAction, w as SaveAsTemplate, x as setEditorContent, y as ApiFields, L as ListField, o as Panel, z as ErrorCallout, B as SmsFields, M as MIN_DELAY_VALUE, C as MAX_DELAY_VALUE, G as PhoneNumberField, l as formatData, u as usePollRuleName, T as TouchErrors, n as ScrollToErrorField, p as getValidationSchema, q as DEFAULT_INITIAL_VALUE, m as buildPayload } from '../index-zvsaUL1M.js';
14
+ import { r as useHasFieldChanged, s as areValuesEqual, t as useResetSaveAsTemplateOnHide, v as SelectTemplateField, E as EditorAction, w as SaveAsTemplate, x as setEditorContent, y as ApiFields, L as ListField, o as Panel, z as ErrorCallout, B as SmsFields, M as MIN_DELAY_VALUE, C as MAX_DELAY_VALUE, G as PhoneNumberField, l as formatData, u as usePollRuleName, T as TouchErrors, n as ScrollToErrorField, p as getValidationSchema, q as DEFAULT_INITIAL_VALUE, m as buildPayload } from '../index-C0MlXbjP.js';
15
15
  import { u as useCustomDataStore } from '../useCustomDataStore-CEbhXugO.js';
16
16
  import { u as useUtilityStore } from '../useUtilityStore-BVCulMEC.js';
17
17
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
@@ -2623,6 +2623,7 @@ var descriptorFor = function descriptorFor(_ref19) {
2623
2623
  return {
2624
2624
  label: option.paneLabel || option.label,
2625
2625
  value: triggerValue(option),
2626
+ dataTestid: option.dataTestid,
2626
2627
  category: option.category,
2627
2628
  disabled: isLocked,
2628
2629
  disabledTooltip: isLocked && (schema.triggers.groupDisabledTooltip || t("neetoRules.builder.panes.triggerGroupDisabled"))
@@ -2638,7 +2639,8 @@ var descriptorFor = function descriptorFor(_ref19) {
2638
2639
  options: (((_schema$actor2 = schema.actor) === null || _schema$actor2 === void 0 ? void 0 : _schema$actor2.options) || []).map(function (option) {
2639
2640
  return {
2640
2641
  label: option.label,
2641
- value: optionValue(option)
2642
+ value: optionValue(option),
2643
+ dataTestid: option.dataTestid
2642
2644
  };
2643
2645
  }),
2644
2646
  selectedValues: [rule.performer]
@@ -2655,6 +2657,7 @@ var descriptorFor = function descriptorFor(_ref19) {
2655
2657
  return {
2656
2658
  label: field.paneLabel || field.label,
2657
2659
  value: optionValue(field),
2660
+ dataTestid: field.dataTestid,
2658
2661
  category: field.category
2659
2662
  };
2660
2663
  }),
@@ -2743,6 +2746,7 @@ var descriptorFor = function descriptorFor(_ref19) {
2743
2746
  return {
2744
2747
  label: isSwap ? meta.channelLabel || option.label : option.label,
2745
2748
  value: value,
2749
+ dataTestid: option.dataTestid,
2746
2750
  category: option.category,
2747
2751
  // Hosts mark unavailable actions with isDisabled; without carrying
2748
2752
  // the reason across, the picker disables them with no explanation.
@@ -2791,7 +2795,8 @@ var descriptorFor = function descriptorFor(_ref19) {
2791
2795
  }).map(function (recipient) {
2792
2796
  return {
2793
2797
  label: recipient.label,
2794
- value: optionValue(recipient)
2798
+ value: optionValue(recipient),
2799
+ dataTestid: recipient.dataTestid
2795
2800
  };
2796
2801
  }),
2797
2802
  selectedValues: [recipientOf({
@@ -2847,6 +2852,7 @@ var descriptorFor = function descriptorFor(_ref19) {
2847
2852
  return {
2848
2853
  label: option.label,
2849
2854
  value: value,
2855
+ dataTestid: option.dataTestid,
2850
2856
  disabled: (!!((_option$disabled2 = option.disabled) !== null && _option$disabled2 !== void 0 ? _option$disabled2 : option.isDisabled) || blockedNoPhone) && !isSelected,
2851
2857
  disabledReason: blockedNoPhone ? sc.disabledReason : option.disabledReason,
2852
2858
  disabledPopover: option.disabledPopover,
@@ -2880,7 +2886,8 @@ var descriptorFor = function descriptorFor(_ref19) {
2880
2886
  options: options.map(function (option) {
2881
2887
  return {
2882
2888
  label: option.label,
2883
- value: optionValue(option)
2889
+ value: optionValue(option),
2890
+ dataTestid: option.dataTestid
2884
2891
  };
2885
2892
  }),
2886
2893
  selectedValues: [item.phoneField]
@@ -4818,11 +4825,12 @@ var OptionsPane = function OptionsPane(_ref) {
4818
4825
  };
4819
4826
  var renderOptionRow = function renderOptionRow(option) {
4820
4827
  var item = /*#__PURE__*/jsx(RadioGroup.Item, _objectSpread$3(_objectSpread$3({
4828
+ dataTestId: option.dataTestid,
4821
4829
  disabled: option.disabled,
4822
4830
  label: optionLabel(option),
4823
4831
  labelProps: previewHandlers(option.value, option.disabled),
4824
4832
  value: option.value
4825
- }, option.icon || option.disabledReason ? {
4833
+ }, !option.dataTestid && (option.icon || option.disabledReason) ? {
4826
4834
  "data-testid": option.value
4827
4835
  } : {}), previewHandlers(option.value, option.disabled)), option.value);
4828
4836
  var content = renderOptionContent === null || renderOptionContent === void 0 ? void 0 : renderOptionContent({
@@ -4854,17 +4862,16 @@ var OptionsPane = function OptionsPane(_ref) {
4854
4862
  items = _ref4[1];
4855
4863
  return /*#__PURE__*/jsxs(Fragment, {
4856
4864
  children: [renderGroupHeader(category), items.map(function (option) {
4857
- return /*#__PURE__*/jsx(Checkbox, _objectSpread$3(_objectSpread$3({
4865
+ return /*#__PURE__*/jsx(Checkbox, _objectSpread$3({
4858
4866
  checked: isSelected(option.value),
4867
+ dataTestId: option.dataTestid,
4859
4868
  disabled: option.disabled,
4860
4869
  label: optionLabel(option),
4861
4870
  labelProps: previewHandlers(option.value, option.disabled),
4862
4871
  onCheckedChange: function onCheckedChange() {
4863
4872
  return handleSelect(option.value);
4864
4873
  }
4865
- }, option.icon || option.disabledReason ? {
4866
- dataTestid: option.value
4867
- } : {}), previewHandlers(option.value, option.disabled)), option.value);
4874
+ }, previewHandlers(option.value, option.disabled)), option.value);
4868
4875
  })]
4869
4876
  }, category || "_uncategorized");
4870
4877
  })