@bigbinary/neeto-rules-frontend 2.9.3-beta1 → 2.9.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.
@@ -13,7 +13,7 @@ var neetoCist = require('@bigbinary/neeto-cist');
13
13
  var Container = require('@bigbinary/neeto-molecules/v2/Container');
14
14
  var Header = require('@bigbinary/neeto-molecules/v2/Header');
15
15
  var reactI18next = require('react-i18next');
16
- var index = require('../../index-D7d7coUX.js');
16
+ var index = require('../../index-B_8d4J93.js');
17
17
  var useCustomDataStore = require('../../useCustomDataStore-DPmWkEhs.js');
18
18
  var useUtilityStore = require('../../useUtilityStore-gtPhFvpI.js');
19
19
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
@@ -86,19 +86,20 @@ var UNIT_MINUTES = {
86
86
  };
87
87
 
88
88
  /* eslint-disable @bigbinary/neeto/hard-coded-strings-should-be-localized */
89
- /* eslint-disable @bigbinary/neeto/neetocommons-tips */
90
89
  var TIME_UNITS = [{
91
90
  label: "minutes",
92
- value: "minutes"
91
+ value: "minutes",
92
+ dataTestId: "minutes"
93
93
  }, {
94
94
  label: "hours",
95
- value: "hours"
95
+ value: "hours",
96
+ dataTestId: "hours"
96
97
  }, {
97
98
  label: "days",
98
- value: "days"
99
+ value: "days",
100
+ dataTestId: "days"
99
101
  }];
100
102
  /* eslint-enable @bigbinary/neeto/hard-coded-strings-should-be-localized */
101
- /* eslint-enable @bigbinary/neeto/neetocommons-tips */
102
103
 
103
104
  var LEAD_TIME_UNITS = TIME_UNITS;
104
105
 
@@ -2715,10 +2716,13 @@ var descriptorFor = function descriptorFor(_ref19) {
2715
2716
  }) : i18next.t("neetoRules.builder.panes.operatorSubtitle"),
2716
2717
  cascade: true,
2717
2718
  options: verbs.map(function (verb) {
2719
+ var _schema$conditions3;
2718
2720
  return {
2719
2721
  // eslint-disable-next-line security/detect-object-injection
2720
2722
  label: labels[verb] || humanize(verb),
2721
- value: verb
2723
+ value: verb,
2724
+ // eslint-disable-next-line security/detect-object-injection
2725
+ dataTestid: (_schema$conditions3 = schema.conditions) === null || _schema$conditions3 === void 0 || (_schema$conditions3 = _schema$conditions3.operatorDataTestids) === null || _schema$conditions3 === void 0 ? void 0 : _schema$conditions3[verb]
2722
2726
  };
2723
2727
  }),
