contentoh-components-library 21.4.77 → 21.4.78

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.
@@ -0,0 +1,8 @@
1
+ <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_731_2487" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="10" height="10">
3
+ <rect width="10" height="10" fill="#D9D9D9"/>
4
+ </mask>
5
+ <g mask="url(#mask0_731_2487)">
6
+ <path d="M0.769231 10L0 9.23077L4.23077 5L0 0.769231L0.769231 0L5 4.23077L9.23077 0L10 0.769231L5.76923 5L10 9.23077L9.23077 10L5 5.76923L0.769231 10Z" fill="#B64545"/>
7
+ </g>
8
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_731_2312" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="12" height="12">
3
+ <rect width="12" height="12" fill="#D9D9D9"/>
4
+ </mask>
5
+ <g mask="url(#mask0_731_2312)">
6
+ <path d="M1.40041 10.5996H2.06071L8.70873 3.95157L8.04843 3.29127L1.40041 9.93929V10.5996ZM10.6146 3.30628L8.69372 1.3854L9.32401 0.755116C9.49409 0.585039 9.70418 0.5 9.9543 0.5C10.2044 0.5 10.4145 0.585039 10.5846 0.755116L11.2449 1.41542C11.415 1.58549 11.5 1.79559 11.5 2.0457C11.5 2.29582 11.415 2.50591 11.2449 2.67599L10.6146 3.30628ZM9.98431 3.93656L2.42087 11.5H0.5V9.57913L8.06344 2.01569L9.98431 3.93656Z" fill="#E33AA9"/>
7
+ </g>
8
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_748_1469" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="14" height="14">
3
+ <rect width="14" height="14" fill="#D9D9D9"/>
4
+ </mask>
5
+ <g mask="url(#mask0_748_1469)">
6
+ <path d="M14 3.05278V12.8333C14 13.1444 13.8833 13.4167 13.65 13.65C13.4167 13.8833 13.1444 14 12.8333 14H1.16667C0.855556 14 0.583333 13.8833 0.35 13.65C0.116667 13.4167 0 13.1444 0 12.8333V1.16667C0 0.855556 0.116667 0.583333 0.35 0.35C0.583333 0.116667 0.855556 0 1.16667 0H10.9472L14 3.05278ZM12.8333 3.57778L10.4222 1.16667H1.16667V12.8333H12.8333V3.57778ZM6.99543 11.5694C7.55588 11.5694 8.0338 11.3733 8.42917 10.981C8.82454 10.5886 9.02222 10.1123 9.02222 9.55179C9.02222 8.99134 8.82606 8.51343 8.43374 8.11806C8.04143 7.72269 7.56504 7.525 7.00457 7.525C6.44412 7.525 5.9662 7.72116 5.57083 8.11349C5.17546 8.5058 4.97778 8.98219 4.97778 9.54265C4.97778 10.1031 5.17394 10.581 5.56626 10.9764C5.95858 11.3718 6.43496 11.5694 6.99543 11.5694ZM2.19722 4.97778H9.15833V2.19722H2.19722V4.97778Z" fill="#E33AA9"/>
7
+ </g>
8
+ </svg>
@@ -23,7 +23,7 @@ var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
23
23
 
24
24
  var _material = require("@mui/material");
25
25
 
26
- var _Select = _interopRequireDefault(require("../../atoms/Select"));
26
+ var _Select = _interopRequireDefault(require("@mui/material/Select"));
27
27
 
28
28
  var _addv = _interopRequireDefault(require("../../../assets/images/Icons/addv2.svg"));
29
29
 
