contentoh-components-library 21.4.83 → 21.4.84
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 +8 -3
- package/dist/components/organisms/EditGroup/index.js +0 -11
- package/dist/components/organisms/FullProductNameHeader/index.js +3 -1
- package/dist/components/organisms/VersionSelector/index.js +101 -169
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +34 -38
- package/dist/components/pages/ProviderProductEdition/index.js +71 -53
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +47 -52
- package/dist/components/pages/RetailerProductEdition/index.js +101 -177
- package/dist/global-files/data.js +11 -26
- package/package.json +2 -1
- package/src/components/atoms/GeneralButton/styles.js +1 -0
- package/src/components/atoms/ObservationFlag/ObservationFlag.stories.js +20 -0
- package/src/components/atoms/ObservationFlag/index.js +33 -0
- package/src/components/atoms/ObservationFlag/styles.js +3 -0
- package/src/components/atoms/TabSection/index.js +1 -1
- package/src/components/molecules/ProductNameHeader/index.js +5 -1
- package/src/components/organisms/EditGroup/index.js +0 -8
- package/src/components/organisms/FullProductNameHeader/index.js +2 -0
- package/src/components/organisms/VersionSelector/index.js +100 -100
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +39 -29
- package/src/components/pages/ProviderProductEdition/index.js +34 -21
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +48 -52
- package/src/components/pages/RetailerProductEdition/index.js +32 -144
- package/src/global-files/data.js +7 -33
|
@@ -15,6 +15,8 @@ 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
|
+
|
|
18
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
21
|
|
|
20
22
|
var ProductNameHeader = function ProductNameHeader(_ref) {
|
|
@@ -22,7 +24,9 @@ var ProductNameHeader = function ProductNameHeader(_ref) {
|
|
|
22
24
|
statusType = _ref.statusType,
|
|
23
25
|
priority = _ref.priority,
|
|
24
26
|
date = _ref.date,
|
|
25
|
-
percentRequired = _ref.percentRequired
|
|
27
|
+
percentRequired = _ref.percentRequired,
|
|
28
|
+
productObservation = _ref.productObservation;
|
|
29
|
+
var typeFlag = productObservation !== null && productObservation !== "" ? "high" : "low";
|
|
26
30
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
27
31
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
|
|
28
32
|
headerType: "product-name-header",
|
|
@@ -33,8 +37,9 @@ var ProductNameHeader = function ProductNameHeader(_ref) {
|
|
|
33
37
|
percent: percentRequired,
|
|
34
38
|
progressBarType: statusType,
|
|
35
39
|
percentRequired: percentRequired
|
|
36
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
37
|
-
|
|
40
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index5.ObservationFlag, {
|
|
41
|
+
observation: typeFlag,
|
|
42
|
+
contentObservation: productObservation
|
|
38
43
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
|
|
39
44
|
headerType: "date-header",
|
|
40
45
|
text: date
|
|
@@ -130,20 +130,10 @@ var EditGroup = function EditGroup(_ref) {
|
|
|
130
130
|
inputValue = _useState18[0],
|
|
131
131
|
setInputValue = _useState18[1];
|
|
132
132
|
|
|
133
|
-
var _useState19 = (0, _react.useState)(false),
|
|
134
|
-
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
135
|
-
shouldClose = _useState20[0],
|
|
136
|
-
setShouldClose = _useState20[1];
|
|
137
|
-
|
|
138
133
|
(0, _react.useEffect)(function () {}, [groups]);
|
|
139
134
|
(0, _react.useEffect)(function () {
|
|
140
135
|
loadData();
|
|
141
136
|
}, []);
|
|
142
|
-
(0, _react.useEffect)(function () {
|
|
143
|
-
if (shouldClose) {
|
|
144
|
-
onClose && onClose();
|
|
145
|
-
}
|
|
146
|
-
}, [shouldClose, onClose]);
|
|
147
137
|
|
|
148
138
|
var loadData = /*#__PURE__*/function () {
|
|
149
139
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
@@ -451,7 +441,6 @@ var EditGroup = function EditGroup(_ref) {
|
|
|
451
441
|
backgroundColor: "transparent",
|
|
452
442
|
zIndex: 10
|
|
453
443
|
},
|
|
454
|
-
onClick: onClose,
|
|
455
444
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Fade, {
|
|
456
445
|
in: show,
|
|
457
446
|
timeout: 400,
|
|
@@ -34,7 +34,8 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
34
34
|
approveAll = _ref.approveAll,
|
|
35
35
|
rejectAll = _ref.rejectAll,
|
|
36
36
|
servicesData = _ref.servicesData,
|
|
37
|
-
showApproveRejectAll = _ref.showApproveRejectAll
|
|
37
|
+
showApproveRejectAll = _ref.showApproveRejectAll,
|
|
38
|
+
productObservation = _ref.productObservation;
|
|
38
39
|
|
|
39
40
|
var _useState = (0, _react.useState)([]),
|
|
40
41
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -68,6 +69,7 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
68
69
|
percentRequired: percent,
|
|
69
70
|
percent: percent === null || percent === void 0 ? void 0 : percent.toFixed(0),
|
|
70
71
|
priority: headerData === null || headerData === void 0 ? void 0 : headerData.prio,
|
|
72
|
+
productObservation: productObservation,
|
|
71
73
|
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))
|
|
72
74
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
73
75
|
className: "features-bar-container",
|
|
@@ -1,169 +1,101 @@
|
|
|
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
|
-
|
|
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;
|
|
1
|
+
// import { Container } from "./styles";
|
|
2
|
+
// import axios from "axios";
|
|
3
|
+
// import { useEffect, useState } from "react";
|
|
4
|
+
// import { ScreenHeader } from "../../atoms/ScreenHeader";
|
|
5
|
+
// import { Button } from "../../atoms/GeneralButton";
|
|
6
|
+
// import addVersion from "../../../assets/images/versionSelector/addVersion.svg";
|
|
7
|
+
// import closeIcon from "../../../assets/images/versionSelector/closeVersionSelector.svg";
|
|
8
|
+
// import { GlobalColors } from "../../../../dist/global-files/variables";
|
|
9
|
+
// import { FontFamily } from "../../../global-files/variables";
|
|
10
|
+
// import { VersionItem } from "../../molecules/VersionItem";
|
|
11
|
+
// import { CreateVersion } from "../../organisms/CreateVersion";
|
|
12
|
+
// import { useCloseModal } from "../../../global-files/customHooks";
|
|
13
|
+
// export const VersionSelector = ({
|
|
14
|
+
// modalId,
|
|
15
|
+
// articleId,
|
|
16
|
+
// setVersion,
|
|
17
|
+
// companyName,
|
|
18
|
+
// currentVersion,
|
|
19
|
+
// setShowVersionSelector,
|
|
20
|
+
// jwt,
|
|
21
|
+
// }) => {
|
|
22
|
+
// const [versions, setVersions] = useState([]);
|
|
23
|
+
// const [showCreateVersion, setShowCreateVersion] =
|
|
24
|
+
// useCloseModal("create-version");
|
|
25
|
+
// const [reload, setReload] = useState(false);
|
|
26
|
+
// const loadProductVersions = async (articleId) => {
|
|
27
|
+
// try {
|
|
28
|
+
// const response = await axios.get(
|
|
29
|
+
// `${process.env.REACT_APP_VERSIONS_ENDPOINT}?articleId=${articleId}&provider=true`,
|
|
30
|
+
// {
|
|
31
|
+
// headers: {
|
|
32
|
+
// Authorization: jwt,
|
|
33
|
+
// },
|
|
34
|
+
// }
|
|
35
|
+
// );
|
|
36
|
+
// const versionList = JSON.parse(response.data.body).data;
|
|
37
|
+
// setVersions(versionList);
|
|
38
|
+
// } catch (error) {
|
|
39
|
+
// console.log(error);
|
|
40
|
+
// }
|
|
41
|
+
// };
|
|
42
|
+
// useEffect(() => {
|
|
43
|
+
// const ac = new AbortController();
|
|
44
|
+
// loadProductVersions(articleId);
|
|
45
|
+
// return () => {
|
|
46
|
+
// setVersions([]);
|
|
47
|
+
// setShowCreateVersion(false);
|
|
48
|
+
// return () => ac.abort(); // Abort both fetches on unmount
|
|
49
|
+
// };
|
|
50
|
+
// }, [reload]);
|
|
51
|
+
// return (
|
|
52
|
+
// <Container id={modalId}>
|
|
53
|
+
// <div className="versions-header">
|
|
54
|
+
// <ScreenHeader
|
|
55
|
+
// text={"Versión del producto"}
|
|
56
|
+
// headerType={"input-name-header"}
|
|
57
|
+
// color={GlobalColors.white}
|
|
58
|
+
// fontFamily={FontFamily.Lato}
|
|
59
|
+
// />
|
|
60
|
+
// <div className="buttons-container">
|
|
61
|
+
// <Button
|
|
62
|
+
// image={addVersion}
|
|
63
|
+
// buttonType={"circular-button"}
|
|
64
|
+
// onClick={() => setShowCreateVersion(true)}
|
|
65
|
+
// id="add-version"
|
|
66
|
+
// />
|
|
67
|
+
// <Button
|
|
68
|
+
// image={closeIcon}
|
|
69
|
+
// buttonType={"circular-button"}
|
|
70
|
+
// onClick={() => setShowVersionSelector(false)}
|
|
71
|
+
// id="close-button"
|
|
72
|
+
// />
|
|
73
|
+
// </div>
|
|
74
|
+
// </div>
|
|
75
|
+
// <div className="versions-container">
|
|
76
|
+
// {versions?.map((item) => (
|
|
77
|
+
// <VersionItem
|
|
78
|
+
// key={item.version}
|
|
79
|
+
// version={item.version}
|
|
80
|
+
// articleStatus={item.article_status}
|
|
81
|
+
// currentVersion={item.version === currentVersion}
|
|
82
|
+
// productOwner={companyName}
|
|
83
|
+
// setVersion={setVersion}
|
|
84
|
+
// timestamp={item.timestamp}
|
|
85
|
+
// />
|
|
86
|
+
// ))}
|
|
87
|
+
// </div>
|
|
88
|
+
// {showCreateVersion && (
|
|
89
|
+
// <CreateVersion
|
|
90
|
+
// articleId={articleId}
|
|
91
|
+
// version={currentVersion}
|
|
92
|
+
// versionsList={versions}
|
|
93
|
+
// setShowCreateVersion={setShowCreateVersion}
|
|
94
|
+
// realoadVersion={() => setReload(!reload)}
|
|
95
|
+
// jwt={jwt}
|
|
96
|
+
// />
|
|
97
|
+
// )}
|
|
98
|
+
// </Container>
|
|
99
|
+
// );
|
|
100
|
+
// };
|
|
101
|
+
"use strict";
|
|
@@ -36,43 +36,45 @@ ProviderProductEditionDefault.args = {
|
|
|
36
36
|
category: 287,
|
|
37
37
|
version: 1,
|
|
38
38
|
productSelected: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
category: "Accesorios Decorativos|Accesorios Decorativos",
|
|
40
|
+
company_name: "Demo",
|
|
41
|
+
company_id: 923,
|
|
42
|
+
id_category: "2028",
|
|
43
|
+
id_article: 118465,
|
|
44
|
+
name: "VELA AROMA 18 OZ MAN/CAN",
|
|
45
|
+
upc: "Modelo6",
|
|
46
|
+
isVisible: 1,
|
|
47
|
+
retailers: [{
|
|
48
|
+
id: 68,
|
|
49
|
+
name: "The Home Depot Onboarding"
|
|
50
|
+
}],
|
|
45
51
|
version: 1,
|
|
46
52
|
retailersAvailable: [{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
name: "The Home Depot Onboarding",
|
|
51
|
-
id: 68
|
|
52
|
-
}],
|
|
53
|
-
percentage: "89"
|
|
53
|
+
id: 68,
|
|
54
|
+
name: "The Home Depot Onboarding"
|
|
55
|
+
}]
|
|
54
56
|
},
|
|
55
57
|
productToEdit: {
|
|
56
|
-
idCategory:
|
|
57
|
-
ArticleId:
|
|
58
|
+
idCategory: "2028",
|
|
59
|
+
ArticleId: 118465,
|
|
58
60
|
product: [{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
category: "Accesorios Decorativos|Accesorios Decorativos",
|
|
62
|
+
company_name: "Demo",
|
|
63
|
+
company_id: 923,
|
|
64
|
+
id_category: "2028",
|
|
65
|
+
id_article: 118465,
|
|
66
|
+
name: "VELA AROMA 18 OZ MAN/CAN",
|
|
67
|
+
upc: "Modelo6",
|
|
68
|
+
isVisible: 1,
|
|
69
|
+
retailers: [{
|
|
70
|
+
id: 68,
|
|
71
|
+
name: "The Home Depot Onboarding"
|
|
72
|
+
}],
|
|
65
73
|
version: 1,
|
|
66
74
|
retailersAvailable: [{
|
|
67
|
-
name: "The Home Depot Golden",
|
|
68
|
-
id: 58,
|
|
69
|
-
percentage: 100
|
|
70
|
-
}, {
|
|
71
|
-
name: "The Home Depot Onboarding",
|
|
72
75
|
id: 68,
|
|
73
|
-
|
|
74
|
-
}]
|
|
75
|
-
percentage: "89"
|
|
76
|
+
name: "The Home Depot Onboarding"
|
|
77
|
+
}]
|
|
76
78
|
}]
|
|
77
79
|
},
|
|
78
80
|
location: {
|
|
@@ -118,7 +120,7 @@ ProviderProductEditionDefault.args = {
|
|
|
118
120
|
products_limit: "5000",
|
|
119
121
|
type: "Enterprise"
|
|
120
122
|
},
|
|
121
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-191/191.png?
|
|
123
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-191/191.png?1701729602068"
|
|
122
124
|
},
|
|
123
125
|
company: {
|
|
124
126
|
id_company: 923,
|
|
@@ -136,18 +138,12 @@ ProviderProductEditionDefault.args = {
|
|
|
136
138
|
financedRetailers: [{
|
|
137
139
|
id: 68,
|
|
138
140
|
name: "The Home Depot Onboarding",
|
|
139
|
-
country: "México"
|
|
140
|
-
id_region: 1,
|
|
141
|
-
active: 1,
|
|
142
|
-
flow: 1
|
|
141
|
+
country: "México"
|
|
143
142
|
}],
|
|
144
143
|
retailers: [{
|
|
145
144
|
id: 68,
|
|
146
145
|
name: "The Home Depot Onboarding",
|
|
147
|
-
country: "México"
|
|
148
|
-
id_region: 1,
|
|
149
|
-
active: 1,
|
|
150
|
-
flow: 1
|
|
146
|
+
country: "México"
|
|
151
147
|
}]
|
|
152
148
|
},
|
|
153
149
|
showSurvey: function showSurvey(v) {
|