contentoh-components-library 21.4.82 → 21.4.83
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/molecules/ProductNameHeader/index.js +3 -8
- package/dist/components/organisms/EditGroup/index.js +0 -3
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -3
- package/dist/components/organisms/VersionSelector/index.js +169 -101
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +38 -34
- package/dist/components/pages/ProviderProductEdition/index.js +53 -71
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +52 -47
- package/dist/components/pages/RetailerProductEdition/index.js +177 -101
- package/dist/global-files/data.js +26 -11
- package/package.json +1 -2
- package/src/components/atoms/GeneralButton/styles.js +0 -1
- package/src/components/atoms/TabSection/index.js +1 -1
- package/src/components/molecules/ProductNameHeader/index.js +1 -5
- package/src/components/organisms/EditGroup/index.js +1 -3
- package/src/components/organisms/FullProductNameHeader/index.js +0 -2
- package/src/components/organisms/VersionSelector/index.js +100 -100
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +29 -39
- package/src/components/pages/ProviderProductEdition/index.js +21 -34
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +52 -48
- package/src/components/pages/RetailerProductEdition/index.js +144 -32
- package/src/global-files/data.js +33 -7
- package/src/components/atoms/ObservationFlag/ObservationFlag.stories.js +0 -20
- package/src/components/atoms/ObservationFlag/index.js +0 -33
- package/src/components/atoms/ObservationFlag/styles.js +0 -3
|
@@ -15,8 +15,6 @@ var _index3 = require("../../atoms/ProgressBar/index");
|
|
|
15
15
|
|
|
16
16
|
var _index4 = require("../../atoms/PriorityFlag/index");
|
|
17
17
|
|
|
18
|
-
var _index5 = require("../../atoms/ObservationFlag/index");
|
|
19
|
-
|
|
20
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
19
|
|
|
22
20
|
var ProductNameHeader = function ProductNameHeader(_ref) {
|
|
@@ -24,9 +22,7 @@ var ProductNameHeader = function ProductNameHeader(_ref) {
|
|
|
24
22
|
statusType = _ref.statusType,
|
|
25
23
|
priority = _ref.priority,
|
|
26
24
|
date = _ref.date,
|
|
27
|
-
percentRequired = _ref.percentRequired
|
|
28
|
-
productObservation = _ref.productObservation;
|
|
29
|
-
var typeFlag = productObservation !== null && productObservation !== "" ? "high" : "low";
|
|
25
|
+
percentRequired = _ref.percentRequired;
|
|
30
26
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
31
27
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
|
|
32
28
|
headerType: "product-name-header",
|
|
@@ -37,9 +33,8 @@ var ProductNameHeader = function ProductNameHeader(_ref) {
|
|
|
37
33
|
percent: percentRequired,
|
|
38
34
|
progressBarType: statusType,
|
|
39
35
|
percentRequired: percentRequired
|
|
40
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
41
|
-
|
|
42
|
-
contentObservation: productObservation
|
|
36
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index4.PriorityFlag, {
|
|
37
|
+
priority: priority
|
|
43
38
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
|
|
44
39
|
headerType: "date-header",
|
|
45
40
|
text: date
|
|
@@ -135,7 +135,6 @@ var EditGroup = function EditGroup(_ref) {
|
|
|
135
135
|
shouldClose = _useState20[0],
|
|
136
136
|
setShouldClose = _useState20[1];
|
|
137
137
|
|
|
138
|
-
var modalRef = (0, _react.useRef)();
|
|
139
138
|
(0, _react.useEffect)(function () {}, [groups]);
|
|
140
139
|
(0, _react.useEffect)(function () {
|
|
141
140
|
loadData();
|
|
@@ -457,8 +456,6 @@ var EditGroup = function EditGroup(_ref) {
|
|
|
457
456
|
in: show,
|
|
458
457
|
timeout: 400,
|
|
459
458
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
460
|
-
ref: modalRef,
|
|
461
|
-
open: show,
|
|
462
459
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
463
460
|
className: "contentModal",
|
|
464
461
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -34,8 +34,7 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
34
34
|
approveAll = _ref.approveAll,
|
|
35
35
|
rejectAll = _ref.rejectAll,
|
|
36
36
|
servicesData = _ref.servicesData,
|
|
37
|
-
showApproveRejectAll = _ref.showApproveRejectAll
|
|
38
|
-
productObservation = _ref.productObservation;
|
|
37
|
+
showApproveRejectAll = _ref.showApproveRejectAll;
|
|
39
38
|
|
|
40
39
|
var _useState = (0, _react.useState)([]),
|
|
41
40
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -69,7 +68,6 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
69
68
|
percentRequired: percent,
|
|
70
69
|
percent: percent === null || percent === void 0 ? void 0 : percent.toFixed(0),
|
|
71
70
|
priority: headerData === null || headerData === void 0 ? void 0 : headerData.prio,
|
|
72
|
-
productObservation: productObservation,
|
|
73
71
|
date: getTime((headerData === null || headerData === void 0 ? void 0 : (_headerData$article2 = headerData.article) === null || _headerData$article2 === void 0 ? void 0 : _headerData$article2.timestamp) || (headerData === null || headerData === void 0 ? void 0 : headerData.timestamp))
|
|
74
72
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
75
73
|
className: "features-bar-container",
|
|
@@ -1,101 +1,169 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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.VersionSelector = void 0;
|
|
9
|
+
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
13
|
+
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
15
|
+
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
|
|
18
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
19
|
+
|
|
20
|
+
var _react = require("react");
|
|
21
|
+
|
|
22
|
+
var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
23
|
+
|
|
24
|
+
var _GeneralButton = require("../../atoms/GeneralButton");
|
|
25
|
+
|
|
26
|
+
var _addVersion = _interopRequireDefault(require("../../../assets/images/versionSelector/addVersion.svg"));
|
|
27
|
+
|
|
28
|
+
var _closeVersionSelector = _interopRequireDefault(require("../../../assets/images/versionSelector/closeVersionSelector.svg"));
|
|
29
|
+
|
|
30
|
+
var _variables = require("../../../../dist/global-files/variables");
|
|
31
|
+
|
|
32
|
+
var _variables2 = require("../../../global-files/variables");
|
|
33
|
+
|
|
34
|
+
var _VersionItem = require("../../molecules/VersionItem");
|
|
35
|
+
|
|
36
|
+
var _CreateVersion = require("../../organisms/CreateVersion");
|
|
37
|
+
|
|
38
|
+
var _customHooks = require("../../../global-files/customHooks");
|
|
39
|
+
|
|
40
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
41
|
+
|
|
42
|
+
var VersionSelector = function VersionSelector(_ref) {
|
|
43
|
+
var modalId = _ref.modalId,
|
|
44
|
+
articleId = _ref.articleId,
|
|
45
|
+
setVersion = _ref.setVersion,
|
|
46
|
+
companyName = _ref.companyName,
|
|
47
|
+
currentVersion = _ref.currentVersion,
|
|
48
|
+
setShowVersionSelector = _ref.setShowVersionSelector,
|
|
49
|
+
jwt = _ref.jwt;
|
|
50
|
+
|
|
51
|
+
var _useState = (0, _react.useState)([]),
|
|
52
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
53
|
+
versions = _useState2[0],
|
|
54
|
+
setVersions = _useState2[1];
|
|
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
|
+
|
|
66
|
+
var loadProductVersions = /*#__PURE__*/function () {
|
|
67
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(articleId) {
|
|
68
|
+
var response, versionList;
|
|
69
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
70
|
+
while (1) {
|
|
71
|
+
switch (_context.prev = _context.next) {
|
|
72
|
+
case 0:
|
|
73
|
+
_context.prev = 0;
|
|
74
|
+
_context.next = 3;
|
|
75
|
+
return _axios.default.get("".concat(process.env.REACT_APP_VERSIONS_ENDPOINT, "?articleId=").concat(articleId, "&provider=true"), {
|
|
76
|
+
headers: {
|
|
77
|
+
Authorization: jwt
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
case 3:
|
|
82
|
+
response = _context.sent;
|
|
83
|
+
versionList = JSON.parse(response.data.body).data;
|
|
84
|
+
setVersions(versionList);
|
|
85
|
+
_context.next = 11;
|
|
86
|
+
break;
|
|
87
|
+
|
|
88
|
+
case 8:
|
|
89
|
+
_context.prev = 8;
|
|
90
|
+
_context.t0 = _context["catch"](0);
|
|
91
|
+
console.log(_context.t0);
|
|
92
|
+
|
|
93
|
+
case 11:
|
|
94
|
+
case "end":
|
|
95
|
+
return _context.stop();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}, _callee, null, [[0, 8]]);
|
|
99
|
+
}));
|
|
100
|
+
|
|
101
|
+
return function loadProductVersions(_x) {
|
|
102
|
+
return _ref2.apply(this, arguments);
|
|
103
|
+
};
|
|
104
|
+
}();
|
|
105
|
+
|
|
106
|
+
(0, _react.useEffect)(function () {
|
|
107
|
+
var ac = new AbortController();
|
|
108
|
+
loadProductVersions(articleId);
|
|
109
|
+
return function () {
|
|
110
|
+
setVersions([]);
|
|
111
|
+
setShowCreateVersion(false);
|
|
112
|
+
return function () {
|
|
113
|
+
return ac.abort();
|
|
114
|
+
}; // Abort both fetches on unmount
|
|
115
|
+
};
|
|
116
|
+
}, [reload]);
|
|
117
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
118
|
+
id: modalId,
|
|
119
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
120
|
+
className: "versions-header",
|
|
121
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
122
|
+
text: "Versión del producto",
|
|
123
|
+
headerType: "input-name-header",
|
|
124
|
+
color: _variables.GlobalColors.white,
|
|
125
|
+
fontFamily: _variables2.FontFamily.Lato
|
|
126
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
127
|
+
className: "buttons-container",
|
|
128
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
129
|
+
image: _addVersion.default,
|
|
130
|
+
buttonType: "circular-button",
|
|
131
|
+
onClick: function onClick() {
|
|
132
|
+
return setShowCreateVersion(true);
|
|
133
|
+
},
|
|
134
|
+
id: "add-version"
|
|
135
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
136
|
+
image: _closeVersionSelector.default,
|
|
137
|
+
buttonType: "circular-button",
|
|
138
|
+
onClick: function onClick() {
|
|
139
|
+
return setShowVersionSelector(false);
|
|
140
|
+
},
|
|
141
|
+
id: "close-button"
|
|
142
|
+
})]
|
|
143
|
+
})]
|
|
144
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
145
|
+
className: "versions-container",
|
|
146
|
+
children: versions === null || versions === void 0 ? void 0 : versions.map(function (item) {
|
|
147
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionItem.VersionItem, {
|
|
148
|
+
version: item.version,
|
|
149
|
+
articleStatus: item.article_status,
|
|
150
|
+
currentVersion: item.version === currentVersion,
|
|
151
|
+
productOwner: companyName,
|
|
152
|
+
setVersion: setVersion,
|
|
153
|
+
timestamp: item.timestamp
|
|
154
|
+
}, item.version);
|
|
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
|
|
165
|
+
})]
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
exports.VersionSelector = VersionSelector;
|
|
@@ -36,45 +36,43 @@ 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: 39550,
|
|
40
|
+
upc: 43654697,
|
|
41
|
+
name: "Campana de Cocina",
|
|
42
|
+
timestamp: "2023-08-04T22:23:40.000Z",
|
|
43
|
+
categoryName: "Ferretería|Ferretería General|Tornillos, Tuercas y Arandelas",
|
|
44
|
+
id_category: 287,
|
|
51
45
|
version: 1,
|
|
52
46
|
retailersAvailable: [{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
47
|
+
name: "The Home Depot Golden",
|
|
48
|
+
id: 58
|
|
49
|
+
}, {
|
|
50
|
+
name: "The Home Depot Onboarding",
|
|
51
|
+
id: 68
|
|
52
|
+
}],
|
|
53
|
+
percentage: "89"
|
|
56
54
|
},
|
|
57
55
|
productToEdit: {
|
|
58
|
-
idCategory:
|
|
59
|
-
ArticleId:
|
|
56
|
+
idCategory: 287,
|
|
57
|
+
ArticleId: 39550,
|
|
60
58
|
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
|
-
}],
|
|
59
|
+
id_article: 39550,
|
|
60
|
+
upc: 43654697,
|
|
61
|
+
name: "Campana de Cocina",
|
|
62
|
+
timestamp: "2023-08-04T22:23:40.000Z",
|
|
63
|
+
categoryName: "Ferretería|Ferretería General|Tornillos, Tuercas y Arandelas",
|
|
64
|
+
id_category: 287,
|
|
73
65
|
version: 1,
|
|
74
66
|
retailersAvailable: [{
|
|
67
|
+
name: "The Home Depot Golden",
|
|
68
|
+
id: 58,
|
|
69
|
+
percentage: 100
|
|
70
|
+
}, {
|
|
71
|
+
name: "The Home Depot Onboarding",
|
|
75
72
|
id: 68,
|
|
76
|
-
|
|
77
|
-
}]
|
|
73
|
+
percentage: 78
|
|
74
|
+
}],
|
|
75
|
+
percentage: "89"
|
|
78
76
|
}]
|
|
79
77
|
},
|
|
80
78
|
location: {
|
|
@@ -120,7 +118,7 @@ ProviderProductEditionDefault.args = {
|
|
|
120
118
|
products_limit: "5000",
|
|
121
119
|
type: "Enterprise"
|
|
122
120
|
},
|
|
123
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-191/191.png?
|
|
121
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-191/191.png?1697171804447"
|
|
124
122
|
},
|
|
125
123
|
company: {
|
|
126
124
|
id_company: 923,
|
|
@@ -138,12 +136,18 @@ ProviderProductEditionDefault.args = {
|
|
|
138
136
|
financedRetailers: [{
|
|
139
137
|
id: 68,
|
|
140
138
|
name: "The Home Depot Onboarding",
|
|
141
|
-
country: "México"
|
|
139
|
+
country: "México",
|
|
140
|
+
id_region: 1,
|
|
141
|
+
active: 1,
|
|
142
|
+
flow: 1
|
|
142
143
|
}],
|
|
143
144
|
retailers: [{
|
|
144
145
|
id: 68,
|
|
145
146
|
name: "The Home Depot Onboarding",
|
|
146
|
-
country: "México"
|
|
147
|
+
country: "México",
|
|
148
|
+
id_region: 1,
|
|
149
|
+
active: 1,
|
|
150
|
+
flow: 1
|
|
147
151
|
}]
|
|
148
152
|
},
|
|
149
153
|
showSurvey: function showSurvey(v) {
|