contentoh-components-library 21.2.101 → 21.2.103
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/components/atoms/GeneralButton/index.js +6 -2
- package/dist/components/atoms/Select/VersionSelect.js +2 -1
- package/dist/components/organisms/CreateVersion/RenderChilds.js +11 -11
- package/dist/components/organisms/CreateVersion/index.js +30 -89
- package/dist/components/organisms/VersionSelector/index.js +28 -2
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +69 -147
- package/dist/components/pages/ProviderProductEdition/index.js +0 -20
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +77 -67
- package/dist/components/pages/RetailerProductEdition/index.js +3 -22
- package/package.json +1 -1
- package/src/components/atoms/GeneralButton/index.js +4 -1
- package/src/components/atoms/Select/VersionSelect.js +4 -2
- package/src/components/organisms/CreateVersion/RenderChilds.js +28 -34
- package/src/components/organisms/CreateVersion/index.js +16 -36
- package/src/components/organisms/VersionSelector/index.js +18 -3
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +75 -166
- package/src/components/pages/ProviderProductEdition/index.js +0 -19
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +79 -67
- package/src/components/pages/RetailerProductEdition/index.js +0 -12
- package/src/global-files/customHooks.js +2 -2
- package/dist/assets/images/chatPopup/Spinner.gif +0 -0
- package/dist/assets/images/chatPopup/close.svg +0 -3
- package/dist/assets/images/chatPopup/defaultImage.png +0 -0
- package/dist/assets/images/chatPopup/defaultProfile.png +0 -0
- package/dist/assets/images/chatPopup/doc.svg +0 -1
- package/dist/assets/images/chatPopup/document.svg +0 -1
- package/dist/assets/images/chatPopup/iconChat.svg +0 -19
- package/dist/assets/images/chatPopup/iconPlus.svg +0 -3
- package/dist/assets/images/chatPopup/pdf.svg +0 -75
- package/dist/assets/images/chatPopup/remove.svg +0 -4
- package/dist/assets/images/chatPopup/send.svg +0 -3
- package/dist/assets/images/chatPopup/svgIcon.svg +0 -109
- package/dist/assets/images/chatPopup/upload_file.svg +0 -3
- package/dist/assets/images/chatPopup/xls.svg +0 -53
- package/dist/assets/images/customSelect/starIcon.svg +0 -14
- package/dist/assets/images/defaultImages/Spinner.gif +0 -0
- package/dist/assets/images/defaultImages/notFound.svg +0 -124
- package/dist/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -72
- package/dist/components/atoms/ButtonFileChooser/index.js +0 -118
- package/dist/components/atoms/ButtonFileChooser/styles.js +0 -20
- package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +0 -66
- package/dist/components/atoms/ButtonV2/index.js +0 -111
- package/dist/components/atoms/ButtonV2/styles.js +0 -53
- package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +0 -28
- package/dist/components/atoms/ChatPopUp/index.js +0 -841
- package/dist/components/atoms/ChatPopUp/styles.js +0 -27
- package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +0 -182
- package/dist/components/atoms/CustomIcon/CustomIcon.stories.js +0 -50
- package/dist/components/atoms/CustomIcon/index.js +0 -40
- package/dist/components/atoms/CustomIcon/styles.js +0 -33
- package/dist/components/atoms/IconFile/IconFile.stories.js +0 -48
- package/dist/components/atoms/IconFile/index.js +0 -249
- package/dist/components/atoms/IconFile/styles.js +0 -23
- package/dist/components/atoms/Image/Image.stories.js +0 -73
- package/dist/components/atoms/Image/index.js +0 -76
- package/dist/components/atoms/Image/styles.js +0 -43
- package/dist/components/atoms/ImageLink/ImageLink.stories.js +0 -63
- package/dist/components/atoms/ImageLink/index.js +0 -77
- package/dist/components/atoms/ImageLink/styles.js +0 -40
- package/dist/components/atoms/ImagePreview/ImagePreview.stories.js +0 -70
- package/dist/components/atoms/ImagePreview/index.js +0 -222
- package/dist/components/atoms/ImagePreview/styles.js +0 -44
- package/dist/components/atoms/InputText/InputText.stories.js +0 -60
- package/dist/components/atoms/InputText/index.js +0 -66
- package/dist/components/atoms/InputText/styles.js +0 -32
- package/dist/components/atoms/NotFound/NotFound.stories.js +0 -36
- package/dist/components/atoms/NotFound/index.js +0 -75
- package/dist/components/atoms/NotFound/styles.js +0 -20
- package/dist/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -45
- package/dist/components/atoms/SelectItemV2/index.js +0 -46
- package/dist/components/atoms/SelectItemV2/styles.js +0 -23
- package/dist/components/atoms/Tooltip/Tooltip.stories.js +0 -66
- package/dist/components/atoms/Tooltip/index.js +0 -72
- package/dist/components/atoms/Tooltip/styles.js +0 -20
- package/dist/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -66
- package/dist/components/molecules/ButtonDownloadFile/index.js +0 -179
- package/dist/components/molecules/ButtonDownloadFile/styles.js +0 -23
- package/dist/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -72
- package/dist/components/molecules/ImageTooltip/index.js +0 -84
- package/dist/components/molecules/ImageTooltip/styles.js +0 -33
- package/dist/components/molecules/SelectV2/SelectV2.stories.js +0 -119
- package/dist/components/molecules/SelectV2/index.js +0 -298
- package/dist/components/molecules/SelectV2/styles.js +0 -42
- package/dist/components/organisms/Chat/Chat.stories.js +0 -215
- package/dist/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -83
- package/dist/components/organisms/Chat/ChatLists/index.js +0 -160
- package/dist/components/organisms/Chat/ChatLists/styles.js +0 -29
- package/dist/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -176
- package/dist/components/organisms/Chat/ContainerItems/index.js +0 -569
- package/dist/components/organisms/Chat/ContainerItems/styles.js +0 -20
- package/dist/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -142
- package/dist/components/organisms/Chat/ContentChat/index.js +0 -1422
- package/dist/components/organisms/Chat/ContentChat/styles.js +0 -20
- package/dist/components/organisms/Chat/Footer/Footer.stories.js +0 -43
- package/dist/components/organisms/Chat/Footer/index.js +0 -984
- package/dist/components/organisms/Chat/Footer/styles.js +0 -32
- package/dist/components/organisms/Chat/Header/Header.stories.js +0 -96
- package/dist/components/organisms/Chat/Header/index.js +0 -84
- package/dist/components/organisms/Chat/Header/styles.js +0 -20
- package/dist/components/organisms/Chat/index.js +0 -327
- package/dist/components/organisms/Chat/styles.js +0 -29
- package/dist/components/organisms/Modal/Modal.stories.js +0 -66
- package/dist/components/organisms/Modal/index.js +0 -95
- package/dist/components/organisms/Modal/styles.js +0 -20
- package/dist/global-files/handle_http.js +0 -383
- package/dist/global-files/utils.js +0 -472
|
@@ -20,12 +20,16 @@ var Button = function Button(_ref) {
|
|
|
20
20
|
image = _ref.image,
|
|
21
21
|
altText = _ref.altText,
|
|
22
22
|
buttonFont = _ref.buttonFont,
|
|
23
|
-
|
|
23
|
+
_onClick = _ref.onClick;
|
|
24
24
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
25
25
|
id: id,
|
|
26
26
|
className: buttonType,
|
|
27
27
|
buttonFont: buttonFont,
|
|
28
|
-
onClick: onClick
|
|
28
|
+
onClick: function onClick(e) {
|
|
29
|
+
e.stopPropagation();
|
|
30
|
+
|
|
31
|
+
_onClick(e);
|
|
32
|
+
},
|
|
29
33
|
disabled: buttonType === "general-button-disabled",
|
|
30
34
|
children: [buttonType.includes("general") && label, image && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
31
35
|
src: image,
|
|
@@ -23,10 +23,11 @@ var VersionSelect = function VersionSelect(_ref) {
|
|
|
23
23
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("select", {
|
|
24
24
|
id: id,
|
|
25
25
|
name: id,
|
|
26
|
-
value:
|
|
26
|
+
value: selectedVersions[id],
|
|
27
27
|
onChange: onChange,
|
|
28
28
|
children: versions.map(function (item, index) {
|
|
29
29
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("option", {
|
|
30
|
+
value: item.version,
|
|
30
31
|
children: ["Version ", item.version]
|
|
31
32
|
}, "".concat(id, "-").concat(index));
|
|
32
33
|
})
|
|
@@ -34,22 +34,22 @@ var Children = function Children(step, setStep, versions, selectedVersions, _onC
|
|
|
34
34
|
fontFamily: _variables.FontFamily.Raleway_500,
|
|
35
35
|
headerType: "product-name-header",
|
|
36
36
|
color: _variables.GlobalColors.white,
|
|
37
|
-
text: "Crea una nueva
|
|
37
|
+
text: "Crea una nueva versi\xF3n"
|
|
38
38
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
39
39
|
fontFamily: _variables.FontFamily.Raleway,
|
|
40
40
|
headerType: "retailer-name-header",
|
|
41
41
|
color: _variables.GlobalColors.white,
|
|
42
|
-
text: "Puedes elegir el contenido de versiones anteriores o crear una
|
|
42
|
+
text: "Puedes elegir el contenido de versiones anteriores o crear una versi\xF3n desde cero"
|
|
43
43
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
44
44
|
className: "buttons-container",
|
|
45
45
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
46
|
-
label: "
|
|
46
|
+
label: "Versi\xF3n desde cero",
|
|
47
47
|
buttonType: "general-transparent-button",
|
|
48
48
|
onClick: function onClick() {
|
|
49
49
|
return setStep("empty-version");
|
|
50
50
|
}
|
|
51
51
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
52
|
-
label: "
|
|
52
|
+
label: "Versi\xF3n personalizada",
|
|
53
53
|
buttonType: "general-default-button",
|
|
54
54
|
onClick: function onClick() {
|
|
55
55
|
return setStep("create-version");
|
|
@@ -67,16 +67,16 @@ var Children = function Children(step, setStep, versions, selectedVersions, _onC
|
|
|
67
67
|
fontFamily: _variables.FontFamily.Raleway_500,
|
|
68
68
|
headerType: "product-name-header",
|
|
69
69
|
color: _variables.GlobalColors.white,
|
|
70
|
-
text: "Si creas una
|
|
70
|
+
text: "Si creas una versi\xF3n desde cero perderas la informaci\xF3n actual"
|
|
71
71
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
72
72
|
fontFamily: _variables.FontFamily.Raleway,
|
|
73
73
|
headerType: "retailer-name-header",
|
|
74
74
|
color: _variables.GlobalColors.white,
|
|
75
|
-
text: "
|
|
75
|
+
text: "\xBFDeseas Continuar?"
|
|
76
76
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
77
77
|
className: "buttons-container",
|
|
78
78
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
79
|
-
label: "
|
|
79
|
+
label: "Atr\xE1s",
|
|
80
80
|
buttonType: "general-transparent-button",
|
|
81
81
|
onClick: function onClick() {
|
|
82
82
|
return setStep("version-options");
|
|
@@ -104,7 +104,7 @@ var Children = function Children(step, setStep, versions, selectedVersions, _onC
|
|
|
104
104
|
className: "selector",
|
|
105
105
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionSelect.VersionSelect, {
|
|
106
106
|
versions: versions,
|
|
107
|
-
label: "Ficha
|
|
107
|
+
label: "Ficha t\xE9cnica",
|
|
108
108
|
id: "datasheet",
|
|
109
109
|
selectedVersions: selectedVersions,
|
|
110
110
|
onChange: function onChange(e) {
|
|
@@ -115,7 +115,7 @@ var Children = function Children(step, setStep, versions, selectedVersions, _onC
|
|
|
115
115
|
className: "selector",
|
|
116
116
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionSelect.VersionSelect, {
|
|
117
117
|
versions: versions,
|
|
118
|
-
label: "
|
|
118
|
+
label: "Descripci\xF3n",
|
|
119
119
|
id: "description",
|
|
120
120
|
selectedVersions: selectedVersions,
|
|
121
121
|
onChange: function onChange(e) {
|
|
@@ -126,7 +126,7 @@ var Children = function Children(step, setStep, versions, selectedVersions, _onC
|
|
|
126
126
|
className: "selector",
|
|
127
127
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionSelect.VersionSelect, {
|
|
128
128
|
versions: versions,
|
|
129
|
-
label: "
|
|
129
|
+
label: "Im\xE1genes",
|
|
130
130
|
id: "image",
|
|
131
131
|
selectedVersions: selectedVersions,
|
|
132
132
|
onChange: function onChange(e) {
|
|
@@ -137,7 +137,7 @@ var Children = function Children(step, setStep, versions, selectedVersions, _onC
|
|
|
137
137
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
138
138
|
className: "buttons-container",
|
|
139
139
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
140
|
-
label: "
|
|
140
|
+
label: "Atr\xE1s",
|
|
141
141
|
buttonType: "general-transparent-button",
|
|
142
142
|
onClick: function onClick() {
|
|
143
143
|
return setStep("version-options");
|
|
@@ -32,137 +32,78 @@ var _axios = _interopRequireDefault(require("axios"));
|
|
|
32
32
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
33
|
|
|
34
34
|
var CreateVersion = function CreateVersion(_ref) {
|
|
35
|
-
var
|
|
35
|
+
var articleId = _ref.articleId,
|
|
36
36
|
version = _ref.version,
|
|
37
|
-
setShowCreateVersion = _ref.setShowCreateVersion
|
|
37
|
+
setShowCreateVersion = _ref.setShowCreateVersion,
|
|
38
|
+
versionsList = _ref.versionsList,
|
|
39
|
+
realoadVersion = _ref.realoadVersion,
|
|
40
|
+
jwt = _ref.jwt;
|
|
38
41
|
|
|
39
42
|
var _useState = (0, _react.useState)("version-options"),
|
|
40
43
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
41
44
|
step = _useState2[0],
|
|
42
45
|
setStep = _useState2[1];
|
|
43
46
|
|
|
44
|
-
var _useState3 = (0, _react.useState)(
|
|
45
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
46
|
-
versions = _useState4[0],
|
|
47
|
-
setVersions = _useState4[1];
|
|
48
|
-
|
|
49
|
-
var _useState5 = (0, _react.useState)({
|
|
47
|
+
var _useState3 = (0, _react.useState)({
|
|
50
48
|
datasheet: version,
|
|
51
49
|
description: version,
|
|
52
50
|
image: version
|
|
53
51
|
}),
|
|
54
|
-
|
|
55
|
-
selectedVersions =
|
|
56
|
-
setSelectedVersions =
|
|
52
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
53
|
+
selectedVersions = _useState4[0],
|
|
54
|
+
setSelectedVersions = _useState4[1];
|
|
57
55
|
|
|
58
|
-
var
|
|
59
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
60
|
-
var
|
|
56
|
+
var createVersion = /*#__PURE__*/function () {
|
|
57
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(isEmpty) {
|
|
58
|
+
var data;
|
|
61
59
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
62
60
|
while (1) {
|
|
63
61
|
switch (_context.prev = _context.next) {
|
|
64
62
|
case 0:
|
|
65
63
|
_context.prev = 0;
|
|
66
|
-
_context.next = 3;
|
|
67
|
-
return (0, _axios.default)({
|
|
68
|
-
method: "get",
|
|
69
|
-
url: "".concat(process.env.REACT_APP_VERSIONS_ENDPOINT, "?articleId=").concat(idArticle, "&provider=true"),
|
|
70
|
-
headers: {
|
|
71
|
-
Authorization: sessionStorage.getItem("jwt")
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
case 3:
|
|
76
|
-
response = _context.sent;
|
|
77
|
-
setVersions(JSON.parse(response.data.body).data);
|
|
78
|
-
_context.next = 10;
|
|
79
|
-
break;
|
|
80
|
-
|
|
81
|
-
case 7:
|
|
82
|
-
_context.prev = 7;
|
|
83
|
-
_context.t0 = _context["catch"](0);
|
|
84
|
-
console.log(_context.t0);
|
|
85
|
-
|
|
86
|
-
case 10:
|
|
87
|
-
case "end":
|
|
88
|
-
return _context.stop();
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}, _callee, null, [[0, 7]]);
|
|
92
|
-
}));
|
|
93
|
-
|
|
94
|
-
return function getVersions() {
|
|
95
|
-
return _ref2.apply(this, arguments);
|
|
96
|
-
};
|
|
97
|
-
}();
|
|
98
|
-
|
|
99
|
-
var createVersion = /*#__PURE__*/function () {
|
|
100
|
-
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(isEmpty) {
|
|
101
|
-
var data;
|
|
102
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
103
|
-
while (1) {
|
|
104
|
-
switch (_context2.prev = _context2.next) {
|
|
105
|
-
case 0:
|
|
106
|
-
_context2.prev = 0;
|
|
107
64
|
data = {
|
|
108
|
-
articleId:
|
|
65
|
+
articleId: articleId,
|
|
109
66
|
isEmpty: isEmpty
|
|
110
67
|
};
|
|
111
|
-
isEmpty
|
|
112
|
-
|
|
113
|
-
return
|
|
114
|
-
method: "post",
|
|
115
|
-
url: process.env.REACT_APP_VERSIONS_ENDPOINT,
|
|
116
|
-
data: data,
|
|
68
|
+
if (!isEmpty) data["version"] = selectedVersions;
|
|
69
|
+
_context.next = 5;
|
|
70
|
+
return _axios.default.post(process.env.REACT_APP_VERSIONS_ENDPOINT, data, {
|
|
117
71
|
headers: {
|
|
118
|
-
Authorization:
|
|
72
|
+
Authorization: jwt
|
|
119
73
|
}
|
|
120
74
|
});
|
|
121
75
|
|
|
122
76
|
case 5:
|
|
123
77
|
setShowCreateVersion(false);
|
|
124
|
-
|
|
78
|
+
realoadVersion && realoadVersion();
|
|
79
|
+
_context.next = 12;
|
|
125
80
|
break;
|
|
126
81
|
|
|
127
|
-
case
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
console.log(
|
|
82
|
+
case 9:
|
|
83
|
+
_context.prev = 9;
|
|
84
|
+
_context.t0 = _context["catch"](0);
|
|
85
|
+
console.log(_context.t0);
|
|
131
86
|
|
|
132
|
-
case
|
|
87
|
+
case 12:
|
|
133
88
|
case "end":
|
|
134
|
-
return
|
|
89
|
+
return _context.stop();
|
|
135
90
|
}
|
|
136
91
|
}
|
|
137
|
-
},
|
|
92
|
+
}, _callee, null, [[0, 9]]);
|
|
138
93
|
}));
|
|
139
94
|
|
|
140
95
|
return function createVersion(_x) {
|
|
141
|
-
return
|
|
96
|
+
return _ref2.apply(this, arguments);
|
|
142
97
|
};
|
|
143
98
|
}();
|
|
144
99
|
|
|
145
100
|
var onChange = function onChange(e) {
|
|
146
|
-
setSelectedVersions((0, _objectSpread3.default)((0, _objectSpread3.default)({}, selectedVersions), {}, (0, _defineProperty2.default)({}, e.target.name, parseInt(e.target.value
|
|
101
|
+
setSelectedVersions((0, _objectSpread3.default)((0, _objectSpread3.default)({}, selectedVersions), {}, (0, _defineProperty2.default)({}, e.target.name, parseInt(e.target.value))));
|
|
147
102
|
};
|
|
148
103
|
|
|
149
|
-
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
150
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
151
|
-
while (1) {
|
|
152
|
-
switch (_context3.prev = _context3.next) {
|
|
153
|
-
case 0:
|
|
154
|
-
_context3.next = 2;
|
|
155
|
-
return getVersions();
|
|
156
|
-
|
|
157
|
-
case 2:
|
|
158
|
-
case "end":
|
|
159
|
-
return _context3.stop();
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}, _callee3);
|
|
163
|
-
})), []);
|
|
164
104
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
165
105
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
106
|
+
id: "create-version",
|
|
166
107
|
className: "modal-container",
|
|
167
108
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
168
109
|
className: "button-container",
|
|
@@ -174,7 +115,7 @@ var CreateVersion = function CreateVersion(_ref) {
|
|
|
174
115
|
return setShowCreateVersion(false);
|
|
175
116
|
}
|
|
176
117
|
})
|
|
177
|
-
}), (0, _RenderChilds.Children)(step, setStep,
|
|
118
|
+
}), (0, _RenderChilds.Children)(step, setStep, versionsList, selectedVersions, onChange, createVersion)]
|
|
178
119
|
})
|
|
179
120
|
});
|
|
180
121
|
};
|
|
@@ -33,6 +33,10 @@ var _variables2 = require("../../../global-files/variables");
|
|
|
33
33
|
|
|
34
34
|
var _VersionItem = require("../../molecules/VersionItem");
|
|
35
35
|
|
|
36
|
+
var _CreateVersion = require("../../organisms/CreateVersion");
|
|
37
|
+
|
|
38
|
+
var _customHooks = require("../../../global-files/customHooks");
|
|
39
|
+
|
|
36
40
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
37
41
|
|
|
38
42
|
var VersionSelector = function VersionSelector(_ref) {
|
|
@@ -41,7 +45,6 @@ var VersionSelector = function VersionSelector(_ref) {
|
|
|
41
45
|
setVersion = _ref.setVersion,
|
|
42
46
|
companyName = _ref.companyName,
|
|
43
47
|
currentVersion = _ref.currentVersion,
|
|
44
|
-
setShowCreateVersion = _ref.setShowCreateVersion,
|
|
45
48
|
setShowVersionSelector = _ref.setShowVersionSelector,
|
|
46
49
|
jwt = _ref.jwt;
|
|
47
50
|
|
|
@@ -50,6 +53,16 @@ var VersionSelector = function VersionSelector(_ref) {
|
|
|
50
53
|
versions = _useState2[0],
|
|
51
54
|
setVersions = _useState2[1];
|
|
52
55
|
|
|
56
|
+
var _useCloseModal = (0, _customHooks.useCloseModal)("create-version"),
|
|
57
|
+
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
58
|
+
showCreateVersion = _useCloseModal2[0],
|
|
59
|
+
setShowCreateVersion = _useCloseModal2[1];
|
|
60
|
+
|
|
61
|
+
var _useState3 = (0, _react.useState)(false),
|
|
62
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
63
|
+
reload = _useState4[0],
|
|
64
|
+
setReload = _useState4[1];
|
|
65
|
+
|
|
53
66
|
var loadProductVersions = /*#__PURE__*/function () {
|
|
54
67
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(articleId) {
|
|
55
68
|
var response, versionList;
|
|
@@ -91,12 +104,16 @@ var VersionSelector = function VersionSelector(_ref) {
|
|
|
91
104
|
}();
|
|
92
105
|
|
|
93
106
|
(0, _react.useEffect)(function () {
|
|
107
|
+
var ac = new AbortController();
|
|
94
108
|
loadProductVersions(articleId);
|
|
95
109
|
return function () {
|
|
96
110
|
setVersions([]);
|
|
97
111
|
setShowCreateVersion(false);
|
|
112
|
+
return function () {
|
|
113
|
+
return ac.abort();
|
|
114
|
+
}; // Abort both fetches on unmount
|
|
98
115
|
};
|
|
99
|
-
}, []);
|
|
116
|
+
}, [reload]);
|
|
100
117
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
101
118
|
id: modalId,
|
|
102
119
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -136,6 +153,15 @@ var VersionSelector = function VersionSelector(_ref) {
|
|
|
136
153
|
timestamp: item.timestamp
|
|
137
154
|
}, item.version);
|
|
138
155
|
})
|
|
156
|
+
}), showCreateVersion && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CreateVersion.CreateVersion, {
|
|
157
|
+
articleId: articleId,
|
|
158
|
+
version: currentVersion,
|
|
159
|
+
versionsList: versions,
|
|
160
|
+
setShowCreateVersion: setShowCreateVersion,
|
|
161
|
+
realoadVersion: function realoadVersion() {
|
|
162
|
+
return setReload(!reload);
|
|
163
|
+
},
|
|
164
|
+
jwt: jwt
|
|
139
165
|
})]
|
|
140
166
|
});
|
|
141
167
|
};
|
|
@@ -31,93 +31,39 @@ ProviderProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": true,
|
|
32
32
|
Imágenes: true
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
34
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIyOWY3YWY3Zi0yNmQ0LTRiMWItODZmZS0zOWY2ZTUyMDFhNzAiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2OTkyNzAyMSwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2Njk5MzA2MjEsImlhdCI6MTY2OTkyNzAyMSwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.NK6hVSiBksguboJ1m8yYqtDq19kzgE3GqYDEJHLUya_n_TsXriv6W1ypq7XiSo9zrqWcmHBpOoJQS7WbWzjGe__NlJEXjo8bykS8QBTTOiMrKxz1KzGRYJkwgG0axk-zVysUQH0_y-fbwgEgMPtd6qO46DB_KlFI_PEL1-uR5MJ9U0kNkS61gMbHwFQFs_DU-sS01NxjBsjUEp783rs1r-jm7TelZac1rGaFNUyi5vHdSozYzlnzfzGcuACZ0lHqvah2FHbDyurp-G_uhpUn5lNmcL4rVNh2lDd4TOnhJ3AtN1wGSmtErmhjmBHTvavh1ub9pklA1B9qjVuTRpYANw",
|
|
35
35
|
articleId: 238,
|
|
36
36
|
category: 846,
|
|
37
37
|
version: 2,
|
|
38
38
|
productSelected: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"company_name": "Norday",
|
|
50
|
-
"id_company": 810,
|
|
51
|
-
"country": "México",
|
|
52
|
-
"id_category": "2454",
|
|
53
|
-
"id_article": 84492,
|
|
54
|
-
"name": "prueba dos",
|
|
55
|
-
"upc": "8375"
|
|
56
|
-
},
|
|
57
|
-
"retailers": [{
|
|
58
|
-
"id": 59,
|
|
59
|
-
"name": "The Home Depot Platinum"
|
|
60
|
-
}],
|
|
61
|
-
"services": {
|
|
62
|
-
"datasheets": 0,
|
|
63
|
-
"descriptions": 0,
|
|
64
|
-
"images": 1
|
|
65
|
-
},
|
|
66
|
-
"statusByRetailer": {
|
|
67
|
-
"59": {
|
|
68
|
-
"images": "AP"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"retailersWithService": ["59"],
|
|
72
|
-
"id_article": 84492,
|
|
73
|
-
"retailersAvailable": [{
|
|
74
|
-
"id": 59,
|
|
75
|
-
"name": "The Home Depot Platinum"
|
|
39
|
+
id_article: 3,
|
|
40
|
+
id_category: 2032,
|
|
41
|
+
name: "CORTINA BLACKOUT DE POLIÉSTER CAFÉ 2.13 X 1.06 M",
|
|
42
|
+
upc: "161157",
|
|
43
|
+
timestamp: "2022-11-14T16:02:47.000Z",
|
|
44
|
+
categoryName: "Decoración|Cortinas y Persianas|Cortinas",
|
|
45
|
+
version: 1,
|
|
46
|
+
retailersAvailable: [{
|
|
47
|
+
name: "The Home Depot Golden",
|
|
48
|
+
id: 58
|
|
76
49
|
}]
|
|
77
50
|
},
|
|
78
51
|
productToEdit: {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"company_name": "Norday",
|
|
93
|
-
"id_company": 810,
|
|
94
|
-
"country": "México",
|
|
95
|
-
"id_category": "2454",
|
|
96
|
-
"id_article": 84492,
|
|
97
|
-
"name": "prueba dos",
|
|
98
|
-
"upc": "8375"
|
|
99
|
-
},
|
|
100
|
-
"retailers": [{
|
|
101
|
-
"id": 59,
|
|
102
|
-
"name": "The Home Depot Platinum"
|
|
103
|
-
}],
|
|
104
|
-
"services": {
|
|
105
|
-
"datasheets": 0,
|
|
106
|
-
"descriptions": 0,
|
|
107
|
-
"images": 1
|
|
108
|
-
},
|
|
109
|
-
"statusByRetailer": {
|
|
110
|
-
"59": {
|
|
111
|
-
"images": "AP"
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
"retailersWithService": ["59"],
|
|
115
|
-
"id_article": 84492,
|
|
116
|
-
"retailersAvailable": [{
|
|
117
|
-
"id": 59,
|
|
118
|
-
"name": "The Home Depot Platinum"
|
|
52
|
+
idCategory: 2032,
|
|
53
|
+
ArticleId: 3,
|
|
54
|
+
product: [{
|
|
55
|
+
id_article: 3,
|
|
56
|
+
id_category: 2032,
|
|
57
|
+
name: "CORTINA BLACKOUT DE POLIÉSTER CAFÉ 2.13 X 1.06 M",
|
|
58
|
+
upc: "161157",
|
|
59
|
+
timestamp: "2022-11-14T16:02:47.000Z",
|
|
60
|
+
categoryName: "Decoración|Cortinas y Persianas|Cortinas",
|
|
61
|
+
version: 1,
|
|
62
|
+
retailersAvailable: [{
|
|
63
|
+
name: "The Home Depot Golden",
|
|
64
|
+
id: 58
|
|
119
65
|
}]
|
|
120
|
-
}
|
|
66
|
+
}]
|
|
121
67
|
},
|
|
122
68
|
location: {
|
|
123
69
|
state: {
|
|
@@ -125,78 +71,54 @@ ProviderProductEditionDefault.args = {
|
|
|
125
71
|
}
|
|
126
72
|
},
|
|
127
73
|
user: {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
74
|
+
id_user: 28,
|
|
75
|
+
name: "Ismael",
|
|
76
|
+
last_name: "López",
|
|
77
|
+
email: "ilopez@contentoh.com",
|
|
78
|
+
position: "Test States",
|
|
79
|
+
telephone: "+523111366336",
|
|
80
|
+
country: "México",
|
|
81
|
+
id_company: 1,
|
|
82
|
+
id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
|
|
83
|
+
birth_Date: null,
|
|
84
|
+
about_me: "",
|
|
85
|
+
zip_code: "",
|
|
86
|
+
address: "",
|
|
87
|
+
job: "",
|
|
88
|
+
id_stripe: "cus_KuEt6R6vwmN09f",
|
|
89
|
+
id_role: 0,
|
|
90
|
+
active: 1,
|
|
91
|
+
is_retailer: 0,
|
|
92
|
+
email_notify: 0,
|
|
93
|
+
is_user_tech: "AS",
|
|
94
|
+
membership: {
|
|
95
|
+
id: 76,
|
|
96
|
+
start_date: "2022-01-18T17:25:35.000Z",
|
|
97
|
+
end_date: "2023-01-18T17:25:35.000Z",
|
|
98
|
+
planID: 8,
|
|
99
|
+
plan: "prod_KtlhECVSFG2iro",
|
|
100
|
+
name: "Plan Pro",
|
|
101
|
+
user_limit: "20",
|
|
102
|
+
products_limit: "5000",
|
|
103
|
+
type: "Enterprise"
|
|
158
104
|
},
|
|
159
|
-
|
|
105
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1669927021851"
|
|
160
106
|
},
|
|
161
107
|
company: {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
"financedRetailers": [{
|
|
175
|
-
"id": 68,
|
|
176
|
-
"name": "The Home Depot Merchants",
|
|
177
|
-
"country": "México",
|
|
178
|
-
"id_region": 1,
|
|
179
|
-
"active": 1
|
|
180
|
-
}],
|
|
181
|
-
"retailers": [{
|
|
182
|
-
"id": 59,
|
|
183
|
-
"name": "The Home Depot Platinum",
|
|
184
|
-
"country": "México"
|
|
185
|
-
}, {
|
|
186
|
-
"id": 60,
|
|
187
|
-
"name": "The Home Depot Resizing",
|
|
188
|
-
"country": "México"
|
|
189
|
-
}, {
|
|
190
|
-
"id": 61,
|
|
191
|
-
"name": "Home Depot TAB",
|
|
192
|
-
"country": "México"
|
|
193
|
-
}, {
|
|
194
|
-
"id": 68,
|
|
195
|
-
"name": "The Home Depot Merchants",
|
|
196
|
-
"country": "México"
|
|
197
|
-
}]
|
|
108
|
+
id_company: 1,
|
|
109
|
+
trade_name: "GRUPO BRAHMA",
|
|
110
|
+
company_name: "GRUPO BRAHMA",
|
|
111
|
+
rfc: "XAXX010101000",
|
|
112
|
+
adress: "AA",
|
|
113
|
+
about_company: "",
|
|
114
|
+
telephone: "",
|
|
115
|
+
web_site: "",
|
|
116
|
+
zip_code: "",
|
|
117
|
+
email: null,
|
|
118
|
+
social_link: "",
|
|
119
|
+
is_retailer: 0
|
|
198
120
|
},
|
|
199
121
|
showSurvey: function showSurvey(v) {
|
|
200
|
-
return v && alert(
|
|
122
|
+
return v && alert("se muestra");
|
|
201
123
|
}
|
|
202
124
|
};
|
|
@@ -99,8 +99,6 @@ var _VersionSelector = require("../../organisms/VersionSelector");
|
|
|
99
99
|
|
|
100
100
|
var _customHooks = require("../../../global-files/customHooks");
|
|
101
101
|
|
|
102
|
-
var _CreateVersion = require("../../organisms/CreateVersion");
|
|
103
|
-
|
|
104
102
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
105
103
|
|
|
106
104
|
var reducerImages = function reducerImages(state, action) {
|
|
@@ -530,11 +528,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
530
528
|
retailerStatus = _useState82[0],
|
|
531
529
|
setRetailerStatus = _useState82[1];
|
|
532
530
|
|
|
533
|
-
var _useState83 = (0, _react.useState)(false),
|
|
534
|
-
_useState84 = (0, _slicedToArray2.default)(_useState83, 2),
|
|
535
|
-
showCreateVersion = _useState84[0],
|
|
536
|
-
setShowCreateVersion = _useState84[1];
|
|
537
|
-
|
|
538
531
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
539
532
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
540
533
|
showVersionSelector = _useCloseModal2[0],
|
|
@@ -564,14 +557,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
564
557
|
return getServices();
|
|
565
558
|
|
|
566
559
|
case 6:
|
|
567
|
-
// if (!originProp) {
|
|
568
|
-
// setActiveRetailer(
|
|
569
|
-
// product?.retailers
|
|
570
|
-
// ? product?.retailers[0]
|
|
571
|
-
// : product?.retailersAvailable[0]
|
|
572
|
-
// );
|
|
573
|
-
// }
|
|
574
|
-
// setActiveRetailer(product?.retailers[0]);
|
|
575
560
|
setImages({
|
|
576
561
|
action: "init",
|
|
577
562
|
init: services[2]
|
|
@@ -2082,13 +2067,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2082
2067
|
setVersion: setVersion,
|
|
2083
2068
|
companyName: company.company_name,
|
|
2084
2069
|
currentVersion: version,
|
|
2085
|
-
setShowCreateVersion: setShowCreateVersion,
|
|
2086
2070
|
setShowVersionSelector: setShowVersionSelector,
|
|
2087
2071
|
jwt: token
|
|
2088
|
-
}), showCreateVersion && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CreateVersion.CreateVersion, {
|
|
2089
|
-
idArticle: product.id_article,
|
|
2090
|
-
version: version,
|
|
2091
|
-
setShowCreateVersion: setShowCreateVersion
|
|
2092
2072
|
})]
|
|
2093
2073
|
});
|
|
2094
2074
|
};
|