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.
Files changed (31) hide show
  1. package/dist/components/atoms/AsignationOption/index.js +1 -1
  2. package/dist/components/atoms/InputFormatter/index.js +3 -3
  3. package/dist/components/atoms/SliderToolTip/index.js +9 -23
  4. package/dist/components/atoms/Status/index.js +1 -1
  5. package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
  6. package/dist/components/atoms/StatusTag/index.js +58 -0
  7. package/dist/components/atoms/StatusTag/styles.js +20 -0
  8. package/dist/components/molecules/StatusAsignationInfo/index.js +6 -2
  9. package/dist/components/organisms/VersionSelector/index.js +13 -17
  10. package/dist/components/organisms/VersionSelector/styles.js +1 -1
  11. package/dist/components/pages/ProviderProductEdition/index.js +7 -6
  12. package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
  13. package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
  14. package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
  15. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +57 -50
  16. package/dist/components/pages/RetailerProductEdition/index.js +8 -6
  17. package/dist/global-files/customHooks.js +18 -11
  18. package/dist/global-files/data.js +1 -0
  19. package/package.json +1 -1
  20. package/src/components/atoms/AsignationOption/index.js +1 -1
  21. package/src/components/atoms/InputFormatter/index.js +8 -3
  22. package/src/components/atoms/SliderToolTip/index.js +6 -22
  23. package/src/components/atoms/Status/index.js +1 -1
  24. package/src/components/molecules/StatusAsignationInfo/index.js +6 -2
  25. package/src/components/organisms/VersionSelector/index.js +10 -3
  26. package/src/components/organisms/VersionSelector/styles.js +1 -0
  27. package/src/components/pages/ProviderProductEdition/index.js +3 -3
  28. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +58 -50
  29. package/src/components/pages/RetailerProductEdition/index.js +4 -2
  30. package/src/global-files/customHooks.js +13 -14
  31. 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: 131,
42
- status: "AA",
43
- datasheet_status: "AA",
41
+ orderId: 2426,
42
+ status: "AS",
43
+ datasheet_status: "AS",
44
44
  prio: "none",
45
45
  version: 2,
46
- description_status: "AA",
47
- images_status: "AA",
46
+ description_status: "AS",
47
+ images_status: "AS",
48
48
  article: {
49
- id_article: 76201,
50
- id_category: "632",
51
- name: "DEMO SB BAA PLAY CR SM FP PANDAS",
52
- upc: "7501816169170",
53
- timestamp: "2022-07-25T20:42:40.000Z",
54
- id_user: 119,
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: 841,
58
- company_name: "Financiado Bodega",
59
- country: "México",
60
- id_order: 131,
61
- id_datasheet_especialist: 54,
62
- id_datasheet_facilitator: 52,
63
- id_description_especialist: 54,
64
- id_description_facilitator: 52,
65
- id_images_especialist: 55,
66
- id_images_facilitator: 53,
67
- id_auditor: 30,
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: "Ropa, Accesorios, Fragancias y Joyería|Ropa Bebés|Bebé Niña",
70
- missingAttributes: 0,
71
- missingDescriptions: 0,
72
- missingImages: 0
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: 13,
76
- name: "Soriana"
79
+ id: 58,
80
+ name: "The Home Depot Golden",
81
+ country: "México",
82
+ id_region: 1,
83
+ active: 1
77
84
  }],