@@ -45,7 +45,8 @@ var Phase = function Phase(_ref) {
45
45
  phaseName = _ref.phaseName,
46
46
  nextPhase = _ref.nextPhase,
47
47
  groups = _ref.groups,
48
- onDeletePhase = _ref.onDeletePhase;
48
+ onDeletePhase = _ref.onDeletePhase,
49
+ draggable = _ref.draggable;
49
50
 
50
51
  var _useState = (0, _react.useState)(""),
51
52
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -79,6 +80,16 @@ var Phase = function Phase(_ref) {
79
80
 
80
81
  var idPhase = id + 1;
81
82
 
83
+ var _useState11 = (0, _react.useState)(null),
84
+ _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
85
+ draggedItem = _useState12[0],
86
+ setDraggedItem = _useState12[1];
87
+
88
+ var _useState13 = (0, _react.useState)([]),
89
+ _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
90
+ tempItems = _useState14[0],
91
+ setTempItems = _useState14[1];
92
+
82
93
  var onAdd = function onAdd() {
83
94
  if (selectedValue && !groupsSelected.includes(selectedValue)) {
84
95
  setGroupsSelected(function (prevGroups) {
@@ -113,8 +124,7 @@ var Phase = function Phase(_ref) {
113
124
  return chip !== chipToRemove;
114
125
  });
115
126
  });
116
- }; // const combinedGroups = [...grupos, ...chips];
117
-
127
+ };
118
128
 
119
129
  var _React$useState = _react.default.useState(null),
120
130
  _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
@@ -135,10 +145,10 @@ var Phase = function Phase(_ref) {
135
145
  var label = _ref2.label,
136
146
  onDelete = _ref2.onDelete;
137
147
 
138
- var _useState11 = (0, _react.useState)(false),
139
- _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
140
- isHovered = _useState12[0],
141
- setIsHovered = _useState12[1];
148
+ var _useState15 = (0, _react.useState)(false),
149
+ _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
150
+ isHovered = _useState16[0],
151
+ setIsHovered = _useState16[1];
142
152
 
143
153
  var handleMouseEnter = function handleMouseEnter() {
144
154
  setIsHovered(true);
@@ -163,9 +173,33 @@ var Phase = function Phase(_ref) {
163
173
  });
164
174
  };
165
175
 
166
- console.log(id, phases, nextPhase, groups); // useEffect(() => initialPhase(),[]);
176
+ var onDragStartHandler = function onDragStartHandler(e) {
177
+ e.dataTransfer.effectAllowed = "move";
178
+ e.dataTransfer.setData("text/html", e.target.parentNode);
179
+ e.dataTransfer.setDragImage(e.target.parentNode, 20, 20);
180
+ setDraggedItem(id);
181
+ onDragStart(e, id);
182
+ };
183
+
184
+ var onDragOverHandler = function onDragOverHandler(index) {
185
+ if (!draggedItem || draggedItem === id) {
186
+ return;
187
+ }
188
+
189
+ onDragOver(id);
190
+ setDraggedItem(null);
191
+ };
192
+
193
+ var onDragEndHandler = function onDragEndHandler() {
194
+ onDragEnd();
195
+ setDraggedItem(null);
196
+ };
167
197
 
168
198
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
199
+ onDragStart: onDragStartHandler,
200
+ onDragOver: onDragOverHandler,
201
+ onDragEnd: onDragEndHandler,
202
+ draggable: draggable,
169
203
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
170
204
  className: "header-phase",
171
205
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("h2", {
@@ -179,21 +213,41 @@ var Phase = function Phase(_ref) {
179
213
  className: "phase-sel",
180
214
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
181
215
  className: "text-phase",
182
- children: "Al rechazar en esta fase enviar a "
216
+ children: "Siguiente Fase "
183
217
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
184
218
  width: "100px",
185
- valueSelected: nextPhase ? Object.values(nextPhase) : [],
219
+ value: selectedValue !== "" ? selectedValue : nextPhase,
186
220
  placeholder: "Fase",
187
- options: phases.map(function (phase) {
188
- return phase.phaseName;
189
- }),
190
221
  onChange: function onChange(e) {
191
222
  var selectedPhase = phases.find(function (phase) {
192
223
  return phase.phaseName === e.target.value;
193
224
  });
194
- console.log("fase seleccionada", selectedPhase);
195
225
  setSelectedValue(selectedPhase.nextPhaseIfApproved);
196
- }
226
+ },
227
+ sx: {
228
+ width: "auto",
229
+ minWidth: "100px",
230
+ height: "24px",
231
+ background: "#F7F7FC",
232
+ borderRadius: "5px"
233
+ },
234
+ MenuProps: {
235
+ PaperProps: {
236
+ style: {
237
+ background: "#F7F7FC"
238
+ }
239
+ }
240
+ },
241
+ children: phases.map(function (phase) {
242
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
243
+ value: phase.phaseName,
244
+ sx: {
245
+ fontSize: "10px",
246
+ color: "#262626"
247
+ },
248
+ children: phase.phaseName
249
+ }, phase.phaseId);
250
+ })
197
251
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
198
252
  id: "basic-button",
199
253
  "aria-controls": open ? "basic-menu" : undefined,
@@ -11,11 +11,9 @@ exports.DragAndDropPhases = void 0;
11
11
 
12
12
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
13
13
 
14
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
15
-
16
14
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
17
15
 
18
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
16
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
19
17
 
20
18
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
21
19
 
@@ -31,10 +29,10 @@ var _Modal = require("../Modal");
31
29
 
32
30
  var _axios = _interopRequireDefault(require("axios"));
33
31
 
34
- var _GeneralInputv = require("../../atoms/GeneralInputv2");
35
-
36
32
  var _checkv = _interopRequireDefault(require("../../../assets/images/Icons/checkv2.svg"));
37
33
 
34
+ var _material = require("@mui/material");
35
+
38
36
  var _jsxRuntime = require("react/jsx-runtime");
39
37
 
40
38
  var DragAndDropPhases = function DragAndDropPhases(_ref) {
@@ -67,7 +65,7 @@ var DragAndDropPhases = function DragAndDropPhases(_ref) {
67
65
  listPhases = _useState10[0],
68
66
  setListPhases = _useState10[1];
69
67
 
70
- var _useState11 = (0, _react.useState)(),
68
+ var _useState11 = (0, _react.useState)(""),
71
69
  _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
72
70
  newPhaseName = _useState12[0],
73
71
  setNewPhaseName = _useState12[1];
@@ -80,135 +78,185 @@ var DragAndDropPhases = function DragAndDropPhases(_ref) {
80
78
  }),
81
79
  _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
82
80
  modalData = _useState14[0],
83
- setModalData = _useState14[1];
84
-
85
- var onDragStart = function onDragStart(e, idx) {
86
- e.dataTransfer.effectAllowed = "move";
87
- e.dataTransfer.setData("text/html", e.target.parentNode);
88
- e.dataTransfer.setDragImage(e.target.parentNode, 20, 20);
89
- setDraggedItem(items[idx]);
81
+ setModalData = _useState14[1]; // useEffect(() => {console.log("nuevo",newPhaseName)},[newPhaseName]);
82
+
83
+
84
+ {
85
+ /*const updatePhases = async () => {
86
+ try {
87
+ console.log("listPhases:", listPhases);
88
+ const updateData = {
89
+ body: {
90
+ updateReferencesOfNodes: listPhases.map((phase) => ({
91
+ name:phase.phaseName,
92
+ isInitialPhase: phase.isInitialPhase,
93
+ phaseId: phase.phaseId,
94
+ nextPhaseIfApproved: phase.nextPhaseIfApproved,
95
+ })),
96
+ },
97
+ path: {
98
+ action: "update",
99
+ },
100
+ headers: {
101
+ Authorization: token,
102
+ },
103
+ };
104
+ console.log("updateData:", updateData);
105
+ const response = await axios.post(
106
+ `${process.env.REACT_APP_PHASES_ENDPOINT}/update`,
107
+ updateData
108
+ );
109
+ // Handle response if needed
110
+ console.log("Update response:", response.data);
111
+ } catch (error) {
112
+ console.error("Error al actualizar fases", error);
113
+ }
114
+ };*/
115
+ }
116
+
117
+ var handleInputChange = function handleInputChange(e) {
118
+ console.log("nuevo nombre", e.target.value);
119
+ setNewPhaseName(e.target.value);
90
120
  };
91
121
 
92
- var onDragOver = function onDragOver(index) {
93
- if (!draggedItem) {
94
- return;
95
- }
96
-
97
- if (draggedItem === tempItems[index]) {
98
- return;
99
- }
100
-
101
- var draggedIndex = tempItems.findIndex(function (item) {
102
- return item === draggedItem;
103
- });
104
- var updatedItems = (0, _toConsumableArray2.default)(tempItems);
105
-
106
- if (draggedIndex > index) {
107
- updatedItems[draggedIndex] = tempItems[index];
108
- updatedItems[index] = draggedItem;
109
- } else {
110
- updatedItems.splice(draggedIndex, 1);
111
- updatedItems.splice(index, 0, draggedItem);
112
- }
113
-
114
- setTempItems(updatedItems);
115
- };
122
+ var AddPhase = /*#__PURE__*/function () {
123
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
124
+ return _regenerator.default.wrap(function _callee$(_context) {
125
+ while (1) {
126
+ switch (_context.prev = _context.next) {
127
+ case 0:
128
+ try {
129
+ console.log("fase nueva", newPhaseName);
130
+ {
131
+ /*const body = {
132
+ name: phaseName,
133
+ retailerGroupsIds: [],
134
+ nextPhaseId: null
135
+ }
136
+ const response = await axios.post(
137
+ `${process.env.REACT_APP_PHASES_ENDPOINT}/create`,
138
+ body,
139
+ {
140
+ headers: {
141
+ Authorization: token,
142
+ },
143
+ }
144
+ );
145
+ const createdPhase = response.data.body;
146
+ console.log(createdPhase)*/
147
+ }
148
+ } catch (error) {
149
+ console.error("Error al agregar fase:", error);
150
+ }
116
151
 
117
- var onDragEnd = function onDragEnd() {
118
- setItems(tempItems);
119
- setDraggedItem(null);
120
- };
152
+ case 1:
153
+ case "end":
154
+ return _context.stop();
155
+ }
156
+ }
157
+ }, _callee);
158
+ }));
121
159
 
122
- (0, _react.useEffect)(function () {
123
- console.log("nuevo", newPhaseName);
124
- }, [newPhaseName]);
160
+ return function AddPhase() {
161
+ return _ref2.apply(this, arguments);
162
+ };
163
+ }();
125
164
 
