@bigbinary/neeto-rules-frontend 2.5.12 → 2.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/NeetoRules.js +19 -281
- package/dist/NeetoRules.js.map +1 -1
- package/dist/RulesReorder.js +20 -0
- package/dist/RulesReorder.js.map +1 -0
- package/dist/cjs/NeetoRules.js +27 -289
- package/dist/cjs/NeetoRules.js.map +1 -1
- package/dist/cjs/RulesReorder.js +26 -0
- package/dist/cjs/RulesReorder.js.map +1 -0
- package/dist/cjs/index.js +8 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/index-CYeamuNR.js +284 -0
- package/dist/index-CYeamuNR.js.map +1 -0
- package/dist/index-DGlpB-_C.js +291 -0
- package/dist/index-DGlpB-_C.js.map +1 -0
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
require('@babel/runtime/helpers/slicedToArray');
|
|
5
|
+
require('react');
|
|
6
|
+
require('@hello-pangea/dnd');
|
|
7
|
+
require('@bigbinary/neeto-icons/Reorder');
|
|
8
|
+
require('@bigbinary/neetoui/Pane');
|
|
9
|
+
require('@bigbinary/neetoui/Typography');
|
|
10
|
+
require('@bigbinary/neetoui/Button');
|
|
11
|
+
require('@bigbinary/neetoui/Spinner');
|
|
12
|
+
require('ramda');
|
|
13
|
+
require('react-i18next');
|
|
14
|
+
var RulesReorder = require('../index-DGlpB-_C.js');
|
|
15
|
+
require('react/jsx-runtime');
|
|
16
|
+
require('@tanstack/react-query');
|
|
17
|
+
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
18
|
+
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
19
|
+
require('axios');
|
|
20
|
+
require('../index-DFwPrb81.js');
|
|
21
|
+
require('react-router-dom');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
module.exports = RulesReorder.RulesReorder;
|
|
26
|
+
//# sourceMappingURL=RulesReorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RulesReorder.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var constants = require('../index-DFwPrb81.js');
|
|
4
4
|
var CannedResponsesPane = require('./CannedResponsesPane.js');
|
|
5
5
|
var NeetoRules = require('./NeetoRules.js');
|
|
6
|
+
var RulesReorder = require('../index-DGlpB-_C.js');
|
|
6
7
|
var useCustomDataStore = require('../useCustomDataStore-BEG8I__n.js');
|
|
7
8
|
var NeetoRulesForm = require('./NeetoRulesForm.js');
|
|
8
9
|
var RulePreview = require('./RulePreview.js');
|
|
@@ -29,16 +30,11 @@ require('@bigbinary/neetoui/Label');
|
|
|
29
30
|
require('react/jsx-runtime');
|
|
30
31
|
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
31
32
|
require('@bigbinary/neeto-molecules/Container');
|
|
32
|
-
require('@tanstack/react-query');
|
|
33
|
-
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
34
|
-
require('axios');
|
|
35
33
|
require('@bigbinary/neeto-molecules/Header');
|
|
36
34
|
require('@bigbinary/neetoui/Button');
|
|
37
35
|
require('../utils-BngEaPaz.js');
|
|
38
|
-
require('@hello-pangea/dnd');
|
|
39
|
-
require('@bigbinary/neeto-icons/Reorder');
|
|
40
|
-
require('react-router-dom');
|
|
41
36
|
require('zustand/shallow');
|
|
37
|
+
require('@bigbinary/neeto-icons/Reorder');
|
|
42
38
|
require('@bigbinary/neeto-molecules/SubHeader');
|
|
43
39
|
require('@bigbinary/neeto-molecules/TableWrapper');
|
|
44
40
|
require('@bigbinary/neetoui/Alert');
|
|
@@ -46,10 +42,15 @@ require('@bigbinary/neetoui/Table');
|
|
|
46
42
|
require('@bigbinary/neetoui/NoData');
|
|
47
43
|
require('../useUtilityStore-BGuo9bko.js');
|
|
48
44
|
require('zustand');
|
|
45
|
+
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
49
46
|
require('@bigbinary/neeto-commons-frontend/utils');
|
|
50
47
|
require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
51
48
|
require('@bigbinary/neetoui/Switch');
|
|
52
49
|
require('@bigbinary/neetoui/Tooltip');
|
|
50
|
+
require('@hello-pangea/dnd');
|
|
51
|
+
require('@tanstack/react-query');
|
|
52
|
+
require('axios');
|
|
53
|
+
require('react-router-dom');
|
|
53
54
|
require('@babel/runtime/helpers/objectDestructuringEmpty');
|
|
54
55
|
require('@bigbinary/neeto-icons/Plus');
|
|
55
56
|
require('@bigbinary/neeto-icons/Delete');
|
|
@@ -88,6 +89,7 @@ require('@bigbinary/neeto-icons/Up');
|
|
|
88
89
|
exports.AUTOMATION_RULES_QUERY_KEY = constants.AUTOMATION_RULES;
|
|
89
90
|
exports.CannedResponsesPane = CannedResponsesPane;
|
|
90
91
|
exports.NeetoRules = NeetoRules;
|
|
92
|
+
exports.RulesReorder = RulesReorder.RulesReorder;
|
|
91
93
|
exports.useCustomDataStore = useCustomDataStore.useCustomDataStore;
|
|
92
94
|
exports.NeetoRulesForm = NeetoRulesForm;
|
|
93
95
|
exports.RulePreview = RulePreview;
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
+
import { useState, useEffect, createElement } from 'react';
|
|
4
|
+
import { Draggable, DragDropContext, Droppable } from '@hello-pangea/dnd';
|
|
5
|
+
import Reorder from '@bigbinary/neeto-icons/Reorder';
|
|
6
|
+
import Pane from '@bigbinary/neetoui/Pane';
|
|
7
|
+
import Typography from '@bigbinary/neetoui/Typography';
|
|
8
|
+
import Button from '@bigbinary/neetoui/Button';
|
|
9
|
+
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
10
|
+
import { equals, clone as clone$1 } from 'ramda';
|
|
11
|
+
import { useTranslation } from 'react-i18next';
|
|
12
|
+
import { useQuery, keepPreviousData } from '@tanstack/react-query';
|
|
13
|
+
import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
14
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
15
|
+
import axios from 'axios';
|
|
16
|
+
import { A as AUTOMATION_RULES, S as STALE_TIME } from './index-9h4B7JZZ.js';
|
|
17
|
+
import { withRouter } from 'react-router-dom';
|
|
18
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
19
|
+
|
|
20
|
+
var _excluded = ["url"];
|
|
21
|
+
var fetch = function fetch(_ref) {
|
|
22
|
+
var url = _ref.url,
|
|
23
|
+
params = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
return axios.get(url, {
|
|
25
|
+
params: params
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
var update = function update(_ref2) {
|
|
29
|
+
var url = _ref2.url,
|
|
30
|
+
id = _ref2.id,
|
|
31
|
+
payload = _ref2.payload;
|
|
32
|
+
return axios.patch("".concat(url, "/").concat(id), payload);
|
|
33
|
+
};
|
|
34
|
+
var clone = function clone(_ref3) {
|
|
35
|
+
var url = _ref3.url,
|
|
36
|
+
id = _ref3.id;
|
|
37
|
+
return axios.post("".concat(url, "/").concat(id, "/clone"));
|
|
38
|
+
};
|
|
39
|
+
var destroy = function destroy(_ref4) {
|
|
40
|
+
var url = _ref4.url,
|
|
41
|
+
id = _ref4.id;
|
|
42
|
+
return axios["delete"]("".concat(url, "/").concat(id));
|
|
43
|
+
};
|
|
44
|
+
var reorder = function reorder(_ref5) {
|
|
45
|
+
var url = _ref5.url,
|
|
46
|
+
payload = _ref5.payload;
|
|
47
|
+
return axios.patch("".concat(url, "/reorder"), payload);
|
|
48
|
+
};
|
|
49
|
+
var automationRulesApi = {
|
|
50
|
+
fetch: fetch,
|
|
51
|
+
update: update,
|
|
52
|
+
clone: clone,
|
|
53
|
+
destroy: destroy,
|
|
54
|
+
reorder: reorder
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
function ownKeys$3(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; }
|
|
58
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
59
|
+
var useFetchAutomationRules = function useFetchAutomationRules(params) {
|
|
60
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
61
|
+
return useQuery(_objectSpread$3({
|
|
62
|
+
queryKey: [AUTOMATION_RULES, params.url, params],
|
|
63
|
+
queryFn: function queryFn() {
|
|
64
|
+
return automationRulesApi.fetch(params);
|
|
65
|
+
},
|
|
66
|
+
staleTime: STALE_TIME,
|
|
67
|
+
select: function select(response) {
|
|
68
|
+
return response.data || response;
|
|
69
|
+
},
|
|
70
|
+
placeholderData: keepPreviousData
|
|
71
|
+
}, options));
|
|
72
|
+
};
|
|
73
|
+
var useUpdateAutomationRule = function useUpdateAutomationRule(url) {
|
|
74
|
+
return useMutationWithInvalidation(automationRulesApi.update, {
|
|
75
|
+
keysToInvalidate: [[AUTOMATION_RULES, url]]
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
var useCloneAutomationRule = function useCloneAutomationRule(url) {
|
|
79
|
+
return useMutationWithInvalidation(automationRulesApi.clone, {
|
|
80
|
+
keysToInvalidate: [[AUTOMATION_RULES, url]]
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
var useDeleteAutomationRule = function useDeleteAutomationRule(url) {
|
|
84
|
+
return useMutationWithInvalidation(automationRulesApi.destroy, {
|
|
85
|
+
keysToInvalidate: [[AUTOMATION_RULES, url]]
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
var useReorderAutomationRules = function useReorderAutomationRules(url) {
|
|
89
|
+
return useMutationWithInvalidation(automationRulesApi.reorder, {
|
|
90
|
+
keysToInvalidate: [[AUTOMATION_RULES, url]]
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
var INITIAL_RULES_DATA = {
|
|
95
|
+
rules: [],
|
|
96
|
+
totalCount: 0
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
function ownKeys$2(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; }
|
|
100
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
101
|
+
var reorderList = function reorderList(_ref) {
|
|
102
|
+
var endIndex = _ref.endIndex,
|
|
103
|
+
firstDisplayOrder = _ref.firstDisplayOrder,
|
|
104
|
+
list = _ref.list,
|
|
105
|
+
startIndex = _ref.startIndex;
|
|
106
|
+
var result = Array.from(list);
|
|
107
|
+
var _result$splice = result.splice(startIndex, 1),
|
|
108
|
+
_result$splice2 = _slicedToArray(_result$splice, 1),
|
|
109
|
+
removed = _result$splice2[0];
|
|
110
|
+
result.splice(endIndex, 0, removed);
|
|
111
|
+
return result.map(function (item, index) {
|
|
112
|
+
return _objectSpread$2(_objectSpread$2({}, item), {}, {
|
|
113
|
+
displayOrder: firstDisplayOrder + index
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
var getDragItemStyle = function getDragItemStyle(isDragging, draggableStyle) {
|
|
118
|
+
return _objectSpread$2(_objectSpread$2({}, draggableStyle), isDragging && {
|
|
119
|
+
zIndex: 99999
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
function ownKeys$1(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; }
|
|
124
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
125
|
+
var DraggableItem = function DraggableItem(props) {
|
|
126
|
+
var rule = props.rule,
|
|
127
|
+
ruleIndex = props.ruleIndex;
|
|
128
|
+
return /*#__PURE__*/jsx(Draggable, {
|
|
129
|
+
draggableId: "item_".concat(rule.id),
|
|
130
|
+
index: ruleIndex,
|
|
131
|
+
children: function children(provided, snapshot) {
|
|
132
|
+
return /*#__PURE__*/jsxs("div", _objectSpread$1(_objectSpread$1(_objectSpread$1({
|
|
133
|
+
className: "neeto-ui-text-gray-800 mb-3 flex items-center space-x-4 font-medium",
|
|
134
|
+
ref: provided.innerRef
|
|
135
|
+
}, provided.draggableProps), provided.dragHandleProps), {}, {
|
|
136
|
+
style: getDragItemStyle(snapshot.isDragging, provided.draggableProps.style),
|
|
137
|
+
children: [/*#__PURE__*/jsx(Reorder, {}), /*#__PURE__*/jsx("div", {
|
|
138
|
+
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",
|
|
139
|
+
"data-cy": "automation-rule-reorder-container",
|
|
140
|
+
children: rule.name
|
|
141
|
+
})]
|
|
142
|
+
}), "list_".concat(rule.id));
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
var DraggableItem$1 = withRouter(DraggableItem);
|
|
147
|
+
|
|
148
|
+
function ownKeys(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; }
|
|
149
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
150
|
+
var RulesReorder = function RulesReorder(_ref) {
|
|
151
|
+
var _rules$0$displayOrder, _rules$;
|
|
152
|
+
var isOpen = _ref.isOpen,
|
|
153
|
+
totalCount = _ref.totalCount,
|
|
154
|
+
url = _ref.url,
|
|
155
|
+
onClose = _ref.onClose,
|
|
156
|
+
onReorderSuccess = _ref.onReorderSuccess;
|
|
157
|
+
var _useState = useState([]),
|
|
158
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
159
|
+
reorderedRules = _useState2[0],
|
|
160
|
+
setReorderedRules = _useState2[1];
|
|
161
|
+
var _useTranslation = useTranslation(),
|
|
162
|
+
t = _useTranslation.t;
|
|
163
|
+
var _useFetchAutomationRu = useFetchAutomationRules({
|
|
164
|
+
pageSize: totalCount,
|
|
165
|
+
url: url
|
|
166
|
+
}, {
|
|
167
|
+
enabled: isOpen
|
|
168
|
+
}),
|
|
169
|
+
_useFetchAutomationRu2 = _useFetchAutomationRu.data,
|
|
170
|
+
_useFetchAutomationRu3 = _useFetchAutomationRu2 === void 0 ? INITIAL_RULES_DATA : _useFetchAutomationRu2,
|
|
171
|
+
rules = _useFetchAutomationRu3.rules,
|
|
172
|
+
isLoading = _useFetchAutomationRu.isLoading;
|
|
173
|
+
var _useReorderAutomation = useReorderAutomationRules(url),
|
|
174
|
+
reOrder = _useReorderAutomation.mutate,
|
|
175
|
+
isPending = _useReorderAutomation.isPending;
|
|
176
|
+
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;
|
|
177
|
+
var handleReorderSave = function handleReorderSave() {
|
|
178
|
+
return reOrder({
|
|
179
|
+
url: url,
|
|
180
|
+
payload: {
|
|
181
|
+
reorder: {
|
|
182
|
+
rules: reorderedRules
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}, {
|
|
186
|
+
onSuccess: function onSuccess() {
|
|
187
|
+
onReorderSuccess === null || onReorderSuccess === void 0 || onReorderSuccess();
|
|
188
|
+
onClose();
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
var onDragEnd = function onDragEnd(_ref2) {
|
|
193
|
+
var destination = _ref2.destination,
|
|
194
|
+
source = _ref2.source;
|
|
195
|
+
if (!destination || source.index === destination.index) return;
|
|
196
|
+
var items = reorderList({
|
|
197
|
+
endIndex: destination.index,
|
|
198
|
+
firstDisplayOrder: firstDisplayOrder,
|
|
199
|
+
list: clone$1(reorderedRules),
|
|
200
|
+
startIndex: source.index
|
|
201
|
+
});
|
|
202
|
+
setReorderedRules(items);
|
|
203
|
+
};
|
|
204
|
+
useEffect(function () {
|
|
205
|
+
setReorderedRules(rules);
|
|
206
|
+
}, [rules]);
|
|
207
|
+
if (isLoading) {
|
|
208
|
+
return /*#__PURE__*/jsx(Pane, {
|
|
209
|
+
isOpen: isOpen,
|
|
210
|
+
onClose: onClose,
|
|
211
|
+
children: /*#__PURE__*/jsx("div", {
|
|
212
|
+
className: "flex h-full w-full items-center justify-center",
|
|
213
|
+
children: /*#__PURE__*/jsx(Spinner, {})
|
|
214
|
+
})
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
return /*#__PURE__*/jsxs(Pane, {
|
|
218
|
+
isOpen: isOpen,
|
|
219
|
+
onClose: onClose,
|
|
220
|
+
children: [/*#__PURE__*/jsx(Pane.Header, {
|
|
221
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
222
|
+
style: "h2",
|
|
223
|
+
weight: "semibold",
|
|
224
|
+
children: t("neetoRules.common.reorder")
|
|
225
|
+
})
|
|
226
|
+
}), /*#__PURE__*/jsxs(Pane.Body, {
|
|
227
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
228
|
+
className: "mb-3",
|
|
229
|
+
style: "body2",
|
|
230
|
+
children: t("neetoRules.description.reorder")
|
|
231
|
+
}), /*#__PURE__*/jsx("div", {
|
|
232
|
+
className: "flex flex-col items-center",
|
|
233
|
+
children: /*#__PURE__*/jsx(DragDropContext, {
|
|
234
|
+
onDragEnd: onDragEnd,
|
|
235
|
+
children: /*#__PURE__*/jsx(Droppable, {
|
|
236
|
+
droppableId: "droppable",
|
|
237
|
+
renderClone: function renderClone(provided, snapshot, rubric) {
|
|
238
|
+
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread(_objectSpread({
|
|
239
|
+
className: "neeto-ui-text-gray-800 mb-3 flex items-center space-x-4 font-medium",
|
|
240
|
+
ref: provided.innerRef
|
|
241
|
+
}, provided.draggableProps), provided.dragHandleProps), {}, {
|
|
242
|
+
style: getDragItemStyle(snapshot.isDragging, provided.draggableProps.style),
|
|
243
|
+
children: [/*#__PURE__*/jsx(Reorder, {}), /*#__PURE__*/jsx("div", {
|
|
244
|
+
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",
|
|
245
|
+
children: /*#__PURE__*/jsx("div", {
|
|
246
|
+
children: reorderedRules[rubric.source.index].name
|
|
247
|
+
})
|
|
248
|
+
})]
|
|
249
|
+
}), "list_".concat(reorderedRules[rubric.source.index].id));
|
|
250
|
+
},
|
|
251
|
+
children: function children(provided) {
|
|
252
|
+
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({}, provided.droppableProps), {}, {
|
|
253
|
+
ref: provided.innerRef,
|
|
254
|
+
children: [reorderedRules.map(function (rule, index) {
|
|
255
|
+
return /*#__PURE__*/createElement(DraggableItem$1, {
|
|
256
|
+
rule: rule,
|
|
257
|
+
key: rule.id,
|
|
258
|
+
ruleIndex: index
|
|
259
|
+
});
|
|
260
|
+
}), provided.placeholder]
|
|
261
|
+
}));
|
|
262
|
+
}
|
|
263
|
+
})
|
|
264
|
+
})
|
|
265
|
+
})]
|
|
266
|
+
}), /*#__PURE__*/jsxs(Pane.Footer, {
|
|
267
|
+
className: "flex items-center gap-x-2",
|
|
268
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
269
|
+
disabled: isPending || equals(rules, reorderedRules),
|
|
270
|
+
label: t("neetoRules.common.saveChange"),
|
|
271
|
+
loading: isPending,
|
|
272
|
+
style: "primary",
|
|
273
|
+
onClick: handleReorderSave
|
|
274
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
275
|
+
label: t("neetoRules.buttons.cancel"),
|
|
276
|
+
style: "text",
|
|
277
|
+
onClick: onClose
|
|
278
|
+
})]
|
|
279
|
+
})]
|
|
280
|
+
});
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
export { INITIAL_RULES_DATA as I, RulesReorder as R, useCloneAutomationRule as a, useDeleteAutomationRule as b, useFetchAutomationRules as c, useUpdateAutomationRule as u };
|
|
284
|
+
//# sourceMappingURL=index-CYeamuNR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CYeamuNR.js","sources":["../app/javascript/src/apis/automation_rules.js","../app/javascript/src/hooks/reactQuery/useAutomationRulesApi.js","../app/javascript/src/components/NeetoRules/constants.js","../app/javascript/src/components/NeetoRules/RulesReorder/utils.js","../app/javascript/src/components/NeetoRules/RulesReorder/DraggableItem.jsx","../app/javascript/src/components/NeetoRules/RulesReorder/index.jsx"],"sourcesContent":["import axios from \"axios\";\n\nconst fetch = ({ url, ...params }) => axios.get(url, { params });\n\nconst update = ({ url, id, payload }) => axios.patch(`${url}/${id}`, payload);\n\nconst clone = ({ url, id }) => axios.post(`${url}/${id}/clone`);\n\nconst destroy = ({ url, id }) => axios.delete(`${url}/${id}`);\n\nconst reorder = ({ url, payload }) => axios.patch(`${url}/reorder`, payload);\n\nconst automationRulesApi = { fetch, update, clone, destroy, reorder };\n\nexport default automationRulesApi;\n","import { keepPreviousData, useQuery } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport automationRulesApi from \"apis/automation_rules\";\nimport { AUTOMATION_RULES, STALE_TIME } from \"common/constants\";\n\nconst useFetchAutomationRules = (params, options = {}) =>\n useQuery({\n queryKey: [AUTOMATION_RULES, params.url, params],\n queryFn: () => automationRulesApi.fetch(params),\n staleTime: STALE_TIME,\n select: response => response.data || response,\n placeholderData: keepPreviousData,\n ...options,\n });\n\nconst useUpdateAutomationRule = url =>\n useMutationWithInvalidation(automationRulesApi.update, {\n keysToInvalidate: [[AUTOMATION_RULES, url]],\n });\n\nconst useCloneAutomationRule = url =>\n useMutationWithInvalidation(automationRulesApi.clone, {\n keysToInvalidate: [[AUTOMATION_RULES, url]],\n });\n\nconst useDeleteAutomationRule = url =>\n useMutationWithInvalidation(automationRulesApi.destroy, {\n keysToInvalidate: [[AUTOMATION_RULES, url]],\n });\n\nconst useReorderAutomationRules = url =>\n useMutationWithInvalidation(automationRulesApi.reorder, {\n keysToInvalidate: [[AUTOMATION_RULES, url]],\n });\nexport {\n useFetchAutomationRules,\n useUpdateAutomationRule,\n useCloneAutomationRule,\n useDeleteAutomationRule,\n useReorderAutomationRules,\n};\n","export const STATUS_KEYS = { ENABLED: \"enabled\", DISABLED: \"disabled\" };\n\nexport const DEFAULT_INIT_PAGE = 1;\n\nexport const INITIAL_RULES_DATA = { rules: [], totalCount: 0 };\n","export const reorderList = ({\n endIndex,\n firstDisplayOrder,\n list,\n startIndex,\n}) => {\n const result = Array.from(list);\n const [removed] = result.splice(startIndex, 1);\n result.splice(endIndex, 0, removed);\n\n return result.map((item, index) => ({\n ...item,\n displayOrder: firstDisplayOrder + index,\n }));\n};\n\nexport const getDragItemStyle = (isDragging, draggableStyle) => ({\n // styles we need to apply on draggables\n ...draggableStyle,\n\n ...(isDragging && { zIndex: 99999 }),\n});\n","import { Draggable } from \"@hello-pangea/dnd\";\nimport { Reorder } from \"neetoicons\";\nimport { withRouter } from \"react-router-dom\";\n\nimport { getDragItemStyle } from \"./utils\";\n\nconst DraggableItem = props => {\n const { rule, ruleIndex } = props;\n\n return (\n <Draggable draggableId={`item_${rule.id}`} index={ruleIndex}>\n {(provided, snapshot) => (\n <div\n className=\"neeto-ui-text-gray-800 mb-3 flex items-center space-x-4 font-medium\"\n key={`list_${rule.id}`}\n ref={provided.innerRef}\n {...provided.draggableProps}\n {...provided.dragHandleProps}\n style={getDragItemStyle(\n snapshot.isDragging,\n provided.draggableProps.style\n )}\n >\n <Reorder />\n <div\n 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\"\n data-cy=\"automation-rule-reorder-container\"\n >\n {rule.name}\n </div>\n </div>\n )}\n </Draggable>\n );\n};\n\nexport default withRouter(DraggableItem);\n","import { useEffect, useState } from \"react\";\n\nimport { DragDropContext, Droppable } from \"@hello-pangea/dnd\";\nimport { Reorder as NeetoUIReorderIcon } from \"neetoicons\";\nimport { Pane, Typography, Button, Spinner } from \"neetoui\";\nimport { clone, equals } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n useFetchAutomationRules,\n useReorderAutomationRules,\n} from \"hooks/reactQuery/useAutomationRulesApi\";\n\nimport DraggableItem from \"./DraggableItem\";\nimport { getDragItemStyle, reorderList } from \"./utils\";\n\nimport { INITIAL_RULES_DATA } from \"../constants\";\n\nconst RulesReorder = ({\n isOpen,\n totalCount,\n url,\n onClose,\n onReorderSuccess,\n}) => {\n const [reorderedRules, setReorderedRules] = useState([]);\n\n const { t } = useTranslation();\n\n const { data: { rules } = INITIAL_RULES_DATA, isLoading } =\n useFetchAutomationRules({ pageSize: totalCount, url }, { enabled: isOpen });\n\n const { mutate: reOrder, isPending } = useReorderAutomationRules(url);\n\n const firstDisplayOrder = rules[0]?.displayOrder ?? 1;\n\n const handleReorderSave = () =>\n reOrder(\n { url, payload: { reorder: { rules: reorderedRules } } },\n {\n onSuccess: () => {\n onReorderSuccess?.();\n onClose();\n },\n }\n );\n\n const onDragEnd = ({ destination, source }) => {\n if (!destination || source.index === destination.index) return;\n\n const items = reorderList({\n endIndex: destination.index,\n firstDisplayOrder,\n list: clone(reorderedRules),\n startIndex: source.index,\n });\n setReorderedRules(items);\n };\n\n useEffect(() => {\n setReorderedRules(rules);\n }, [rules]);\n\n if (isLoading) {\n return (\n <Pane {...{ isOpen, onClose }}>\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n </Pane>\n );\n }\n\n return (\n <Pane {...{ isOpen, onClose }}>\n <Pane.Header>\n <Typography style=\"h2\" weight=\"semibold\">\n {t(\"neetoRules.common.reorder\")}\n </Typography>\n </Pane.Header>\n <Pane.Body>\n <Typography className=\"mb-3\" style=\"body2\">\n {t(\"neetoRules.description.reorder\")}\n </Typography>\n <div className=\"flex flex-col items-center\">\n <DragDropContext {...{ onDragEnd }}>\n <Droppable\n droppableId=\"droppable\"\n renderClone={(provided, snapshot, rubric) => (\n <div\n className=\"neeto-ui-text-gray-800 mb-3 flex items-center space-x-4 font-medium\"\n key={`list_${reorderedRules[rubric.source.index].id}`}\n ref={provided.innerRef}\n {...provided.draggableProps}\n {...provided.dragHandleProps}\n style={getDragItemStyle(\n snapshot.isDragging,\n provided.draggableProps.style\n )}\n >\n <NeetoUIReorderIcon />\n <div 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\">\n <div>{reorderedRules[rubric.source.index].name}</div>\n </div>\n </div>\n )}\n >\n {provided => (\n <div {...provided.droppableProps} ref={provided.innerRef}>\n {reorderedRules.map((rule, index) => (\n <DraggableItem\n {...{ rule }}\n key={rule.id}\n ruleIndex={index}\n />\n ))}\n {provided.placeholder}\n </div>\n )}\n </Droppable>\n </DragDropContext>\n </div>\n </Pane.Body>\n <Pane.Footer className=\"flex items-center gap-x-2\">\n <Button\n disabled={isPending || equals(rules, reorderedRules)}\n label={t(\"neetoRules.common.saveChange\")}\n loading={isPending}\n style=\"primary\"\n onClick={handleReorderSave}\n />\n <Button\n label={t(\"neetoRules.buttons.cancel\")}\n style=\"text\"\n onClick={onClose}\n />\n </Pane.Footer>\n </Pane>\n );\n};\nexport default RulesReorder;\n"],"names":["fetch","_ref","url","params","_objectWithoutProperties","_excluded","axios","get","update","_ref2","id","payload","patch","concat","clone","_ref3","post","destroy","_ref4","reorder","_ref5","automationRulesApi","useFetchAutomationRules","options","arguments","length","undefined","useQuery","_objectSpread","queryKey","AUTOMATION_RULES","queryFn","staleTime","STALE_TIME","select","response","data","placeholderData","keepPreviousData","useUpdateAutomationRule","useMutationWithInvalidation","keysToInvalidate","useCloneAutomationRule","useDeleteAutomationRule","useReorderAutomationRules","INITIAL_RULES_DATA","rules","totalCount","reorderList","endIndex","firstDisplayOrder","list","startIndex","result","Array","from","_result$splice","splice","_result$splice2","_slicedToArray","removed","map","item","index","displayOrder","getDragItemStyle","isDragging","draggableStyle","zIndex","DraggableItem","props","rule","ruleIndex","_jsx","Draggable","draggableId","children","provided","snapshot","_jsxs","className","ref","innerRef","draggableProps","dragHandleProps","style","Reorder","name","withRouter","RulesReorder","_rules$0$displayOrder","_rules$","isOpen","onClose","onReorderSuccess","_useState","useState","_useState2","reorderedRules","setReorderedRules","_useTranslation","useTranslation","t","_useFetchAutomationRu","pageSize","enabled","_useFetchAutomationRu2","_useFetchAutomationRu3","isLoading","_useReorderAutomation","reOrder","mutate","isPending","handleReorderSave","onSuccess","onDragEnd","destination","source","items","useEffect","Pane","Spinner","Header","Typography","weight","Body","DragDropContext","Droppable","droppableId","renderClone","rubric","NeetoUIReorderIcon","droppableProps","_createElement","key","placeholder","Footer","Button","disabled","equals","label","loading","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,KAAK,GAAG,SAARA,KAAKA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,GAAG,GAAAD,IAAA,CAAHC,GAAG;AAAKC,IAAAA,MAAM,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA,CAAA;AAAA,EAAA,OAAOC,KAAK,CAACC,GAAG,CAACL,GAAG,EAAE;AAAEC,IAAAA,MAAM,EAANA;AAAO,GAAC,CAAC;AAAA,CAAA;AAEhE,IAAMK,MAAM,GAAG,SAATA,MAAMA,CAAAC,KAAA,EAAA;AAAA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