78
- country: "México",
79
- upc: "7501816169170"
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: 51,
89
- name: "ADMIN PRUEBA",
90
- last_name: "",
91
- email: "etc@contentoh.com",
92
- position: null,
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: null,
95
- id_company: 2,
96
- id_cognito: "a6c4d3d6-24a4-41d4-ad0f-d087438ab5b6",
97
- birth_Date: null,
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: 0,
113
+ email_notify: null,
107
114
  membership: {
108
- id: 2,
109
- start_date: "2021-11-05T02:35:12.000Z",
110
- end_date: "2022-11-05T02:34:49.000Z",
111
- planID: 1,
112
- plan: "prod_KtkvuFFLpOdP6e",
113
- name: "Plan Free",
114
- user_limit: "1",
115
- products_limit: "3",
116
- type: "PyMES"
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-51/51.png?1658991766462"
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 _closeModals = (0, _customHooks.closeModals)("version-selector"),
396
- _closeModals2 = (0, _slicedToArray2.default)(_closeModals, 2),
397
- showVersionSelector = _closeModals2[0],
398
- setShowVersionSelector = _closeModals2[1];
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.closeModals = void 0;
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 closeModals = function closeModals(id) {
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
- (0, _react.useEffect)(function () {
21
- var closeModal = function closeModal(e) {
22
- if ((!e.target.closest("#".concat(id)) || e.target.closest("#close-button") || e.target.closest("#add-version")) && showModal) {
23
- document.removeEventListener("click", closeModal);
24
- setShowModal(false);
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.closeModals = closeModals;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.1.84",
3
+ "version": "21.1.87",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -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 "../Status";
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.replace(/\n/gm, "<br>").replace(/&/gm, "&amp;");
25
+ let temp = value
26
+ .replace(/\n/gm, "<br>")
27
+ .replace(/&/gm, "&amp;")
28
+ .replace(/&nbsp;/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(/&amp;/gm, "&");
43
+ .replace(/&amp;/gm, "&")
44
+ .replace(/&nbsp;/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(/&nbsp;/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] = useState(false);
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
- setShowMenu(!showMenu);
47
- if (showMenu) {
48
- document.removeEventListener("click", closeMenu, false);
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
  >
@@ -7,7 +7,7 @@ export const Status = ({ statusType, ovalForm }) => {
7
7
  ovalForm && "oval-form"
8
8
  }`}
9
9
  >
10
- <p>{statusType ?? '-'}</p>
10
+ <p>{statusType ?? "NS"}</p>
11
11
  </Container>
12
12
  );
13
13
  };
@@ -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(async () => {
36
- await loadProductVersions(articleId);
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>
@@ -10,6 +10,7 @@ export const Container = styled.div`
10
10
  position: absolute;
11
11
  right: 0;
12
12
  top: 0;
13
+ z-index: 500;
13
14
 
14
15
  .versions-header {
15
16
  display: flex;
@@ -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 { closeModals } from "../../../global-files/customHooks";
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
- closeModals("version-selector");
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: 131,
27
- status: "AA",
28
- datasheet_status: "AA",
26
+ orderId: 2426,
27
+ status: "AS",
28
+ datasheet_status: "AS",
29
29
  prio: "none",
30
30
  version: 2,
31
- description_status: "AA",
32
- images_status: "AA",
31
+ description_status: "AS",
32
+ images_status: "AS",
33
33
  article: {
34
- id_article: 76201,
35
- id_category: "632",
36
- name: "DEMO SB BAA PLAY CR SM FP PANDAS",
37
- upc: "7501816169170",
38
- timestamp: "2022-07-25T20:42:40.000Z",
39
- id_user: 119,
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: 841,
43
- company_name: "Financiado Bodega",
44
- country: "México",
45
- id_order: 131,
46
- id_datasheet_especialist: 54,
47
- id_datasheet_facilitator: 52,
48
- id_description_especialist: 54,
49
- id_description_facilitator: 52,
50
- id_images_especialist: 55,
51
- id_images_facilitator: 53,
52
- id_auditor: 30,
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: "Ropa, Accesorios, Fragancias y Joyería|Ropa Bebés|Bebé Niña",
55
- missingAttributes: 0,
56
- missingDescriptions: 0,
57
- missingImages: 0,
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: 13,
62
- name: "Soriana",
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: "México",
66
- upc: "7501816169170",
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: 51,
73
- name: "ADMIN PRUEBA",
74
- last_name: "",
75
- email: "etc@contentoh.com",
76
- position: null,
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: null,
79
- id_company: 2,
80
- id_cognito: "a6c4d3d6-24a4-41d4-ad0f-d087438ab5b6",
81
- birth_Date: null,
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: 0,
98
+ email_notify: null,
91
99
  membership: {
92
- id: 2,
93
- start_date: "2021-11-05T02:35:12.000Z",
94
- end_date: "2022-11-05T02:34:49.000Z",
95
- planID: 1,
96
- plan: "prod_KtkvuFFLpOdP6e",
97
- name: "Plan Free",
98
- user_limit: "1",
99
- products_limit: "3",
100
- type: "PyMES",
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-51/51.png?1658991766462",
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 { closeModals } from "../../../global-files/customHooks";
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
- closeModals("version-selector");
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 && (