126
- var handleAddPhase = function handleAddPhase() {
165
+ var handleAddPhaseButton = function handleAddPhaseButton() {
127
166
  setModalData({
128
167
  show: true,
168
+ className: "modal-add-phase",
129
169
  title: "Agregar fase de revisión",
130
170
  buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
131
171
  type: "white",
132
172
  label: "Cancelar",
133
173
  size: 12,
134
174
  onClick: function onClick() {
135
- handleAcceptModal();
175
+ setModalData(function (prev) {
176
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, prev), {}, {
177
+ show: false
178
+ });
179
+ });
136
180
  }
137
181
  }, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
138
182
  type: "pink",
139
183
  label: "Guardar",
140
184
  size: 12,
141
- onClick: function onClick() {
142
- handleAcceptModal();
143
- }
185
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
186
+ return _regenerator.default.wrap(function _callee2$(_context2) {
187
+ while (1) {
188
+ switch (_context2.prev = _context2.next) {
189
+ case 0:
190
+ setModalData(function (prev) {
191
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, prev), {}, {
192
+ show: false
193
+ });
194
+ });
195
+ _context2.next = 3;
196
+ return new Promise(function (resolve) {
197
+ return setTimeout(resolve, 0);
198
+ });
199
+
200
+ case 3:
201
+ AddPhase();
202
+
203
+ case 4:
204
+ case "end":
205
+ return _context2.stop();
206
+ }
207
+ }
208
+ }, _callee2);
209
+ }))
144
210
  }, "btn-Guardar")],