2724
2728
  selectedValues: [conditionAt({
@@ -2733,10 +2737,12 @@ var descriptorFor = function descriptorFor(_ref19) {
2733
2737
  subtitle: i18next.t("neetoRules.builder.panes.connectorSubtitle"),
2734
2738
  options: [{
2735
2739
  label: i18next.t("neetoRules.builder.panes.connectorAndOption"),
2736
- value: CONDITION_MODE.AND
2740
+ value: CONDITION_MODE.AND,
2741
+ dataTestid: "and"
2737
2742
  }, {
2738
2743
  label: i18next.t("neetoRules.builder.panes.connectorOrOption"),
2739
- value: CONDITION_MODE.OR
2744
+ value: CONDITION_MODE.OR,
2745
+ dataTestid: "or"
2740
2746
  }],
2741
2747
  selectedValues: [rule.conditionMode]
2742
2748
  };
@@ -3698,7 +3704,7 @@ var CONDITION_VALUE_TYPES = {
3698
3704
  function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3699
3705
  function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3700
3706
  var EmailChannelFields = function EmailChannelFields(_ref) {
3701
- var _getIn, _getIn2, _action$metadata;
3707
+ var _getIn, _option$recipientData, _getIn2, _action$metadata;
3702
3708
  var name = _ref.name,
3703
3709
  option = _ref.option,
3704
3710
  action = _ref.action,
@@ -3764,6 +3770,7 @@ var EmailChannelFields = function EmailChannelFields(_ref) {
3764
3770
  placeholder: option === null || option === void 0 ? void 0 : option.valuePlaceholder,
3765
3771
  size: "large",
3766
3772
  value: (_getIn = formik.getIn(values, valuePath)) !== null && _getIn !== void 0 ? _getIn : undefined,
3773
+ dataTestId: (_option$recipientData = option === null || option === void 0 ? void 0 : option.recipientDataTestid) !== null && _option$recipientData !== void 0 ? _option$recipientData : option !== null && option !== void 0 && option.recipientLabel ? undefined : "recipient",
3767
3774
  label: (option === null || option === void 0 ? void 0 : option.recipientLabel) || t("neetoRules.builder.config.recipient"),
3768
3775
  onBlur: function onBlur() {
3769
3776
  return setFieldTouched(valuePath, true);
@@ -3777,6 +3784,7 @@ var EmailChannelFields = function EmailChannelFields(_ref) {
3777
3784
  onChange: handleTemplateChange
3778
3785
  }), !(option !== null && option !== void 0 && option.hideSubject) && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Input, {
3779
3786
  required: true,
3787
+ dataTestId: "subject",
3780
3788
  error: fieldError(subjectPath),
3781
3789
  label: t("neetoRules.builder.config.subject"),
3782
3790
  placeholder: t("neetoRules.builder.config.subjectPlaceholder"),
@@ -3792,6 +3800,7 @@ var EmailChannelFields = function EmailChannelFields(_ref) {
3792
3800
  editorRef: editorRef,
3793
3801
  required: true,
3794
3802
  label: t("neetoRules.builder.config.body"),
3803
+ labelDataTestid: "body-editor-label",
3795
3804
  name: bodyPath,
3796
3805
  placeholder: t("neetoRules.builder.config.bodyPlaceholder"),
3797
3806
  value: action === null || action === void 0 || (_action$metadata = action.metadata) === null || _action$metadata === void 0 ? void 0 : _action$metadata.body,
@@ -3884,6 +3893,7 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
3884
3893
  children: [filtered.map(function (item) {
3885
3894
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Checkbox, {
3886
3895
  checked: current.includes(item.value),
3896
+ dataTestId: item.dataTestid,
3887
3897
  label: item.label,
3888
3898
  onCheckedChange: function onCheckedChange() {
3889
3899
  return toggle(item.value);
@@ -3913,6 +3923,7 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
3913
3923
  },
3914
3924
  children: _filtered.map(function (item) {
3915
3925
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.RadioGroup.Item, {
3926
+ dataTestId: item.dataTestid,
3916
3927
  label: item.label,
3917
3928
  value: String(item.value)
3918
3929
  }, item.value);
@@ -3934,6 +3945,7 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
3934
3945
  children: [/*#__PURE__*/jsxRuntime.jsx(index.EditorAction, {
3935
3946
  required: true,
3936
3947
  label: t("neetoRules.builder.config.note"),
3948
+ labelDataTestid: "note-editor-label",
3937
3949
  name: valuePath,
3938
3950
  placeholder: t("neetoRules.builder.config.bodyPlaceholder"),
3939
3951
  value: action === null || action === void 0 || (_action$metadata = action.metadata) === null || _action$metadata === void 0 ? void 0 : _action$metadata.value,
@@ -3945,6 +3957,7 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
3945
3957
  var _getIn, _getIn2;
3946
3958
  return type === ACTION_CONFIG_TYPES.number ? /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Input, {
3947
3959
  required: true,
3960
+ dataTestId: "value",
3948
3961
  error: fieldError(valuePath),
3949
3962
  label: t("neetoRules.builder.config.value"),
3950
3963
  size: "large",
@@ -3958,6 +3971,7 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
3958
3971
  }
3959
3972
  }) : /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Textarea, {
3960
3973
  required: true,
3974
+ dataTestId: "message",
3961
3975
  error: fieldError(valuePath),
3962
3976
  label: t("neetoRules.builder.config.message"),
3963
3977
  rows: 5,
@@ -3977,6 +3991,7 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
3977
3991
  className: "flex flex-col gap-2",
3978
3992
  children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Input, {
3979
3993
  required: true,
3994
+ dataTestId: "value",
3980
3995
  error: fieldError(valuePath),
3981
3996
  label: t("neetoRules.builder.config.value"),
3982
3997
  placeholder: option === null || option === void 0 ? void 0 : option.valuePlaceholder,
@@ -3996,6 +4011,7 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
3996
4011
  className: "flex flex-col gap-2",
3997
4012
  children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DatePicker, {
3998
4013
  required: true,
4014
+ dataTestId: "value",
3999
4015
  error: fieldError(valuePath),
4000
4016
  label: t("neetoRules.builder.config.value"),
4001
4017
  type: "date",
@@ -4600,6 +4616,7 @@ var NamePane = function NamePane(_ref) {
4600
4616
  children: /*#__PURE__*/jsxRuntime.jsx(formik$1.Input, {
4601
4617
  autoFocus: true,
4602
4618
  required: true,
4619
+ dataTestId: "name",
4603
4620
  label: t("neetoRules.common.name"),
4604
4621
  name: "".concat(fieldKeys.name, ".value"),
4605
4622
  placeholder: t("neetoRules.builder.nameYourAutomation"),
@@ -4975,6 +4992,7 @@ var RecipientField = function RecipientField(_ref) {
4975
4992
  var _current = formik.getIn(values, _path) || [];
4976
4993
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.MultiEmailInput, {
4977
4994
  required: true,
4995
+ dataTestId: "email-addresses",
4978
4996
  error: fieldError(_path),
4979
4997
  label: t("neetoRules.builder.config.emailAddresses"),
4980
4998
  placeholder: t("neetoRules.builder.config.emailPlaceholder"),
@@ -5000,6 +5018,7 @@ var RecipientField = function RecipientField(_ref) {
5000
5018
  options: options,
5001
5019
  placeholder: placeholder,
5002
5020
  required: true,
5021
+ dataTestId: "recipient",
5003
5022
  error: fieldError(path),
5004
5023
  label: t("neetoRules.builder.config.recipient"),
5005
5024
  size: "large",
@@ -5202,6 +5221,7 @@ var ConditionValueFields = function ConditionValueFields(_ref) {
5202
5221
  children: [filtered.map(function (option) {
5203
5222
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Checkbox, {
5204
5223
  checked: current.includes(option.value),
5224
+ dataTestId: option.dataTestid,
5205
5225
  label: option.label,
5206
5226
  onCheckedChange: function onCheckedChange() {
5207
5227
  return toggle(option.value);
@@ -5230,6 +5250,7 @@ var ConditionValueFields = function ConditionValueFields(_ref) {
5230
5250
  isCreatable: true,
5231
5251
  isMulti: true,
5232
5252
  required: true,
5253
+ dataTestId: "keywords",
5233
5254
  error: fieldError(valuesPath),
5234
5255
  label: t("neetoRules.builder.config.keywords"),
5235
5256
  placeholder: t("neetoRules.builder.config.keywordsPlaceholder"),
@@ -5256,6 +5277,7 @@ var ConditionValueFields = function ConditionValueFields(_ref) {
5256
5277
  },
5257
5278
  children: _filtered.map(function (option) {
5258
5279
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.RadioGroup.Item, {
5280
+ dataTestId: option.dataTestid,
5259
5281
  label: String(option.label).toLowerCase(),
5260
5282
  value: String(option.value)
5261
5283
  }, option.value);
@@ -5298,9 +5320,11 @@ var ConditionValueFields = function ConditionValueFields(_ref) {
5298
5320
  onChange: handleChange
5299
5321
  };
5300
5322
  return dateTimeType === utils$1.DATE_TIME_TYPES.time ? /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.TimePicker, _objectSpread$2(_objectSpread$2({}, pickerProps), {}, {
5323
+ dataTestId: "select-time",
5301
5324
  format: "24",
5302
5325
  label: t("neetoRules.form.selectTime")
5303
5326
  })) : /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DatePicker, _objectSpread$2(_objectSpread$2({}, pickerProps), {}, {
5327
+ dataTestId: "select-date",
5304
5328
  label: t("neetoRules.form.selectDate"),
5305
5329
  showTime: field === null || field === void 0 ? void 0 : field.showTime,
5306
5330
  timeFormat: "HH:mm",
@@ -5312,6 +5336,7 @@ var ConditionValueFields = function ConditionValueFields(_ref) {
5312
5336
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Input, {
5313
5337
  autoFocus: true,
5314
5338
  required: true,
5339
+ dataTestId: "value",
5315
5340
  error: fieldError(valuePath),
5316
5341
  label: t("neetoRules.common.value"),
5317
5342
  size: "large",
@@ -5328,6 +5353,7 @@ var ConditionValueFields = function ConditionValueFields(_ref) {
5328
5353
  return /*#__PURE__*/jsxRuntime.jsx(formik$1.Input, {
5329
5354
  autoFocus: true,
5330
5355
  required: true,
5356
+ dataTestId: "value",
5331
5357
  label: t("neetoRules.common.value"),
5332
5358
  name: valuePath,
5333
5359
  size: "large",