contentoh-components-library 21.4.84 → 21.4.86
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/assets/images/Icons/search.svg +3 -0
- package/dist/assets/images/Icons/settings.svg +8 -0
- package/dist/components/atoms/Multiselect/Multiselect.stories.js +31 -0
- package/dist/components/atoms/Multiselect/index.js +275 -0
- package/dist/components/atoms/Multiselect/styles.js +18 -0
- package/dist/components/atoms/TabSection/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +57 -72
- package/dist/components/pages/ProviderProductEdition/index.js +17 -13
- package/package.json +1 -1
- package/src/assets/images/Icons/search.svg +3 -0
- package/src/assets/images/Icons/settings.svg +8 -0
- package/src/components/atoms/Multiselect/Multiselect.stories.js +17 -0
- package/src/components/atoms/Multiselect/index.js +234 -0
- package/src/components/atoms/Multiselect/styles.js +29 -0
- package/src/components/atoms/TabSection/styles.js +1 -4
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +72 -95
- package/src/components/pages/ProviderProductEdition/index.js +4 -2
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M11.2667 12L6.88333 7.61667C6.55 7.90556 6.16134 8.13056 5.71735 8.29167C5.27336 8.45278 4.80091 8.53333 4.3 8.53333C3.0982 8.53333 2.08108 8.11667 1.24865 7.28333C0.416217 6.45 0 5.44444 0 4.26667C0 3.08889 0.416667 2.08333 1.25 1.25C2.08333 0.416667 3.09167 0 4.275 0C5.45833 0 6.46389 0.416667 7.29167 1.25C8.11944 2.08333 8.53333 3.08972 8.53333 4.26917C8.53333 4.74528 8.45556 5.20556 8.3 5.65C8.14444 6.09444 7.91111 6.51111 7.6 6.9L12 11.2667L11.2667 12ZM4.28333 7.53333C5.18611 7.53333 5.95347 7.21389 6.58542 6.575C7.21736 5.93611 7.53333 5.16667 7.53333 4.26667C7.53333 3.36667 7.21736 2.59722 6.58542 1.95833C5.95347 1.31944 5.18611 1 4.28333 1C3.3713 1 2.59607 1.31944 1.95763 1.95833C1.31921 2.59722 1 3.36667 1 4.26667C1 5.16667 1.31921 5.93611 1.95763 6.575C2.59607 7.21389 3.3713 7.53333 4.28333 7.53333Z" fill="#707070"/>
|
|
3
|
+
</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_801_1360" 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_801_1360)">
|
|
6
|
+
<path d="M4.62 12L4.32 10.11C4.13 10.04 3.93 9.945 3.72 9.825C3.51 9.705 3.325 9.58 3.165 9.45L1.395 10.26L0 7.8L1.62 6.615C1.6 6.525 1.5875 6.4225 1.5825 6.3075C1.5775 6.1925 1.575 6.09 1.575 6C1.575 5.91 1.5775 5.8075 1.5825 5.6925C1.5875 5.5775 1.6 5.475 1.62 5.385L0 4.2L1.395 1.74L3.165 2.55C3.325 2.42 3.51 2.295 3.72 2.175C3.93 2.055 4.13 1.965 4.32 1.905L4.62 0H7.38L7.68 1.89C7.87 1.96 8.0725 2.0525 8.2875 2.1675C8.5025 2.2825 8.685 2.41 8.835 2.55L10.605 1.74L12 4.2L10.38 5.355C10.4 5.455 10.4125 5.5625 10.4175 5.6775C10.4225 5.7925 10.425 5.9 10.425 6C10.425 6.1 10.4225 6.205 10.4175 6.315C10.4125 6.425 10.4 6.53 10.38 6.63L12 7.8L10.605 10.26L8.835 9.45C8.675 9.58 8.4925 9.7075 8.2875 9.8325C8.0825 9.9575 7.88 10.05 7.68 10.11L7.38 12H4.62ZM5.34 11.1H6.66L6.87 9.42C7.2 9.34 7.5125 9.215 7.8075 9.045C8.1025 8.875 8.37 8.67 8.61 8.43L10.2 9.12L10.8 8.04L9.39 7.005C9.43 6.835 9.4625 6.6675 9.4875 6.5025C9.5125 6.3375 9.525 6.17 9.525 6C9.525 5.83 9.515 5.6625 9.495 5.4975C9.475 5.3325 9.44 5.165 9.39 4.995L10.8 3.96L10.2 2.88L8.61 3.57C8.38 3.31 8.12 3.0925 7.83 2.9175C7.54 2.7425 7.22 2.63 6.87 2.58L6.66 0.9H5.34L5.13 2.58C4.79 2.65 4.4725 2.77 4.1775 2.94C3.8825 3.11 3.62 3.32 3.39 3.57L1.8 2.88L1.2 3.96L2.61 4.995C2.57 5.165 2.5375 5.3325 2.5125 5.4975C2.4875 5.6625 2.475 5.83 2.475 6C2.475 6.17 2.4875 6.3375 2.5125 6.5025C2.5375 6.6675 2.57 6.835 2.61 7.005L1.2 8.04L1.8 9.12L3.39 8.43C3.63 8.67 3.8975 8.875 4.1925 9.045C4.4875 9.215 4.8 9.34 5.13 9.42L5.34 11.1ZM6 7.95C6.54 7.95 7 7.76 7.38 7.38C7.76 7 7.95 6.54 7.95 6C7.95 5.46 7.76 5 7.38 4.62C7 4.24 6.54 4.05 6 4.05C5.46 4.05 5 4.24 4.62 4.62C4.24 5 4.05 5.46 4.05 6C4.05 6.54 4.24 7 4.62 7.38C5 7.76 5.46 7.95 6 7.95Z" fill="#E33AA9"/>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.MultiselectDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: "Components/atoms/Multiselect",
|
|
18
|
+
component: _index.Multiselect,
|
|
19
|
+
argTypes: {}
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
22
|
+
|
|
23
|
+
var Template = function Template(args) {
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Multiselect, (0, _objectSpread2.default)({}, args));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var MultiselectDefault = Template.bind({});
|
|
28
|
+
exports.MultiselectDefault = MultiselectDefault;
|
|
29
|
+
MultiselectDefault.args = {
|
|
30
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIxZmFjNjY2Ny1hMDMzLTQ1NjAtOWU5ZC01MTQwMDc2MmI2MWYiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjFmYWM2NjY3LWEwMzMtNDU2MC05ZTlkLTUxNDAwNzYyYjYxZiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI1YjFkNTAxMS1mZjYxLTQ5ZDUtYjQ1Mi05MWY4YWFjMzc2NjciLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcwNDI5NjI1MywibmFtZSI6IlJhZGlvc2NoYWNrIE9uYm9hcmRpbmciLCJwaG9uZV9udW1iZXIiOiIrNTIxMjM0NTY3ODk4IiwiZXhwIjoxNzA0Mjk5ODUzLCJpYXQiOjE3MDQyOTYyNTMsImVtYWlsIjoicmFkaW9zaGFja2Ryb3BzaGlwQGFsbGZyZWVtYWlsLm5ldCJ9.jxuawcG-ktvnugT2_bJnHbj6JFn5OEY5ehBxI5mQNVkY92CAvzVud5LLMTfhis7FtctJGWY49-iP2IQJQZM-D7nmySieEyIlgl0jeZsmEFUIpXF5y6IjGVdVpM5I7BKwAJeZbk80tgz1FHEJO_U1RKlXc88roNJK9ZZRHXO795Ilk4DH1wN1HPPtmSSBF7kAUSpolWcywNyg2o-7hUfmxu8UDJ3gYaOq2IkKjD2efQkw7PwBIzCobGYQfoWAo8QaQo-lbxh5SGcC33Qtu-T8Abk-Cm8AGCkKyDiX5ml4FbPnsCf-ND_1-lPWOY6z0n1YPf8ow32l0Aa0eOhdphsnPg"
|
|
31
|
+
};
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.Multiselect = void 0;
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
13
|
+
|
|
14
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
15
|
+
|
|
16
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
17
|
+
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
20
|
+
var _styles = require("./styles");
|
|
21
|
+
|
|
22
|
+
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
23
|
+
|
|
24
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
25
|
+
|
|
26
|
+
var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
|
|
27
|
+
|
|
28
|
+
var _ListItemText = _interopRequireDefault(require("@mui/material/ListItemText"));
|
|
29
|
+
|
|
30
|
+
var _OutlinedInput = _interopRequireDefault(require("@mui/material/OutlinedInput"));
|
|
31
|
+
|
|
32
|
+
var _EditGroup = require("../../organisms/EditGroup");
|
|
33
|
+
|
|
34
|
+
var _search = _interopRequireDefault(require("../../../assets/images/Icons/search.svg"));
|
|
35
|
+
|
|
36
|
+
var _settings = _interopRequireDefault(require("../../../assets/images/Icons/settings.svg"));
|
|
37
|
+
|
|
38
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
39
|
+
|
|
40
|
+
//styles
|
|
41
|
+
//components
|
|
42
|
+
//svg
|
|
43
|
+
var Multiselect = function Multiselect(_ref) {
|
|
44
|
+
var arrayData = _ref.arrayData,
|
|
45
|
+
token = _ref.token,
|
|
46
|
+
showSearchBar = _ref.showSearchBar,
|
|
47
|
+
_ref$placeHolder = _ref.placeHolder,
|
|
48
|
+
placeHolder = _ref$placeHolder === void 0 ? "Buscar grupo" : _ref$placeHolder,
|
|
49
|
+
_ref$textButton = _ref.textButton,
|
|
50
|
+
textButton = _ref$textButton === void 0 ? "Editar grupos" : _ref$textButton;
|
|
51
|
+
|
|
52
|
+
var _useState = (0, _react.useState)(null),
|
|
53
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
54
|
+
userData = _useState2[0],
|
|
55
|
+
setUserData = _useState2[1];
|
|
56
|
+
|
|
57
|
+
var _useState3 = (0, _react.useState)(null),
|
|
58
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
59
|
+
groups = _useState4[0],
|
|
60
|
+
setGroups = _useState4[1];
|
|
61
|
+
|
|
62
|
+
var _useState5 = (0, _react.useState)([]),
|
|
63
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
64
|
+
selectValues = _useState6[0],
|
|
65
|
+
setSelectValues = _useState6[1];
|
|
66
|
+
|
|
67
|
+
var _useState7 = (0, _react.useState)(""),
|
|
68
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
69
|
+
text = _useState8[0],
|
|
70
|
+
setText = _useState8[1];
|
|
71
|
+
|
|
72
|
+
var _useState9 = (0, _react.useState)(false),
|
|
73
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
74
|
+
isEditGroupVisible = _useState10[0],
|
|
75
|
+
setIsEditGroupVisible = _useState10[1];
|
|
76
|
+
|
|
77
|
+
var _useState11 = (0, _react.useState)(true),
|
|
78
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
79
|
+
isItemListVisible = _useState12[0],
|
|
80
|
+
setIsItemListVisible = _useState12[1];
|
|
81
|
+
|
|
82
|
+
var onChange = function onChange(evt) {
|
|
83
|
+
setText(evt.target.value);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
var handleChange = function handleChange(userId) {
|
|
87
|
+
return function (event) {
|
|
88
|
+
var value = event.target.value;
|
|
89
|
+
var updatedValues = value.filter(function (group) {
|
|
90
|
+
var groupInfo = groups.find(function (g) {
|
|
91
|
+
return g.groupName === group;
|
|
92
|
+
});
|
|
93
|
+
return groupInfo && groupInfo.userContentGroup === 1;
|
|
94
|
+
});
|
|
95
|
+
setSelectValues(function (prevValues) {
|
|
96
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prevValues), {}, (0, _defineProperty2.default)({}, userId, updatedValues));
|
|
97
|
+
});
|
|
98
|
+
setIsCheckboxChecked(updatedValues.length > 0);
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
(0, _react.useEffect)(function () {
|
|
103
|
+
var filteredArray = (groups === null || groups === void 0 ? void 0 : groups.slice()) || [];
|
|
104
|
+
|
|
105
|
+
if (text.length > 0) {
|
|
106
|
+
filteredArray = filteredArray.filter(function (option) {
|
|
107
|
+
return option === null || option === void 0 ? void 0 : option.name.toLowerCase().includes(text.toLocaleLowerCase());
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}, [text]);
|
|
111
|
+
(0, _react.useEffect)(function () {
|
|
112
|
+
console.log("userData", userData);
|
|
113
|
+
}, [userData]);
|
|
114
|
+
(0, _react.useEffect)(function () {
|
|
115
|
+
console.log("groups", groups);
|
|
116
|
+
}, [groups]);
|
|
117
|
+
var ITEM_HEIGHT = 48;
|
|
118
|
+
var ITEM_PADDING_TOP = 8;
|
|
119
|
+
var MenuProps = {
|
|
120
|
+
PaperProps: {
|
|
121
|
+
style: {
|
|
122
|
+
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
|
|
123
|
+
width: 250,
|
|
124
|
+
display: isItemListVisible ? "block" : "none"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
129
|
+
children: [arrayData.map(function (user) {
|
|
130
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
131
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
132
|
+
children: user.idUser
|
|
133
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
134
|
+
children: user.userName
|
|
135
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Select.default, {
|
|
136
|
+
labelId: "demo-multiple-checkbox-label-".concat(user.idUser),
|
|
137
|
+
id: "demo-multiple-checkbox-".concat(user.idUser),
|
|
138
|
+
multiple: true,
|
|
139
|
+
value: selectValues[user.idUser] || [],
|
|
140
|
+
onChange: handleChange(user.idUser),
|
|
141
|
+
input: /*#__PURE__*/(0, _jsxRuntime.jsx)(_OutlinedInput.default, {
|
|
142
|
+
sx: {
|
|
143
|
+
width: "80%",
|
|
144
|
+
height: "34px",
|
|
145
|
+
paddingBottom: "1px solid #F0F0F0"
|
|
146
|
+
}
|
|
147
|
+
}),
|
|
148
|
+
renderValue: function renderValue(selected) {
|
|
149
|
+
return selected.join(", ");
|
|
150
|
+
},
|
|
151
|
+
MenuProps: MenuProps,
|
|
152
|
+
sx: {
|
|
153
|
+
width: "80%",
|
|
154
|
+
height: "24px"
|
|
155
|
+
},
|
|
156
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
|
|
157
|
+
sx: {
|
|
158
|
+
maxHeight: "34px",
|
|
159
|
+
paddingLeft: "10px",
|
|
160
|
+
"& .search-bar-filter": {
|
|
161
|
+
display: "flex",
|
|
162
|
+
gap: "10px",
|
|
163
|
+
input: {
|
|
164
|
+
border: "none",
|
|
165
|
+
background: "transparent",
|
|
166
|
+
"::placeholder": {
|
|
167
|
+
fontSize: "12px",
|
|
168
|
+
color: "#CBCBCB"
|
|
169
|
+
},
|
|
170
|
+
":focus-visible, :hover": {
|
|
171
|
+
border: "none",
|
|
172
|
+
background: "transparent",
|
|
173
|
+
outline: "none"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
":focus-visible, :hover": {
|
|
177
|
+
background: "transparent"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
children: showSearchBar && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
182
|
+
className: "search-bar-filter",
|
|
183
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
184
|
+
src: _search.default,
|
|
185
|
+
alt: "search icon"
|
|
186
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
187
|
+
type: "text",
|
|
188
|
+
placeholder: placeHolder,
|
|
189
|
+
value: text,
|
|
190
|
+
onChange: onChange
|
|
191
|
+
})]
|
|
192
|
+
})
|
|
193
|
+
}), console.log("usuario", user.idUser, "grupos", user.groups), user.groups && user.groups.filter(function (group) {
|
|
194
|
+
return group.groupId !== "Sin id";
|
|
195
|
+
}).map(function (group) {
|
|
196
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MenuItem.default, {
|
|
197
|
+
value: group.groupName,
|
|
198
|
+
sx: {
|
|
199
|
+
paddingLeft: "0px",
|
|
200
|
+
maxHeight: "34px",
|
|
201
|
+
":focus-visible, :hover": {
|
|
202
|
+
border: "none",
|
|
203
|
+
background: "transparent"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
|
|
207
|
+
checked: (selectValues[user.idUser] || []).indexOf(group.groupName) > -1 && group.userContentGroup === 1,
|
|
208
|
+
sx: {
|
|
209
|
+
maxHeight: "34px",
|
|
210
|
+
"&.Mui-checked": {
|
|
211
|
+
color: "#85BC5B"
|
|
212
|
+
},
|
|
213
|
+
"input, svg": {
|
|
214
|
+
maxWidth: "12px",
|
|
215
|
+
maxHeight: "12px"
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}), console.log("nombre grupo", group.groupName), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemText.default, {
|
|
219
|
+
primary: group.groupName,
|
|
220
|
+
sx: {
|
|
221
|
+
span: {
|
|
222
|
+
fontSize: "12px",
|
|
223
|
+
color: "#000000"
|
|
224
|
+
},
|
|
225
|
+
"input, svg": {
|
|
226
|
+
maxWidth: "12px",
|
|
227
|
+
maxHeight: "12px"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
})]
|
|
231
|
+
}, group.groupId);
|
|
232
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
|
|
233
|
+
sx: {
|
|
234
|
+
minHeight: "34px",
|
|
235
|
+
paddingLeft: "10px",
|
|
236
|
+
".btn-edit": {
|
|
237
|
+
color: "#E33AA9",
|
|
238
|
+
border: "none",
|
|
239
|
+
background: "transparent",
|
|
240
|
+
display: "flex",
|
|
241
|
+
gap: "10px",
|
|
242
|
+
alignItems: "center"
|
|
243
|
+
},
|
|
244
|
+
":focus-visible, :hover": {
|
|
245
|
+
border: "none",
|
|
246
|
+
background: "transparent"
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
250
|
+
className: "btn-edit",
|
|
251
|
+
onClick: function onClick() {
|
|
252
|
+
setIsItemListVisible(false);
|
|
253
|
+
setIsEditGroupVisible(true);
|
|
254
|
+
},
|
|
255
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
256
|
+
src: _settings.default,
|
|
257
|
+
className: "icon",
|
|
258
|
+
alt: "search icon"
|
|
259
|
+
}), textButton]
|
|
260
|
+
})
|
|
261
|
+
})]
|
|
262
|
+
})]
|
|
263
|
+
});
|
|
264
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_EditGroup.EditGroup, {
|
|
265
|
+
token: token,
|
|
266
|
+
show: isEditGroupVisible,
|
|
267
|
+
onClose: function onClose() {
|
|
268
|
+
setIsEditGroupVisible(false);
|
|
269
|
+
setIsItemListVisible(true);
|
|
270
|
+
}
|
|
271
|
+
})]
|
|
272
|
+
});
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
exports.Multiselect = Multiselect;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _templateObject;
|
|
15
|
+
|
|
16
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width:100%;\n height:auto;\n .search-bar-filter {\n display: flex;\n align-items: center;\n border: 1px solid #f0f0f0;\n padding-left: 10px;\n \n img {\n width: 15px;\n height: 15px;\n }\n \n input {\n background-color: transparent;\n padding: 10px 10px;\n outline: none;\n border: none;\n }\n }\n\n img.icon{\n width: 15px;\n height: 15px;\n }\n"])));
|
|
17
|
+
|
|
18
|
+
exports.Container = Container;
|
|
@@ -15,6 +15,6 @@ var _variables = require("../../../global-files/variables");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n font-family: ", ";\n color: ", ";\n font-size: 14px;\n line-height: 21px;\n border-bottom: 2px solid ", ";\n width: 149px;\n padding-bottom: 5px;\n transition: 0.1s all;\n cursor: pointer;\n
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n font-family: ", ";\n color: ", ";\n font-size: 14px;\n line-height: 21px;\n border-bottom: 2px solid ", ";\n width: 149px;\n padding-bottom: 5px;\n transition: 0.1s all;\n cursor: pointer;\n &.active {\n font-size: 18px;\n border-bottom: 2px solid ", ";\n }\n & + * {\n margin-left: 10px;\n }\n"])), _variables.FontFamily.Raleway_500, _variables.GlobalColors.s5, _variables.GlobalColors.s3, _variables.GlobalColors.magenta_s2);
|
|
19
19
|
|
|
20
20
|
exports.Container = Container;
|
|
@@ -27,8 +27,8 @@ var ProviderProductEditionDefault = Template.bind({});
|
|
|
27
27
|
exports.ProviderProductEditionDefault = ProviderProductEditionDefault;
|
|
28
28
|
ProviderProductEditionDefault.args = {
|
|
29
29
|
tabsSections: {
|
|
30
|
-
Descripción:
|
|
31
|
-
"Ficha técnica":
|
|
30
|
+
Descripción: false,
|
|
31
|
+
"Ficha técnica": true,
|
|
32
32
|
Imágenes: false
|
|
33
33
|
},
|
|
34
34
|
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIyM2Q1NTlmYi1jMzIwLTRhMjItYjJmNy1lOThhYTFhZGEyNmYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MzkyNjgyMSwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2ODM5MzA0MjEsImlhdCI6MTY4MzkyNjgyMSwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.TvCoaKoctj5mypXWMz3NyV1Vm1ToBV0vJmpVyZSQw4-ikTChkxcZ5tFYvqhk1GdvNCFttfSQIqM-14dAYYBc28YwwKP86gqOuzB1fG41rN5x1Yx3tkJq6hiVRgiBbSHWtThA9c8VnxNQbrJiaRTvvkDiM5KNTEst1oxQHL5Ct9_iKQMJMRFie7Xv0xnyS0qZ6QHK4Q2A9OHsnDkAuumALZJcE19Zh6VgSitgWrZiz3x5Text4Q-U-R48NUAzUFirAzYZzJN_fCme5pGf1AnUaZjeUjPsmrV5TBVzPEYwXO0KG8lYjL8id80D7tbGs28ZIK6B4rf3-eqI_ngmBB4CjQ",
|
|
@@ -36,45 +36,38 @@ ProviderProductEditionDefault.args = {
|
|
|
36
36
|
category: 287,
|
|
37
37
|
version: 1,
|
|
38
38
|
productSelected: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
upc: "Modelo6",
|
|
46
|
-
isVisible: 1,
|
|
47
|
-
retailers: [{
|
|
48
|
-
id: 68,
|
|
49
|
-
name: "The Home Depot Onboarding"
|
|
50
|
-
}],
|
|
39
|
+
id_article: 121067,
|
|
40
|
+
upc: "2342341",
|
|
41
|
+
name: "asd",
|
|
42
|
+
timestamp: "2024-01-03T19:42:59.000Z",
|
|
43
|
+
categoryName: "Abarrotes|Abarrotes Secos|Alimentos Deshidratados",
|
|
44
|
+
id_category: 4,
|
|
51
45
|
version: 1,
|
|
46
|
+
value: null,
|
|
52
47
|
retailersAvailable: [{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}]
|
|
48
|
+
"name": "Walmart Marketplace",
|
|
49
|
+
"id": 75
|
|
50
|
+
}],
|
|
51
|
+
percentage: 1.33
|
|
56
52
|
},
|
|
57
53
|
productToEdit: {
|
|
58
|
-
idCategory:
|
|
59
|
-
ArticleId:
|
|
54
|
+
idCategory: 4,
|
|
55
|
+
ArticleId: 121067,
|
|
60
56
|
product: [{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
upc: "Modelo6",
|
|
68
|
-
isVisible: 1,
|
|
69
|
-
retailers: [{
|
|
70
|
-
id: 68,
|
|
71
|
-
name: "The Home Depot Onboarding"
|
|
72
|
-
}],
|
|
57
|
+
id_article: 121067,
|
|
58
|
+
upc: "2342341",
|
|
59
|
+
name: "asd",
|
|
60
|
+
timestamp: "2024-01-03T19:42:59.000Z",
|
|
61
|
+
categoryName: "Abarrotes|Abarrotes Secos|Alimentos Deshidratados",
|
|
62
|
+
id_category: 4,
|
|
73
63
|
version: 1,
|
|
64
|
+
value: null,
|
|
74
65
|
retailersAvailable: [{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
66
|
+
name: "Walmart Marketplace",
|
|
67
|
+
id: 75,
|
|
68
|
+
percentage: 1.33
|
|
69
|
+
}],
|
|
70
|
+
percentage: 1.33
|
|
78
71
|
}]
|
|
79
72
|
},
|
|
80
73
|
location: {
|
|
@@ -89,30 +82,30 @@ ProviderProductEditionDefault.args = {
|
|
|
89
82
|
key: "24vwut"
|
|
90
83
|
},
|
|
91
84
|
user: {
|
|
92
|
-
id_user:
|
|
93
|
-
name: "
|
|
94
|
-
last_name: "
|
|
95
|
-
email: "
|
|
96
|
-
position: "Test",
|
|
97
|
-
telephone: "+
|
|
85
|
+
id_user: 28,
|
|
86
|
+
name: "Ismael",
|
|
87
|
+
last_name: "López",
|
|
88
|
+
email: "ilopez@contentoh.com",
|
|
89
|
+
position: "Test States",
|
|
90
|
+
telephone: "+523111366336",
|
|
98
91
|
country: "México",
|
|
99
|
-
id_company:
|
|
100
|
-
id_cognito: "
|
|
92
|
+
id_company: 1,
|
|
93
|
+
id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
|
|
101
94
|
birth_Date: null,
|
|
102
|
-
about_me:
|
|
103
|
-
zip_code:
|
|
104
|
-
address:
|
|
105
|
-
job:
|
|
106
|
-
id_stripe:
|
|
95
|
+
about_me: "",
|
|
96
|
+
zip_code: "",
|
|
97
|
+
address: "",
|
|
98
|
+
job: "",
|
|
99
|
+
id_stripe: "cus_KuEt6R6vwmN09f",
|
|
107
100
|
id_role: 0,
|
|
108
101
|
active: 1,
|
|
109
102
|
is_retailer: 0,
|
|
110
103
|
email_notify: 1,
|
|
111
|
-
is_user_tech:
|
|
104
|
+
is_user_tech: "ADMIN-AS",
|
|
112
105
|
membership: {
|
|
113
|
-
id:
|
|
114
|
-
start_date: "
|
|
115
|
-
end_date: "
|
|
106
|
+
id: 76,
|
|
107
|
+
start_date: "2022-01-18T17:25:35.000Z",
|
|
108
|
+
end_date: "2023-01-18T17:25:35.000Z",
|
|
116
109
|
planID: 8,
|
|
117
110
|
plan: "prod_KtlhECVSFG2iro",
|
|
118
111
|
name: "Plan Pro",
|
|
@@ -120,31 +113,23 @@ ProviderProductEditionDefault.args = {
|
|
|
120
113
|
products_limit: "5000",
|
|
121
114
|
type: "Enterprise"
|
|
122
115
|
},
|
|
123
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
116
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1704310718113"
|
|
124
117
|
},
|
|
125
118
|
company: {
|
|
126
|
-
id_company:
|
|
127
|
-
trade_name: "
|
|
128
|
-
company_name: "
|
|
129
|
-
rfc: "
|
|
130
|
-
adress: "
|
|
131
|
-
about_company:
|
|
132
|
-
telephone:
|
|
133
|
-
web_site:
|
|
134
|
-
zip_code:
|
|
119
|
+
id_company: 1,
|
|
120
|
+
trade_name: "GRUPO BRAHMA",
|
|
121
|
+
company_name: "GRUPO BRAHMA",
|
|
122
|
+
rfc: "XAXX010101000",
|
|
123
|
+
adress: "AA",
|
|
124
|
+
about_company: "",
|
|
125
|
+
telephone: "",
|
|
126
|
+
web_site: "",
|
|
127
|
+
zip_code: "",
|
|
135
128
|
email: null,
|
|
136
|
-
social_link:
|
|
129
|
+
social_link: "",
|
|
137
130
|
is_retailer: 0,
|
|
138
|
-
financedRetailers: [
|
|
139
|
-
|
|
140
|
-
name: "The Home Depot Onboarding",
|
|
141
|
-
country: "México"
|
|
142
|
-
}],
|
|
143
|
-
retailers: [{
|
|
144
|
-
id: 68,
|
|
145
|
-
name: "The Home Depot Onboarding",
|
|
146
|
-
country: "México"
|
|
147
|
-
}]
|
|
131
|
+
financedRetailers: [],
|
|
132
|
+
retailers: []
|
|
148
133
|
},
|
|
149
134
|
showSurvey: function showSurvey(v) {
|
|
150
135
|
return v && alert("se muestra");
|
|
@@ -280,7 +280,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
280
280
|
showModal = _useState14[0],
|
|
281
281
|
setShowModal = _useState14[1];
|
|
282
282
|
|
|
283
|
-
var _useState15 = (0, _react.useState)(),
|
|
283
|
+
var _useState15 = (0, _react.useState)({}),
|
|
284
284
|
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
285
285
|
boxData = _useState16[0],
|
|
286
286
|
setBoxData = _useState16[1];
|
|
@@ -1271,43 +1271,47 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1271
1271
|
}, parseBoxData.length > 0 && {
|
|
1272
1272
|
boxData: parseBoxData
|
|
1273
1273
|
});
|
|
1274
|
+
console.log({
|
|
1275
|
+
dataObject: dataObject
|
|
1276
|
+
});
|
|
1277
|
+
console.log(product === null || product === void 0 ? void 0 : product.orderId);
|
|
1274
1278
|
if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
|
|
1275
|
-
_context12.prev =
|
|
1276
|
-
_context12.next =
|
|
1279
|
+
_context12.prev = 6;
|
|
1280
|
+
_context12.next = 9;
|
|
1277
1281
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
|
|
1278
1282
|
headers: {
|
|
1279
1283
|
Authorization: token
|
|
1280
1284
|
}
|
|
1281
1285
|
});
|
|
1282
1286
|
|
|
1283
|
-
case
|
|
1287
|
+
case 9:
|
|
1284
1288
|
res = _context12.sent;
|
|
1285
1289
|
|
|
1286
1290
|
if (!(res.data.statusCode === 200)) {
|
|
1287
|
-
_context12.next =
|
|
1291
|
+
_context12.next = 15;
|
|
1288
1292
|
break;
|
|
1289
1293
|
}
|
|
1290
1294
|
|
|
1291
1295
|
setUpdatedDatasheets([]);
|
|
1292
1296
|
setMessage("Fichas técnicas guardadas");
|
|
1293
|
-
_context12.next =
|
|
1297
|
+
_context12.next = 15;
|
|
1294
1298
|
return loadData();
|
|
1295
1299
|
|
|
1296
|
-
case
|
|
1297
|
-
_context12.next =
|
|
1300
|
+
case 15:
|
|
1301
|
+
_context12.next = 20;
|
|
1298
1302
|
break;
|
|
1299
1303
|
|
|
1300
|
-
case
|
|
1301
|
-
_context12.prev =
|
|
1302
|
-
_context12.t0 = _context12["catch"](
|
|
1304
|
+
case 17:
|
|
1305
|
+
_context12.prev = 17;
|
|
1306
|
+
_context12.t0 = _context12["catch"](6);
|
|
1303
1307
|
console.log(_context12.t0);
|
|
1304
1308
|
|
|
1305
|
-
case
|
|
1309
|
+
case 20:
|
|
1306
1310
|
case "end":
|
|
1307
1311
|
return _context12.stop();
|
|
1308
1312
|
}
|
|
1309
1313
|
}
|
|
1310
|
-
}, _callee12, null, [[
|
|
1314
|
+
}, _callee12, null, [[6, 17]]);
|
|
1311
1315
|
}));
|
|
1312
1316
|
|
|
1313
1317
|
return function saveDatasheets() {
|
package/package.json
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M11.2667 12L6.88333 7.61667C6.55 7.90556 6.16134 8.13056 5.71735 8.29167C5.27336 8.45278 4.80091 8.53333 4.3 8.53333C3.0982 8.53333 2.08108 8.11667 1.24865 7.28333C0.416217 6.45 0 5.44444 0 4.26667C0 3.08889 0.416667 2.08333 1.25 1.25C2.08333 0.416667 3.09167 0 4.275 0C5.45833 0 6.46389 0.416667 7.29167 1.25C8.11944 2.08333 8.53333 3.08972 8.53333 4.26917C8.53333 4.74528 8.45556 5.20556 8.3 5.65C8.14444 6.09444 7.91111 6.51111 7.6 6.9L12 11.2667L11.2667 12ZM4.28333 7.53333C5.18611 7.53333 5.95347 7.21389 6.58542 6.575C7.21736 5.93611 7.53333 5.16667 7.53333 4.26667C7.53333 3.36667 7.21736 2.59722 6.58542 1.95833C5.95347 1.31944 5.18611 1 4.28333 1C3.3713 1 2.59607 1.31944 1.95763 1.95833C1.31921 2.59722 1 3.36667 1 4.26667C1 5.16667 1.31921 5.93611 1.95763 6.575C2.59607 7.21389 3.3713 7.53333 4.28333 7.53333Z" fill="#707070"/>
|
|
3
|
+
</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_801_1360" 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_801_1360)">
|
|
6
|
+
<path d="M4.62 12L4.32 10.11C4.13 10.04 3.93 9.945 3.72 9.825C3.51 9.705 3.325 9.58 3.165 9.45L1.395 10.26L0 7.8L1.62 6.615C1.6 6.525 1.5875 6.4225 1.5825 6.3075C1.5775 6.1925 1.575 6.09 1.575 6C1.575 5.91 1.5775 5.8075 1.5825 5.6925C1.5875 5.5775 1.6 5.475 1.62 5.385L0 4.2L1.395 1.74L3.165 2.55C3.325 2.42 3.51 2.295 3.72 2.175C3.93 2.055 4.13 1.965 4.32 1.905L4.62 0H7.38L7.68 1.89C7.87 1.96 8.0725 2.0525 8.2875 2.1675C8.5025 2.2825 8.685 2.41 8.835 2.55L10.605 1.74L12 4.2L10.38 5.355C10.4 5.455 10.4125 5.5625 10.4175 5.6775C10.4225 5.7925 10.425 5.9 10.425 6C10.425 6.1 10.4225 6.205 10.4175 6.315C10.4125 6.425 10.4 6.53 10.38 6.63L12 7.8L10.605 10.26L8.835 9.45C8.675 9.58 8.4925 9.7075 8.2875 9.8325C8.0825 9.9575 7.88 10.05 7.68 10.11L7.38 12H4.62ZM5.34 11.1H6.66L6.87 9.42C7.2 9.34 7.5125 9.215 7.8075 9.045C8.1025 8.875 8.37 8.67 8.61 8.43L10.2 9.12L10.8 8.04L9.39 7.005C9.43 6.835 9.4625 6.6675 9.4875 6.5025C9.5125 6.3375 9.525 6.17 9.525 6C9.525 5.83 9.515 5.6625 9.495 5.4975C9.475 5.3325 9.44 5.165 9.39 4.995L10.8 3.96L10.2 2.88L8.61 3.57C8.38 3.31 8.12 3.0925 7.83 2.9175C7.54 2.7425 7.22 2.63 6.87 2.58L6.66 0.9H5.34L5.13 2.58C4.79 2.65 4.4725 2.77 4.1775 2.94C3.8825 3.11 3.62 3.32 3.39 3.57L1.8 2.88L1.2 3.96L2.61 4.995C2.57 5.165 2.5375 5.3325 2.5125 5.4975C2.4875 5.6625 2.475 5.83 2.475 6C2.475 6.17 2.4875 6.3375 2.5125 6.5025C2.5375 6.6675 2.57 6.835 2.61 7.005L1.2 8.04L1.8 9.12L3.39 8.43C3.63 8.67 3.8975 8.875 4.1925 9.045C4.4875 9.215 4.8 9.34 5.13 9.42L5.34 11.1ZM6 7.95C6.54 7.95 7 7.76 7.38 7.38C7.76 7 7.95 6.54 7.95 6C7.95 5.46 7.76 5 7.38 4.62C7 4.24 6.54 4.05 6 4.05C5.46 4.05 5 4.24 4.62 4.62C4.24 5 4.05 5.46 4.05 6C4.05 6.54 4.24 7 4.62 7.38C5 7.76 5.46 7.95 6 7.95Z" fill="#E33AA9"/>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Multiselect } from "./index";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/atoms/Multiselect",
|
|
5
|
+
component: Multiselect,
|
|
6
|
+
argTypes: {
|
|
7
|
+
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const Template = (args) => <Multiselect {...args} />;
|
|
12
|
+
|
|
13
|
+
export const MultiselectDefault = Template.bind({});
|
|
14
|
+
|
|
15
|
+
MultiselectDefault.args = {
|
|
16
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIxZmFjNjY2Ny1hMDMzLTQ1NjAtOWU5ZC01MTQwMDc2MmI2MWYiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjFmYWM2NjY3LWEwMzMtNDU2MC05ZTlkLTUxNDAwNzYyYjYxZiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI1YjFkNTAxMS1mZjYxLTQ5ZDUtYjQ1Mi05MWY4YWFjMzc2NjciLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcwNDI5NjI1MywibmFtZSI6IlJhZGlvc2NoYWNrIE9uYm9hcmRpbmciLCJwaG9uZV9udW1iZXIiOiIrNTIxMjM0NTY3ODk4IiwiZXhwIjoxNzA0Mjk5ODUzLCJpYXQiOjE3MDQyOTYyNTMsImVtYWlsIjoicmFkaW9zaGFja2Ryb3BzaGlwQGFsbGZyZWVtYWlsLm5ldCJ9.jxuawcG-ktvnugT2_bJnHbj6JFn5OEY5ehBxI5mQNVkY92CAvzVud5LLMTfhis7FtctJGWY49-iP2IQJQZM-D7nmySieEyIlgl0jeZsmEFUIpXF5y6IjGVdVpM5I7BKwAJeZbk80tgz1FHEJO_U1RKlXc88roNJK9ZZRHXO795Ilk4DH1wN1HPPtmSSBF7kAUSpolWcywNyg2o-7hUfmxu8UDJ3gYaOq2IkKjD2efQkw7PwBIzCobGYQfoWAo8QaQo-lbxh5SGcC33Qtu-T8Abk-Cm8AGCkKyDiX5ml4FbPnsCf-ND_1-lPWOY6z0n1YPf8ow32l0Aa0eOhdphsnPg",
|
|
17
|
+
};
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
//styles
|
|
3
|
+
import { Container } from "./styles";
|
|
4
|
+
//components
|
|
5
|
+
import Select from "@mui/material/Select";
|
|
6
|
+
import MenuItem from "@mui/material/MenuItem";
|
|
7
|
+
import Checkbox from "@mui/material/Checkbox";
|
|
8
|
+
import ListItemText from "@mui/material/ListItemText";
|
|
9
|
+
import OutlinedInput from "@mui/material/OutlinedInput";
|
|
10
|
+
import { EditGroup } from "../../organisms/EditGroup";
|
|
11
|
+
|
|
12
|
+
//svg
|
|
13
|
+
import searchIcon from "../../../assets/images/Icons/search.svg";
|
|
14
|
+
import settings from "../../../assets/images/Icons/settings.svg";
|
|
15
|
+
|
|
16
|
+
export const Multiselect = ({
|
|
17
|
+
arrayData,
|
|
18
|
+
token,
|
|
19
|
+
showSearchBar,
|
|
20
|
+
placeHolder = "Buscar grupo",
|
|
21
|
+
textButton = "Editar grupos",
|
|
22
|
+
}) => {
|
|
23
|
+
const [userData, setUserData] = useState(null);
|
|
24
|
+
const [groups, setGroups] = useState(null);
|
|
25
|
+
const [selectValues, setSelectValues] = useState([]);
|
|
26
|
+
const [text, setText] = useState("");
|
|
27
|
+
const [isEditGroupVisible, setIsEditGroupVisible] = useState(false);
|
|
28
|
+
const [isItemListVisible, setIsItemListVisible] = useState(true);
|
|
29
|
+
|
|
30
|
+
const onChange = (evt) => {
|
|
31
|
+
setText(evt.target.value);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
const handleChange = (userId) => (event) => {
|
|
36
|
+
const {
|
|
37
|
+
target: { value },
|
|
38
|
+
} = event;
|
|
39
|
+
|
|
40
|
+
const updatedValues = value.filter((group) => {
|
|
41
|
+
const groupInfo = groups.find((g) => g.groupName === group);
|
|
42
|
+
return groupInfo && groupInfo.userContentGroup === 1;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
setSelectValues((prevValues) => ({
|
|
46
|
+
...prevValues,
|
|
47
|
+
[userId]: updatedValues,
|
|
48
|
+
}));
|
|
49
|
+
|
|
50
|
+
setIsCheckboxChecked(updatedValues.length > 0);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
let filteredArray = groups?.slice() || [];
|
|
55
|
+
if (text.length > 0) {
|
|
56
|
+
filteredArray = filteredArray.filter((option) =>
|
|
57
|
+
option?.name.toLowerCase().includes(text.toLocaleLowerCase())
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}, [text]);
|
|
61
|
+
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
console.log("userData", userData);
|
|
64
|
+
}, [userData]);
|
|
65
|
+
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
console.log("groups", groups);
|
|
68
|
+
}, [groups]);
|
|
69
|
+
|
|
70
|
+
const ITEM_HEIGHT = 48;
|
|
71
|
+
const ITEM_PADDING_TOP = 8;
|
|
72
|
+
const MenuProps = {
|
|
73
|
+
PaperProps: {
|
|
74
|
+
style: {
|
|
75
|
+
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
|
|
76
|
+
width: 250,
|
|
77
|
+
display: isItemListVisible ? "block" : "none",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<Container>
|
|
84
|
+
{arrayData.map((user) => (
|
|
85
|
+
<>
|
|
86
|
+
<p>{user.idUser}</p>
|
|
87
|
+
<p>{user.userName}</p>
|
|
88
|
+
<Select
|
|
89
|
+
labelId={`demo-multiple-checkbox-label-${user.idUser}`}
|
|
90
|
+
id={`demo-multiple-checkbox-${user.idUser}`}
|
|
91
|
+
multiple
|
|
92
|
+
value={selectValues[user.idUser] || []}
|
|
93
|
+
onChange={handleChange(user.idUser)}
|
|
94
|
+
input={
|
|
95
|
+
<OutlinedInput
|
|
96
|
+
sx={{
|
|
97
|
+
width: "80%",
|
|
98
|
+
height: "34px",
|
|
99
|
+
paddingBottom: "1px solid #F0F0F0",
|
|
100
|
+
}}
|
|
101
|
+
/>
|
|
102
|
+
}
|
|
103
|
+
renderValue={(selected) => selected.join(", ")}
|
|
104
|
+
MenuProps={MenuProps}
|
|
105
|
+
sx={{ width: "80%", height: "24px" }}
|
|
106
|
+
>
|
|
107
|
+
<MenuItem
|
|
108
|
+
sx={{
|
|
109
|
+
maxHeight: "34px",
|
|
110
|
+
paddingLeft: "10px",
|
|
111
|
+
"& .search-bar-filter": {
|
|
112
|
+
display: "flex",
|
|
113
|
+
gap: "10px",
|
|
114
|
+
input: {
|
|
115
|
+
border: "none",
|
|
116
|
+
background: "transparent",
|
|
117
|
+
"::placeholder": {
|
|
118
|
+
fontSize: "12px",
|
|
119
|
+
color: "#CBCBCB",
|
|
120
|
+
},
|
|
121
|
+
":focus-visible, :hover": {
|
|
122
|
+
border: "none",
|
|
123
|
+
background: "transparent",
|
|
124
|
+
outline: "none",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
":focus-visible, :hover": {
|
|
128
|
+
background: "transparent",
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
}}
|
|
132
|
+
>
|
|
133
|
+
{showSearchBar && (
|
|
134
|
+
<div className="search-bar-filter">
|
|
135
|
+
<img src={searchIcon} alt="search icon" />
|
|
136
|
+
<input
|
|
137
|
+
type="text"
|
|
138
|
+
placeholder={placeHolder}
|
|
139
|
+
value={text}
|
|
140
|
+
onChange={onChange}
|
|
141
|
+
/>
|
|
142
|
+
</div>
|
|
143
|
+
)}
|
|
144
|
+
</MenuItem>
|
|
145
|
+
{console.log("usuario", user.idUser, "grupos", user.groups)}
|
|
146
|
+
{user.groups &&
|
|
147
|
+
user.groups
|
|
148
|
+
.filter((group) => group.groupId !== "Sin id")
|
|
149
|
+
.map((group) => (
|
|
150
|
+
<MenuItem
|
|
151
|
+
key={group.groupId}
|
|
152
|
+
value={group.groupName}
|
|
153
|
+
sx={{
|
|
154
|
+
paddingLeft: "0px",
|
|
155
|
+
maxHeight: "34px",
|
|
156
|
+
":focus-visible, :hover": {
|
|
157
|
+
border: "none",
|
|
158
|
+
background: "transparent",
|
|
159
|
+
},
|
|
160
|
+
}}
|
|
161
|
+
>
|
|
162
|
+
<Checkbox
|
|
163
|
+
checked={
|
|
164
|
+
(selectValues[user.idUser] || []).indexOf(
|
|
165
|
+
group.groupName
|
|
166
|
+
) > -1 && group.userContentGroup === 1
|
|
167
|
+
}
|
|
168
|
+
sx={{
|
|
169
|
+
maxHeight: "34px",
|
|
170
|
+
"&.Mui-checked": {
|
|
171
|
+
color: "#85BC5B",
|
|
172
|
+
},
|
|
173
|
+
"input, svg": {
|
|
174
|
+
maxWidth: "12px",
|
|
175
|
+
maxHeight: "12px",
|
|
176
|
+
},
|
|
177
|
+
}}
|
|
178
|
+
/>
|
|
179
|
+
{console.log("nombre grupo", group.groupName)}
|
|
180
|
+
<ListItemText
|
|
181
|
+
primary={group.groupName}
|
|
182
|
+
sx={{
|
|
183
|
+
span: { fontSize: "12px", color: "#000000" },
|
|
184
|
+
"input, svg": {
|
|
185
|
+
maxWidth: "12px",
|
|
186
|
+
maxHeight: "12px",
|
|
187
|
+
},
|
|
188
|
+
}}
|
|
189
|
+
/>
|
|
190
|
+
</MenuItem>
|
|
191
|
+
))}
|
|
192
|
+
<MenuItem
|
|
193
|
+
sx={{
|
|
194
|
+
minHeight: "34px",
|
|
195
|
+
paddingLeft: "10px",
|
|
196
|
+
".btn-edit": {
|
|
197
|
+
color: "#E33AA9",
|
|
198
|
+
border: "none",
|
|
199
|
+
background: "transparent",
|
|
200
|
+
display: "flex",
|
|
201
|
+
gap: "10px",
|
|
202
|
+
alignItems: "center",
|
|
203
|
+
},
|
|
204
|
+
":focus-visible, :hover": {
|
|
205
|
+
border: "none",
|
|
206
|
+
background: "transparent",
|
|
207
|
+
},
|
|
208
|
+
}}
|
|
209
|
+
>
|
|
210
|
+
<button
|
|
211
|
+
className="btn-edit"
|
|
212
|
+
onClick={() => {
|
|
213
|
+
setIsItemListVisible(false);
|
|
214
|
+
setIsEditGroupVisible(true);
|
|
215
|
+
}}
|
|
216
|
+
>
|
|
217
|
+
<img src={settings} className="icon" alt="search icon" />
|
|
218
|
+
{textButton}
|
|
219
|
+
</button>
|
|
220
|
+
</MenuItem>
|
|
221
|
+
</Select>
|
|
222
|
+
</>
|
|
223
|
+
))}
|
|
224
|
+
<EditGroup
|
|
225
|
+
token={token}
|
|
226
|
+
show={isEditGroupVisible}
|
|
227
|
+
onClose={() => {
|
|
228
|
+
setIsEditGroupVisible(false);
|
|
229
|
+
setIsItemListVisible(true);
|
|
230
|
+
}}
|
|
231
|
+
/>
|
|
232
|
+
</Container>
|
|
233
|
+
);
|
|
234
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const Container = styled.div`
|
|
4
|
+
width:100%;
|
|
5
|
+
height:auto;
|
|
6
|
+
.search-bar-filter {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
border: 1px solid #f0f0f0;
|
|
10
|
+
padding-left: 10px;
|
|
11
|
+
|
|
12
|
+
img {
|
|
13
|
+
width: 15px;
|
|
14
|
+
height: 15px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
input {
|
|
18
|
+
background-color: transparent;
|
|
19
|
+
padding: 10px 10px;
|
|
20
|
+
outline: none;
|
|
21
|
+
border: none;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
img.icon{
|
|
26
|
+
width: 15px;
|
|
27
|
+
height: 15px;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
3
|
-
|
|
4
3
|
export const Container = styled.div`
|
|
5
4
|
font-family: ${FontFamily.Raleway_500};
|
|
6
5
|
color: ${GlobalColors.s5};
|
|
@@ -11,13 +10,11 @@ export const Container = styled.div`
|
|
|
11
10
|
padding-bottom: 5px;
|
|
12
11
|
transition: 0.1s all;
|
|
13
12
|
cursor: pointer;
|
|
14
|
-
|
|
15
13
|
&.active {
|
|
16
14
|
font-size: 18px;
|
|
17
15
|
border-bottom: 2px solid ${GlobalColors.magenta_s2};
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
& + * {
|
|
21
18
|
margin-left: 10px;
|
|
22
19
|
}
|
|
23
|
-
`;
|
|
20
|
+
`;
|
|
@@ -11,8 +11,8 @@ export const ProviderProductEditionDefault = Template.bind({});
|
|
|
11
11
|
|
|
12
12
|
ProviderProductEditionDefault.args = {
|
|
13
13
|
tabsSections: {
|
|
14
|
-
Descripción:
|
|
15
|
-
"Ficha técnica":
|
|
14
|
+
Descripción: false,
|
|
15
|
+
"Ficha técnica": true,
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
@@ -21,57 +21,46 @@ ProviderProductEditionDefault.args = {
|
|
|
21
21
|
category: 287,
|
|
22
22
|
version: 1,
|
|
23
23
|
productSelected: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
upc: "Modelo6",
|
|
31
|
-
isVisible: 1,
|
|
32
|
-
retailers: [
|
|
33
|
-
{
|
|
34
|
-
id: 68,
|
|
35
|
-
name: "The Home Depot Onboarding",
|
|
36
|
-
},
|
|
37
|
-
],
|
|
24
|
+
id_article: 121067,
|
|
25
|
+
upc: "2342341",
|
|
26
|
+
name: "asd",
|
|
27
|
+
timestamp: "2024-01-03T19:42:59.000Z",
|
|
28
|
+
categoryName: "Abarrotes|Abarrotes Secos|Alimentos Deshidratados",
|
|
29
|
+
id_category: 4,
|
|
38
30
|
version: 1,
|
|
31
|
+
value: null,
|
|
39
32
|
retailersAvailable: [
|
|
40
33
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
34
|
+
"name": "Walmart Marketplace",
|
|
35
|
+
"id": 75
|
|
36
|
+
}
|
|
44
37
|
],
|
|
38
|
+
percentage: 1.33
|
|
45
39
|
},
|
|
46
40
|
productToEdit: {
|
|
47
|
-
idCategory:
|
|
48
|
-
ArticleId:
|
|
41
|
+
idCategory: 4,
|
|
42
|
+
ArticleId: 121067,
|
|
49
43
|
product: [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
},
|
|
44
|
+
{
|
|
45
|
+
id_article: 121067,
|
|
46
|
+
upc: "2342341",
|
|
47
|
+
name: "asd",
|
|
48
|
+
timestamp: "2024-01-03T19:42:59.000Z",
|
|
49
|
+
categoryName: "Abarrotes|Abarrotes Secos|Alimentos Deshidratados",
|
|
50
|
+
id_category: 4,
|
|
51
|
+
version: 1,
|
|
52
|
+
value: null,
|
|
53
|
+
retailersAvailable: [
|
|
54
|
+
{
|
|
55
|
+
name: "Walmart Marketplace",
|
|
56
|
+
id: 75,
|
|
57
|
+
percentage: 1.33
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
percentage: 1.33
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
75
64
|
location: {
|
|
76
65
|
pathname: "/EditProducts",
|
|
77
66
|
search: "",
|
|
@@ -84,66 +73,54 @@ ProviderProductEditionDefault.args = {
|
|
|
84
73
|
key: "24vwut",
|
|
85
74
|
},
|
|
86
75
|
user: {
|
|
87
|
-
id_user:
|
|
88
|
-
name: "
|
|
89
|
-
last_name: "
|
|
90
|
-
email: "
|
|
91
|
-
position: "Test",
|
|
92
|
-
telephone: "+
|
|
76
|
+
id_user: 28,
|
|
77
|
+
name: "Ismael",
|
|
78
|
+
last_name: "López",
|
|
79
|
+
email: "ilopez@contentoh.com",
|
|
80
|
+
position: "Test States",
|
|
81
|
+
telephone: "+523111366336",
|
|
93
82
|
country: "México",
|
|
94
|
-
id_company:
|
|
95
|
-
id_cognito: "
|
|
83
|
+
id_company: 1,
|
|
84
|
+
id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
|
|
96
85
|
birth_Date: null,
|
|
97
|
-
about_me:
|
|
98
|
-
zip_code:
|
|
99
|
-
address:
|
|
100
|
-
job:
|
|
101
|
-
id_stripe:
|
|
86
|
+
about_me: "",
|
|
87
|
+
zip_code: "",
|
|
88
|
+
address: "",
|
|
89
|
+
job: "",
|
|
90
|
+
id_stripe: "cus_KuEt6R6vwmN09f",
|
|
102
91
|
id_role: 0,
|
|
103
92
|
active: 1,
|
|
104
93
|
is_retailer: 0,
|
|
105
94
|
email_notify: 1,
|
|
106
|
-
is_user_tech:
|
|
95
|
+
is_user_tech: "ADMIN-AS",
|
|
107
96
|
membership: {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
97
|
+
id: 76,
|
|
98
|
+
start_date: "2022-01-18T17:25:35.000Z",
|
|
99
|
+
end_date: "2023-01-18T17:25:35.000Z",
|
|
100
|
+
planID: 8,
|
|
101
|
+
plan: "prod_KtlhECVSFG2iro",
|
|
102
|
+
name: "Plan Pro",
|
|
103
|
+
user_limit: "50",
|
|
104
|
+
products_limit: "5000",
|
|
105
|
+
type: "Enterprise"
|
|
117
106
|
},
|
|
118
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
107
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1704310718113"
|
|
119
108
|
},
|
|
120
109
|
company: {
|
|
121
|
-
id_company:
|
|
122
|
-
trade_name: "
|
|
123
|
-
company_name: "
|
|
124
|
-
rfc: "
|
|
125
|
-
adress: "
|
|
126
|
-
about_company:
|
|
127
|
-
telephone:
|
|
128
|
-
web_site:
|
|
129
|
-
zip_code:
|
|
110
|
+
id_company: 1,
|
|
111
|
+
trade_name: "GRUPO BRAHMA",
|
|
112
|
+
company_name: "GRUPO BRAHMA",
|
|
113
|
+
rfc: "XAXX010101000",
|
|
114
|
+
adress: "AA",
|
|
115
|
+
about_company: "",
|
|
116
|
+
telephone: "",
|
|
117
|
+
web_site: "",
|
|
118
|
+
zip_code: "",
|
|
130
119
|
email: null,
|
|
131
|
-
social_link:
|
|
120
|
+
social_link: "",
|
|
132
121
|
is_retailer: 0,
|
|
133
|
-
financedRetailers: [
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
name: "The Home Depot Onboarding",
|
|
137
|
-
country: "México",
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
retailers: [
|
|
141
|
-
{
|
|
142
|
-
id: 68,
|
|
143
|
-
name: "The Home Depot Onboarding",
|
|
144
|
-
country: "México",
|
|
145
|
-
},
|
|
146
|
-
],
|
|
147
|
-
},
|
|
122
|
+
financedRetailers: [],
|
|
123
|
+
retailers: []
|
|
124
|
+
},
|
|
148
125
|
showSurvey: (v) => v && alert("se muestra"),
|
|
149
126
|
};
|
|
@@ -151,7 +151,7 @@ export const ProviderProductEdition = ({
|
|
|
151
151
|
const [datasheets, setDatasheets] = useState([]);
|
|
152
152
|
const [images, setImages] = useReducer(reducerImages, {});
|
|
153
153
|
const [showModal, setShowModal] = useState(false);
|
|
154
|
-
const [boxData, setBoxData] = useState();
|
|
154
|
+
const [boxData, setBoxData] = useState({});
|
|
155
155
|
const { getRootProps, getInputProps } = useDropzone({
|
|
156
156
|
accept: "image/*",
|
|
157
157
|
noKeyboard: true,
|
|
@@ -674,7 +674,7 @@ export const ProviderProductEdition = ({
|
|
|
674
674
|
}));
|
|
675
675
|
setSocketType(imageInputs);
|
|
676
676
|
}, [images]);
|
|
677
|
-
|
|
677
|
+
|
|
678
678
|
const saveDescriptions = async () => {
|
|
679
679
|
setLoading(true);
|
|
680
680
|
const dataObject = {
|
|
@@ -724,6 +724,8 @@ export const ProviderProductEdition = ({
|
|
|
724
724
|
...(parseBoxData.length > 0 && { boxData: parseBoxData }),
|
|
725
725
|
};
|
|
726
726
|
|
|
727
|
+
console.log({dataObject});
|
|
728
|
+
console.log(product?.orderId);
|
|
727
729
|
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
728
730
|
try {
|
|
729
731
|
const res = await axios.put(
|