@bigbinary/neeto-rules-frontend 2.9.0-beta1 → 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.
- package/dist/.ready +1 -1
- package/dist/cjs/v2/NeetoRulesBuilder.js +16 -9
- package/dist/cjs/v2/NeetoRulesBuilder.js.map +1 -1
- package/dist/cjs/v2/NeetoRulesForm.js +8 -4
- package/dist/cjs/v2/NeetoRulesForm.js.map +1 -1
- package/dist/cjs/v2/index.js +1 -1
- package/dist/{index-zvsaUL1M.js → index-C0MlXbjP.js} +17 -13
- package/dist/index-C0MlXbjP.js.map +1 -0
- package/dist/{index-djZiAHat.js → index-fOTfZZ-u.js} +17 -13
- package/dist/index-fOTfZZ-u.js.map +1 -0
- package/dist/v2/NeetoRulesBuilder.js +16 -9
- package/dist/v2/NeetoRulesBuilder.js.map +1 -1
- package/dist/v2/NeetoRulesForm.js +8 -4
- package/dist/v2/NeetoRulesForm.js.map +1 -1
- package/dist/v2/index.js +1 -1
- package/package.json +11 -11
- package/types.d.ts +4 -0
- package/dist/index-djZiAHat.js.map +0 -1
- package/dist/index-zvsaUL1M.js.map +0 -1
|
@@ -760,7 +760,8 @@ var CustomHeaders = function CustomHeaders(_ref) {
|
|
|
760
760
|
var name = _ref.name,
|
|
761
761
|
onFocus = _ref.onFocus,
|
|
762
762
|
_ref$helpPopoverProps = _ref.helpPopoverProps,
|
|
763
|
-
helpPopoverProps = _ref$helpPopoverProps === void 0 ? {} : _ref$helpPopoverProps
|
|
763
|
+
helpPopoverProps = _ref$helpPopoverProps === void 0 ? {} : _ref$helpPopoverProps,
|
|
764
|
+
dataTestid = _ref.dataTestid;
|
|
764
765
|
var _useFormikContext = useFormikContext(),
|
|
765
766
|
values = _useFormikContext.values,
|
|
766
767
|
setFieldValue = _useFormikContext.setFieldValue;
|
|
@@ -780,8 +781,8 @@ var CustomHeaders = function CustomHeaders(_ref) {
|
|
|
780
781
|
children: [/*#__PURE__*/jsx(Switch, _objectSpread$g({
|
|
781
782
|
label: label,
|
|
782
783
|
onFocus: onFocus,
|
|
783
|
-
"data-testid": "neeto-rules-api-fields-".concat(hyphenate(label), "-switch"),
|
|
784
784
|
name: switchName,
|
|
785
|
+
"data-testid": dataTestid || "neeto-rules-api-fields-".concat(hyphenate(label), "-switch"),
|
|
785
786
|
onCheckedChange: handleCheckedChange
|
|
786
787
|
}, withHelpPopover(helpPopoverProps))), isCustomHeadersEnabled && /*#__PURE__*/jsx(KeyValuePairsField, {
|
|
787
788
|
onFocus: onFocus,
|
|
@@ -1139,6 +1140,7 @@ var ApiFields = function ApiFields(_ref2) {
|
|
|
1139
1140
|
onFocus: setFieldActive
|
|
1140
1141
|
}), /*#__PURE__*/jsx(CustomHeaders, {
|
|
1141
1142
|
name: name,
|
|
1143
|
+
dataTestid: "neeto-rules-api-fields-include-headers-switch",
|
|
1142
1144
|
helpPopoverProps: customHeadersHelpPopoverProps,
|
|
1143
1145
|
onFocus: setFieldActive
|
|
1144
1146
|
}), /*#__PURE__*/jsx(JsonEditor, {
|
|
@@ -1181,13 +1183,13 @@ var Target$i = function Target(_ref) {
|
|
|
1181
1183
|
variant: "body1",
|
|
1182
1184
|
children: separator
|
|
1183
1185
|
}), /*#__PURE__*/jsx(Button, {
|
|
1184
|
-
"data-testid": "custom-action-button-".concat(hyphenate(defaultLabel)),
|
|
1185
1186
|
label: defaultLabel.toLowerCase(),
|
|
1186
1187
|
variant: "link",
|
|
1187
1188
|
className: classNames("text-base text-foreground font-semibold underline", {
|
|
1188
1189
|
"text-primary": isFieldActive,
|
|
1189
1190
|
"text-destructive": isFieldInvalid && !isFieldActive
|
|
1190
1191
|
}),
|
|
1192
|
+
"data-testid": (selectedField === null || selectedField === void 0 ? void 0 : selectedField.dataTestid) || "custom-action-button-".concat(hyphenate(defaultLabel)),
|
|
1191
1193
|
onClick: handleOnClick
|
|
1192
1194
|
})]
|
|
1193
1195
|
});
|
|
@@ -2127,10 +2129,10 @@ var MultiSelectCheckbox$1 = function MultiSelectCheckbox(_ref2) {
|
|
|
2127
2129
|
return /*#__PURE__*/createElement(Checkbox, {
|
|
2128
2130
|
ref: ref,
|
|
2129
2131
|
checked: selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.includes(option.value),
|
|
2130
|
-
"data-testid": "".concat(joinHyphenCase(option.label), "-checkbox"),
|
|
2131
2132
|
id: option.value,
|
|
2132
2133
|
key: option.value,
|
|
2133
2134
|
label: option.label,
|
|
2135
|
+
"data-testid": option.dataTestid || "".concat(joinHyphenCase(option.label), "-checkbox"),
|
|
2134
2136
|
onChange: function onChange() {
|
|
2135
2137
|
return handleSelectOption(option.value);
|
|
2136
2138
|
},
|
|
@@ -2441,7 +2443,7 @@ var CUSTOM_COMPONENTS = {
|
|
|
2441
2443
|
ClearIndicator: ClearIndicator
|
|
2442
2444
|
};
|
|
2443
2445
|
|
|
2444
|
-
var _excluded$3 = ["value", "onChange", "error", "onBlur", "onFocus"];
|
|
2446
|
+
var _excluded$3 = ["value", "onChange", "error", "onBlur", "onFocus", "dataTestid"];
|
|
2445
2447
|
function ownKeys$8(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; }
|
|
2446
2448
|
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2447
2449
|
var MultiPhoneNumberInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
@@ -2455,6 +2457,7 @@ var MultiPhoneNumberInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
2455
2457
|
onBlur = _ref$onBlur === void 0 ? noop : _ref$onBlur,
|
|
2456
2458
|
_ref$onFocus = _ref.onFocus,
|
|
2457
2459
|
_onFocus = _ref$onFocus === void 0 ? noop : _ref$onFocus,
|
|
2460
|
+
dataTestid = _ref.dataTestid,
|
|
2458
2461
|
otherProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
2459
2462
|
var _useTranslation = useTranslation(),
|
|
2460
2463
|
t = _useTranslation.t;
|
|
@@ -2501,7 +2504,7 @@ var MultiPhoneNumberInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
2501
2504
|
children: /*#__PURE__*/jsx(Label, {
|
|
2502
2505
|
required: true,
|
|
2503
2506
|
className: "neeto-ui-email-input__label",
|
|
2504
|
-
"data-testid": "".concat(dasherize(label), "-input-label"),
|
|
2507
|
+
"data-testid": "".concat(dataTestid || dasherize(label), "-input-label"),
|
|
2505
2508
|
children: label
|
|
2506
2509
|
})
|
|
2507
2510
|
}), /*#__PURE__*/jsx(CreatableSelect, _objectSpread$8({
|
|
@@ -2537,7 +2540,7 @@ var MultiPhoneNumberInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
2537
2540
|
value: value
|
|
2538
2541
|
}, otherProps))), !!error && /*#__PURE__*/jsxs("p", {
|
|
2539
2542
|
className: "text-destructive text-xs",
|
|
2540
|
-
"data-testid": "".concat(dasherize(label), "-input-error"),
|
|
2543
|
+
"data-testid": "".concat(dataTestid || dasherize(label), "-input-error"),
|
|
2541
2544
|
children: [formatErrorMessage(error), isFilterPhoneNumbersLinkVisible && /*#__PURE__*/jsxs("span", {
|
|
2542
2545
|
className: "font-semibold cursor-pointer",
|
|
2543
2546
|
onClick: handleFilterPhoneNumbers,
|
|
@@ -2545,7 +2548,7 @@ var MultiPhoneNumberInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
2545
2548
|
})]
|
|
2546
2549
|
}), /*#__PURE__*/jsx("p", {
|
|
2547
2550
|
className: "text-muted-foreground text-xs",
|
|
2548
|
-
"data-testid": "".concat(dasherize(label), "-input-help"),
|
|
2551
|
+
"data-testid": "".concat(dataTestid || dasherize(label), "-input-help"),
|
|
2549
2552
|
children: t("neetoRules.helpTexts.phoneNumber")
|
|
2550
2553
|
})]
|
|
2551
2554
|
});
|
|
@@ -2573,6 +2576,7 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
2573
2576
|
children: /*#__PURE__*/jsx(MultiPhoneNumberInput, {
|
|
2574
2577
|
name: name,
|
|
2575
2578
|
onFocus: onFocus,
|
|
2579
|
+
dataTestid: "phone-numbers",
|
|
2576
2580
|
error: meta.touched ? meta.error : "",
|
|
2577
2581
|
label: t("neetoRules.common.phoneNumbers"),
|
|
2578
2582
|
placeholder: t("neetoRules.placeholders.phoneNumberField"),
|
|
@@ -3584,10 +3588,10 @@ var MultiSelectCheckbox = function MultiSelectCheckbox(_ref2) {
|
|
|
3584
3588
|
return /*#__PURE__*/createElement(Checkbox, _objectSpread$5({
|
|
3585
3589
|
ref: ref,
|
|
3586
3590
|
checked: selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.includes(option.value),
|
|
3587
|
-
"data-testid": "".concat(joinHyphenCase(option.label), "-checkbox"),
|
|
3588
3591
|
id: option.value,
|
|
3589
3592
|
key: option.value,
|
|
3590
3593
|
label: option.label,
|
|
3594
|
+
"data-testid": option.dataTestid || "".concat(joinHyphenCase(option.label), "-checkbox"),
|
|
3591
3595
|
onChange: function onChange() {
|
|
3592
3596
|
return handleMultiSelectOption(option.value);
|
|
3593
3597
|
},
|
|
@@ -4711,10 +4715,10 @@ var EventsPanel = function EventsPanel() {
|
|
|
4711
4715
|
ref: ref,
|
|
4712
4716
|
onFocus: setFieldActive
|
|
4713
4717
|
} : {}), {}, {
|
|
4714
|
-
"data-testid": "".concat(joinHyphenCase(option.label), "-radio"),
|
|
4715
4718
|
key: option.value,
|
|
4716
4719
|
label: option.label,
|
|
4717
|
-
value: option.value
|
|
4720
|
+
value: option.value,
|
|
4721
|
+
"data-testid": option.dataTestid || "".concat(joinHyphenCase(option.label), "-radio")
|
|
4718
4722
|
}));
|
|
4719
4723
|
})
|
|
4720
4724
|
}) : searchedOptions.map(function (option, index) {
|
|
@@ -4722,10 +4726,10 @@ var EventsPanel = function EventsPanel() {
|
|
|
4722
4726
|
ref: ref
|
|
4723
4727
|
} : {}), {}, {
|
|
4724
4728
|
checked: eventNames === null || eventNames === void 0 ? void 0 : eventNames.includes(option.value),
|
|
4725
|
-
"data-testid": "".concat(joinHyphenCase(option.label), "-checkbox"),
|
|
4726
4729
|
id: option.value,
|
|
4727
4730
|
key: option.value,
|
|
4728
4731
|
label: option.label,
|
|
4732
|
+
"data-testid": option.dataTestid || "".concat(joinHyphenCase(option.label), "-checkbox"),
|
|
4729
4733
|
onCheckedChange: function onCheckedChange() {
|
|
4730
4734
|
return handleMultiSelectOption(option);
|
|
4731
4735
|
},
|
|
@@ -5419,4 +5423,4 @@ var formatData = function formatData(data) {
|
|
|
5419
5423
|
};
|
|
5420
5424
|
|
|
5421
5425
|
export { ActionSubItem as A, SmsFields as B, MAX_DELAY_VALUE as C, DEFAULT_RULE_ACTION as D, EditorAction as E, FIELDS_WITH_OPTIONS as F, PhoneNumberField as G, ListField as L, MIN_DELAY_VALUE as M, OPERATORS as O, PANEL_TYPES as P, RadioField as R, SelectField as S, TouchErrors as T, ValueField as V, getFieldDetails$1 as a, getSlackChannelErrors as b, getOptionsKey as c, getActionLabel as d, getLogicalOperatorOptions as e, getFieldDetails as f, getActionOptions as g, getVerbOptions as h, DEFAULT_DELAY as i, getAllEvents as j, STATUS_KEYS as k, formatData as l, buildPayload as m, ScrollToErrorField as n, Panel as o, getValidationSchema as p, DEFAULT_INITIAL_VALUE as q, useHasFieldChanged as r, areValuesEqual as s, useResetSaveAsTemplateOnHide as t, usePollRuleName as u, SelectTemplateField as v, SaveAsTemplate as w, setEditorContent as x, ApiFields as y, ErrorCallout as z };
|
|
5422
|
-
//# sourceMappingURL=index-
|
|
5426
|
+
//# sourceMappingURL=index-C0MlXbjP.js.map
|