@bigbinary/neeto-rules-frontend 2.9.3 → 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 @@ import { useTranslation } from 'react-i18next';
13
13
  import { u as useUtilityStore } from '../useUtilityStore-BVCulMEC.js';
14
14
  import classNames from 'classnames';
15
15
  import { isNotNil, isEmpty, pluck } from 'ramda';
16
- import { g as getActionOptions, a as getFieldDetails, b as getSlackChannelErrors, c as getOptionsKey, d as getActionLabel, A as ActionSubItem, F as FIELDS_WITH_OPTIONS, P as PANEL_TYPES, D as DEFAULT_RULE_ACTION, e as getLogicalOperatorOptions, f as getFieldDetails$1, h as getVerbOptions, R as RadioField$1, S as SelectField$1, V as ValueField, i as DEFAULT_DELAY, j as getAllEvents, O as OPERATORS$1, k as STATUS_KEYS, l as formatData, u as usePollRuleName, T as TouchErrors, m as buildPayload, n as ScrollToErrorField, o as Panel, p as getValidationSchema, q as DEFAULT_INITIAL_VALUE } from '../index-KEm6XVbK.js';
16
+ import { g as getActionOptions, a as getFieldDetails, b as getSlackChannelErrors, c as getOptionsKey, d as getActionLabel, A as ActionSubItem, F as FIELDS_WITH_OPTIONS, P as PANEL_TYPES, D as DEFAULT_RULE_ACTION, e as getLogicalOperatorOptions, f as getFieldDetails$1, h as getVerbOptions, R as RadioField$1, S as SelectField$1, V as ValueField, i as DEFAULT_DELAY, j as getAllEvents, O as OPERATORS$1, k as STATUS_KEYS, l as formatData, u as usePollRuleName, T as TouchErrors, m as buildPayload, n as ScrollToErrorField, o as Panel, p as getValidationSchema, q as DEFAULT_INITIAL_VALUE } from '../index-Di9n5OiL.js';
17
17
  import { a as useActiveField, u as useCustomDataStore } from '../useCustomDataStore-CEbhXugO.js';
18
18
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
19
19
  import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/v2/utils';
@@ -1143,10 +1143,12 @@ var RadioField = function RadioField(_ref) {
1143
1143
  }, componentProps), {}, {
1144
1144
  children: radioOptions.map(function (_ref2, index) {
1145
1145
  var label = _ref2.label,
1146
- value = _ref2.value;
1146
+ value = _ref2.value,
1147
+ dataTestid = _ref2.dataTestid;
1147
1148
  return /*#__PURE__*/createElement(RadioGroup.Item, {
1148
1149
  label: label,
1149
1150
  value: value,
1151
+ dataTestId: dataTestid,
1150
1152
  key: index
1151
1153
  });
1152
1154
  })
@@ -1215,7 +1217,8 @@ var Status = function Status(_ref) {
1215
1217
  var _helpText$active, _helpText$inactive;
1216
1218
  var label = _ref.label,
1217
1219
  _ref$helpText = _ref.helpText,
1218
- helpText = _ref$helpText === void 0 ? {} : _ref$helpText;
1220
+ helpText = _ref$helpText === void 0 ? {} : _ref$helpText,
1221
+ dataTestid = _ref.dataTestid;
1219
1222
  var _useFormikContext = useFormikContext(),
1220
1223
  status = _useFormikContext.values.status,
1221
1224
  setFieldValue = _useFormikContext.setFieldValue;
@@ -1227,6 +1230,7 @@ var Status = function Status(_ref) {
1227
1230
  };
1228
1231
  return /*#__PURE__*/jsx(Switch, {
1229
1232
  checked: defaultValue === ENABLED,
1233
+ dataTestId: dataTestid !== null && dataTestid !== void 0 ? dataTestid : label ? undefined : "active",
1230
1234
  label: label || t("neetoRules.labels.active"),
1231
1235
  size: "lg",
1232
1236
  labelProps: {
@@ -1262,6 +1266,7 @@ var Form = function Form(_ref) {
1262
1266
  _ref$showStatusSwitch = _ref.showStatusSwitch,
1263
1267
  showStatusSwitch = _ref$showStatusSwitch === void 0 ? true : _ref$showStatusSwitch,
1264
1268
  statusSwitchLabel = _ref.statusSwitchLabel,
1269
+ statusSwitchDataTestid = _ref.statusSwitchDataTestid,
1265
1270
  _ref$statusHelpText = _ref.statusHelpText,
1266
1271
  statusHelpText = _ref$statusHelpText === void 0 ? {} : _ref$statusHelpText,
1267
1272
  _ref$payloadKey = _ref.payloadKey,
@@ -1351,6 +1356,7 @@ var Form = function Form(_ref) {
1351
1356
  className: "flex items-center gap-x-3",
1352
1357
  children: [/*#__PURE__*/jsx(InputField, {
1353
1358
  data: initialValues,
1359
+ dataTestId: "name",
1354
1360
  label: t("neetoRules.common.name"),
1355
1361
  name: "name",
1356
1362
  placeholder: isNameGenerationDisabled ? "" : t("neetoRules.placeholders.autoGenerateName")
@@ -1375,6 +1381,7 @@ var Form = function Form(_ref) {
1375
1381
  })]
1376
1382
  })]
1377
1383
  }), showStatusSwitch && /*#__PURE__*/jsx(Status, {
1384
+ dataTestid: statusSwitchDataTestid,
1378
1385
  helpText: statusHelpText,
1379
1386
  label: statusSwitchLabel
1380
1387
  })]