@bigbinary/neeto-rules-frontend 2.0.4 → 2.0.5
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/app/javascript/src/translations/en.json +1 -1
- package/dist/index.cjs.js +320 -332
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +320 -331
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -13,13 +13,12 @@ import { useTranslation, Trans } from 'react-i18next';
|
|
|
13
13
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
14
|
import ReactDOM, { unstable_batchedUpdates, flushSync } from 'react-dom';
|
|
15
15
|
import Reorder from '@bigbinary/neeto-icons/Reorder';
|
|
16
|
+
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
16
17
|
import Pane from '@bigbinary/neetoui/Pane';
|
|
17
18
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
18
|
-
import Pagination from '@bigbinary/neetoui/Pagination';
|
|
19
19
|
import { equals, clone as clone$1, isNotNil, isEmpty, isNil, whereAny, useWith, path, split, assocPath, toLower, without, append, pipe, filter, uniq, join, pluck, map, assoc, mergeLeft, includes, test, partition } from 'ramda';
|
|
20
|
-
import { withRouter
|
|
20
|
+
import { withRouter } from 'react-router-dom';
|
|
21
21
|
import { shallow } from 'zustand/shallow';
|
|
22
|
-
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
23
22
|
import SubHeader from '@bigbinary/neeto-molecules/SubHeader';
|
|
24
23
|
import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
|
|
25
24
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
@@ -267,6 +266,11 @@ var useReorderAutomationRules = function useReorderAutomationRules(url) {
|
|
|
267
266
|
});
|
|
268
267
|
};
|
|
269
268
|
|
|
269
|
+
var INITIAL_RULES_DATA = {
|
|
270
|
+
rules: [],
|
|
271
|
+
totalCount: 0
|
|
272
|
+
};
|
|
273
|
+
|
|
270
274
|
var createRoutes = function createRoutes(basePath) {
|
|
271
275
|
return {
|
|
272
276
|
index: basePath,
|
|
@@ -9393,13 +9397,21 @@ var ConnectedDroppable$1 = ConnectedDroppable;
|
|
|
9393
9397
|
|
|
9394
9398
|
function ownKeys$r(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; }
|
|
9395
9399
|
function _objectSpread$r(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$r(Object(t), !0).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$r(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9396
|
-
var reorderList = function reorderList(
|
|
9400
|
+
var reorderList = function reorderList(_ref) {
|
|
9401
|
+
var endIndex = _ref.endIndex,
|
|
9402
|
+
firstDisplayOrder = _ref.firstDisplayOrder,
|
|
9403
|
+
list = _ref.list,
|
|
9404
|
+
startIndex = _ref.startIndex;
|
|
9397
9405
|
var result = Array.from(list);
|
|
9398
9406
|
var _result$splice = result.splice(startIndex, 1),
|
|
9399
9407
|
_result$splice2 = _slicedToArray(_result$splice, 1),
|
|
9400
9408
|
removed = _result$splice2[0];
|
|
9401
9409
|
result.splice(endIndex, 0, removed);
|
|
9402
|
-
return result
|
|
9410
|
+
return result.map(function (item, index) {
|
|
9411
|
+
return _objectSpread$r(_objectSpread$r({}, item), {}, {
|
|
9412
|
+
displayOrder: firstDisplayOrder + index
|
|
9413
|
+
});
|
|
9414
|
+
});
|
|
9403
9415
|
};
|
|
9404
9416
|
var getDragItemStyle = function getDragItemStyle(isDragging, draggableStyle) {
|
|
9405
9417
|
return _objectSpread$r(_objectSpread$r({}, draggableStyle), isDragging && {
|
|
@@ -9438,35 +9450,38 @@ var DraggableItem$1 = withRouter(DraggableItem);
|
|
|
9438
9450
|
function ownKeys$p(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; }
|
|
9439
9451
|
function _objectSpread$p(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$p(Object(t), !0).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$p(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9440
9452
|
var RulesReorder = function RulesReorder(_ref) {
|
|
9453
|
+
var _rules$0$displayOrder, _rules$;
|
|
9441
9454
|
var isOpen = _ref.isOpen,
|
|
9442
|
-
|
|
9443
|
-
rules = _ref.rules,
|
|
9444
|
-
_ref$paginationProps = _ref.paginationProps,
|
|
9445
|
-
paginationProps = _ref$paginationProps === void 0 ? {} : _ref$paginationProps,
|
|
9455
|
+
totalCount = _ref.totalCount,
|
|
9446
9456
|
url = _ref.url,
|
|
9457
|
+
onClose = _ref.onClose,
|
|
9447
9458
|
onReorderSuccess = _ref.onReorderSuccess;
|
|
9448
|
-
var _useState = useState(
|
|
9459
|
+
var _useState = useState([]),
|
|
9449
9460
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9450
|
-
|
|
9451
|
-
|
|
9461
|
+
reorderedRules = _useState2[0],
|
|
9462
|
+
setReorderedRules = _useState2[1];
|
|
9452
9463
|
var _useTranslation = useTranslation(),
|
|
9453
9464
|
t = _useTranslation.t;
|
|
9465
|
+
var _useFetchAutomationRu = useFetchAutomationRules({
|
|
9466
|
+
pageSize: totalCount,
|
|
9467
|
+
url: url
|
|
9468
|
+
}, {
|
|
9469
|
+
enabled: isOpen
|
|
9470
|
+
}),
|
|
9471
|
+
_useFetchAutomationRu2 = _useFetchAutomationRu.data,
|
|
9472
|
+
_useFetchAutomationRu3 = _useFetchAutomationRu2 === void 0 ? INITIAL_RULES_DATA : _useFetchAutomationRu2,
|
|
9473
|
+
rules = _useFetchAutomationRu3.rules,
|
|
9474
|
+
isLoading = _useFetchAutomationRu.isLoading;
|
|
9454
9475
|
var _useReorderAutomation = useReorderAutomationRules(url),
|
|
9455
9476
|
reOrder = _useReorderAutomation.mutate,
|
|
9456
9477
|
isPending = _useReorderAutomation.isPending;
|
|
9457
|
-
var
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
params.push({
|
|
9461
|
-
id: rule.id,
|
|
9462
|
-
display_order: index
|
|
9463
|
-
});
|
|
9464
|
-
});
|
|
9465
|
-
reOrder({
|
|
9478
|
+
var firstDisplayOrder = (_rules$0$displayOrder = (_rules$ = rules[0]) === null || _rules$ === void 0 ? void 0 : _rules$.displayOrder) !== null && _rules$0$displayOrder !== void 0 ? _rules$0$displayOrder : 1;
|
|
9479
|
+
var handleReorderSave = function handleReorderSave() {
|
|
9480
|
+
return reOrder({
|
|
9466
9481
|
url: url,
|
|
9467
9482
|
payload: {
|
|
9468
9483
|
reorder: {
|
|
9469
|
-
rules:
|
|
9484
|
+
rules: reorderedRules
|
|
9470
9485
|
}
|
|
9471
9486
|
}
|
|
9472
9487
|
}, {
|
|
@@ -9476,22 +9491,30 @@ var RulesReorder = function RulesReorder(_ref) {
|
|
|
9476
9491
|
}
|
|
9477
9492
|
});
|
|
9478
9493
|
};
|
|
9479
|
-
var onDragEnd = function onDragEnd(
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
var
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
});
|
|
9494
|
+
var onDragEnd = function onDragEnd(_ref2) {
|
|
9495
|
+
var destination = _ref2.destination,
|
|
9496
|
+
source = _ref2.source;
|
|
9497
|
+
if (!destination || source.index === destination.index) return;
|
|
9498
|
+
var items = reorderList({
|
|
9499
|
+
endIndex: destination.index,
|
|
9500
|
+
firstDisplayOrder: firstDisplayOrder,
|
|
9501
|
+
list: clone$1(reorderedRules),
|
|
9502
|
+
startIndex: source.index
|
|
9489
9503
|
});
|
|
9490
|
-
|
|
9504
|
+
setReorderedRules(items);
|
|
9491
9505
|
};
|
|
9492
9506
|
useEffect(function () {
|
|
9493
|
-
|
|
9507
|
+
setReorderedRules(rules);
|
|
9494
9508
|
}, [rules]);
|
|
9509
|
+
if (isLoading) {
|
|
9510
|
+
return /*#__PURE__*/jsx(Pane, {
|
|
9511
|
+
isOpen: isOpen,
|
|
9512
|
+
onClose: onClose,
|
|
9513
|
+
children: /*#__PURE__*/jsx(Container, {
|
|
9514
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
9515
|
+
})
|
|
9516
|
+
});
|
|
9517
|
+
}
|
|
9495
9518
|
return /*#__PURE__*/jsxs(Pane, {
|
|
9496
9519
|
isOpen: isOpen,
|
|
9497
9520
|
onClose: onClose,
|
|
@@ -9506,9 +9529,9 @@ var RulesReorder = function RulesReorder(_ref) {
|
|
|
9506
9529
|
className: "mb-3",
|
|
9507
9530
|
style: "body2",
|
|
9508
9531
|
children: t("neetoRules.description.reorder")
|
|
9509
|
-
}), /*#__PURE__*/
|
|
9532
|
+
}), /*#__PURE__*/jsx("div", {
|
|
9510
9533
|
className: "flex flex-col items-center",
|
|
9511
|
-
children:
|
|
9534
|
+
children: /*#__PURE__*/jsx(DragDropContext, {
|
|
9512
9535
|
onDragEnd: onDragEnd,
|
|
9513
9536
|
children: /*#__PURE__*/jsx(ConnectedDroppable$1, {
|
|
9514
9537
|
droppableId: "droppable",
|
|
@@ -9524,15 +9547,15 @@ var RulesReorder = function RulesReorder(_ref) {
|
|
|
9524
9547
|
}), /*#__PURE__*/jsxs("div", {
|
|
9525
9548
|
className: "neeto-ui-bg-white neeto-ui-border-gray-400 neeto-ui-rounded neeto-ui-shadow-xs flex w-96 items-center space-x-4 border border-solid p-3",
|
|
9526
9549
|
children: [/*#__PURE__*/jsx(Reorder, {}), /*#__PURE__*/jsx("div", {
|
|
9527
|
-
children:
|
|
9550
|
+
children: reorderedRules[rubric.source.index].name
|
|
9528
9551
|
})]
|
|
9529
9552
|
})]
|
|
9530
|
-
}), "list_".concat(
|
|
9553
|
+
}), "list_".concat(reorderedRules[rubric.source.index].id));
|
|
9531
9554
|
},
|
|
9532
9555
|
children: function children(provided) {
|
|
9533
9556
|
return /*#__PURE__*/jsxs("div", _objectSpread$p(_objectSpread$p({}, provided.droppableProps), {}, {
|
|
9534
9557
|
ref: provided.innerRef,
|
|
9535
|
-
children: [
|
|
9558
|
+
children: [reorderedRules.map(function (rule, index) {
|
|
9536
9559
|
return /*#__PURE__*/createElement(DraggableItem$1, {
|
|
9537
9560
|
rule: rule,
|
|
9538
9561
|
key: rule.id,
|
|
@@ -9542,18 +9565,16 @@ var RulesReorder = function RulesReorder(_ref) {
|
|
|
9542
9565
|
}));
|
|
9543
9566
|
}
|
|
9544
9567
|
})
|
|
9545
|
-
})
|
|
9568
|
+
})
|
|
9546
9569
|
})]
|
|
9547
9570
|
}), /*#__PURE__*/jsxs(Pane.Footer, {
|
|
9548
9571
|
className: "flex items-center gap-x-2",
|
|
9549
9572
|
children: [/*#__PURE__*/jsx(Button, {
|
|
9550
|
-
disabled: isPending || equals(rules,
|
|
9573
|
+
disabled: isPending || equals(rules, reorderedRules),
|
|
9551
9574
|
label: t("neetoRules.common.saveChange"),
|
|
9552
9575
|
loading: isPending,
|
|
9553
9576
|
style: "primary",
|
|
9554
|
-
onClick:
|
|
9555
|
-
return handleReorderSave(initialRules);
|
|
9556
|
-
}
|
|
9577
|
+
onClick: handleReorderSave
|
|
9557
9578
|
}), /*#__PURE__*/jsx(Button, {
|
|
9558
9579
|
label: t("neetoRules.buttons.cancel"),
|
|
9559
9580
|
style: "text",
|
|
@@ -9642,6 +9663,7 @@ var buildActionDropdownMenuItems = function buildActionDropdownMenuItems(_ref) {
|
|
|
9642
9663
|
key: "edit",
|
|
9643
9664
|
className: "neeto-ui-btn",
|
|
9644
9665
|
"data-test-id": "automation-rules-edit-link",
|
|
9666
|
+
"data-cy": "automation-rules-edit-link",
|
|
9645
9667
|
label: t$5("neetoRules.button.edit"),
|
|
9646
9668
|
to: buildUrl(createRoutes(automationRulesPath).edit, {
|
|
9647
9669
|
ruleId: rule.id
|
|
@@ -9649,6 +9671,7 @@ var buildActionDropdownMenuItems = function buildActionDropdownMenuItems(_ref) {
|
|
|
9649
9671
|
}, {
|
|
9650
9672
|
key: "clone",
|
|
9651
9673
|
"data-test-id": "automation-rules-clone-link",
|
|
9674
|
+
"data-cy": "automation-rules-clone-link",
|
|
9652
9675
|
label: t$5("neetoRules.button.clone"),
|
|
9653
9676
|
onClick: function onClick() {
|
|
9654
9677
|
return onClone(rule.id);
|
|
@@ -9659,6 +9682,7 @@ var buildActionDropdownMenuItems = function buildActionDropdownMenuItems(_ref) {
|
|
|
9659
9682
|
}, {
|
|
9660
9683
|
key: "delete",
|
|
9661
9684
|
"data-test-id": "automation-rules-delete-link",
|
|
9685
|
+
"data-cy": "automation-rules-delete-link",
|
|
9662
9686
|
label: t$5("neetoRules.button.delete"),
|
|
9663
9687
|
onClick: function onClick() {
|
|
9664
9688
|
return onDelete(rule);
|
|
@@ -9759,8 +9783,8 @@ var renderNoDataHelpText = function renderNoDataHelpText(helpDocUrl) {
|
|
|
9759
9783
|
return /*#__PURE__*/jsx(Trans, {
|
|
9760
9784
|
i18nKey: "neetoRules.noData.helpText",
|
|
9761
9785
|
components: {
|
|
9762
|
-
a: /*#__PURE__*/jsx(
|
|
9763
|
-
|
|
9786
|
+
a: /*#__PURE__*/jsx(Button, {
|
|
9787
|
+
style: "link",
|
|
9764
9788
|
target: "_blank",
|
|
9765
9789
|
to: {
|
|
9766
9790
|
pathname: helpDocUrl
|
|
@@ -9971,11 +9995,9 @@ var NeetoRules = function NeetoRules(_ref) {
|
|
|
9971
9995
|
searchTerm: searchTerm
|
|
9972
9996
|
}),
|
|
9973
9997
|
_useFetchAutomationRu2 = _useFetchAutomationRu.data,
|
|
9974
|
-
_useFetchAutomationRu3 = _useFetchAutomationRu2 === void 0 ?
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
_useFetchAutomationRu5 = _useFetchAutomationRu3.totalCount,
|
|
9978
|
-
totalCount = _useFetchAutomationRu5 === void 0 ? 0 : _useFetchAutomationRu5,
|
|
9998
|
+
_useFetchAutomationRu3 = _useFetchAutomationRu2 === void 0 ? INITIAL_RULES_DATA : _useFetchAutomationRu2,
|
|
9999
|
+
rules = _useFetchAutomationRu3.rules,
|
|
10000
|
+
totalCount = _useFetchAutomationRu3.totalCount,
|
|
9979
10001
|
isLoading = _useFetchAutomationRu.isLoading,
|
|
9980
10002
|
isFetching = _useFetchAutomationRu.isFetching;
|
|
9981
10003
|
var hasUnfilteredRules = isPresent(searchTerm) || totalCount > 0;
|
|
@@ -10003,15 +10025,9 @@ var NeetoRules = function NeetoRules(_ref) {
|
|
|
10003
10025
|
onDeleteSuccess: deleteRule === null || deleteRule === void 0 || (_deleteRule$onSuccess = deleteRule.onSuccess) === null || _deleteRule$onSuccess === void 0 ? void 0 : _deleteRule$onSuccess.callback,
|
|
10004
10026
|
onUpdateSuccess: updateRule === null || updateRule === void 0 || (_updateRule$onSuccess = updateRule.onSuccess) === null || _updateRule$onSuccess === void 0 ? void 0 : _updateRule$onSuccess.callback
|
|
10005
10027
|
})), allowReordering && !isLoading && /*#__PURE__*/jsx(RulesReorder, {
|
|
10006
|
-
|
|
10028
|
+
totalCount: totalCount,
|
|
10007
10029
|
url: url,
|
|
10008
10030
|
isOpen: isReorderPaneOpen,
|
|
10009
|
-
paginationProps: {
|
|
10010
|
-
pageNo: page,
|
|
10011
|
-
count: totalCount,
|
|
10012
|
-
pageSize: DEFAULT_PAGE_SIZE,
|
|
10013
|
-
navigate: setPage
|
|
10014
|
-
},
|
|
10015
10031
|
onClose: function onClose() {
|
|
10016
10032
|
return setIsReorderPaneOpen(false);
|
|
10017
10033
|
},
|
|
@@ -10126,25 +10142,24 @@ var LongTextField = function LongTextField(_ref) {
|
|
|
10126
10142
|
var rows = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.rows) || DEFAULT_LONG_TEXT_ROWS;
|
|
10127
10143
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
10128
10144
|
children: [separator && /*#__PURE__*/jsx(Typography, {
|
|
10129
|
-
className: "neeto-ui-text-gray-700
|
|
10145
|
+
className: "neeto-ui-text-gray-700",
|
|
10130
10146
|
"data-cy": "long-text-action-separator-text",
|
|
10131
10147
|
style: "h5",
|
|
10132
10148
|
weight: "normal",
|
|
10133
10149
|
children: separator
|
|
10134
|
-
}), /*#__PURE__*/jsx(
|
|
10150
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
10135
10151
|
"data-cy": "long-text-action-button",
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
className: classNames("
|
|
10139
|
-
"neeto-ui-text-
|
|
10152
|
+
label: label.toLowerCase(),
|
|
10153
|
+
style: "link",
|
|
10154
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
10155
|
+
"neeto-ui-text-accent-800": showPane,
|
|
10140
10156
|
"neeto-ui-text-error-500": isValid
|
|
10141
10157
|
}),
|
|
10142
10158
|
onClick: function onClick() {
|
|
10143
10159
|
return setShowPane(function (prevState) {
|
|
10144
10160
|
return !prevState;
|
|
10145
10161
|
});
|
|
10146
|
-
}
|
|
10147
|
-
children: label.toLowerCase()
|
|
10162
|
+
}
|
|
10148
10163
|
}), /*#__PURE__*/jsxs(Pane, {
|
|
10149
10164
|
initialFocusRef: initialFocusRef,
|
|
10150
10165
|
isOpen: showPane,
|
|
@@ -10348,25 +10363,24 @@ var ApiFields = function ApiFields(_ref) {
|
|
|
10348
10363
|
};
|
|
10349
10364
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
10350
10365
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
10351
|
-
className: "neeto-ui-text-gray-700
|
|
10366
|
+
className: "neeto-ui-text-gray-700",
|
|
10352
10367
|
"data-cy": "api-action-separator-text",
|
|
10353
10368
|
style: "h5",
|
|
10354
10369
|
weight: "normal",
|
|
10355
10370
|
children: separator
|
|
10356
|
-
}), /*#__PURE__*/jsx(
|
|
10371
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
10357
10372
|
"data-cy": "api-action-button",
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
className: classNames("
|
|
10361
|
-
"neeto-ui-text-
|
|
10373
|
+
label: defaultLabel.toLowerCase(),
|
|
10374
|
+
style: "link",
|
|
10375
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
10376
|
+
"neeto-ui-text-accent-800": showPane,
|
|
10362
10377
|
"neeto-ui-text-error-500": isValid
|
|
10363
10378
|
}),
|
|
10364
10379
|
onClick: function onClick() {
|
|
10365
10380
|
return setShowPane(function (prevState) {
|
|
10366
10381
|
return !prevState;
|
|
10367
10382
|
});
|
|
10368
|
-
}
|
|
10369
|
-
children: defaultLabel.toLowerCase()
|
|
10383
|
+
}
|
|
10370
10384
|
}), /*#__PURE__*/jsxs(Pane, {
|
|
10371
10385
|
initialFocusRef: initialFocusRef,
|
|
10372
10386
|
isOpen: showPane,
|
|
@@ -10437,23 +10451,22 @@ var CustomAction = function CustomAction(_ref) {
|
|
|
10437
10451
|
var defaultLabel = selectedField === null || selectedField === void 0 ? void 0 : selectedField.placeholder;
|
|
10438
10452
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
10439
10453
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
10440
|
-
className: "neeto-ui-text-gray-700
|
|
10454
|
+
className: "neeto-ui-text-gray-700",
|
|
10441
10455
|
style: "h5",
|
|
10442
10456
|
weight: "normal",
|
|
10443
10457
|
children: separator
|
|
10444
|
-
}), /*#__PURE__*/jsx(
|
|
10445
|
-
|
|
10446
|
-
|
|
10447
|
-
className: classNames("
|
|
10448
|
-
"neeto-ui-text-
|
|
10458
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
10459
|
+
label: defaultLabel.toLowerCase(),
|
|
10460
|
+
style: "link",
|
|
10461
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
10462
|
+
"neeto-ui-text-accent-800": showPane,
|
|
10449
10463
|
"neeto-ui-text-error-500": isValid
|
|
10450
10464
|
}),
|
|
10451
10465
|
onClick: function onClick() {
|
|
10452
10466
|
return setShowPane(function (prevState) {
|
|
10453
10467
|
return !prevState;
|
|
10454
10468
|
});
|
|
10455
|
-
}
|
|
10456
|
-
children: defaultLabel.toLowerCase()
|
|
10469
|
+
}
|
|
10457
10470
|
}), /*#__PURE__*/jsxs(Pane, {
|
|
10458
10471
|
initialFocusRef: initialFocusRef,
|
|
10459
10472
|
isOpen: showPane,
|
|
@@ -10505,7 +10518,7 @@ var DateField$1 = function DateField(_ref) {
|
|
|
10505
10518
|
var isValid = errors.actions && 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]) && 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]);
|
|
10506
10519
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
10507
10520
|
children: [!selectedField.hideSeparator && /*#__PURE__*/jsx(Typography, {
|
|
10508
|
-
className: "neeto-ui-text-gray-700
|
|
10521
|
+
className: "neeto-ui-text-gray-700",
|
|
10509
10522
|
"data-cy": "action-dropdown-seperator-text",
|
|
10510
10523
|
style: "h5",
|
|
10511
10524
|
weight: "normal",
|
|
@@ -10530,10 +10543,10 @@ var DateField$1 = function DateField(_ref) {
|
|
|
10530
10543
|
});
|
|
10531
10544
|
}
|
|
10532
10545
|
})]
|
|
10533
|
-
}) : /*#__PURE__*/jsx(
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
className: classNames("neeto-ui-text-gray-800
|
|
10546
|
+
}) : /*#__PURE__*/jsx(Button, {
|
|
10547
|
+
label: label,
|
|
10548
|
+
style: "link",
|
|
10549
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
10537
10550
|
"neeto-ui-text-error-500": isValid
|
|
10538
10551
|
}),
|
|
10539
10552
|
onClick: function onClick() {
|
|
@@ -10541,8 +10554,7 @@ var DateField$1 = function DateField(_ref) {
|
|
|
10541
10554
|
setShowInput(function (prevState) {
|
|
10542
10555
|
return !prevState;
|
|
10543
10556
|
});
|
|
10544
|
-
}
|
|
10545
|
-
children: label
|
|
10557
|
+
}
|
|
10546
10558
|
})]
|
|
10547
10559
|
});
|
|
10548
10560
|
};
|
|
@@ -10734,7 +10746,7 @@ var DropdownField$1 = function DropdownField(_ref) {
|
|
|
10734
10746
|
}, [defaultValue, dropdownOptions]);
|
|
10735
10747
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
10736
10748
|
children: [!selectedField.hideSeparator && /*#__PURE__*/jsx(Typography, {
|
|
10737
|
-
className: "neeto-ui-text-gray-700
|
|
10749
|
+
className: "neeto-ui-text-gray-700",
|
|
10738
10750
|
"data-cy": "action-dropdown-seperator-text",
|
|
10739
10751
|
style: "h5",
|
|
10740
10752
|
weight: "normal",
|
|
@@ -10742,12 +10754,12 @@ var DropdownField$1 = function DropdownField(_ref) {
|
|
|
10742
10754
|
}), /*#__PURE__*/jsx(Dropdown$1, {
|
|
10743
10755
|
buttonStyle: "secondary",
|
|
10744
10756
|
className: "neeto-ui-bg-gray-100",
|
|
10745
|
-
customTarget: /*#__PURE__*/jsx(
|
|
10757
|
+
customTarget: /*#__PURE__*/jsx(Button, {
|
|
10746
10758
|
"data-cy": "action-dropdown-button",
|
|
10747
|
-
|
|
10748
|
-
|
|
10749
|
-
className: classNames("
|
|
10750
|
-
"neeto-ui-text-
|
|
10759
|
+
label: defaultSelectedOption === null || defaultSelectedOption === void 0 || (_defaultSelectedOptio = defaultSelectedOption.label) === null || _defaultSelectedOptio === void 0 ? void 0 : _defaultSelectedOptio.toLowerCase(),
|
|
10760
|
+
style: "link",
|
|
10761
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
10762
|
+
"neeto-ui-text-accent-800": isActive,
|
|
10751
10763
|
"neeto-ui-text-error-500": isValueSelected
|
|
10752
10764
|
}),
|
|
10753
10765
|
onClick: function onClick() {
|
|
@@ -10755,8 +10767,7 @@ var DropdownField$1 = function DropdownField(_ref) {
|
|
|
10755
10767
|
setIsActive(function (prevState) {
|
|
10756
10768
|
return !prevState;
|
|
10757
10769
|
});
|
|
10758
|
-
}
|
|
10759
|
-
children: defaultSelectedOption === null || defaultSelectedOption === void 0 || (_defaultSelectedOptio = defaultSelectedOption.label) === null || _defaultSelectedOptio === void 0 ? void 0 : _defaultSelectedOptio.toLowerCase()
|
|
10770
|
+
}
|
|
10760
10771
|
}),
|
|
10761
10772
|
onClose: handleClose,
|
|
10762
10773
|
children: /*#__PURE__*/jsxs(Menu$9, {
|
|
@@ -10921,25 +10932,24 @@ var EmailFields = function EmailFields(_ref) {
|
|
|
10921
10932
|
};
|
|
10922
10933
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
10923
10934
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
10924
|
-
className: "neeto-ui-text-gray-700
|
|
10935
|
+
className: "neeto-ui-text-gray-700",
|
|
10925
10936
|
"data-cy": "action-email-seperator-text",
|
|
10926
10937
|
style: "h5",
|
|
10927
10938
|
weight: "normal",
|
|
10928
10939
|
children: separator
|
|
10929
|
-
}), /*#__PURE__*/jsx(
|
|
10940
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
10930
10941
|
"data-cy": "email-action-button",
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
className: classNames("
|
|
10934
|
-
"neeto-ui-text-
|
|
10942
|
+
label: defaultLabel.toLowerCase(),
|
|
10943
|
+
style: "link",
|
|
10944
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
10945
|
+
"neeto-ui-text-accent-800": showPane,
|
|
10935
10946
|
"neeto-ui-text-error-500": isValid
|
|
10936
10947
|
}),
|
|
10937
10948
|
onClick: function onClick() {
|
|
10938
10949
|
return setShowPane(function (prevState) {
|
|
10939
10950
|
return !prevState;
|
|
10940
10951
|
});
|
|
10941
|
-
}
|
|
10942
|
-
children: defaultLabel.toLowerCase()
|
|
10952
|
+
}
|
|
10943
10953
|
}), /*#__PURE__*/jsxs(Pane, {
|
|
10944
10954
|
initialFocusRef: initialFocusRef,
|
|
10945
10955
|
isOpen: showPane,
|
|
@@ -11063,18 +11073,17 @@ var Input = function Input(_ref) {
|
|
|
11063
11073
|
});
|
|
11064
11074
|
}
|
|
11065
11075
|
})
|
|
11066
|
-
}) : /*#__PURE__*/jsx(
|
|
11067
|
-
|
|
11068
|
-
|
|
11069
|
-
className: classNames("neeto-ui-text-gray-800
|
|
11070
|
-
"neeto-ui-text-
|
|
11076
|
+
}) : /*#__PURE__*/jsx(Button, {
|
|
11077
|
+
label: label,
|
|
11078
|
+
style: "link",
|
|
11079
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
11080
|
+
"neeto-ui-text-accent-500": isValid
|
|
11071
11081
|
}),
|
|
11072
11082
|
onClick: function onClick() {
|
|
11073
11083
|
return setShowInput(function (prevState) {
|
|
11074
11084
|
return !prevState;
|
|
11075
11085
|
});
|
|
11076
|
-
}
|
|
11077
|
-
children: label
|
|
11086
|
+
}
|
|
11078
11087
|
})]
|
|
11079
11088
|
});
|
|
11080
11089
|
};
|
|
@@ -11211,25 +11220,24 @@ var ListField = function ListField(_ref) {
|
|
|
11211
11220
|
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");
|
|
11212
11221
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
11213
11222
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
11214
|
-
className: "neeto-ui-text-gray-700
|
|
11223
|
+
className: "neeto-ui-text-gray-700",
|
|
11215
11224
|
"data-cy": "list-action-separator-text",
|
|
11216
11225
|
style: "h5",
|
|
11217
11226
|
weight: "normal",
|
|
11218
11227
|
children: separator
|
|
11219
|
-
}), /*#__PURE__*/jsx(
|
|
11228
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
11220
11229
|
"data-cy": "list-action-button",
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
className: classNames("
|
|
11224
|
-
"neeto-ui-text-
|
|
11230
|
+
label: t("neetoRules.form.list"),
|
|
11231
|
+
style: "link",
|
|
11232
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
11233
|
+
"neeto-ui-text-accent-800": showPane,
|
|
11225
11234
|
"neeto-ui-text-error-500": isValid
|
|
11226
11235
|
}),
|
|
11227
11236
|
onClick: function onClick() {
|
|
11228
11237
|
return setShowPane(function (prevState) {
|
|
11229
11238
|
return !prevState;
|
|
11230
11239
|
});
|
|
11231
|
-
}
|
|
11232
|
-
children: t("neetoRules.form.list")
|
|
11240
|
+
}
|
|
11233
11241
|
}), /*#__PURE__*/jsxs(Pane, {
|
|
11234
11242
|
initialFocusRef: initialFocusRef,
|
|
11235
11243
|
isOpen: showPane,
|
|
@@ -11276,7 +11284,7 @@ var ListField = function ListField(_ref) {
|
|
|
11276
11284
|
className: "w-full",
|
|
11277
11285
|
children: function children(message) {
|
|
11278
11286
|
return /*#__PURE__*/jsx(Typography, {
|
|
11279
|
-
className: "neeto-ui-text-error-500 neeto-ui-text-gray-700
|
|
11287
|
+
className: "neeto-ui-text-error-500 neeto-ui-text-gray-700",
|
|
11280
11288
|
"data-cy": "list-action-error-message",
|
|
11281
11289
|
style: "h5",
|
|
11282
11290
|
children: message
|
|
@@ -11359,7 +11367,7 @@ var MultiSelect$1 = function MultiSelect(_ref) {
|
|
|
11359
11367
|
};
|
|
11360
11368
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
11361
11369
|
children: [!selectedField.hideSeparator && /*#__PURE__*/jsx(Typography, {
|
|
11362
|
-
className: "neeto-ui-text-gray-700
|
|
11370
|
+
className: "neeto-ui-text-gray-700",
|
|
11363
11371
|
"data-cy": "multi-select-action-separator-text",
|
|
11364
11372
|
style: "h5",
|
|
11365
11373
|
weight: "normal",
|
|
@@ -11370,12 +11378,12 @@ var MultiSelect$1 = function MultiSelect(_ref) {
|
|
|
11370
11378
|
closeOnSelect: false,
|
|
11371
11379
|
position: "top-start",
|
|
11372
11380
|
customTarget: isNotEmpty(selectedOptions) ? /*#__PURE__*/jsx("span", {
|
|
11373
|
-
className: "flex flex-wrap gap-y-1",
|
|
11381
|
+
className: "flex flex-wrap items-center gap-x-2 gap-y-1",
|
|
11374
11382
|
children: selectedOptions.map(function (option, idx) {
|
|
11375
11383
|
return /*#__PURE__*/jsxs("span", {
|
|
11376
|
-
className: "flex flex-wrap",
|
|
11384
|
+
className: "flex flex-wrap items-center gap-x-2 gap-y-1",
|
|
11377
11385
|
children: [!!idx && /*#__PURE__*/jsx(Typography, {
|
|
11378
|
-
className: "neeto-ui-text-gray-700
|
|
11386
|
+
className: "neeto-ui-text-gray-700",
|
|
11379
11387
|
style: "h5",
|
|
11380
11388
|
weight: "normal",
|
|
11381
11389
|
onClick: function onClick(e) {
|
|
@@ -11384,33 +11392,31 @@ var MultiSelect$1 = function MultiSelect(_ref) {
|
|
|
11384
11392
|
children: t("neetoRules.common.and", {
|
|
11385
11393
|
what: ""
|
|
11386
11394
|
})
|
|
11387
|
-
}), /*#__PURE__*/jsx(
|
|
11395
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
11388
11396
|
"data-cy": "multi-select-action-button",
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
className: classNames("
|
|
11392
|
-
"neeto-ui-text-
|
|
11397
|
+
label: option === null || option === void 0 ? void 0 : option.label.toLowerCase(),
|
|
11398
|
+
style: "link",
|
|
11399
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
11400
|
+
"neeto-ui-text-accent-800": activeOption === (option === null || option === void 0 ? void 0 : option.value)
|
|
11393
11401
|
}),
|
|
11394
11402
|
onClick: function onClick() {
|
|
11395
11403
|
setTouched(assocPath(["actions", "value", index], true, touched));
|
|
11396
11404
|
setActiveOption(activeOption ? null : option === null || option === void 0 ? void 0 : option.value);
|
|
11397
|
-
}
|
|
11398
|
-
children: option === null || option === void 0 ? void 0 : option.label.toLowerCase()
|
|
11405
|
+
}
|
|
11399
11406
|
})]
|
|
11400
11407
|
}, idx);
|
|
11401
11408
|
})
|
|
11402
|
-
}) : /*#__PURE__*/jsx(
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
className: classNames("
|
|
11406
|
-
"neeto-ui-text-
|
|
11409
|
+
}) : /*#__PURE__*/jsx(Button, {
|
|
11410
|
+
label: defaultLabel,
|
|
11411
|
+
style: "link",
|
|
11412
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
11413
|
+
"neeto-ui-text-accent-800": activeOption === defaultLabel,
|
|
11407
11414
|
"neeto-ui-text-error-500": isValid
|
|
11408
11415
|
}),
|
|
11409
11416
|
onClick: function onClick() {
|
|
11410
11417
|
setTouched(assocPath(["actions", "value", index], true, touched));
|
|
11411
11418
|
setActiveOption(activeOption ? null : defaultLabel);
|
|
11412
|
-
}
|
|
11413
|
-
children: defaultLabel
|
|
11419
|
+
}
|
|
11414
11420
|
}),
|
|
11415
11421
|
onClose: handleClose,
|
|
11416
11422
|
children: /*#__PURE__*/jsxs(Menu$8, {
|
|
@@ -11476,25 +11482,24 @@ var NoteField = function NoteField(_ref) {
|
|
|
11476
11482
|
var defaultLabel = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.placeholder) || t("neetoRules.form.note");
|
|
11477
11483
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
11478
11484
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
11479
|
-
className: "neeto-ui-text-gray-700
|
|
11485
|
+
className: "neeto-ui-text-gray-700",
|
|
11480
11486
|
"data-cy": "note-action-separator-text",
|
|
11481
11487
|
style: "h5",
|
|
11482
11488
|
weight: "normal",
|
|
11483
11489
|
children: separator
|
|
11484
|
-
}), /*#__PURE__*/jsx(
|
|
11490
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
11485
11491
|
"data-cy": "note-action-button",
|
|
11486
|
-
|
|
11487
|
-
|
|
11488
|
-
className: classNames("
|
|
11489
|
-
"neeto-ui-text-
|
|
11492
|
+
label: defaultLabel.toLowerCase(),
|
|
11493
|
+
style: "link",
|
|
11494
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
11495
|
+
"neeto-ui-text-accent-800": showPane,
|
|
11490
11496
|
"neeto-ui-text-error-500": isValid
|
|
11491
11497
|
}),
|
|
11492
11498
|
onClick: function onClick() {
|
|
11493
11499
|
return setShowPane(function (prevState) {
|
|
11494
11500
|
return !prevState;
|
|
11495
11501
|
});
|
|
11496
|
-
}
|
|
11497
|
-
children: defaultLabel.toLowerCase()
|
|
11502
|
+
}
|
|
11498
11503
|
}), /*#__PURE__*/jsxs(Pane, {
|
|
11499
11504
|
initialFocusRef: initialFocusRef,
|
|
11500
11505
|
isOpen: showPane,
|
|
@@ -11823,25 +11828,24 @@ var SmsFields = function SmsFields(_ref) {
|
|
|
11823
11828
|
};
|
|
11824
11829
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
11825
11830
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
11826
|
-
className: "neeto-ui-text-gray-700
|
|
11831
|
+
className: "neeto-ui-text-gray-700",
|
|
11827
11832
|
"data-cy": "sms-action-separator-text",
|
|
11828
11833
|
style: "h5",
|
|
11829
11834
|
weight: "normal",
|
|
11830
11835
|
children: separator
|
|
11831
|
-
}), /*#__PURE__*/jsx(
|
|
11836
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
11832
11837
|
"data-cy": "sms-action-button",
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
className: classNames("
|
|
11836
|
-
"neeto-ui-text-
|
|
11838
|
+
label: defaultLabel.toLowerCase(),
|
|
11839
|
+
style: "link",
|
|
11840
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
11841
|
+
"neeto-ui-text-accent-800": showPane,
|
|
11837
11842
|
"neeto-ui-text-error-500": isValid
|
|
11838
11843
|
}),
|
|
11839
11844
|
onClick: function onClick() {
|
|
11840
11845
|
return setShowPane(function (prevState) {
|
|
11841
11846
|
return !prevState;
|
|
11842
11847
|
});
|
|
11843
|
-
}
|
|
11844
|
-
children: defaultLabel.toLowerCase()
|
|
11848
|
+
}
|
|
11845
11849
|
}), /*#__PURE__*/jsxs(Pane, {
|
|
11846
11850
|
initialFocusRef: initialFocusRef,
|
|
11847
11851
|
isOpen: showPane,
|
|
@@ -12486,77 +12490,78 @@ var ActionItem = function ActionItem(_ref) {
|
|
|
12486
12490
|
findSelectedOption();
|
|
12487
12491
|
}, [selectedField]);
|
|
12488
12492
|
return /*#__PURE__*/jsxs("div", {
|
|
12489
|
-
className: "
|
|
12490
|
-
children: [selectDropDownHasError && renderErrorCallout(selectDropDownErrorMessage), !isMessageToSlackAction && isDisabled && renderDisabledReason(), /*#__PURE__*/
|
|
12491
|
-
className: "
|
|
12492
|
-
|
|
12493
|
-
|
|
12494
|
-
children: label
|
|
12495
|
-
}), /*#__PURE__*/jsx(Dropdown$1, {
|
|
12496
|
-
buttonStyle: "secondary",
|
|
12497
|
-
className: "neeto-ui-bg-gray-100",
|
|
12498
|
-
position: "bottom-start",
|
|
12499
|
-
customTarget: /*#__PURE__*/jsx(Typography, {
|
|
12500
|
-
"data-cy": "action-dropdown-button",
|
|
12493
|
+
className: "flex max-w-2xl flex-wrap gap-x-1 gap-y-3",
|
|
12494
|
+
children: [selectDropDownHasError && renderErrorCallout(selectDropDownErrorMessage), !isMessageToSlackAction && isDisabled && renderDisabledReason(), /*#__PURE__*/jsxs("div", {
|
|
12495
|
+
className: "flex flex-wrap items-center gap-x-2 gap-y-3",
|
|
12496
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
12497
|
+
className: "neeto-ui-text-gray-700",
|
|
12501
12498
|
style: "h5",
|
|
12502
|
-
weight: "
|
|
12503
|
-
|
|
12504
|
-
|
|
12505
|
-
|
|
12506
|
-
|
|
12507
|
-
|
|
12508
|
-
|
|
12509
|
-
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
|
|
12513
|
-
|
|
12514
|
-
|
|
12515
|
-
|
|
12516
|
-
|
|
12517
|
-
|
|
12518
|
-
|
|
12519
|
-
|
|
12520
|
-
"data-cy": "search-text-field",
|
|
12521
|
-
placeholder: t("neetoRules.common.search"),
|
|
12522
|
-
prefix: /*#__PURE__*/jsx(Search, {}),
|
|
12523
|
-
value: searchTerm,
|
|
12524
|
-
onChange: function onChange(e) {
|
|
12525
|
-
return setSearchTerm(e.target.value);
|
|
12526
|
-
},
|
|
12527
|
-
onClick: function onClick(e) {
|
|
12528
|
-
return e.stopPropagation();
|
|
12499
|
+
weight: "normal",
|
|
12500
|
+
children: label
|
|
12501
|
+
}), /*#__PURE__*/jsx(Dropdown$1, {
|
|
12502
|
+
buttonStyle: "secondary",
|
|
12503
|
+
className: "neeto-ui-bg-gray-100",
|
|
12504
|
+
position: "bottom-start",
|
|
12505
|
+
customTarget: /*#__PURE__*/jsx(Button, {
|
|
12506
|
+
"data-cy": "action-dropdown-button",
|
|
12507
|
+
label: selectedOption === null || selectedOption === void 0 || (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase(),
|
|
12508
|
+
style: "link",
|
|
12509
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
12510
|
+
"neeto-ui-text-accent-800": isActive,
|
|
12511
|
+
"neeto-ui-text-error-500": isActionSelected
|
|
12512
|
+
}),
|
|
12513
|
+
onClick: function onClick() {
|
|
12514
|
+
return setIsActive(function (prevState) {
|
|
12515
|
+
return !prevState;
|
|
12516
|
+
});
|
|
12529
12517
|
}
|
|
12530
|
-
}),
|
|
12531
|
-
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
|
|
12535
|
-
|
|
12536
|
-
|
|
12537
|
-
|
|
12538
|
-
|
|
12539
|
-
|
|
12540
|
-
|
|
12541
|
-
|
|
12542
|
-
},
|
|
12543
|
-
|
|
12544
|
-
|
|
12545
|
-
|
|
12546
|
-
|
|
12547
|
-
|
|
12548
|
-
|
|
12549
|
-
|
|
12550
|
-
|
|
12551
|
-
|
|
12552
|
-
|
|
12553
|
-
|
|
12554
|
-
|
|
12555
|
-
|
|
12556
|
-
|
|
12557
|
-
|
|
12558
|
-
|
|
12559
|
-
|
|
12518
|
+
}),
|
|
12519
|
+
onClose: handleClose,
|
|
12520
|
+
children: /*#__PURE__*/jsxs(Menu$7, {
|
|
12521
|
+
className: "max-h-60 max-w-2xl p-3",
|
|
12522
|
+
children: [actionOptions.length > MAXIMUM_OPTION_LENGTH$1 && /*#__PURE__*/jsx(Input$1, {
|
|
12523
|
+
autoFocus: true,
|
|
12524
|
+
"data-cy": "search-text-field",
|
|
12525
|
+
placeholder: t("neetoRules.common.search"),
|
|
12526
|
+
prefix: /*#__PURE__*/jsx(Search, {}),
|
|
12527
|
+
value: searchTerm,
|
|
12528
|
+
onChange: function onChange(e) {
|
|
12529
|
+
return setSearchTerm(e.target.value);
|
|
12530
|
+
},
|
|
12531
|
+
onClick: function onClick(e) {
|
|
12532
|
+
return e.stopPropagation();
|
|
12533
|
+
}
|
|
12534
|
+
}), /*#__PURE__*/jsx(OptionsWrapper, {
|
|
12535
|
+
hasScroll: actionOptions.length > MAXIMUM_OPTION_LENGTH$1,
|
|
12536
|
+
children: searchedOptions.map(function (option, idx) {
|
|
12537
|
+
return /*#__PURE__*/jsx(MenuItem$7.Button, {
|
|
12538
|
+
"data-cy": "".concat(joinHyphenCase(option.label), "-menu-item"),
|
|
12539
|
+
suffix: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value && /*#__PURE__*/jsx(Check, {
|
|
12540
|
+
className: "neeto-ui-text-primary-800"
|
|
12541
|
+
}),
|
|
12542
|
+
onClick: function onClick() {
|
|
12543
|
+
return handleSelectOption(option);
|
|
12544
|
+
},
|
|
12545
|
+
children: option.label
|
|
12546
|
+
}, idx);
|
|
12547
|
+
})
|
|
12548
|
+
}), isEmpty(actionOptions) && /*#__PURE__*/jsx(MenuItem$7.Button, {
|
|
12549
|
+
"data-cy": "no-options-menu-item",
|
|
12550
|
+
children: t("neetoRules.common.noOptions")
|
|
12551
|
+
})]
|
|
12552
|
+
})
|
|
12553
|
+
}), /*#__PURE__*/jsx(ActionSubItem, {
|
|
12554
|
+
action: action,
|
|
12555
|
+
index: index,
|
|
12556
|
+
selectedField: selectedField,
|
|
12557
|
+
name: "".concat(name, ".metadata"),
|
|
12558
|
+
options: getSelectedFieldOptions()
|
|
12559
|
+
}), isPresent(action === null || action === void 0 ? void 0 : action.children) && /*#__PURE__*/jsx(ActionChildren, {
|
|
12560
|
+
action: action,
|
|
12561
|
+
index: index,
|
|
12562
|
+
selectedField: selectedField,
|
|
12563
|
+
parentFieldName: name
|
|
12564
|
+
})]
|
|
12560
12565
|
})]
|
|
12561
12566
|
});
|
|
12562
12567
|
};
|
|
@@ -12754,26 +12759,24 @@ var DropdownField = function DropdownField(_ref) {
|
|
|
12754
12759
|
buttonStyle: "secondary",
|
|
12755
12760
|
className: "neeto-ui-bg-gray-100",
|
|
12756
12761
|
position: "bottom-start",
|
|
12757
|
-
customTarget: /*#__PURE__*/jsx(
|
|
12762
|
+
customTarget: /*#__PURE__*/jsx(Button, {
|
|
12758
12763
|
"data-cy": "condition-".concat(fieldType, "-dropdown-button"),
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
className: classNames("
|
|
12762
|
-
"neeto-ui-text-
|
|
12764
|
+
label: selectedOption === null || selectedOption === void 0 || (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase(),
|
|
12765
|
+
style: "link",
|
|
12766
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
12767
|
+
"neeto-ui-text-accent-800": isSelected
|
|
12763
12768
|
}),
|
|
12764
12769
|
onClick: function onClick() {
|
|
12765
12770
|
return setIsSelected(function (prevState) {
|
|
12766
12771
|
return !prevState;
|
|
12767
12772
|
});
|
|
12768
|
-
}
|
|
12769
|
-
children: selectedOption === null || selectedOption === void 0 || (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase()
|
|
12773
|
+
}
|
|
12770
12774
|
}),
|
|
12771
12775
|
onClose: handleClose,
|
|
12772
12776
|
children: /*#__PURE__*/jsxs(Menu$6, {
|
|
12773
12777
|
className: "max-h-60 max-w-2xl p-3",
|
|
12774
12778
|
children: [options.length > MAXIMUM_OPTION_LENGTH$2 && /*#__PURE__*/jsx(Input$1, {
|
|
12775
12779
|
autoFocus: true,
|
|
12776
|
-
className: "mb-1",
|
|
12777
12780
|
"data-cy": "search-text-field",
|
|
12778
12781
|
placeholder: t("neetoRules.common.search"),
|
|
12779
12782
|
prefix: /*#__PURE__*/jsx(Search, {}),
|
|
@@ -12876,12 +12879,12 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
12876
12879
|
return /*#__PURE__*/jsx(Dropdown$1, {
|
|
12877
12880
|
buttonStyle: "secondary",
|
|
12878
12881
|
className: "neeto-ui-bg-gray-100",
|
|
12879
|
-
customTarget: /*#__PURE__*/jsx(
|
|
12882
|
+
customTarget: /*#__PURE__*/jsx(Button, {
|
|
12880
12883
|
"data-cy": "condition-value-dropdown-button",
|
|
12881
|
-
|
|
12882
|
-
|
|
12883
|
-
className: classNames("
|
|
12884
|
-
"neeto-ui-text-
|
|
12884
|
+
label: defaultSelectedOption === null || defaultSelectedOption === void 0 || (_defaultSelectedOptio = defaultSelectedOption.label) === null || _defaultSelectedOptio === void 0 ? void 0 : _defaultSelectedOptio.toLowerCase(),
|
|
12885
|
+
style: "link",
|
|
12886
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
12887
|
+
"neeto-ui-text-accent-800": isActive,
|
|
12885
12888
|
"neeto-ui-text-error-500": isValueSelected
|
|
12886
12889
|
}),
|
|
12887
12890
|
onClick: function onClick() {
|
|
@@ -12889,15 +12892,13 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
12889
12892
|
setIsActive(function (prevState) {
|
|
12890
12893
|
return !prevState;
|
|
12891
12894
|
});
|
|
12892
|
-
}
|
|
12893
|
-
children: defaultSelectedOption === null || defaultSelectedOption === void 0 || (_defaultSelectedOptio = defaultSelectedOption.label) === null || _defaultSelectedOptio === void 0 ? void 0 : _defaultSelectedOptio.toLowerCase()
|
|
12895
|
+
}
|
|
12894
12896
|
}),
|
|
12895
12897
|
onClose: handleClose,
|
|
12896
12898
|
children: /*#__PURE__*/jsxs(Menu$5, {
|
|
12897
12899
|
className: "max-h-60 max-w-2xl p-3",
|
|
12898
12900
|
children: [options.length > MAXIMUM_OPTION_LENGTH$2 && /*#__PURE__*/jsx(Input$1, {
|
|
12899
12901
|
autoFocus: true,
|
|
12900
|
-
className: "mb-1",
|
|
12901
12902
|
"data-cy": "search-text-field",
|
|
12902
12903
|
placeholder: t("neetoRules.common.search"),
|
|
12903
12904
|
prefix: /*#__PURE__*/jsx(Search, {}),
|
|
@@ -12972,18 +12973,17 @@ var InputField$1 = function InputField(_ref) {
|
|
|
12972
12973
|
});
|
|
12973
12974
|
}
|
|
12974
12975
|
})
|
|
12975
|
-
}) : /*#__PURE__*/jsx(
|
|
12976
|
-
|
|
12977
|
-
|
|
12978
|
-
className: classNames("neeto-ui-text-gray-800
|
|
12976
|
+
}) : /*#__PURE__*/jsx(Button, {
|
|
12977
|
+
label: label,
|
|
12978
|
+
style: "link",
|
|
12979
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
12979
12980
|
"neeto-ui-text-error-500": isValid
|
|
12980
12981
|
}),
|
|
12981
12982
|
onClick: function onClick() {
|
|
12982
12983
|
return setShowInput(function (prevState) {
|
|
12983
12984
|
return !prevState;
|
|
12984
12985
|
});
|
|
12985
|
-
}
|
|
12986
|
-
children: label
|
|
12986
|
+
}
|
|
12987
12987
|
});
|
|
12988
12988
|
};
|
|
12989
12989
|
|
|
@@ -13032,43 +13032,41 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
13032
13032
|
closeOnSelect: false,
|
|
13033
13033
|
position: "top-start",
|
|
13034
13034
|
customTarget: isNotEmpty(options) ? /*#__PURE__*/jsx("span", {
|
|
13035
|
-
className: "flex flex-wrap gap-y-1",
|
|
13035
|
+
className: "flex flex-wrap items-center gap-x-2 gap-y-1",
|
|
13036
13036
|
children: options.map(function (option, idx) {
|
|
13037
13037
|
var _option$label;
|
|
13038
13038
|
return /*#__PURE__*/jsxs(React__default.Fragment, {
|
|
13039
13039
|
children: [!!idx && /*#__PURE__*/jsx(Typography, {
|
|
13040
|
-
className: "neeto-ui-text-gray-700
|
|
13040
|
+
className: "neeto-ui-text-gray-700",
|
|
13041
13041
|
style: "h5",
|
|
13042
13042
|
weight: "normal",
|
|
13043
13043
|
children: t("neetoRules.common.or")
|
|
13044
|
-
}), /*#__PURE__*/jsx(
|
|
13044
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
13045
13045
|
"data-cy": "condition-value-multi-select-field",
|
|
13046
|
-
|
|
13047
|
-
|
|
13048
|
-
className: classNames("
|
|
13049
|
-
"neeto-ui-text-
|
|
13046
|
+
label: option === null || option === void 0 || (_option$label = option.label) === null || _option$label === void 0 ? void 0 : _option$label.toLowerCase(),
|
|
13047
|
+
style: "link",
|
|
13048
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
13049
|
+
"neeto-ui-text-accent-800": activeOption === option.value
|
|
13050
13050
|
}),
|
|
13051
13051
|
onClick: function onClick() {
|
|
13052
13052
|
setTouched(assocPath(["conditions", "value", index], true, touched));
|
|
13053
13053
|
setActiveOption(activeOption ? null : option.value);
|
|
13054
|
-
}
|
|
13055
|
-
children: option === null || option === void 0 || (_option$label = option.label) === null || _option$label === void 0 ? void 0 : _option$label.toLowerCase()
|
|
13054
|
+
}
|
|
13056
13055
|
})]
|
|
13057
13056
|
}, idx);
|
|
13058
13057
|
})
|
|
13059
|
-
}) : /*#__PURE__*/jsx(
|
|
13058
|
+
}) : /*#__PURE__*/jsx(Button, {
|
|
13060
13059
|
"data-cy": "condition-value-multi-select-field",
|
|
13061
|
-
|
|
13062
|
-
|
|
13063
|
-
className: classNames("
|
|
13064
|
-
"neeto-ui-text-
|
|
13060
|
+
label: defaultLabel,
|
|
13061
|
+
style: "link",
|
|
13062
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
13063
|
+
"neeto-ui-text-accent-800": activeOption === defaultLabel,
|
|
13065
13064
|
"neeto-ui-text-error-500": isValid
|
|
13066
13065
|
}),
|
|
13067
13066
|
onClick: function onClick() {
|
|
13068
13067
|
setTouched(assocPath(["conditions", "value", index], true, touched));
|
|
13069
13068
|
setActiveOption(activeOption ? null : defaultLabel);
|
|
13070
|
-
}
|
|
13071
|
-
children: defaultLabel
|
|
13069
|
+
}
|
|
13072
13070
|
}),
|
|
13073
13071
|
onClose: handleClose,
|
|
13074
13072
|
children: /*#__PURE__*/jsxs(Menu$4, {
|
|
@@ -13136,11 +13134,11 @@ var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
|
13136
13134
|
var defaultLabel = t("neetoRules.form.selectValues");
|
|
13137
13135
|
var isValid = errors.conditions && 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]) && 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]);
|
|
13138
13136
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
13139
|
-
children: [isEmpty(allOptions) && /*#__PURE__*/jsx(
|
|
13137
|
+
children: [isEmpty(allOptions) && /*#__PURE__*/jsx(Button, {
|
|
13140
13138
|
"data-cy": "condition-value-multi-select-create-button",
|
|
13141
|
-
|
|
13142
|
-
|
|
13143
|
-
className: classNames("
|
|
13139
|
+
label: defaultLabel,
|
|
13140
|
+
style: "link",
|
|
13141
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
13144
13142
|
"neeto-ui-text-error-500": isValid
|
|
13145
13143
|
}),
|
|
13146
13144
|
onClick: function onClick() {
|
|
@@ -13148,26 +13146,24 @@ var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
|
13148
13146
|
setShowPane(function (prevState) {
|
|
13149
13147
|
return !prevState;
|
|
13150
13148
|
});
|
|
13151
|
-
}
|
|
13152
|
-
children: defaultLabel
|
|
13149
|
+
}
|
|
13153
13150
|
}), allOptions.map(function (option, idx) {
|
|
13154
13151
|
return /*#__PURE__*/jsxs(React__default.Fragment, {
|
|
13155
13152
|
children: [!!idx && /*#__PURE__*/jsx(Typography, {
|
|
13156
|
-
className: "neeto-ui-text-gray-700
|
|
13153
|
+
className: "neeto-ui-text-gray-700",
|
|
13157
13154
|
style: "h5",
|
|
13158
13155
|
weight: "normal",
|
|
13159
13156
|
children: t("neetoRules.common.or")
|
|
13160
|
-
}), /*#__PURE__*/jsx(
|
|
13161
|
-
className: "
|
|
13157
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
13158
|
+
className: "neeto-ui-text-gray-800 neeto-ui-font-semibold underline",
|
|
13162
13159
|
"data-cy": "condition-value-multi-select-create-button",
|
|
13163
|
-
|
|
13164
|
-
|
|
13160
|
+
label: option.label,
|
|
13161
|
+
style: "link",
|
|
13165
13162
|
onClick: function onClick() {
|
|
13166
13163
|
return setShowPane(function (prevState) {
|
|
13167
13164
|
return !prevState;
|
|
13168
13165
|
});
|
|
13169
|
-
}
|
|
13170
|
-
children: option.label
|
|
13166
|
+
}
|
|
13171
13167
|
})]
|
|
13172
13168
|
}, idx);
|
|
13173
13169
|
}), /*#__PURE__*/jsxs(Pane, {
|
|
@@ -13659,10 +13655,10 @@ var DateField = function DateField(_ref) {
|
|
|
13659
13655
|
});
|
|
13660
13656
|
}
|
|
13661
13657
|
})]
|
|
13662
|
-
}) : /*#__PURE__*/jsx(
|
|
13663
|
-
|
|
13664
|
-
|
|
13665
|
-
className: classNames("neeto-ui-text-gray-800
|
|
13658
|
+
}) : /*#__PURE__*/jsx(Button, {
|
|
13659
|
+
label: label,
|
|
13660
|
+
style: "link",
|
|
13661
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
13666
13662
|
"neeto-ui-text-error-500": isValid
|
|
13667
13663
|
}),
|
|
13668
13664
|
onClick: function onClick() {
|
|
@@ -13670,8 +13666,7 @@ var DateField = function DateField(_ref) {
|
|
|
13670
13666
|
setShowInput(function (prevState) {
|
|
13671
13667
|
return !prevState;
|
|
13672
13668
|
});
|
|
13673
|
-
}
|
|
13674
|
-
children: label
|
|
13669
|
+
}
|
|
13675
13670
|
})
|
|
13676
13671
|
});
|
|
13677
13672
|
};
|
|
@@ -13788,14 +13783,14 @@ var ConditionItem = function ConditionItem(_ref) {
|
|
|
13788
13783
|
};
|
|
13789
13784
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
13790
13785
|
children: [isWithEvents && !index && /*#__PURE__*/jsx(Typography, {
|
|
13791
|
-
className: "neeto-ui-text-gray-700
|
|
13786
|
+
className: "neeto-ui-text-gray-700",
|
|
13792
13787
|
style: "h5",
|
|
13793
13788
|
weight: "normal",
|
|
13794
13789
|
children: t("neetoRules.common.and", {
|
|
13795
13790
|
what: ""
|
|
13796
13791
|
})
|
|
13797
13792
|
}), /*#__PURE__*/jsx(Typography, {
|
|
13798
|
-
className: "neeto-ui-text-gray-700
|
|
13793
|
+
className: "neeto-ui-text-gray-700",
|
|
13799
13794
|
style: "h5",
|
|
13800
13795
|
weight: "normal",
|
|
13801
13796
|
children: defaultLabel
|
|
@@ -13826,15 +13821,14 @@ var LogicOperator = function LogicOperator(_ref) {
|
|
|
13826
13821
|
var logicOperation = _ref.logicOperation,
|
|
13827
13822
|
handleGroupJoinType = _ref.handleGroupJoinType;
|
|
13828
13823
|
var logicOperationLabel = OPERATOR_LABELS[logicOperation];
|
|
13829
|
-
return /*#__PURE__*/jsx(
|
|
13830
|
-
className: "neeto-ui-text-gray-800
|
|
13824
|
+
return /*#__PURE__*/jsx(Button, {
|
|
13825
|
+
className: "neeto-ui-text-gray-800 neeto-ui-font-semibold underline",
|
|
13831
13826
|
"data-cy": "logic-operator-button",
|
|
13832
|
-
|
|
13833
|
-
|
|
13827
|
+
label: logicOperationLabel,
|
|
13828
|
+
style: "link",
|
|
13834
13829
|
onClick: function onClick() {
|
|
13835
13830
|
return handleGroupJoinType(logicOperation);
|
|
13836
|
-
}
|
|
13837
|
-
children: logicOperationLabel
|
|
13831
|
+
}
|
|
13838
13832
|
});
|
|
13839
13833
|
};
|
|
13840
13834
|
|
|
@@ -13898,7 +13892,7 @@ var Conditions = function Conditions(_ref) {
|
|
|
13898
13892
|
return /*#__PURE__*/jsxs("div", {
|
|
13899
13893
|
className: "flex w-full justify-between",
|
|
13900
13894
|
children: [/*#__PURE__*/jsxs("div", {
|
|
13901
|
-
className: "
|
|
13895
|
+
className: "flex flex-wrap items-center gap-x-2 gap-y-2",
|
|
13902
13896
|
children: [!!index && /*#__PURE__*/jsx(LogicOperator, {
|
|
13903
13897
|
handleGroupJoinType: handleGroupJoinType,
|
|
13904
13898
|
logicOperation: condition.joinType
|
|
@@ -14057,29 +14051,28 @@ var Performer$1 = function Performer(_ref) {
|
|
|
14057
14051
|
setSelectedOption(option);
|
|
14058
14052
|
};
|
|
14059
14053
|
return /*#__PURE__*/jsxs("div", {
|
|
14060
|
-
className: "my-auto flex",
|
|
14054
|
+
className: "my-auto flex items-center gap-x-2 gap-y-3",
|
|
14061
14055
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
14062
|
-
className: "neeto-ui-text-gray-700
|
|
14056
|
+
className: "neeto-ui-text-gray-700",
|
|
14063
14057
|
style: "h5",
|
|
14064
14058
|
weight: "normal",
|
|
14065
14059
|
children: t("neetoRules.common.by")
|
|
14066
14060
|
}), /*#__PURE__*/jsx(Dropdown$1, {
|
|
14067
14061
|
buttonStyle: "secondary",
|
|
14068
14062
|
className: "neeto-ui-bg-gray-100",
|
|
14069
|
-
customTarget: /*#__PURE__*/jsx(
|
|
14063
|
+
customTarget: /*#__PURE__*/jsx(Button, {
|
|
14070
14064
|
"data-cy": "event-performer-dropdown",
|
|
14071
|
-
|
|
14072
|
-
|
|
14073
|
-
className: classNames("
|
|
14074
|
-
"neeto-ui-text-
|
|
14065
|
+
label: selectedOption === null || selectedOption === void 0 || (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase(),
|
|
14066
|
+
style: "link",
|
|
14067
|
+
className: classNames(" neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
14068
|
+
"neeto-ui-text-accent-800": isSelected,
|
|
14075
14069
|
"neeto-ui-text-error-500": isValueSelected
|
|
14076
14070
|
}),
|
|
14077
14071
|
onClick: function onClick() {
|
|
14078
14072
|
return setIsSelected(function (prevState) {
|
|
14079
14073
|
return !prevState;
|
|
14080
14074
|
});
|
|
14081
|
-
}
|
|
14082
|
-
children: selectedOption === null || selectedOption === void 0 || (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase()
|
|
14075
|
+
}
|
|
14083
14076
|
}),
|
|
14084
14077
|
onClose: handleClose,
|
|
14085
14078
|
children: /*#__PURE__*/jsxs(Menu$3, {
|
|
@@ -14220,7 +14213,7 @@ var Events$1 = function Events(_ref) {
|
|
|
14220
14213
|
setSearchTerm("");
|
|
14221
14214
|
};
|
|
14222
14215
|
return /*#__PURE__*/jsxs("div", {
|
|
14223
|
-
className: "my-auto flex flex-wrap gap-x-2 gap-y-3",
|
|
14216
|
+
className: "my-auto flex flex-wrap items-center gap-x-2 gap-y-3",
|
|
14224
14217
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
14225
14218
|
className: "neeto-ui-text-gray-700 my-auto",
|
|
14226
14219
|
style: "h5",
|
|
@@ -14232,42 +14225,40 @@ var Events$1 = function Events(_ref) {
|
|
|
14232
14225
|
closeOnSelect: false,
|
|
14233
14226
|
position: "top-start",
|
|
14234
14227
|
customTarget: isNotEmpty(allEvents) ? /*#__PURE__*/jsx("span", {
|
|
14235
|
-
className: "flex flex-wrap gap-y-1",
|
|
14228
|
+
className: "flex flex-wrap items-center gap-x-2 gap-y-1",
|
|
14236
14229
|
children: allEvents.map(function (event, idx) {
|
|
14237
14230
|
var _event$label;
|
|
14238
14231
|
return /*#__PURE__*/jsxs("span", {
|
|
14239
|
-
className: "flex flex-wrap gap-y-1",
|
|
14232
|
+
className: "flex flex-wrap items-center gap-x-2 gap-y-1",
|
|
14240
14233
|
children: [!!idx && /*#__PURE__*/jsx(Typography, {
|
|
14241
|
-
className: "neeto-ui-text-gray-700
|
|
14234
|
+
className: "neeto-ui-text-gray-700",
|
|
14242
14235
|
style: "h5",
|
|
14243
14236
|
weight: "normal",
|
|
14244
14237
|
children: t("neetoRules.common.or")
|
|
14245
|
-
}), /*#__PURE__*/jsx(
|
|
14238
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
14246
14239
|
"data-cy": "condition-value-multi-select-field",
|
|
14247
|
-
|
|
14248
|
-
|
|
14249
|
-
className: classNames("
|
|
14250
|
-
"neeto-ui-text-
|
|
14240
|
+
label: event === null || event === void 0 || (_event$label = event.label) === null || _event$label === void 0 ? void 0 : _event$label.toLowerCase(),
|
|
14241
|
+
style: "link",
|
|
14242
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
14243
|
+
"neeto-ui-text-accent-800": activeOption === event.value
|
|
14251
14244
|
}),
|
|
14252
14245
|
onClick: function onClick() {
|
|
14253
14246
|
return setActiveOption(activeOption ? null : event.value);
|
|
14254
|
-
}
|
|
14255
|
-
children: event === null || event === void 0 || (_event$label = event.label) === null || _event$label === void 0 ? void 0 : _event$label.toLowerCase()
|
|
14247
|
+
}
|
|
14256
14248
|
})]
|
|
14257
14249
|
}, idx);
|
|
14258
14250
|
})
|
|
14259
|
-
}) : /*#__PURE__*/jsx(
|
|
14251
|
+
}) : /*#__PURE__*/jsx(Button, {
|
|
14260
14252
|
"data-cy": "condition-value-multi-select-field",
|
|
14261
|
-
|
|
14262
|
-
|
|
14263
|
-
className: classNames("
|
|
14264
|
-
"neeto-ui-text-
|
|
14253
|
+
label: defaultLabel,
|
|
14254
|
+
style: "link",
|
|
14255
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
14256
|
+
"neeto-ui-text-accent-800": activeOption === defaultLabel,
|
|
14265
14257
|
"neeto-ui-text-error-500": !isValid
|
|
14266
14258
|
}),
|
|
14267
14259
|
onClick: function onClick() {
|
|
14268
14260
|
return setActiveOption(activeOption ? null : defaultLabel);
|
|
14269
|
-
}
|
|
14270
|
-
children: defaultLabel
|
|
14261
|
+
}
|
|
14271
14262
|
}),
|
|
14272
14263
|
onClose: handleClose,
|
|
14273
14264
|
children: /*#__PURE__*/jsxs(Menu$2, {
|
|
@@ -14473,20 +14464,19 @@ var EventItem = function EventItem(_ref) {
|
|
|
14473
14464
|
buttonStyle: "secondary",
|
|
14474
14465
|
className: "neeto-ui-bg-gray-100",
|
|
14475
14466
|
closeOnSelect: false,
|
|
14476
|
-
customTarget: /*#__PURE__*/jsx(
|
|
14467
|
+
customTarget: /*#__PURE__*/jsx(Button, {
|
|
14477
14468
|
"data-cy": "event-dropdown-button",
|
|
14478
|
-
|
|
14479
|
-
|
|
14480
|
-
className: classNames("
|
|
14481
|
-
"neeto-ui-text-
|
|
14469
|
+
label: selectedOption.toLowerCase(),
|
|
14470
|
+
style: "link",
|
|
14471
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
14472
|
+
"neeto-ui-text-accent-800": isActive,
|
|
14482
14473
|
"neeto-ui-text-error-500": isValueSelected
|
|
14483
14474
|
}),
|
|
14484
14475
|
onClick: function onClick() {
|
|
14485
14476
|
return setIsActive(function (prevState) {
|
|
14486
14477
|
return !prevState;
|
|
14487
14478
|
});
|
|
14488
|
-
}
|
|
14489
|
-
children: selectedOption.toLowerCase()
|
|
14479
|
+
}
|
|
14490
14480
|
}),
|
|
14491
14481
|
onClose: handleClose,
|
|
14492
14482
|
children: /*#__PURE__*/jsxs(Menu$1, {
|
|
@@ -14589,20 +14579,19 @@ var Performer = function Performer(_ref) {
|
|
|
14589
14579
|
buttonStyle: "secondary",
|
|
14590
14580
|
className: "neeto-ui-bg-gray-100",
|
|
14591
14581
|
closeOnSelect: false,
|
|
14592
|
-
customTarget: /*#__PURE__*/jsx(
|
|
14582
|
+
customTarget: /*#__PURE__*/jsx(Button, {
|
|
14593
14583
|
"data-cy": "event-performer-dropdown",
|
|
14594
|
-
|
|
14595
|
-
|
|
14596
|
-
className: classNames("
|
|
14597
|
-
"neeto-ui-text-
|
|
14584
|
+
label: selectedOption === null || selectedOption === void 0 || (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase(),
|
|
14585
|
+
style: "link",
|
|
14586
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
14587
|
+
"neeto-ui-text-accent-800": isSelected,
|
|
14598
14588
|
"neeto-ui-text-error-500": isValueSelected
|
|
14599
14589
|
}),
|
|
14600
14590
|
onClick: function onClick() {
|
|
14601
14591
|
return setIsSelected(function (prevState) {
|
|
14602
14592
|
return !prevState;
|
|
14603
14593
|
});
|
|
14604
|
-
}
|
|
14605
|
-
children: selectedOption === null || selectedOption === void 0 || (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase()
|
|
14594
|
+
}
|
|
14606
14595
|
}),
|
|
14607
14596
|
onClose: handleClose,
|
|
14608
14597
|
children: /*#__PURE__*/jsxs(Menu, {
|