145
211
  customComponent: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
146
212
  className: "container-input-name",
147
213
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
148
214
  children: ["Las fases nuevas siempre se agregan al final.", /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), "Puedes ordenar las fases arrastr\xE1ndolas."]
149
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralInputv.GeneralInputv2, {
150
- inputType: "text",
151
- inputName: "input-phase-name",
152
- inputId: 0,
153
- inputValue: newPhaseName,
154
- inputOnChange: function inputOnChange(e) {
155
- return setNewPhaseName(e.target.value);
156
- },
157
- inputPlaceholder: "Nombre de fase"
215
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
216
+ className: "input-phases",
217
+ placeholder: "Nombre de fase",
218
+ value: newPhaseName,
219
+ onChange: handleInputChange
158
220
  })]
159
221
  })
160
222
  });
161
223
  };
162
224
 
163
- var handleAcceptModal = function handleAcceptModal() {
164
- var newPhaseData = {
165
- id: listPhases.length + 1,
166
- phaseName: newPhaseName,
167
- // Utiliza el nuevo nombre de la fase
168
- groupsAssigned: []
169
- };
170
- setListPhases(function (prevListPhases) {
171
- var updatedListPhases = [].concat((0, _toConsumableArray2.default)(prevListPhases), [newPhaseData]);
172
- console.log("actualizada", updatedListPhases);
173
- return updatedListPhases;
174
- });
175
- setModalData(function (prev) {
176
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, prev), {}, {
177
- show: false
178
- });
179
- });
225
+ var handleAcceptModal = function handleAcceptModal(PhaseName) {
226
+ console.log("nombre", PhaseName);
227
+ AddPhase(PhaseName);
180
228
  };
