@bigbinary/neeto-rules-frontend 2.5.4 → 2.5.8
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/README.md +2 -0
- package/dist/CannedResponsesPane.js.map +1 -1
- package/dist/NeetoRules.js +14 -14
- package/dist/NeetoRules.js.map +1 -1
- package/dist/NeetoRulesForm.js +85 -82
- package/dist/NeetoRulesForm.js.map +1 -1
- package/dist/RulePreview.js +3 -3
- package/dist/RulePreview.js.map +1 -1
- package/dist/cjs/CannedResponsesPane.js.map +1 -1
- package/dist/cjs/NeetoRules.js +14 -14
- package/dist/cjs/NeetoRules.js.map +1 -1
- package/dist/cjs/NeetoRulesForm.js +85 -82
- package/dist/cjs/NeetoRulesForm.js.map +1 -1
- package/dist/cjs/RulePreview.js +3 -3
- package/dist/cjs/RulePreview.js.map +1 -1
- package/dist/constants-C0OOtVhT.js.map +1 -1
- package/dist/constants-CB5HRjxq.js.map +1 -1
- package/dist/index-9h4B7JZZ.js.map +1 -1
- package/dist/index-DFwPrb81.js.map +1 -1
- package/dist/useCustomDataStore-B1qHMIGJ.js.map +1 -1
- package/dist/useCustomDataStore-BEG8I__n.js.map +1 -1
- package/dist/useUtilityStore-BGuo9bko.js.map +1 -1
- package/dist/useUtilityStore-KjKihXb0.js.map +1 -1
- package/dist/utils-BngEaPaz.js.map +1 -1
- package/dist/utils-CvS2p6ZS.js.map +1 -1
- package/package.json +56 -54
|
@@ -80,7 +80,7 @@ var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
|
|
|
80
80
|
|
|
81
81
|
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
82
82
|
|
|
83
|
-
var css = ".neeto-filters-error-boundary{align-items:center;background-color:rgb(var(--neeto-ui-gray-100));border-radius:var(--neeto-ui-rounded-sm);display:flex;gap:
|
|
83
|
+
var css = ".neeto-filters-error-boundary{align-items:center;background-color:rgb(var(--neeto-ui-gray-100));border-radius:var(--neeto-ui-rounded-sm);display:flex;gap:1rem;margin-bottom:.75rem;padding:.5rem 1.25rem}.neeto-filters-error-boundary p{color:rgb(var(--neeto-ui-gray-800))}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3NyYy9zdHlsZXNoZWV0cy9jb21wb25lbnRzL19lcnJvci1ib3VuZGFyeS5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3JjL3N0eWxlc2hlZXRzL21haW4uc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw4QkFJRSxrQkFBQSxDQUdBLDhDQUFBLENBREEsd0NBQUEsQ0FIQSxZQUFBLENBRUEsUUFBQSxDQUhBLG9CQUFBLENBREEscUJDT0YsQ0RDRSxnQ0FDRSxtQ0NDSiIsInNvdXJjZXNDb250ZW50IjpbIi5uZWV0by1maWx0ZXJzLWVycm9yLWJvdW5kYXJ5IHtcbiAgcGFkZGluZzogMC41cmVtIDEuMjVyZW07XG4gIG1hcmdpbi1ib3R0b206IDAuNzVyZW07XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIGdhcDogMXJlbTtcbiAgYm9yZGVyLXJhZGl1czogdmFyKC0tbmVldG8tdWktcm91bmRlZC1zbSk7XG4gIGJhY2tncm91bmQtY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS1ncmF5LTEwMCkpO1xuXG4gIHAge1xuICAgIGNvbG9yOiByZ2IodmFyKC0tbmVldG8tdWktZ3JheS04MDApKTtcbiAgfVxufVxuIiwiLm5lZXRvLWZpbHRlcnMtZXJyb3ItYm91bmRhcnkge1xuICBwYWRkaW5nOiAwLjVyZW0gMS4yNXJlbTtcbiAgbWFyZ2luLWJvdHRvbTogMC43NXJlbTtcbiAgZGlzcGxheTogZmxleDtcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgZ2FwOiAxcmVtO1xuICBib3JkZXItcmFkaXVzOiB2YXIoLS1uZWV0by11aS1yb3VuZGVkLXNtKTtcbiAgYmFja2dyb3VuZC1jb2xvcjogcmdiKHZhcigtLW5lZXRvLXVpLWdyYXktMTAwKSk7XG59XG4ubmVldG8tZmlsdGVycy1lcnJvci1ib3VuZGFyeSBwIHtcbiAgY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS1ncmF5LTgwMCkpO1xufSJdfQ== */";
|
|
84
84
|
n(css,{});
|
|
85
85
|
|
|
86
86
|
var OptionsWrapper = function OptionsWrapper(_ref) {
|
|
@@ -146,7 +146,7 @@ var PaneFooterBlock = function PaneFooterBlock(_ref) {
|
|
|
146
146
|
};
|
|
147
147
|
|
|
148
148
|
var LongTextField = function LongTextField(_ref) {
|
|
149
|
-
var _errors$actions,
|
|
149
|
+
var _errors$actions, _touched$actions, _selectedField$separa;
|
|
150
150
|
var name = _ref.name,
|
|
151
151
|
_ref$value = _ref.value,
|
|
152
152
|
value = _ref$value === void 0 ? "" : _ref$value,
|
|
@@ -166,8 +166,8 @@ var LongTextField = function LongTextField(_ref) {
|
|
|
166
166
|
useOnButtonPressed(initialFocusRef, function () {
|
|
167
167
|
return setShowPane(false);
|
|
168
168
|
});
|
|
169
|
-
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0
|
|
170
|
-
var separator = (selectedField === null || selectedField === void 0
|
|
169
|
+
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
170
|
+
var separator = (selectedField === null || selectedField === void 0 || (_selectedField$separa = selectedField.separator) === null || _selectedField$separa === void 0 ? void 0 : _selectedField$separa.toLowerCase()) || defaultSeparator;
|
|
171
171
|
var label = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.placeholder) || defaultLabel;
|
|
172
172
|
var rows = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.rows) || DEFAULT_LONG_TEXT_ROWS;
|
|
173
173
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -345,7 +345,7 @@ var SelectTemplateField = function SelectTemplateField(_ref) {
|
|
|
345
345
|
var template = neetoCist.findBy({
|
|
346
346
|
id: option.value
|
|
347
347
|
}, templates);
|
|
348
|
-
onChange === null || onChange === void 0
|
|
348
|
+
onChange === null || onChange === void 0 || onChange(template);
|
|
349
349
|
};
|
|
350
350
|
return /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
351
351
|
isClearable: true,
|
|
@@ -364,7 +364,7 @@ var SelectTemplateField = function SelectTemplateField(_ref) {
|
|
|
364
364
|
};
|
|
365
365
|
|
|
366
366
|
var ApiFields = function ApiFields(_ref) {
|
|
367
|
-
var _errors$actions,
|
|
367
|
+
var _errors$actions, _touched$actions, _selectedField$separa;
|
|
368
368
|
var name = _ref.name,
|
|
369
369
|
selectedField = _ref.selectedField,
|
|
370
370
|
index = _ref.index;
|
|
@@ -382,8 +382,8 @@ var ApiFields = function ApiFields(_ref) {
|
|
|
382
382
|
useOnButtonPressed(initialFocusRef, function () {
|
|
383
383
|
return setShowPane(false);
|
|
384
384
|
});
|
|
385
|
-
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0
|
|
386
|
-
var separator = (selectedField === null || selectedField === void 0
|
|
385
|
+
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
386
|
+
var separator = (selectedField === null || selectedField === void 0 || (_selectedField$separa = selectedField.separator) === null || _selectedField$separa === void 0 ? void 0 : _selectedField$separa.toLowerCase()) || t("neetoRules.common.as");
|
|
387
387
|
var defaultLabel = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.dataPlaceholder) || t("neetoRules.common.data");
|
|
388
388
|
var templates = selectedField === null || selectedField === void 0 ? void 0 : selectedField.templates;
|
|
389
389
|
var isTemplateSelectionEnabled = neetoCist.isPresent(templates);
|
|
@@ -457,7 +457,7 @@ var ApiFields = function ApiFields(_ref) {
|
|
|
457
457
|
};
|
|
458
458
|
|
|
459
459
|
var CustomAction = function CustomAction(_ref) {
|
|
460
|
-
var _errors$actions,
|
|
460
|
+
var _errors$actions, _touched$actions, _selectedField$separa;
|
|
461
461
|
var ActionComponent = _ref.ActionComponent,
|
|
462
462
|
name = _ref.name,
|
|
463
463
|
action = _ref.action,
|
|
@@ -476,8 +476,8 @@ var CustomAction = function CustomAction(_ref) {
|
|
|
476
476
|
useOnButtonPressed(initialFocusRef, function () {
|
|
477
477
|
return setShowPane(false);
|
|
478
478
|
});
|
|
479
|
-
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0
|
|
480
|
-
var separator = (selectedField === null || selectedField === void 0
|
|
479
|
+
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
480
|
+
var separator = (selectedField === null || selectedField === void 0 || (_selectedField$separa = selectedField.separator) === null || _selectedField$separa === void 0 ? void 0 : _selectedField$separa.toLowerCase()) || t("neetoRules.common.as");
|
|
481
481
|
var defaultLabel = selectedField === null || selectedField === void 0 ? void 0 : selectedField.placeholder;
|
|
482
482
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
483
483
|
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
@@ -526,7 +526,7 @@ var CustomAction = function CustomAction(_ref) {
|
|
|
526
526
|
};
|
|
527
527
|
|
|
528
528
|
var DateField$1 = function DateField(_ref) {
|
|
529
|
-
var _actions$value$index$, _selectedField$separa, _errors$actions,
|
|
529
|
+
var _actions$value$index$, _selectedField$separa, _errors$actions, _touched$actions;
|
|
530
530
|
var name = _ref.name,
|
|
531
531
|
index = _ref.index,
|
|
532
532
|
selectedField = _ref.selectedField;
|
|
@@ -544,8 +544,8 @@ var DateField$1 = function DateField(_ref) {
|
|
|
544
544
|
t = _useTranslation.t;
|
|
545
545
|
var valueTerm = (_actions$value$index$ = actions.value[index].metadata) === null || _actions$value$index$ === void 0 ? void 0 : _actions$value$index$.value;
|
|
546
546
|
var label = valueTerm || t("neetoRules.form.selectDate");
|
|
547
|
-
var separator = (selectedField === null || selectedField === void 0
|
|
548
|
-
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0
|
|
547
|
+
var separator = (selectedField === null || selectedField === void 0 || (_selectedField$separa = selectedField.separator) === null || _selectedField$separa === void 0 ? void 0 : _selectedField$separa.toLowerCase()) || t("neetoRules.common.to");
|
|
548
|
+
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
549
549
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
550
550
|
children: [!selectedField.hideSeparator && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
551
551
|
className: "neeto-ui-text-gray-700",
|
|
@@ -695,7 +695,7 @@ var getSlackChannelErrors = function getSlackChannelErrors(_ref2) {
|
|
|
695
695
|
if (action !== null && action !== void 0 && (_action$metadata = action.metadata) !== null && _action$metadata !== void 0 && _action$metadata.value) {
|
|
696
696
|
var selectedOption = opts.find(function (op) {
|
|
697
697
|
var _action$metadata2;
|
|
698
|
-
return (op === null || op === void 0 ? void 0 : op.value) === (action === null || action === void 0
|
|
698
|
+
return (op === null || op === void 0 ? void 0 : op.value) === (action === null || action === void 0 || (_action$metadata2 = action.metadata) === null || _action$metadata2 === void 0 ? void 0 : _action$metadata2.value);
|
|
699
699
|
});
|
|
700
700
|
if (!selectedOption) {
|
|
701
701
|
return {
|
|
@@ -712,7 +712,7 @@ var getSlackChannelErrors = function getSlackChannelErrors(_ref2) {
|
|
|
712
712
|
var Menu$9 = Dropdown$1.Menu,
|
|
713
713
|
MenuItem$9 = Dropdown$1.MenuItem;
|
|
714
714
|
var DropdownField$1 = function DropdownField(_ref) {
|
|
715
|
-
var _actions$value$index$, _actions$value$index, _errors$actions,
|
|
715
|
+
var _actions$value$index$, _actions$value$index, _errors$actions, _touched$actions, _defaultSelectedOptio;
|
|
716
716
|
var dropdownOptions = _ref.dropdownOptions,
|
|
717
717
|
name = _ref.name,
|
|
718
718
|
index = _ref.index,
|
|
@@ -742,7 +742,7 @@ var DropdownField$1 = function DropdownField(_ref) {
|
|
|
742
742
|
setSearchTerm = _useState6[1];
|
|
743
743
|
var defaultValue = ((_actions$value$index$ = actions.value[index].metadata) === null || _actions$value$index$ === void 0 ? void 0 : _actions$value$index$.value) || ((_actions$value$index = actions.value[index]) === null || _actions$value$index === void 0 ? void 0 : _actions$value$index.value);
|
|
744
744
|
var searchedOptions = getSearchedOptions$3(dropdownOptions, searchTerm);
|
|
745
|
-
var isValueSelected = defaultSelectedOption.label === defaultLabel && errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0
|
|
745
|
+
var isValueSelected = defaultSelectedOption.label === defaultLabel && errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
746
746
|
var separator = utils$1.getSeparator({
|
|
747
747
|
defaultSeparator: t("neetoRules.common.to"),
|
|
748
748
|
selectedField: selectedField
|
|
@@ -789,7 +789,7 @@ var DropdownField$1 = function DropdownField(_ref) {
|
|
|
789
789
|
className: "neeto-ui-bg-gray-100",
|
|
790
790
|
customTarget: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
791
791
|
"data-cy": "action-dropdown-button",
|
|
792
|
-
label: defaultSelectedOption === null || defaultSelectedOption === void 0
|
|
792
|
+
label: defaultSelectedOption === null || defaultSelectedOption === void 0 || (_defaultSelectedOptio = defaultSelectedOption.label) === null || _defaultSelectedOptio === void 0 ? void 0 : _defaultSelectedOptio.toLowerCase(),
|
|
793
793
|
style: "link",
|
|
794
794
|
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
795
795
|
"neeto-ui-text-accent-800": isActive,
|
|
@@ -915,7 +915,7 @@ var EmailIdFields = function EmailIdFields(_ref) {
|
|
|
915
915
|
};
|
|
916
916
|
|
|
917
917
|
var EmailFields = function EmailFields(_ref) {
|
|
918
|
-
var _errors$actions,
|
|
918
|
+
var _errors$actions, _touched$actions, _action$metadata;
|
|
919
919
|
var _ref$isEmailIdField = _ref.isEmailIdField,
|
|
920
920
|
isEmailIdField = _ref$isEmailIdField === void 0 ? false : _ref$isEmailIdField,
|
|
921
921
|
name = _ref.name,
|
|
@@ -941,7 +941,7 @@ var EmailFields = function EmailFields(_ref) {
|
|
|
941
941
|
useOnButtonPressed(initialFocusRef, function () {
|
|
942
942
|
return setShowPane(false);
|
|
943
943
|
});
|
|
944
|
-
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0
|
|
944
|
+
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
945
945
|
var separator = utils$1.getSeparator({
|
|
946
946
|
defaultSeparator: t("neetoRules.common.as"),
|
|
947
947
|
index: separatorIndex,
|
|
@@ -1052,7 +1052,7 @@ var useCloseInputField = function useCloseInputField(ref, showInput, handler) {
|
|
|
1052
1052
|
handler();
|
|
1053
1053
|
}
|
|
1054
1054
|
};
|
|
1055
|
-
(_ref$current = ref.current) === null || _ref$current === void 0
|
|
1055
|
+
(_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.addEventListener("keydown", listener);
|
|
1056
1056
|
return function () {
|
|
1057
1057
|
var _ref$current2;
|
|
1058
1058
|
return (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.removeEventListener("keydown", listener);
|
|
@@ -1066,7 +1066,7 @@ var useCloseInputField = function useCloseInputField(ref, showInput, handler) {
|
|
|
1066
1066
|
};
|
|
1067
1067
|
|
|
1068
1068
|
var Input = function Input(_ref) {
|
|
1069
|
-
var _action$metadata, _selectedField$separa, _errors$actions,
|
|
1069
|
+
var _action$metadata, _selectedField$separa, _errors$actions, _touched$actions;
|
|
1070
1070
|
var name = _ref.name,
|
|
1071
1071
|
index = _ref.index,
|
|
1072
1072
|
selectedField = _ref.selectedField;
|
|
@@ -1087,8 +1087,8 @@ var Input = function Input(_ref) {
|
|
|
1087
1087
|
var action = actions.value[index];
|
|
1088
1088
|
var valueTerm = (_action$metadata = action.metadata) === null || _action$metadata === void 0 ? void 0 : _action$metadata.value;
|
|
1089
1089
|
var label = valueTerm && neetoCist.isNotEmpty(valueTerm === null || valueTerm === void 0 ? void 0 : valueTerm.trim()) ? valueTerm : t("neetoRules.form.addValue");
|
|
1090
|
-
var separator = (selectedField === null || selectedField === void 0
|
|
1091
|
-
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0
|
|
1090
|
+
var separator = (selectedField === null || selectedField === void 0 || (_selectedField$separa = selectedField.separator) === null || _selectedField$separa === void 0 ? void 0 : _selectedField$separa.toLowerCase()) || t("neetoRules.common.to");
|
|
1091
|
+
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
1092
1092
|
react.useEffect(function () {
|
|
1093
1093
|
setShowInput(false);
|
|
1094
1094
|
}, [action.name]);
|
|
@@ -1232,7 +1232,7 @@ var InlineInput = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
|
1232
1232
|
InlineInput.displayName = "InlineInput";
|
|
1233
1233
|
|
|
1234
1234
|
var ListField = function ListField(_ref) {
|
|
1235
|
-
var _errors$actions,
|
|
1235
|
+
var _errors$actions, _touched$actions, _selectedField$separa;
|
|
1236
1236
|
var name = _ref.name,
|
|
1237
1237
|
_ref$values = _ref.values,
|
|
1238
1238
|
values = _ref$values === void 0 ? [] : _ref$values,
|
|
@@ -1255,8 +1255,8 @@ var ListField = function ListField(_ref) {
|
|
|
1255
1255
|
useOnButtonPressed(initialFocusRef, function () {
|
|
1256
1256
|
return setShowPane(false);
|
|
1257
1257
|
});
|
|
1258
|
-
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0
|
|
1259
|
-
var separator = (selectedField === null || selectedField === void 0
|
|
1258
|
+
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
1259
|
+
var separator = (selectedField === null || selectedField === void 0 || (_selectedField$separa = selectedField.separator) === null || _selectedField$separa === void 0 ? void 0 : _selectedField$separa.toLowerCase()) || t("neetoRules.common.to");
|
|
1260
1260
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1261
1261
|
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1262
1262
|
className: "neeto-ui-text-gray-700",
|
|
@@ -1363,7 +1363,7 @@ var ListField = function ListField(_ref) {
|
|
|
1363
1363
|
var Menu$8 = Dropdown$1.Menu,
|
|
1364
1364
|
MenuItem$8 = Dropdown$1.MenuItem;
|
|
1365
1365
|
var MultiSelect$1 = function MultiSelect(_ref) {
|
|
1366
|
-
var _selectedField$placeh, _selectedField$separa, _errors$actions,
|
|
1366
|
+
var _selectedField$placeh, _selectedField$separa, _errors$actions, _touched$actions;
|
|
1367
1367
|
var _ref$values = _ref.values,
|
|
1368
1368
|
values = _ref$values === void 0 ? [] : _ref$values,
|
|
1369
1369
|
_ref$dropDownOptions = _ref.dropDownOptions,
|
|
@@ -1392,10 +1392,10 @@ var MultiSelect$1 = function MultiSelect(_ref) {
|
|
|
1392
1392
|
});
|
|
1393
1393
|
}, [values, dropDownOptions]);
|
|
1394
1394
|
var selectedOptions = getSelectedOptions(allOptions);
|
|
1395
|
-
var defaultLabel = (selectedField === null || selectedField === void 0
|
|
1395
|
+
var defaultLabel = (selectedField === null || selectedField === void 0 || (_selectedField$placeh = selectedField.placeholder) === null || _selectedField$placeh === void 0 ? void 0 : _selectedField$placeh.toLowerCase()) || t("neetoRules.form.selectValues");
|
|
1396
1396
|
var searchedOptions = getSearchedOptions$3(dropDownOptions, searchTerm);
|
|
1397
|
-
var separator = (selectedField === null || selectedField === void 0
|
|
1398
|
-
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0
|
|
1397
|
+
var separator = (selectedField === null || selectedField === void 0 || (_selectedField$separa = selectedField.separator) === null || _selectedField$separa === void 0 ? void 0 : _selectedField$separa.toLowerCase()) || t("neetoRules.common.to");
|
|
1398
|
+
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
1399
1399
|
var handleSelectOption = function handleSelectOption(option) {
|
|
1400
1400
|
var options = values.includes(option.value) ? ramda.without([option.value], values) : ramda.append(option.value, values);
|
|
1401
1401
|
setFieldValue(name, options);
|
|
@@ -1496,7 +1496,7 @@ var MultiSelect$1 = function MultiSelect(_ref) {
|
|
|
1496
1496
|
};
|
|
1497
1497
|
|
|
1498
1498
|
var NoteField = function NoteField(_ref) {
|
|
1499
|
-
var _errors$actions,
|
|
1499
|
+
var _errors$actions, _touched$actions, _selectedField$separa;
|
|
1500
1500
|
var name = _ref.name,
|
|
1501
1501
|
_ref$value = _ref.value,
|
|
1502
1502
|
value = _ref$value === void 0 ? "" : _ref$value,
|
|
@@ -1515,8 +1515,8 @@ var NoteField = function NoteField(_ref) {
|
|
|
1515
1515
|
useOnButtonPressed(initialFocusRef, function () {
|
|
1516
1516
|
return setShowPane(false);
|
|
1517
1517
|
});
|
|
1518
|
-
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0
|
|
1519
|
-
var separator = (selectedField === null || selectedField === void 0
|
|
1518
|
+
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
1519
|
+
var separator = (selectedField === null || selectedField === void 0 || (_selectedField$separa = selectedField.separator) === null || _selectedField$separa === void 0 ? void 0 : _selectedField$separa.toLowerCase()) || t("neetoRules.common.as");
|
|
1520
1520
|
var variables = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.variables) || [];
|
|
1521
1521
|
var defaultLabel = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.placeholder) || t("neetoRules.form.note");
|
|
1522
1522
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -1822,7 +1822,7 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
1822
1822
|
};
|
|
1823
1823
|
|
|
1824
1824
|
var SmsFields = function SmsFields(_ref) {
|
|
1825
|
-
var _errors$actions,
|
|
1825
|
+
var _errors$actions, _touched$actions, _action$metadata;
|
|
1826
1826
|
var name = _ref.name,
|
|
1827
1827
|
action = _ref.action,
|
|
1828
1828
|
selectedField = _ref.selectedField,
|
|
@@ -1848,7 +1848,7 @@ var SmsFields = function SmsFields(_ref) {
|
|
|
1848
1848
|
useOnButtonPressed(initialFocusRef, function () {
|
|
1849
1849
|
return setShowPane(false);
|
|
1850
1850
|
});
|
|
1851
|
-
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0
|
|
1851
|
+
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
1852
1852
|
var separator = utils$1.getSeparator({
|
|
1853
1853
|
defaultSeparator: t("neetoRules.common.as"),
|
|
1854
1854
|
index: separatorIndex,
|
|
@@ -2430,7 +2430,7 @@ var DEFAULT_INITIAL_VALUE = {
|
|
|
2430
2430
|
var Menu$7 = Dropdown$1.Menu,
|
|
2431
2431
|
MenuItem$7 = Dropdown$1.MenuItem;
|
|
2432
2432
|
var ActionItem = function ActionItem(_ref) {
|
|
2433
|
-
var _errors$actions,
|
|
2433
|
+
var _errors$actions, _touched$actions, _selectedOption$label;
|
|
2434
2434
|
var name = _ref.name,
|
|
2435
2435
|
action = _ref.action,
|
|
2436
2436
|
index = _ref.index,
|
|
@@ -2473,11 +2473,11 @@ var ActionItem = function ActionItem(_ref) {
|
|
|
2473
2473
|
return getFieldDetails$1(action.name, actionOptions);
|
|
2474
2474
|
}, [action, actionOptions]);
|
|
2475
2475
|
var searchedOptions = getSearchedOptions$3(actionOptions, searchTerm);
|
|
2476
|
-
var isActionSelected = (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) === t("neetoRules.form.doThis") && errors.actions && touched.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0
|
|
2476
|
+
var isActionSelected = (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) === t("neetoRules.form.doThis") && errors.actions && touched.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
2477
2477
|
var handleSelectOption = function handleSelectOption(option) {
|
|
2478
2478
|
setFieldValue("".concat(name, ".name"), option.value);
|
|
2479
2479
|
setFieldValue("".concat(name, ".metadata"), {});
|
|
2480
|
-
onSelectAction === null || onSelectAction === void 0
|
|
2480
|
+
onSelectAction === null || onSelectAction === void 0 || onSelectAction(name, option);
|
|
2481
2481
|
setSearchTerm("");
|
|
2482
2482
|
};
|
|
2483
2483
|
var handleClose = function handleClose() {
|
|
@@ -2548,7 +2548,7 @@ var ActionItem = function ActionItem(_ref) {
|
|
|
2548
2548
|
position: "bottom-start",
|
|
2549
2549
|
customTarget: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2550
2550
|
"data-cy": "action-dropdown-button",
|
|
2551
|
-
label: selectedOption === null || selectedOption === void 0
|
|
2551
|
+
label: selectedOption === null || selectedOption === void 0 || (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase(),
|
|
2552
2552
|
style: "link",
|
|
2553
2553
|
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
2554
2554
|
"neeto-ui-text-accent-800": isActive,
|
|
@@ -2805,7 +2805,7 @@ var DropdownField = function DropdownField(_ref) {
|
|
|
2805
2805
|
position: "bottom-start",
|
|
2806
2806
|
customTarget: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2807
2807
|
"data-cy": "condition-".concat(fieldType, "-dropdown-button"),
|
|
2808
|
-
label: selectedOption === null || selectedOption === void 0
|
|
2808
|
+
label: selectedOption === null || selectedOption === void 0 || (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase(),
|
|
2809
2809
|
style: "link",
|
|
2810
2810
|
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
2811
2811
|
"neeto-ui-text-accent-800": isSelected
|
|
@@ -2861,7 +2861,7 @@ var DropdownField = function DropdownField(_ref) {
|
|
|
2861
2861
|
var Menu$5 = Dropdown$1.Menu,
|
|
2862
2862
|
MenuItem$5 = Dropdown$1.MenuItem;
|
|
2863
2863
|
var Dropdown = function Dropdown(_ref) {
|
|
2864
|
-
var _conditions$value$ind, _errors$conditions,
|
|
2864
|
+
var _conditions$value$ind, _errors$conditions, _touched$conditions, _defaultSelectedOptio;
|
|
2865
2865
|
var name = _ref.name,
|
|
2866
2866
|
options = _ref.options,
|
|
2867
2867
|
index = _ref.index;
|
|
@@ -2890,7 +2890,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
2890
2890
|
setSearchTerm = _useState6[1];
|
|
2891
2891
|
var defaultValue = (_conditions$value$ind = conditions.value[index].metadata) === null || _conditions$value$ind === void 0 ? void 0 : _conditions$value$ind.value;
|
|
2892
2892
|
var searchedOptions = getSearchedOptions$2(options, searchTerm);
|
|
2893
|
-
var isValueSelected = (defaultSelectedOption === null || defaultSelectedOption === void 0 ? void 0 : defaultSelectedOption.label) === defaultLabel && errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0
|
|
2893
|
+
var isValueSelected = (defaultSelectedOption === null || defaultSelectedOption === void 0 ? void 0 : defaultSelectedOption.label) === defaultLabel && errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0 || (_errors$conditions = _errors$conditions.value) === null || _errors$conditions === void 0 ? void 0 : _errors$conditions[index]) && ramda.isNotNil((_touched$conditions = touched.conditions) === null || _touched$conditions === void 0 || (_touched$conditions = _touched$conditions.value) === null || _touched$conditions === void 0 ? void 0 : _touched$conditions[index]);
|
|
2894
2894
|
var handleClose = function handleClose() {
|
|
2895
2895
|
setIsActive(false);
|
|
2896
2896
|
setSearchTerm("");
|
|
@@ -2925,7 +2925,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
2925
2925
|
className: "neeto-ui-bg-gray-100",
|
|
2926
2926
|
customTarget: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2927
2927
|
"data-cy": "condition-value-dropdown-button",
|
|
2928
|
-
label: defaultSelectedOption === null || defaultSelectedOption === void 0
|
|
2928
|
+
label: defaultSelectedOption === null || defaultSelectedOption === void 0 || (_defaultSelectedOptio = defaultSelectedOption.label) === null || _defaultSelectedOptio === void 0 ? void 0 : _defaultSelectedOptio.toLowerCase(),
|
|
2929
2929
|
style: "link",
|
|
2930
2930
|
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
2931
2931
|
"neeto-ui-text-accent-800": isActive,
|
|
@@ -2979,7 +2979,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
2979
2979
|
};
|
|
2980
2980
|
|
|
2981
2981
|
var InputField$1 = function InputField(_ref) {
|
|
2982
|
-
var _condition$metadata,
|
|
2982
|
+
var _condition$metadata, _errors$conditions, _touched$conditions;
|
|
2983
2983
|
var name = _ref.name,
|
|
2984
2984
|
index = _ref.index,
|
|
2985
2985
|
placeholder = _ref.placeholder;
|
|
@@ -2998,9 +2998,9 @@ var InputField$1 = function InputField(_ref) {
|
|
|
2998
2998
|
return setShowInput(false);
|
|
2999
2999
|
});
|
|
3000
3000
|
var condition = conditions.value[index];
|
|
3001
|
-
var valueTerm = (_condition$metadata = condition.metadata) === null || _condition$metadata === void 0
|
|
3001
|
+
var valueTerm = (_condition$metadata = condition.metadata) === null || _condition$metadata === void 0 || (_condition$metadata = _condition$metadata.value) === null || _condition$metadata === void 0 ? void 0 : _condition$metadata.toString();
|
|
3002
3002
|
var label = valueTerm && valueTerm !== null && valueTerm !== void 0 && valueTerm.trim().length ? valueTerm : t("neetoRules.form.addValue");
|
|
3003
|
-
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0
|
|
3003
|
+
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0 || (_errors$conditions = _errors$conditions.value) === null || _errors$conditions === void 0 ? void 0 : _errors$conditions[index]) && ramda.isNotNil((_touched$conditions = touched.conditions) === null || _touched$conditions === void 0 || (_touched$conditions = _touched$conditions.value) === null || _touched$conditions === void 0 ? void 0 : _touched$conditions[index]);
|
|
3004
3004
|
react.useEffect(function () {
|
|
3005
3005
|
setShowInput(false);
|
|
3006
3006
|
}, [condition.verb]);
|
|
@@ -3034,7 +3034,7 @@ var InputField$1 = function InputField(_ref) {
|
|
|
3034
3034
|
var Menu$4 = Dropdown$1.Menu,
|
|
3035
3035
|
MenuItem$4 = Dropdown$1.MenuItem;
|
|
3036
3036
|
var MultiSelect = function MultiSelect(_ref) {
|
|
3037
|
-
var _conditions$value$ind,
|
|
3037
|
+
var _conditions$value$ind, _errors$conditions, _touched$conditions;
|
|
3038
3038
|
var name = _ref.name,
|
|
3039
3039
|
dropDownOptions = _ref.dropDownOptions,
|
|
3040
3040
|
index = _ref.index;
|
|
@@ -3054,14 +3054,14 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
3054
3054
|
setSearchTerm = _useState4[1];
|
|
3055
3055
|
var _useTranslation = reactI18next.useTranslation(),
|
|
3056
3056
|
t = _useTranslation.t;
|
|
3057
|
-
var values = (_conditions$value$ind = conditions.value[index]) === null || _conditions$value$ind === void 0
|
|
3057
|
+
var values = (_conditions$value$ind = conditions.value[index]) === null || _conditions$value$ind === void 0 || (_conditions$value$ind = _conditions$value$ind.metadata) === null || _conditions$value$ind === void 0 ? void 0 : _conditions$value$ind.values;
|
|
3058
3058
|
var selectedOptions = values || [];
|
|
3059
3059
|
var defaultLabel = t("neetoRules.form.selectValues");
|
|
3060
3060
|
var options = dropDownOptions === null || dropDownOptions === void 0 ? void 0 : dropDownOptions.filter(function (option) {
|
|
3061
3061
|
return selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.includes(option.value);
|
|
3062
3062
|
});
|
|
3063
3063
|
var searchedOptions = getSearchedOptions$2(dropDownOptions, searchTerm);
|
|
3064
|
-
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0
|
|
3064
|
+
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0 || (_errors$conditions = _errors$conditions.value) === null || _errors$conditions === void 0 ? void 0 : _errors$conditions[index]) && ramda.isNotNil((_touched$conditions = touched.conditions) === null || _touched$conditions === void 0 || (_touched$conditions = _touched$conditions.value) === null || _touched$conditions === void 0 ? void 0 : _touched$conditions[index]);
|
|
3065
3065
|
var handleMultiSelectOption = function handleMultiSelectOption(value) {
|
|
3066
3066
|
var options = selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.includes(value) ? ramda.without([value], selectedOptions) : ramda.append(value, selectedOptions);
|
|
3067
3067
|
setFieldValue(name, options);
|
|
@@ -3087,7 +3087,7 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
3087
3087
|
children: t("neetoRules.common.or")
|
|
3088
3088
|
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3089
3089
|
"data-cy": "condition-value-multi-select-field",
|
|
3090
|
-
label: option === null || option === void 0
|
|
3090
|
+
label: option === null || option === void 0 || (_option$label = option.label) === null || _option$label === void 0 ? void 0 : _option$label.toLowerCase(),
|
|
3091
3091
|
style: "link",
|
|
3092
3092
|
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
3093
3093
|
"neeto-ui-text-accent-800": activeOption === option.value
|
|
@@ -3153,7 +3153,7 @@ var _excluded$7 = ["name", "index"];
|
|
|
3153
3153
|
function ownKeys$d(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; }
|
|
3154
3154
|
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3155
3155
|
var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
3156
|
-
var _conditions$value$ind,
|
|
3156
|
+
var _conditions$value$ind, _errors$conditions, _touched$conditions;
|
|
3157
3157
|
var name = _ref.name,
|
|
3158
3158
|
index = _ref.index,
|
|
3159
3159
|
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
@@ -3173,10 +3173,10 @@ var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
|
3173
3173
|
useOnButtonPressed(initialFocusRef, function () {
|
|
3174
3174
|
return setShowPane(false);
|
|
3175
3175
|
});
|
|
3176
|
-
var values = (_conditions$value$ind = conditions.value[index]) === null || _conditions$value$ind === void 0
|
|
3176
|
+
var values = (_conditions$value$ind = conditions.value[index]) === null || _conditions$value$ind === void 0 || (_conditions$value$ind = _conditions$value$ind.metadata) === null || _conditions$value$ind === void 0 ? void 0 : _conditions$value$ind.values;
|
|
3177
3177
|
var allOptions = getAllOptions(values);
|
|
3178
3178
|
var defaultLabel = t("neetoRules.form.selectValues");
|
|
3179
|
-
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0
|
|
3179
|
+
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0 || (_errors$conditions = _errors$conditions.value) === null || _errors$conditions === void 0 ? void 0 : _errors$conditions[index]) && ramda.isNotNil((_touched$conditions = touched.conditions) === null || _touched$conditions === void 0 || (_touched$conditions = _touched$conditions.value) === null || _touched$conditions === void 0 ? void 0 : _touched$conditions[index]);
|
|
3180
3180
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
3181
3181
|
children: [ramda.isEmpty(allOptions) && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3182
3182
|
"data-cy": "condition-value-multi-select-create-button",
|
|
@@ -3248,7 +3248,7 @@ var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
|
3248
3248
|
};
|
|
3249
3249
|
|
|
3250
3250
|
var DateField = function DateField(_ref) {
|
|
3251
|
-
var _conditions$value$ind, _errors$conditions,
|
|
3251
|
+
var _conditions$value$ind, _errors$conditions, _touched$conditions;
|
|
3252
3252
|
var name = _ref.name,
|
|
3253
3253
|
index = _ref.index,
|
|
3254
3254
|
conditionName = _ref.conditionName,
|
|
@@ -3268,7 +3268,7 @@ var DateField = function DateField(_ref) {
|
|
|
3268
3268
|
t = _useTranslation.t;
|
|
3269
3269
|
var valueTerm = (_conditions$value$ind = conditions.value[index].metadata) === null || _conditions$value$ind === void 0 ? void 0 : _conditions$value$ind.value;
|
|
3270
3270
|
var label = valueTerm || t("neetoRules.form.selectDate");
|
|
3271
|
-
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0
|
|
3271
|
+
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0 || (_errors$conditions = _errors$conditions.value) === null || _errors$conditions === void 0 ? void 0 : _errors$conditions[index]) && ramda.isNotNil((_touched$conditions = touched.conditions) === null || _touched$conditions === void 0 || (_touched$conditions = _touched$conditions.value) === null || _touched$conditions === void 0 ? void 0 : _touched$conditions[index]);
|
|
3272
3272
|
var handleValidate = /*#__PURE__*/function () {
|
|
3273
3273
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
3274
3274
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -3442,7 +3442,7 @@ var ConditionItem = function ConditionItem(_ref) {
|
|
|
3442
3442
|
setFieldValue("".concat(name, ".verb"), fieldDetails === null || fieldDetails === void 0 ? void 0 : fieldDetails.allowMatching[0]);
|
|
3443
3443
|
setFieldValue("".concat(name, ".kind"), fieldDetails === null || fieldDetails === void 0 ? void 0 : fieldDetails.kind);
|
|
3444
3444
|
setFieldValue("".concat(name, ".metadata"), {});
|
|
3445
|
-
onSelectCondition === null || onSelectCondition === void 0
|
|
3445
|
+
onSelectCondition === null || onSelectCondition === void 0 || onSelectCondition(name, option);
|
|
3446
3446
|
};
|
|
3447
3447
|
var handleVerbChange = function handleVerbChange(_ref2) {
|
|
3448
3448
|
var value = _ref2.value;
|
|
@@ -3530,7 +3530,7 @@ var Conditions = function Conditions(_ref) {
|
|
|
3530
3530
|
arrayHelpers.push({
|
|
3531
3531
|
field: elementProps === null || elementProps === void 0 ? void 0 : elementProps.conditionOptions[0].value,
|
|
3532
3532
|
kind: elementProps === null || elementProps === void 0 ? void 0 : elementProps.conditionOptions[0].kind,
|
|
3533
|
-
verb: elementProps === null || elementProps === void 0
|
|
3533
|
+
verb: elementProps === null || elementProps === void 0 || (_elementProps$conditi = elementProps.conditionOptions[0]) === null || _elementProps$conditi === void 0 ? void 0 : _elementProps$conditi.allowMatching[0],
|
|
3534
3534
|
joinType: logicOperation,
|
|
3535
3535
|
metadata: {}
|
|
3536
3536
|
});
|
|
@@ -3829,7 +3829,7 @@ var Performer$1 = function Performer(_ref) {
|
|
|
3829
3829
|
className: "neeto-ui-bg-gray-100",
|
|
3830
3830
|
customTarget: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3831
3831
|
"data-cy": "event-performer-dropdown",
|
|
3832
|
-
label: selectedOption === null || selectedOption === void 0
|
|
3832
|
+
label: selectedOption === null || selectedOption === void 0 || (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase(),
|
|
3833
3833
|
style: "link",
|
|
3834
3834
|
className: classNames(" neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
3835
3835
|
"neeto-ui-text-accent-800": isSelected,
|
|
@@ -3972,7 +3972,7 @@ var Events$1 = function Events(_ref) {
|
|
|
3972
3972
|
}, options) : [].concat(_toConsumableArray(options), [{
|
|
3973
3973
|
name: option.value
|
|
3974
3974
|
}]);
|
|
3975
|
-
onSelectEvent === null || onSelectEvent === void 0
|
|
3975
|
+
onSelectEvent === null || onSelectEvent === void 0 || onSelectEvent(name, options);
|
|
3976
3976
|
setFieldValue("".concat(name, ".value"), options);
|
|
3977
3977
|
};
|
|
3978
3978
|
var handleClose = function handleClose() {
|
|
@@ -4004,7 +4004,7 @@ var Events$1 = function Events(_ref) {
|
|
|
4004
4004
|
children: t("neetoRules.common.or")
|
|
4005
4005
|
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
4006
4006
|
"data-cy": "condition-value-multi-select-field",
|
|
4007
|
-
label: event === null || event === void 0
|
|
4007
|
+
label: event === null || event === void 0 || (_event$label = event.label) === null || _event$label === void 0 ? void 0 : _event$label.toLowerCase(),
|
|
4008
4008
|
style: "link",
|
|
4009
4009
|
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
4010
4010
|
"neeto-ui-text-accent-800": activeOption === event.value
|
|
@@ -4098,7 +4098,7 @@ var EventConditions = function EventConditions(_ref) {
|
|
|
4098
4098
|
setFieldValue("".concat(conditionsName, ".value"), [{
|
|
4099
4099
|
field: conditionProps === null || conditionProps === void 0 ? void 0 : conditionProps.conditionOptions[0].value,
|
|
4100
4100
|
kind: conditionProps === null || conditionProps === void 0 ? void 0 : conditionProps.conditionOptions[0].kind,
|
|
4101
|
-
verb: conditionProps === null || conditionProps === void 0
|
|
4101
|
+
verb: conditionProps === null || conditionProps === void 0 || (_conditionProps$condi = conditionProps.conditionOptions[0]) === null || _conditionProps$condi === void 0 ? void 0 : _conditionProps$condi.allowMatching[0],
|
|
4102
4102
|
joinType: OPERATORS.or,
|
|
4103
4103
|
metadata: {}
|
|
4104
4104
|
}]);
|
|
@@ -4202,7 +4202,7 @@ var EventItem = function EventItem(_ref) {
|
|
|
4202
4202
|
var events = values[parentName].value || [];
|
|
4203
4203
|
var handleEventChange = function handleEventChange(option) {
|
|
4204
4204
|
setFieldValue(name, option.value);
|
|
4205
|
-
onSelectEvent === null || onSelectEvent === void 0
|
|
4205
|
+
onSelectEvent === null || onSelectEvent === void 0 || onSelectEvent(name, option);
|
|
4206
4206
|
setSelectedOption(option.label);
|
|
4207
4207
|
};
|
|
4208
4208
|
var eventOptions = react.useMemo(function () {
|
|
@@ -4354,7 +4354,7 @@ var Performer = function Performer(_ref) {
|
|
|
4354
4354
|
closeOnSelect: false,
|
|
4355
4355
|
customTarget: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
4356
4356
|
"data-cy": "event-performer-dropdown",
|
|
4357
|
-
label: selectedOption === null || selectedOption === void 0
|
|
4357
|
+
label: selectedOption === null || selectedOption === void 0 || (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase(),
|
|
4358
4358
|
style: "link",
|
|
4359
4359
|
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
4360
4360
|
"neeto-ui-text-accent-800": isSelected,
|
|
@@ -4808,7 +4808,7 @@ var ScrollToErrorField = function ScrollToErrorField(_ref) {
|
|
|
4808
4808
|
var errorFormElement = neetoCist.findBy({
|
|
4809
4809
|
name: fieldErrorNames
|
|
4810
4810
|
}, _toConsumableArray(formRef.current.elements));
|
|
4811
|
-
errorFormElement === null || errorFormElement === void 0
|
|
4811
|
+
errorFormElement === null || errorFormElement === void 0 || errorFormElement.scrollIntoView({
|
|
4812
4812
|
behavior: "smooth",
|
|
4813
4813
|
block: "center"
|
|
4814
4814
|
});
|
|
@@ -4857,25 +4857,28 @@ var Form = function Form(_ref) {
|
|
|
4857
4857
|
values = _ref2.values,
|
|
4858
4858
|
fromikBag = _objectWithoutProperties(_ref2, _excluded);
|
|
4859
4859
|
return /*#__PURE__*/jsxRuntime.jsxs(formik.Form, {
|
|
4860
|
+
className: classNames(["w-full px-0 md:px-14 xl:px-24", className]),
|
|
4860
4861
|
ref: formRef,
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4862
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4863
|
+
className: "space-y-6",
|
|
4864
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(InputField, {
|
|
4865
|
+
required: true,
|
|
4866
|
+
data: initialValues,
|
|
4867
|
+
label: t("neetoRules.common.name"),
|
|
4868
|
+
name: "name"
|
|
4869
|
+
}), /*#__PURE__*/jsxRuntime.jsx(TextareaField, {
|
|
4870
|
+
data: initialValues,
|
|
4871
|
+
label: t("neetoRules.common.description"),
|
|
4872
|
+
name: "description"
|
|
4873
|
+
}), showStatusSwitch && /*#__PURE__*/jsxRuntime.jsx(Status, {}), typeof _children === "function" ? _children === null || _children === void 0 ? void 0 : _children(_objectSpread$1({
|
|
4874
|
+
values: values,
|
|
4875
|
+
formattedValues: buildPayload(data, values),
|
|
4876
|
+
dirty: dirty
|
|
4877
|
+
}, fromikBag)) : _children, /*#__PURE__*/jsxRuntime.jsx(ScrollToErrorField, {
|
|
4878
|
+
formRef: formRef
|
|
4879
|
+
})]
|
|
4877
4880
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4878
|
-
className: "py-
|
|
4881
|
+
className: "neeto-ui-bg-white sticky bottom-0 py-6",
|
|
4879
4882
|
children: /*#__PURE__*/jsxRuntime.jsx(ActionBlock, {
|
|
4880
4883
|
cancelButtonProps: {
|
|
4881
4884
|
onClick: handleCancel
|