contentoh-components-library 21.1.84 → 21.1.87
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/AsignationOption/index.js +1 -1
- package/dist/components/atoms/InputFormatter/index.js +3 -3
- package/dist/components/atoms/SliderToolTip/index.js +9 -23
- package/dist/components/atoms/Status/index.js +1 -1
- package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
- package/dist/components/atoms/StatusTag/index.js +58 -0
- package/dist/components/atoms/StatusTag/styles.js +20 -0
- package/dist/components/molecules/StatusAsignationInfo/index.js +6 -2
- package/dist/components/organisms/VersionSelector/index.js +13 -17
- package/dist/components/organisms/VersionSelector/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/index.js +7 -6
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +57 -50
- package/dist/components/pages/RetailerProductEdition/index.js +8 -6
- package/dist/global-files/customHooks.js +18 -11
- package/dist/global-files/data.js +1 -0
- package/package.json +1 -1
- package/src/components/atoms/AsignationOption/index.js +1 -1
- package/src/components/atoms/InputFormatter/index.js +8 -3
- package/src/components/atoms/SliderToolTip/index.js +6 -22
- package/src/components/atoms/Status/index.js +1 -1
- package/src/components/molecules/StatusAsignationInfo/index.js +6 -2
- package/src/components/organisms/VersionSelector/index.js +10 -3
- package/src/components/organisms/VersionSelector/styles.js +1 -0
- package/src/components/pages/ProviderProductEdition/index.js +3 -3
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +58 -50
- package/src/components/pages/RetailerProductEdition/index.js +4 -2
- package/src/global-files/customHooks.js +13 -14
- package/src/global-files/data.js +1 -0
|
@@ -0,0 +1,20 @@
|
|
|
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 _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 100%;\n height: 100vh;\n .user {\n .name-registration-user {\n display: flex;\n justify-content: space-between;\n input {\n width: 160px;\n }\n }\n .input-name-header {\n margin-bottom: 4px;\n margin-top: 12px;\n }\n .phone-registration-user {\n display: flex;\n justify-content: space-between;\n .phone-options {\n width: 80px;\n }\n input {\n width: 100%;\n }\n & + * {\n margin-top: 10px;\n }\n }\n .country-options,\n .phone-options {\n width: 100%;\n border: 1px solid ", ";\n font-family: ", ";\n color: ", ";\n font-weight: normal;\n font-size: 12px;\n line-height: 15px;\n padding: 10px;\n outline: none;\n border-radius: 2px;\n resize: none;\n &:focus {\n border: 1px solid ", ";\n }\n }\n }\n .button-end {\n text-align: end;\n .general-default-button {\n width: 160px;\n }\n & + * {\n margin-top: 10px;\n }\n }\n .progress-bar {\n width: 100%;\n height: 8px;\n display: flex;\n justify-content: space-between;\n .progress-bar-first-step {\n width: 33.33%;\n background-color: rgb(196, 196, 196);\n }\n .progress-bar-registration {\n background-color: rgb(226, 226, 226);\n width: 66.66%;\n }\n }\n .date-header {\n .new-login {\n & + * {\n margin-top: 20px;\n }\n }\n }\n .home-login-retailer,\n .home-retailer {\n width: 50%;\n }\n"])), _variables.GlobalColors.s2, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4, _variables.GlobalColors.magenta_s2);
|
|
19
|
+
|
|
20
|
+
exports.Container = Container;
|
|
@@ -38,45 +38,52 @@ RetailerProductEditionDefault.args = {
|
|
|
38
38
|
descriptions: 1,
|
|
39
39
|
images: 1
|
|
40
40
|
},
|
|
41
|
-
orderId:
|
|
42
|
-
status: "
|
|
43
|
-
datasheet_status: "
|
|
41
|
+
orderId: 2426,
|
|
42
|
+
status: "AS",
|
|
43
|
+
datasheet_status: "AS",
|
|
44
44
|
prio: "none",
|
|
45
45
|
version: 2,
|
|
46
|
-
description_status: "
|
|
47
|
-
images_status: "
|
|
46
|
+
description_status: "AS",
|
|
47
|
+
images_status: "AS",
|
|
48
48
|
article: {
|
|
49
|
-
id_article:
|
|
50
|
-
id_category: "
|
|
51
|
-
name: "
|
|
52
|
-
upc: "
|
|
53
|
-
timestamp: "2022-
|
|
54
|
-
id_user:
|
|
49
|
+
id_article: 78738,
|
|
50
|
+
id_category: "2427",
|
|
51
|
+
name: "INTERRUPTOR TERMOMAGNETICO IUSA 2P 15A",
|
|
52
|
+
upc: "157126",
|
|
53
|
+
timestamp: "2022-08-01T18:28:05.000Z",
|
|
54
|
+
id_user: 651,
|
|
55
55
|
status: "NULL",
|
|
56
56
|
active: 1,
|
|
57
|
-
company_id:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
company_id: 388,
|
|
58
|
+
SKU: null,
|
|
59
|
+
Descripcion: null,
|
|
60
|
+
Proveedor: null,
|
|
61
|
+
id_proveedor: 0,
|
|
62
|
+
company_name: "",
|
|
63
|
+
country: null,
|
|
64
|
+
id_order: 2426,
|
|
65
|
+
id_datasheet_especialist: 1248,
|
|
66
|
+
id_datasheet_facilitator: 1252,
|
|
67
|
+
id_description_especialist: 1248,
|
|
68
|
+
id_description_facilitator: 1252,
|
|
69
|
+
id_images_especialist: 1251,
|
|
70
|
+
id_images_facilitator: 1286,
|
|
71
|
+
id_auditor: 1254,
|
|
68
72
|
id_recepcionist: null,
|
|
69
|
-
category: "
|
|
70
|
-
missingAttributes:
|
|
71
|
-
missingDescriptions:
|
|
72
|
-
missingImages:
|
|
73
|
+
category: "Eléctrico|Centros de Carga e Interruptores|Interruptores de Seguridad",
|
|
74
|
+
missingAttributes: null,
|
|
75
|
+
missingDescriptions: null,
|
|
76
|
+
missingImages: null
|
|
73
77
|
},
|
|
74
78
|
retailers: [{
|
|
75
|
-
id:
|
|
76
|
-
name: "
|
|
79
|
+
id: 58,
|
|
80
|
+
name: "The Home Depot Golden",
|
|
81
|
+
country: "México",
|
|
82
|
+
id_region: 1,
|
|
83
|
+
active: 1
|
|
77
84
|
}],
|
|
78
|
-
country:
|
|
79
|
-
upc: "
|
|
85
|
+
country: null,
|
|
86
|
+
upc: "157126"
|
|
80
87
|
},
|
|
81
88
|
location: {
|
|
82
89
|
product: {
|
|
@@ -85,16 +92,16 @@ RetailerProductEditionDefault.args = {
|
|
|
85
92
|
}
|
|
86
93
|
},
|
|
87
94
|
user: {
|
|
88
|
-
id_user:
|
|
89
|
-
name: "
|
|
90
|
-
last_name: "",
|
|
91
|
-
email: "
|
|
92
|
-
position:
|
|
95
|
+
id_user: 460,
|
|
96
|
+
name: "Ismael",
|
|
97
|
+
last_name: "López",
|
|
98
|
+
email: "ilopez@contentoh.com",
|
|
99
|
+
position: "Desarrollador",
|
|
93
100
|
telephone: null,
|
|
94
|
-
country:
|
|
95
|
-
id_company:
|
|
96
|
-
id_cognito: "
|
|
97
|
-
birth_Date:
|
|
101
|
+
country: "México",
|
|
102
|
+
id_company: 254,
|
|
103
|
+
id_cognito: "9d0cc5c8-a89e-4bdd-9e2d-358a01cc9a62",
|
|
104
|
+
birth_Date: "1997-08-15T00:00:00.000Z",
|
|
98
105
|
about_me: null,
|
|
99
106
|
zip_code: null,
|
|
100
107
|
address: null,
|
|
@@ -103,18 +110,18 @@ RetailerProductEditionDefault.args = {
|
|
|
103
110
|
id_role: 1,
|
|
104
111
|
active: 1,
|
|
105
112
|
is_retailer: 0,
|
|
106
|
-
email_notify:
|
|
113
|
+
email_notify: null,
|
|
107
114
|
membership: {
|
|
108
|
-
id:
|
|
109
|
-
start_date: "
|
|
110
|
-
end_date: "
|
|
111
|
-
planID:
|
|
112
|
-
plan: "
|
|
113
|
-
name: "Plan
|
|
114
|
-
user_limit: "
|
|
115
|
-
products_limit: "
|
|
116
|
-
type: "
|
|
115
|
+
id: 750,
|
|
116
|
+
start_date: "2022-01-07T21:32:54.000Z",
|
|
117
|
+
end_date: "2023-01-07T21:32:54.000Z",
|
|
118
|
+
planID: 6,
|
|
119
|
+
plan: "prod_KvGd6YSTJyR3AP",
|
|
120
|
+
name: "Plan Small",
|
|
121
|
+
user_limit: "10",
|
|
122
|
+
products_limit: "1000",
|
|
123
|
+
type: "Enterprise"
|
|
117
124
|
},
|
|
118
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
125
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-460/460.png?1659463389000"
|
|
119
126
|
}
|
|
120
127
|
};
|
|
@@ -392,10 +392,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
392
392
|
showCreateVersion = _useState72[0],
|
|
393
393
|
setShowCreateVersion = _useState72[1];
|
|
394
394
|
|
|
395
|
-
var
|
|
396
|
-
|
|
397
|
-
showVersionSelector =
|
|
398
|
-
setShowVersionSelector =
|
|
395
|
+
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
396
|
+
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
397
|
+
showVersionSelector = _useCloseModal2[0],
|
|
398
|
+
setShowVersionSelector = _useCloseModal2[1];
|
|
399
399
|
|
|
400
400
|
(0, _react.useEffect)(function () {
|
|
401
401
|
checkAll && setSelectedImages(images.values);
|
|
@@ -1791,7 +1791,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1791
1791
|
default:
|
|
1792
1792
|
break;
|
|
1793
1793
|
}
|
|
1794
|
-
}
|
|
1794
|
+
},
|
|
1795
|
+
canAssign: ![7, 8].includes(user.id_role)
|
|
1795
1796
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1796
1797
|
className: "services-information-container " + (imageLayout && activeTab === "Imágenes" ? "image-services" : ""),
|
|
1797
1798
|
children: loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -1914,7 +1915,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1914
1915
|
setVersion: setVersion,
|
|
1915
1916
|
companyName: product.article.company_name,
|
|
1916
1917
|
currentVersion: version,
|
|
1917
|
-
setShowCreateVersion: setShowCreateVersion
|
|
1918
|
+
setShowCreateVersion: setShowCreateVersion,
|
|
1919
|
+
setShowVersionSelector: setShowVersionSelector
|
|
1918
1920
|
}), showCreateVersion && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CreateVersion.CreateVersion, {
|
|
1919
1921
|
idArticle: product.article.id_article,
|
|
1920
1922
|
version: version,
|
|
@@ -5,31 +5,38 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.useCloseModal = void 0;
|
|
9
9
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
11
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var useCloseModal = function useCloseModal(id) {
|
|
15
15
|
var _useState = (0, _react.useState)(false),
|
|
16
16
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
17
17
|
showModal = _useState2[0],
|
|
18
18
|
setShowModal = _useState2[1];
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
var closeModal = function closeModal(e) {
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
|
|
24
|
+
if (!e.target.closest("#".concat(id)) && showModal) {
|
|
25
|
+
document.removeEventListener("click", closeModal, false);
|
|
26
|
+
setShowModal(false);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
27
29
|
|
|
30
|
+
(0, _react.useEffect)(function () {
|
|
28
31
|
if (showModal) {
|
|
29
|
-
document.addEventListener("click", closeModal);
|
|
32
|
+
document.addEventListener("click", closeModal, false);
|
|
30
33
|
}
|
|
34
|
+
|
|
35
|
+
return function () {
|
|
36
|
+
document.removeEventListener("click", closeModal, false);
|
|
37
|
+
};
|
|
31
38
|
}, [showModal]);
|
|
32
39
|
return [showModal, setShowModal];
|
|
33
40
|
};
|
|
34
41
|
|
|
35
|
-
exports.
|
|
42
|
+
exports.useCloseModal = useCloseModal;
|
|
@@ -280,6 +280,7 @@ var getNewStatus = function getNewStatus(statusArray) {
|
|
|
280
280
|
statusArray.forEach(function (element) {
|
|
281
281
|
return lookupString += element + "/";
|
|
282
282
|
});
|
|
283
|
+
if (lookupString.includes("AS")) return "AS";
|
|
283
284
|
if (lookupString.includes("RCA")) return "RCA";
|
|
284
285
|
if (lookupString.includes("RC")) return "RC";
|
|
285
286
|
if (lookupString.includes("RA")) return "RA";
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ import requesToProvider from "../../../assets/images/asignationOptions/requestTo
|
|
|
6
6
|
import requestToTeam from "../../../assets/images/asignationOptions/requestToTeam.svg";
|
|
7
7
|
import availableIcon from "../../../assets/images/asignationOptions/availableIcon.svg";
|
|
8
8
|
import { getNewStatus } from "../../../global-files/data";
|
|
9
|
-
import { Status } from "
|
|
9
|
+
import { Status } from "../../atoms/Status";
|
|
10
10
|
|
|
11
11
|
export const AsignationOption = ({
|
|
12
12
|
profileImage,
|
|
@@ -22,7 +22,10 @@ export const InputFormatter = ({
|
|
|
22
22
|
const maxLength = maxChar ? maxChar : 999;
|
|
23
23
|
|
|
24
24
|
const getValue = (value) => {
|
|
25
|
-
let temp = value
|
|
25
|
+
let temp = value
|
|
26
|
+
.replace(/\n/gm, "<br>")
|
|
27
|
+
.replace(/&/gm, "&")
|
|
28
|
+
.replace(/ /gm, " ");
|
|
26
29
|
return temp;
|
|
27
30
|
};
|
|
28
31
|
|
|
@@ -37,7 +40,8 @@ export const InputFormatter = ({
|
|
|
37
40
|
return value
|
|
38
41
|
.replace(/<\/p><p>/gm, "\n")
|
|
39
42
|
.replace(/<\/?br>|<\/?p>/gm, "")
|
|
40
|
-
.replace(/&/gm, "&")
|
|
43
|
+
.replace(/&/gm, "&")
|
|
44
|
+
.replace(/ /gm, " ");
|
|
41
45
|
};
|
|
42
46
|
|
|
43
47
|
const onChange = (valueInput, delta, user, h) => {
|
|
@@ -48,7 +52,8 @@ export const InputFormatter = ({
|
|
|
48
52
|
.replace(/<li.*?>/gm, " - ")
|
|
49
53
|
.replace(/<\/li>/gm, "\n")
|
|
50
54
|
.replace(/<\/p><p>/gm, "\n")
|
|
51
|
-
.replaceAll(/<\/?(?!\/?strong).*?>/gm, "")
|
|
55
|
+
.replaceAll(/<\/?(?!\/?strong).*?>/gm, "")
|
|
56
|
+
.replace(/ /gm, " ");
|
|
52
57
|
setInputValue(valueInput);
|
|
53
58
|
value = unformattedText;
|
|
54
59
|
} else {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Container, Slider } from "./styles";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
+
import { useCloseModal } from "../../../global-files/customHooks";
|
|
3
4
|
|
|
4
5
|
export const SliderToolTip = ({
|
|
5
6
|
infoIcon,
|
|
@@ -7,19 +8,8 @@ export const SliderToolTip = ({
|
|
|
7
8
|
iconSize,
|
|
8
9
|
slidePosition,
|
|
9
10
|
}) => {
|
|
10
|
-
const [showMenu, setShowMenu] =
|
|
11
|
-
|
|
12
|
-
const closeMenu = (e) => {
|
|
13
|
-
if (!e.target.closest("#div-slider") && showMenu) {
|
|
14
|
-
document.removeEventListener("click", closeMenu, false);
|
|
15
|
-
setShowMenu(false);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
if (showMenu) {
|
|
20
|
-
document.addEventListener("click", closeMenu, false);
|
|
21
|
-
}
|
|
22
|
-
}, [showMenu]);
|
|
11
|
+
const [showMenu, setShowMenu] = useCloseModal("div-slider");
|
|
12
|
+
|
|
23
13
|
const color = (id) => {
|
|
24
14
|
for (let i = 1; i <= slidefront.length; i++) {
|
|
25
15
|
if (id === `slidea${i}`) {
|
|
@@ -43,10 +33,9 @@ export const SliderToolTip = ({
|
|
|
43
33
|
alt="info icon"
|
|
44
34
|
className={iconSize}
|
|
45
35
|
onClick={(e) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
36
|
+
e.stopPropagation();
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
setShowMenu(true);
|
|
50
39
|
}}
|
|
51
40
|
/>
|
|
52
41
|
{showMenu && (
|
|
@@ -73,11 +62,6 @@ export const SliderToolTip = ({
|
|
|
73
62
|
<button
|
|
74
63
|
id="button-slide"
|
|
75
64
|
onClick={(e) => {
|
|
76
|
-
document.removeEventListener(
|
|
77
|
-
"click",
|
|
78
|
-
closeMenu,
|
|
79
|
-
false
|
|
80
|
-
);
|
|
81
65
|
setShowMenu(false);
|
|
82
66
|
}}
|
|
83
67
|
>
|
|
@@ -76,7 +76,9 @@ export const StatusAsignationInfo = ({
|
|
|
76
76
|
/>
|
|
77
77
|
<Button
|
|
78
78
|
buttonType={"general circular-button version-button"}
|
|
79
|
-
onClick={() => {
|
|
79
|
+
onClick={(e) => {
|
|
80
|
+
e.stopPropagation();
|
|
81
|
+
e.preventDefault();
|
|
80
82
|
setShowVersionSelector(true);
|
|
81
83
|
}}
|
|
82
84
|
label={`V${version}`}
|
|
@@ -120,7 +122,9 @@ export const StatusAsignationInfo = ({
|
|
|
120
122
|
imageType={"small-image"}
|
|
121
123
|
image={getProfilePicture(assignation.id, 20, 20)}
|
|
122
124
|
altText="user profile image"
|
|
123
|
-
onClick={() => {
|
|
125
|
+
onClick={(e) => {
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
e.stopPropagation();
|
|
124
128
|
setShowAsignationPanel(true);
|
|
125
129
|
setAssignationType(assignation?.collaboratorType);
|
|
126
130
|
}}
|
|
@@ -16,8 +16,9 @@ export const VersionSelector = ({
|
|
|
16
16
|
companyName,
|
|
17
17
|
currentVersion,
|
|
18
18
|
setShowCreateVersion,
|
|
19
|
+
setShowVersionSelector,
|
|
19
20
|
}) => {
|
|
20
|
-
const [versions, setVersions] = useState();
|
|
21
|
+
const [versions, setVersions] = useState([]);
|
|
21
22
|
|
|
22
23
|
const loadProductVersions = async (articleId) => {
|
|
23
24
|
try {
|
|
@@ -32,8 +33,13 @@ export const VersionSelector = ({
|
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
35
|
|
|
35
|
-
useEffect(
|
|
36
|
-
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
loadProductVersions(articleId);
|
|
38
|
+
|
|
39
|
+
return () => {
|
|
40
|
+
setVersions([]);
|
|
41
|
+
setShowCreateVersion(false);
|
|
42
|
+
};
|
|
37
43
|
}, []);
|
|
38
44
|
|
|
39
45
|
return (
|
|
@@ -55,6 +61,7 @@ export const VersionSelector = ({
|
|
|
55
61
|
<Button
|
|
56
62
|
image={closeIcon}
|
|
57
63
|
buttonType={"circular-button"}
|
|
64
|
+
onClick={() => setShowVersionSelector(false)}
|
|
58
65
|
id="close-button"
|
|
59
66
|
/>
|
|
60
67
|
</div>
|
|
@@ -41,7 +41,7 @@ import Slide1_3 from "../../../assets/images/sliderToolTip/slide3.svg";
|
|
|
41
41
|
import Slide1_4 from "../../../assets/images/sliderToolTip/slide4.svg";
|
|
42
42
|
import Slide1_5 from "../../../assets/images/sliderToolTip/slide5.svg";
|
|
43
43
|
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
44
|
-
import {
|
|
44
|
+
import { useCloseModal } from "../../../global-files/customHooks";
|
|
45
45
|
import { CreateVersion } from "../../organisms/CreateVersion";
|
|
46
46
|
|
|
47
47
|
const reducerImages = (state, action) => {
|
|
@@ -164,7 +164,7 @@ export const ProviderProductEdition = ({
|
|
|
164
164
|
: productToEdit
|
|
165
165
|
);
|
|
166
166
|
const [icon, setIcon] = useState(null);
|
|
167
|
-
const [version] = useState(product?.version);
|
|
167
|
+
const [version, setVersion] = useState(product?.version);
|
|
168
168
|
const [comments] = useState({});
|
|
169
169
|
const [comment, setComment] = useState("");
|
|
170
170
|
const [crossComment, setCrossComment] = useState(false);
|
|
@@ -211,7 +211,7 @@ export const ProviderProductEdition = ({
|
|
|
211
211
|
);
|
|
212
212
|
const [showCreateVersion, setShowCreateVersion] = useState(false);
|
|
213
213
|
const [showVersionSelector, setShowVersionSelector] =
|
|
214
|
-
|
|
214
|
+
useCloseModal("version-selector");
|
|
215
215
|
|
|
216
216
|
useEffect(() => {
|
|
217
217
|
checkAll && setSelectedImages(images.values);
|
|
@@ -23,62 +23,70 @@ RetailerProductEditionDefault.args = {
|
|
|
23
23
|
descriptions: 1,
|
|
24
24
|
images: 1,
|
|
25
25
|
},
|
|
26
|
-
orderId:
|
|
27
|
-
status: "
|
|
28
|
-
datasheet_status: "
|
|
26
|
+
orderId: 2426,
|
|
27
|
+
status: "AS",
|
|
28
|
+
datasheet_status: "AS",
|
|
29
29
|
prio: "none",
|
|
30
30
|
version: 2,
|
|
31
|
-
description_status: "
|
|
32
|
-
images_status: "
|
|
31
|
+
description_status: "AS",
|
|
32
|
+
images_status: "AS",
|
|
33
33
|
article: {
|
|
34
|
-
id_article:
|
|
35
|
-
id_category: "
|
|
36
|
-
name: "
|
|
37
|
-
upc: "
|
|
38
|
-
timestamp: "2022-
|
|
39
|
-
id_user:
|
|
34
|
+
id_article: 78738,
|
|
35
|
+
id_category: "2427",
|
|
36
|
+
name: "INTERRUPTOR TERMOMAGNETICO IUSA 2P 15A",
|
|
37
|
+
upc: "157126",
|
|
38
|
+
timestamp: "2022-08-01T18:28:05.000Z",
|
|
39
|
+
id_user: 651,
|
|
40
40
|
status: "NULL",
|
|
41
41
|
active: 1,
|
|
42
|
-
company_id:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
company_id: 388,
|
|
43
|
+
SKU: null,
|
|
44
|
+
Descripcion: null,
|
|
45
|
+
Proveedor: null,
|
|
46
|
+
id_proveedor: 0,
|
|
47
|
+
company_name: "",
|
|
48
|
+
country: null,
|
|
49
|
+
id_order: 2426,
|
|
50
|
+
id_datasheet_especialist: 1248,
|
|
51
|
+
id_datasheet_facilitator: 1252,
|
|
52
|
+
id_description_especialist: 1248,
|
|
53
|
+
id_description_facilitator: 1252,
|
|
54
|
+
id_images_especialist: 1251,
|
|
55
|
+
id_images_facilitator: 1286,
|
|
56
|
+
id_auditor: 1254,
|
|
53
57
|
id_recepcionist: null,
|
|
54
|
-
category:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
category:
|
|
59
|
+
"Eléctrico|Centros de Carga e Interruptores|Interruptores de Seguridad",
|
|
60
|
+
missingAttributes: null,
|
|
61
|
+
missingDescriptions: null,
|
|
62
|
+
missingImages: null,
|
|
58
63
|
},
|
|
59
64
|
retailers: [
|
|
60
65
|
{
|
|
61
|
-
id:
|
|
62
|
-
name: "
|
|
66
|
+
id: 58,
|
|
67
|
+
name: "The Home Depot Golden",
|
|
68
|
+
country: "México",
|
|
69
|
+
id_region: 1,
|
|
70
|
+
active: 1,
|
|
63
71
|
},
|
|
64
72
|
],
|
|
65
|
-
country:
|
|
66
|
-
upc: "
|
|
73
|
+
country: null,
|
|
74
|
+
upc: "157126",
|
|
67
75
|
},
|
|
68
76
|
location: {
|
|
69
77
|
product: { articleId: 109485, versionId: 3 },
|
|
70
78
|
},
|
|
71
79
|
user: {
|
|
72
|
-
id_user:
|
|
73
|
-
name: "
|
|
74
|
-
last_name: "",
|
|
75
|
-
email: "
|
|
76
|
-
position:
|
|
80
|
+
id_user: 460,
|
|
81
|
+
name: "Ismael",
|
|
82
|
+
last_name: "López",
|
|
83
|
+
email: "ilopez@contentoh.com",
|
|
84
|
+
position: "Desarrollador",
|
|
77
85
|
telephone: null,
|
|
78
|
-
country:
|
|
79
|
-
id_company:
|
|
80
|
-
id_cognito: "
|
|
81
|
-
birth_Date:
|
|
86
|
+
country: "México",
|
|
87
|
+
id_company: 254,
|
|
88
|
+
id_cognito: "9d0cc5c8-a89e-4bdd-9e2d-358a01cc9a62",
|
|
89
|
+
birth_Date: "1997-08-15T00:00:00.000Z",
|
|
82
90
|
about_me: null,
|
|
83
91
|
zip_code: null,
|
|
84
92
|
address: null,
|
|
@@ -87,18 +95,18 @@ RetailerProductEditionDefault.args = {
|
|
|
87
95
|
id_role: 1,
|
|
88
96
|
active: 1,
|
|
89
97
|
is_retailer: 0,
|
|
90
|
-
email_notify:
|
|
98
|
+
email_notify: null,
|
|
91
99
|
membership: {
|
|
92
|
-
id:
|
|
93
|
-
start_date: "
|
|
94
|
-
end_date: "
|
|
95
|
-
planID:
|
|
96
|
-
plan: "
|
|
97
|
-
name: "Plan
|
|
98
|
-
user_limit: "
|
|
99
|
-
products_limit: "
|
|
100
|
-
type: "
|
|
100
|
+
id: 750,
|
|
101
|
+
start_date: "2022-01-07T21:32:54.000Z",
|
|
102
|
+
end_date: "2023-01-07T21:32:54.000Z",
|
|
103
|
+
planID: 6,
|
|
104
|
+
plan: "prod_KvGd6YSTJyR3AP",
|
|
105
|
+
name: "Plan Small",
|
|
106
|
+
user_limit: "10",
|
|
107
|
+
products_limit: "1000",
|
|
108
|
+
type: "Enterprise",
|
|
101
109
|
},
|
|
102
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
110
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-460/460.png?1659463389000",
|
|
103
111
|
},
|
|
104
112
|
};
|
|
@@ -31,7 +31,7 @@ import { Loading } from "../../atoms/Loading";
|
|
|
31
31
|
import succes from "../../../assets/images/genericModal/genericModalCheck.svg";
|
|
32
32
|
import errorModal from "../../../assets/images/genericModal/errorModal.svg";
|
|
33
33
|
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
34
|
-
import {
|
|
34
|
+
import { useCloseModal } from "../../../global-files/customHooks";
|
|
35
35
|
import { CreateVersion } from "../../organisms/CreateVersion";
|
|
36
36
|
|
|
37
37
|
const reducerImages = (state, action) => {
|
|
@@ -169,7 +169,7 @@ export const RetailerProductEdition = ({
|
|
|
169
169
|
const isAuditor = user.id_role === 6;
|
|
170
170
|
const [showCreateVersion, setShowCreateVersion] = useState(false);
|
|
171
171
|
const [showVersionSelector, setShowVersionSelector] =
|
|
172
|
-
|
|
172
|
+
useCloseModal("version-selector");
|
|
173
173
|
|
|
174
174
|
useEffect(() => {
|
|
175
175
|
checkAll && setSelectedImages(images.values);
|
|
@@ -1267,6 +1267,7 @@ export const RetailerProductEdition = ({
|
|
|
1267
1267
|
break;
|
|
1268
1268
|
}
|
|
1269
1269
|
}}
|
|
1270
|
+
canAssign={![7, 8].includes(user.id_role)}
|
|
1270
1271
|
/>
|
|
1271
1272
|
<div
|
|
1272
1273
|
className={
|
|
@@ -1440,6 +1441,7 @@ export const RetailerProductEdition = ({
|
|
|
1440
1441
|
companyName={product.article.company_name}
|
|
1441
1442
|
currentVersion={version}
|
|
1442
1443
|
setShowCreateVersion={setShowCreateVersion}
|
|
1444
|
+
setShowVersionSelector={setShowVersionSelector}
|
|
1443
1445
|
/>
|
|
1444
1446
|
)}
|
|
1445
1447
|
{showCreateVersion && (
|