181
229
 
182
- var getPhases = /*#__PURE__*/function () {
183
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
230
+ var loadData = /*#__PURE__*/function () {
231
+ var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
184
232
  var response, phasesData, phasesDataArray;
185
- return _regenerator.default.wrap(function _callee$(_context) {
233
+ return _regenerator.default.wrap(function _callee3$(_context3) {
186
234
  while (1) {
187
- switch (_context.prev = _context.next) {
235
+ switch (_context3.prev = _context3.next) {
188
236
  case 0:
189
- _context.prev = 0;
190
- _context.next = 3;
237
+ _context3.prev = 0;
238
+ _context3.next = 3;
191
239
  return _axios.default.post("".concat(process.env.REACT_APP_PHASES_ENDPOINT, "/get"), {}, {
192
240
  headers: {
193
- Authorization: token
241
+ Authorization: token // Authorization: sessionStorage.getItem("jwt"),
242
+
194
243
  }
195
244
  });
196
245
 
197
246
  case 3:
198
- response = _context.sent;
199
- // console.log("response", response);
247
+ response = _context3.sent;
200
248
  phasesData = JSON.parse(response.data.body).data;
201
249
  phasesDataArray = [];
202
- phasesData.forEach(function (_ref3) {
203
- var phaseId = _ref3.phaseId,
204
- phaseName = _ref3.phaseName,
205
- isInitialPhase = _ref3.isInitialPhase,
206
- nextPhaseIfApproved = _ref3.nextPhaseIfApproved,
207
- groups = _ref3.groups;
208
- var groupsAssigned = groups.map(function (_ref4) {
209
- var id = _ref4.id,
210
- name = _ref4.name,
211
- active = _ref4.active;
250
+ phasesData.forEach(function (_ref5) {
251
+ var phaseId = _ref5.phaseId,
252
+ phaseName = _ref5.phaseName,
253
+ isInitialPhase = _ref5.isInitialPhase,
254
+ nextPhaseIfApproved = _ref5.nextPhaseIfApproved,
255
+ groups = _ref5.groups;
256
+ var groupsAssigned = groups.map(function (_ref6) {
257
+ var id = _ref6.id,
258
+ name = _ref6.name,
259
+ active = _ref6.active;
212
260
  return {
213
261
  groupId: id,
214
262
  groupName: name,
@@ -222,27 +270,27 @@ var DragAndDropPhases = function DragAndDropPhases(_ref) {
222
270
  nextPhaseIfApproved: nextPhaseIfApproved,
223
271
  groupsAssigned: groupsAssigned
224
272
  });
225
- }); // console.table("fases Array", phasesDataArray);
226
-
273
+ });
274
+ console.table("fases Array", phasesDataArray);
227
275
  setListPhases(phasesDataArray);
228
- _context.next = 13;
276
+ _context3.next = 14;
229
277
  break;
230
278
 
231
- case 10:
232
- _context.prev = 10;
233
- _context.t0 = _context["catch"](0);
234
- console.error("Error fetching fases:", _context.t0);
279
+ case 11:
280
+ _context3.prev = 11;
281
+ _context3.t0 = _context3["catch"](0);
282
+ console.error("Error al obtener fases:", _context3.t0);
235
283
 
236
- case 13:
284
+ case 14:
237
285
  case "end":
238
- return _context.stop();
286
+ return _context3.stop();
239
287
  }
240
288
  }
241
- }, _callee, null, [[0, 10]]);
289
+ }, _callee3, null, [[0, 11]]);
242
290
  }));
243
291
 
244
- return function getPhases() {
245
- return _ref2.apply(this, arguments);
292
+ return function loadData() {
293
+ return _ref4.apply(this, arguments);
246
294
  };
247
295
  }();
248
296
 
@@ -273,19 +321,23 @@ var DragAndDropPhases = function DragAndDropPhases(_ref) {
273
321
  };
274
322
 
275
323
  (0, _react.useEffect)(function () {
276
- return getPhases();
277
- }, []);
278
- (0, _react.useEffect)(function () {// console.log("fases lista", listPhases);
279
- }, [listPhases]);
324
+ return loadData();
325
+ }, []); // useEffect(() => {
326
+ // updatePhases();
327
+ // setModalData((prev) => ({ ...prev, show: false }));
328
+ // }, [listPhases]);
280
329
 
281
- var renderPhase = function renderPhase(idx, phase) {
330
+ var renderPhase = function renderPhase(phase, idx) {
282
331
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Phase.Phase, {
283
332
  id: idx,
284
333
  phases: listPhases,
285
334
  phaseName: phase.phaseName,
286
335
  nextPhase: phase.nextPhaseIfApproved,
287
336
  groups: phase.groupsAssigned,
288
- onDeletePhase: handleDeletePhase
337
+ onDeletePhase: function onDeletePhase() {
338
+ return handleDeletePhase(phase.id);
339
+ },
340
+ draggable: true
289
341
  }, idx);
290
342
  };
291
343
 
@@ -293,7 +345,7 @@ var DragAndDropPhases = function DragAndDropPhases(_ref) {
293
345
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Header, {
294
346
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
295
347
  className: "button-phase",
296
- onClick: handleAddPhase,
348
+ onClick: handleAddPhaseButton,
297
349
  children: "Agregar fase de revisi\xF3n"
298
350
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
299
351
  className: "button-save",
@@ -323,7 +375,7 @@ var DragAndDropPhases = function DragAndDropPhases(_ref) {
323
375
  }, "btn-Guardar")]
324
376
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
325
377
  children: listPhases.map(function (phase, idx) {
326
- return renderPhase(idx, phase, handleDeletePhase);
378
+ return renderPhase(phase, idx);
327
379
  })
328
380
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, modalData), {}, {
329
381
  onClickBtnDefault: function onClickBtnDefault() {
@@ -15,7 +15,7 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject, _templateObject2;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\ndisplay:flex;\nflex-direction: column;\ngap:20px;\nwidth:100%;\nul{\n display:flex;\n flex-direction:column;\n width:100%;\n gap:10px;\n}\n .item{\n display:flex;\n width:100%;\n }\n .drag{\n width:100%;\n }\n .container-input-name{\n p{\n font-family: ", ", sans-serif;\n font-size: 12px;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0em;\n text-align: left;\n color: ", ";\n margin-bottom:15px;\n }\n }\n"])), _variables.FontFamily.RobotoRegular, _variables.GlobalColors.gray);
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\ndisplay:flex;\nflex-direction: column;\ngap:20px;\nwidth:100%;\nul{\n display:flex;\n flex-direction:column;\n width:100%;\n gap:10px;\n}\n .item{\n display:flex;\n width:100%;\n }\n .drag{\n width:100%;\n }\n .container-input-name{\n p{\n font-family: ", ", sans-serif;\n font-size: 12px;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0em;\n text-align: left;\n color: ", ";\n margin-bottom:15px;\n }\n .input-phases{\n width:100%;\n height: 30px;\n padding: 8px 10px;\n border-radius: 5px;\n border: 1px solid ", ";\n ::placeholder {\n font-family: ", ", sans-serif;\n font-size: 12px;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0em;\n text-align: left;\n color: #CBCBCB;\n }\n }\n }\n .modal-add-phase {\n .contentModal{\n min-width:310px;\n }\n header .label-title{\n text-align: left;\n }\n .container-buttons{\n justify-content: flex-end;\n }\n }\n"])), _variables.FontFamily.RobotoRegular, _variables.GlobalColors.gray, _variables.GlobalColors.gray_light, _variables.FontFamily.RobotoRegular);
19
19
 
20
20
  exports.Container = Container;
21
21
 
@@ -27,13 +27,14 @@ var EditGroupDefault = Template.bind({});
27
27
  exports.EditGroupDefault = EditGroupDefault;
28
28
  EditGroupDefault.args = {
29
29
  groups: [{
30
- text: 'Impuestos',
30
+ groupName: 'Impuestos',
31
31
  editing: false
32
32
  }, {
33
- text: 'Legal',
33
+ groupName: 'Legal',
34
34
  editing: false
35
35
  }, {
36
- text: 'Datos Maestros',
36
+ groupName: 'Datos Maestros',
37
37
  editing: false
38
- }]
38
+ }],
39
+ token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIxZmFjNjY2Ny1hMDMzLTQ1NjAtOWU5ZC01MTQwMDc2MmI2MWYiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjFmYWM2NjY3LWEwMzMtNDU2MC05ZTlkLTUxNDAwNzYyYjYxZiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI4ZGIyZjdhZS01ZGFlLTQ3NDAtOGRiYS04YWYzYzQyNmIyOTkiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcwMzc4Mzk0NywibmFtZSI6IlJhZGlvc2NoYWNrIE9uYm9hcmRpbmciLCJwaG9uZV9udW1iZXIiOiIrNTIxMjM0NTY3ODk4IiwiZXhwIjoxNzAzNzg3NTQ3LCJpYXQiOjE3MDM3ODM5NDcsImVtYWlsIjoicmFkaW9zaGFja2Ryb3BzaGlwQGFsbGZyZWVtYWlsLm5ldCJ9.kE0DTZhG3QNJCcVACjWQd4nm-QQKRU9n2jHwC9XtNC9H3Xz7T2F80qxcOUkaOU1IwuJLhxThzpJ9rMKS5XgyjSz_SO7nUQZFY4_vLXgmVowaV798kXRpP5uuUVPJ0b07BMjw12_k0QLeOiAfs4gP4micwedD8ItmsxfjJvv6OPir5NX0KgBjgd5OSlCafgH72yZX8SNmiCyzZkQIEO0MNLwEiIm2COgu4MwvFd73CnlJYYQa-WjCnhB35jgoc8gLpFUfBjgpMUSNRZU2Ndzt9CNuQ6he6RwsVmteMgm0e2Fyn_viRhOsMMxbP8wDXnA9pXwZHB2P-DqXYKhC4blsVA"
39
40
  };