contentoh-components-library 21.3.98 → 21.4.0

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 (40) hide show
  1. package/dist/components/atoms/CheckBox/styles.js +1 -1
  2. package/dist/components/atoms/RetailerCatalog/index.js +4 -4
  3. package/dist/components/atoms/RetailersList/index.js +3 -1
  4. package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +1 -0
  5. package/dist/components/atoms/UserCatalog/index.js +23 -9
  6. package/dist/components/atoms/UserOption/index.js +49 -2
  7. package/dist/components/atoms/UserOption/styles.js +1 -1
  8. package/dist/components/atoms/UserSelector/index.js +13 -4
  9. package/dist/components/molecules/GridItem/index.js +4 -3
  10. package/dist/components/molecules/GridItem/styles.js +1 -1
  11. package/dist/components/molecules/HeaderItem/styles.js +1 -1
  12. package/dist/components/molecules/RowItem/index.js +1 -2
  13. package/dist/components/molecules/TabsMenu/index.js +13 -7
  14. package/dist/components/organisms/FullTabsMenu/index.js +3 -1
  15. package/dist/components/organisms/GridProducts/GridProducts.stories.js +7 -3
  16. package/dist/components/organisms/GridProducts/index.js +1 -6
  17. package/dist/components/organisms/GridProducts/utils.js +6 -2
  18. package/dist/components/pages/ProviderProductEdition/index.js +3 -2
  19. package/dist/components/pages/RetailerProductEdition/index.js +3 -2
  20. package/package.json +1 -1
  21. package/src/components/atoms/CheckBox/styles.js +1 -1
  22. package/src/components/atoms/RetailerCatalog/index.js +3 -4
  23. package/src/components/atoms/RetailersList/index.js +2 -2
  24. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +1 -0
  25. package/src/components/atoms/UserCatalog/index.js +21 -2
  26. package/src/components/atoms/UserOption/index.js +40 -1
  27. package/src/components/atoms/UserOption/styles.js +8 -1
  28. package/src/components/atoms/UserSelector/index.js +22 -4
  29. package/src/components/molecules/GridItem/index.js +2 -1
  30. package/src/components/molecules/GridItem/styles.js +1 -1
  31. package/src/components/molecules/HeaderItem/styles.js +2 -0
  32. package/src/components/molecules/RowItem/index.js +2 -2
  33. package/src/components/molecules/TabsMenu/index.js +16 -10
  34. package/src/components/organisms/FullTabsMenu/index.js +3 -1
  35. package/src/components/organisms/GridProducts/GridProducts.stories.js +14 -3
  36. package/src/components/organisms/GridProducts/index.js +1 -4
  37. package/src/components/organisms/GridProducts/utils.js +5 -1
  38. package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
  39. package/src/components/pages/ProviderProductEdition/index.js +3 -2
  40. package/src/components/pages/RetailerProductEdition/index.js +3 -2
@@ -19,6 +19,6 @@ var _variables = require("../../../global-files/variables");
19
19
 
20
20
  var _templateObject;
21
21
 
22
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n input {\n display: none;\n &:checked + label {\n &:before {\n background-color: ", ";\n background-image: url(", ");\n }\n }\n }\n\n label {\n position: relative;\n min-height: 16px;\n min-width: 16px;\n display: inline-block;\n\n p {\n display: inline;\n color: ", ";\n font-family: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 21px;\n margin-left: 20px;\n\n &.filter-text {\n color: ", ";\n font-size: 18px;\n line-height: 24px;\n margin-left: 23px;\n }\n }\n\n &:before {\n content: \"\";\n width: 16px;\n height: 16px;\n position: absolute;\n display: inline-block;\n top: 50%;\n transform: translateY(-50%);\n background-image: url(", ");\n z-index: 110;\n cursor: pointer;\n }\n }\n"])), _variables.GlobalColors.white, _checked.default, _variables.GlobalColors.s4, _variables.FontFamily.AvenirNext, _variables.GlobalColors.magenta_s2, _unchecked.default);
22
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n input {\n display: none;\n &:checked + label {\n &:before {\n background-color: ", ";\n background-image: url(", ");\n }\n }\n }\n\n label {\n position: relative;\n min-height: 16px;\n min-width: 16px;\n display: inline-block;\n\n p {\n display: inline;\n color: ", ";\n font-family: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 21px;\n margin-left: 20px;\n\n &.filter-text {\n color: ", ";\n font-size: 18px;\n line-height: 24px;\n margin-left: 23px;\n }\n }\n\n &:before {\n content: \"\";\n width: 16px;\n height: 16px;\n position: absolute;\n display: inline-block;\n top: 50%;\n transform: translateY(-50%);\n background-image: url(", ");\n z-index: 5;\n cursor: pointer;\n }\n }\n"])), _variables.GlobalColors.white, _checked.default, _variables.GlobalColors.s4, _variables.FontFamily.AvenirNext, _variables.GlobalColors.magenta_s2, _unchecked.default);
23
23
 
24
24
  exports.Container = Container;
@@ -42,11 +42,10 @@ var RetailerCatalog = function RetailerCatalog(_ref) {
42
42
 
43
43
  (0, _react.useEffect)(function () {
44
44
  setRetLimit(limit);
45
- console.log("limit");
46
45
  }, [retailers]);
47
46
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
48
- id: id,
49
- onClick: function onClick() {
47
+ onClick: function onClick(e) {
48
+ e.stopPropagation();
50
49
  setShowRetailers(true);
51
50
  },
52
51
  children: [retailers.map(function (retailer, i) {
@@ -62,7 +61,8 @@ var RetailerCatalog = function RetailerCatalog(_ref) {
62
61
  })
63
62
  }), showRetailers && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RetailersList.RetailersList, {
64
63
  retailers: retailers,
65
- article: article
64
+ article: article,
65
+ id: id
66
66
  })]
67
67
  });
68
68
  };
@@ -21,7 +21,8 @@ var _jsxRuntime = require("react/jsx-runtime");
21
21
 
22
22
  var RetailersList = function RetailersList(_ref) {
23
23
  var retailers = _ref.retailers,
24
- article = _ref.article;
24
+ article = _ref.article,
25
+ id = _ref.id;
25
26
 
26
27
  var _useState = (0, _react.useState)({}),
27
28
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -32,6 +33,7 @@ var RetailersList = function RetailersList(_ref) {
32
33
  if (article) setServices(article.statusByRetailer);
33
34
  }, [article]);
34
35
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
36
+ id: id,
35
37
  children: retailers.map(function (retailer, i) {
36
38
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RetailerOption.RetailerOption, {
37
39
  retailer: retailer,
@@ -26,6 +26,7 @@ var Template = function Template(args) {
26
26
  var UserCatalogDefault = Template.bind({});
27
27
  exports.UserCatalogDefault = UserCatalogDefault;
28
28
  UserCatalogDefault.args = {
29
+ product: "product",
29
30
  datasheet: 54,
30
31
  description: 54,
31
32
  images: 55,
@@ -17,10 +17,10 @@ var _data = require("../../../global-files/data");
17
17
 
18
18
  var _UserOption = require("../UserOption");
19
19
 
20
- var _react = require("react");
21
-
22
20
  var _customHooks = require("../../../global-files/customHooks");
23
21
 
22
+ var _react = require("react");
23
+
24
24
  var _jsxRuntime = require("react/jsx-runtime");
25
25
 
26
26
  var UserCatalog = function UserCatalog(_ref) {
@@ -35,7 +35,9 @@ var UserCatalog = function UserCatalog(_ref) {
35
35
  _ref$imagesSpecialist = _ref.imagesSpecialists,
36
36
  imagesSpecialists = _ref$imagesSpecialist === void 0 ? [] : _ref$imagesSpecialist,
37
37
  _ref$id = _ref.id,
38
- id = _ref$id === void 0 ? "list-modal" : _ref$id;
38
+ id = _ref$id === void 0 ? "list-modal" : _ref$id,
39
+ onAssign = _ref.onAssign,
40
+ product = _ref.product;
39
41
 
40
42
  var _useCloseModal = (0, _customHooks.useCloseModal)(id),
41
43
  _useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
@@ -43,10 +45,10 @@ var UserCatalog = function UserCatalog(_ref) {
43
45
  setShowList = _useCloseModal2[1];
44
46
 
45
47
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
48
+ id: id,
46
49
  onClick: function onClick() {
47
- return setShowList(true);
50
+ setShowList(true);
48
51
  },
49
- id: id,
50
52
  children: [datasheet && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
51
53
  image: (0, _data.getProfilePicture)(datasheet, 26, 26),
52
54
  altText: "datasheet specialist",
@@ -66,21 +68,33 @@ var UserCatalog = function UserCatalog(_ref) {
66
68
  }), showList && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
67
69
  className: "users-assigned-list",
68
70
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_UserOption.UserOption, {
71
+ onAssign: onAssign,
72
+ product: product,
69
73
  userId: datasheet,
70
74
  usersArray: textSpecialists,
71
- id: id + "-" + datasheet
75
+ id: id + "-" + datasheet,
76
+ index: "datasheet"
72
77
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_UserOption.UserOption, {
78
+ onAssign: onAssign,
79
+ product: product,
73
80
  userId: description,
74
81
  usersArray: textSpecialists,
75
- id: id + "-" + description
82
+ id: id + "-" + description,
83
+ index: "description"
76
84
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_UserOption.UserOption, {
85
+ onAssign: onAssign,
86
+ product: product,
77
87
  userId: images,
78
88
  usersArray: imagesSpecialists,
79
- id: id + "-" + images
89
+ id: id + "-" + images,
90
+ index: "image"
80
91
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_UserOption.UserOption, {
92
+ onAssign: onAssign,
93
+ product: product,
81
94
  userId: auditor,
82
95
  usersArray: auditors,
83
- id: id + "-" + auditor
96
+ id: id + "-" + auditor,
97
+ index: "auditor"
84
98
  })]
85
99
  })]
86
100
  });
@@ -29,7 +29,9 @@ var UserOption = function UserOption(_ref) {
29
29
  var userId = _ref.userId,
30
30
  index = _ref.index,
31
31
  usersArray = _ref.usersArray,
32
- id = _ref.id;
32
+ id = _ref.id,
33
+ onAssign = _ref.onAssign,
34
+ product = _ref.product;
33
35
 
34
36
  var _useState = (0, _react.useState)({}),
35
37
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -41,6 +43,21 @@ var UserOption = function UserOption(_ref) {
41
43
  showSelector = _useCloseModal2[0],
42
44
  setShowSelector = _useCloseModal2[1];
43
45
 
46
+ var _useState3 = (0, _react.useState)(""),
47
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
48
+ assignationTarget = _useState4[0],
49
+ setAssignationTarget = _useState4[1];
50
+
51
+ var _useState5 = (0, _react.useState)(""),
52
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
53
+ concept = _useState6[0],
54
+ setConcept = _useState6[1];
55
+
56
+ var _useState7 = (0, _react.useState)(""),
57
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
58
+ target = _useState8[0],
59
+ setTarget = _useState8[1];
60
+
44
61
  var icons = _utils.servicesCodeIcon;
45
62
  (0, _react.useEffect)(function () {
46
63
  if (usersArray) {
@@ -51,6 +68,31 @@ var UserOption = function UserOption(_ref) {
51
68
  });
52
69
  }
53
70
  }, [userId, usersArray]);
71
+ (0, _react.useEffect)(function () {
72
+ switch (index) {
73
+ case "datasheet":
74
+ case "description":
75
+ setAssignationTarget("id_".concat(index, "_specialist"));
76
+ setConcept(index);
77
+ setTarget("specialist");
78
+ break;
79
+
80
+ case "image":
81
+ setAssignationTarget("id_".concat(index, "s_specialist"));
82
+ setConcept(index + "s");
83
+ setTarget("specialist");
84
+ break;
85
+
86
+ case "auditor":
87
+ setAssignationTarget("id_".concat(index));
88
+ setConcept(index);
89
+ setTarget(index);
90
+ break;
91
+
92
+ default:
93
+ break;
94
+ }
95
+ }, [index]);
54
96
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
55
97
  onClick: function onClick() {
56
98
  return setShowSelector(true);
@@ -72,7 +114,12 @@ var UserOption = function UserOption(_ref) {
72
114
  searchLabel: "Buscar Usuario",
73
115
  index: index,
74
116
  usersArray: usersArray,
75
- position: "absolute"
117
+ position: "absolute",
118
+ onAssign: onAssign,
119
+ product: product,
120
+ assignationTarget: assignationTarget,
121
+ target: target,
122
+ concept: concept
76
123
  })]
77
124
  });
78
125
  };
@@ -15,6 +15,6 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid #f0f0f0;\n border-radius: 5px;\n color: #262626;\n font-size: 12px;\n font-family: ", ";\n display: flex;\n align-items: center;\n padding: 5px 10px;\n justify-content: space-between;\n cursor: pointer;\n position: relative;\n background-color: white;\n width: 217px;\n\n .image-and-name {\n display: flex;\n align-items: center;\n\n div + p {\n margin-left: 10px;\n }\n }\n\n .icon-container {\n position: relative;\n span {\n color: #808080;\n cursor: pointer;\n\n & + span {\n display: none;\n position: absolute;\n right: 120%;\n top: 50%;\n transform: translateY(-50%);\n white-space: nowrap;\n }\n\n &:hover {\n & + span {\n display: block;\n }\n }\n }\n }\n\n & + * {\n margin-top: 5px;\n }\n"])), _variables.FontFamily.Lato);
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid #f0f0f0;\n border-radius: 5px;\n color: #262626;\n font-size: 12px;\n font-family: ", ";\n display: flex;\n align-items: center;\n padding: 5px 10px;\n justify-content: space-between;\n cursor: pointer;\n position: relative;\n background-color: white;\n\n .image-and-name {\n display: flex;\n align-items: center;\n\n div + p {\n margin-left: 10px;\n white-space: nowrap;\n }\n\n & + * {\n margin-left: 10px;\n }\n }\n\n .icon-container {\n position: relative;\n span {\n color: #808080;\n cursor: pointer;\n\n & + span {\n display: none;\n position: absolute;\n right: 120%;\n top: 50%;\n transform: translateY(-50%);\n white-space: nowrap;\n border: 1px solid #f0f0f0;\n padding: 5px;\n background-color: white;\n }\n\n &:hover {\n & + span {\n display: block;\n }\n }\n }\n }\n\n & + * {\n margin-top: 5px;\n }\n"])), _variables.FontFamily.Lato);
19
19
 
20
20
  exports.Container = Container;
@@ -21,14 +21,20 @@ var _data = require("../../../global-files/data");
21
21
 
22
22
  var _react = require("react");
23
23
 
24
+ var _customHooks = require("../../../global-files/customHooks");
25
+
24
26
  var _jsxRuntime = require("react/jsx-runtime");
25
27
 
26
28
  var UserSelector = function UserSelector(_ref) {
27
29
  var searchLabel = _ref.searchLabel,
28
- index = _ref.index,
29
30
  usersArray = _ref.usersArray,
30
- onClick = _ref.onClick,
31
- position = _ref.position;
31
+ position = _ref.position,
32
+ id = _ref.id,
33
+ onAssign = _ref.onAssign,
34
+ product = _ref.product,
35
+ assignationTarget = _ref.assignationTarget,
36
+ target = _ref.target,
37
+ concept = _ref.concept;
32
38
 
33
39
  var _useState = (0, _react.useState)([]),
34
40
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -53,6 +59,7 @@ var UserSelector = function UserSelector(_ref) {
53
59
 
54
60
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
55
61
  position: position,
62
+ id: id + "users-list",
56
63
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
57
64
  className: "search-cotainer",
58
65
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
@@ -70,7 +77,9 @@ var UserSelector = function UserSelector(_ref) {
70
77
  children: userFiltered.length ? userFiltered.map(function (user) {
71
78
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
72
79
  className: "user-item",
73
- onClick: onClick,
80
+ onClick: function onClick(e) {
81
+ return onAssign && onAssign(product, user.id_user, assignationTarget, target, concept);
82
+ },
74
83
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
75
84
  image: (0, _data.getProfilePicture)(user.id_user, 26, 26),
76
85
  altText: "profile image",
@@ -33,7 +33,8 @@ var GridItem = function GridItem(_ref) {
33
33
  isMerchans = _ref.isMerchans,
34
34
  chkOnChange = _ref.chkOnChange,
35
35
  onGridClick = _ref.onGridClick,
36
- chkChecked = _ref.chkChecked;
36
+ chkChecked = _ref.chkChecked,
37
+ index = _ref.index;
37
38
  var _gridElement$images = gridElement.images,
38
39
  images = _gridElement$images === void 0 ? [] : _gridElement$images,
39
40
  _gridElement$info = gridElement.info,
@@ -43,8 +44,8 @@ var GridItem = function GridItem(_ref) {
43
44
  _gridElement$catalogs = gridElement.catalogs,
44
45
  catalogs = _gridElement$catalogs === void 0 ? {} : _gridElement$catalogs;
45
46
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
46
- onClick: function onClick() {
47
- return onGridClick && onGridClick(product);
47
+ onClick: function onClick(e) {
48
+ return onGridClick && onGridClick(e, product, index);
48
49
  },
49
50
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
50
51
  className: "chk-container",
@@ -15,6 +15,6 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 175px;\n border: 1px solid #f0f0f0;\n position: relative;\n\n .chk-container {\n position: absolute;\n top: 5px;\n left: 5px;\n z-index: 10;\n height: 16px;\n }\n\n .data-body {\n padding: 10px;\n border-bottom: 1px solid #f0f0f0;\n\n h3,\n p {\n color: #262626;\n font-family: ", ";\n font-size: 12px;\n line-height: 16px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n & + p {\n margin-top: 5px;\n }\n }\n p {\n font-size: 10px;\n line-height: 12px;\n color: #808080;\n }\n }\n\n .status-slider {\n display: flex;\n padding: 5px 10px;\n overflow: auto;\n border-bottom: 1px solid #f0f0f0;\n flex-wrap: nowrap;\n\n .status-element {\n display: flex;\n }\n\n * + * {\n margin-left: 10px;\n }\n }\n\n .cart-and-raiting,\n .retailers-and-user {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 5px 10px;\n .star-button {\n button {\n padding: 3px;\n color: transparent;\n -webkit-text-stroke: 1px #808080;\n }\n }\n }\n\n .retailers-and-user {\n padding: 0;\n > * {\n flex: 1 0 50%;\n display: flex;\n padding: 5px;\n height: 36px;\n }\n .retailers-container {\n border-right: 1px solid #f0f0f0;\n }\n }\n"])), _variables.FontFamily.Lato);
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 175px;\n border: 1px solid #f0f0f0;\n position: relative;\n\n .chk-container {\n position: absolute;\n top: 5px;\n left: 5px;\n z-index: 5;\n height: 16px;\n }\n\n .data-body {\n padding: 10px;\n border-bottom: 1px solid #f0f0f0;\n\n h3,\n p {\n color: #262626;\n font-family: ", ";\n font-size: 12px;\n line-height: 16px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n & + p {\n margin-top: 5px;\n }\n }\n p {\n font-size: 10px;\n line-height: 12px;\n color: #808080;\n }\n }\n\n .status-slider {\n display: flex;\n padding: 5px 10px;\n overflow: auto;\n border-bottom: 1px solid #f0f0f0;\n flex-wrap: nowrap;\n\n .status-element {\n display: flex;\n }\n\n * + * {\n margin-left: 10px;\n }\n }\n\n .cart-and-raiting,\n .retailers-and-user {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 5px 10px;\n .star-button {\n button {\n padding: 3px;\n color: transparent;\n -webkit-text-stroke: 1px #808080;\n }\n }\n }\n\n .retailers-and-user {\n padding: 0;\n > * {\n flex: 1 0 50%;\n display: flex;\n padding: 5px;\n height: 36px;\n }\n .retailers-container {\n border-right: 1px solid #f0f0f0;\n }\n }\n"])), _variables.FontFamily.Lato);
19
19
 
20
20
  exports.Container = Container;
@@ -15,7 +15,7 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject, _templateObject2;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: #f0f0f0;\n display: flex;\n\n .chk-global-container {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 30px;\n }\n"])));
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: #f0f0f0;\n display: flex;\n width: 100%;\n min-width: fit-content;\n\n .chk-global-container {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 30px;\n }\n"])));
19
19
 
20
20
  exports.Container = Container;
21
21
 
@@ -22,13 +22,12 @@ var RowItem = function RowItem(_ref) {
22
22
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
23
23
  children: productsArray.map(function (_ref2, i) {
24
24
  var cols = _ref2.cols,
25
- id = _ref2.id,
26
25
  product = _ref2.product,
27
26
  article = _ref2.article;
28
27
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
29
28
  className: "row-container",
30
29
  onClick: function onClick(e) {
31
- return onGridClick && onGridClick(product);
30
+ return onGridClick && onGridClick(e, product, i);
32
31
  },
33
32
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
34
33
  className: "chk-container",
@@ -29,7 +29,10 @@ var TabsMenu = function TabsMenu(_ref) {
29
29
  activeTab = _ref.activeTab,
30
30
  updatedDescriptions = _ref.updatedDescriptions,
31
31
  updatedDatasheets = _ref.updatedDatasheets,
32
- images = _ref.images;
32
+ images = _ref.images,
33
+ setUpdatedDescriptions = _ref.setUpdatedDescriptions,
34
+ setUpdatedDatasheets = _ref.setUpdatedDatasheets,
35
+ setImages = _ref.setImages;
33
36
 
34
37
  var _useState = (0, _react.useState)(tabsSections),
35
38
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -68,11 +71,14 @@ var TabsMenu = function TabsMenu(_ref) {
68
71
  };
69
72
 
70
73
  (0, _react.useEffect)(function () {
71
- if (cancelAccept === "Aceptar" & llave !== "") {
74
+ if (cancelAccept === "Aceptar" && llave !== "") {
72
75
  setCancelAccept("");
73
76
  setModal(false);
74
77
  activeSection(llave, objeto);
75
- } else if (cancelAccept === "Cancelar" & llave !== "") {
78
+ setUpdatedDescriptions([]);
79
+ setUpdatedDatasheets([]);
80
+ setImages({});
81
+ } else if (cancelAccept === "Cancelar" && llave !== "") {
76
82
  setModal(false);
77
83
  setCancelAccept("");
78
84
  }
@@ -109,15 +115,15 @@ var TabsMenu = function TabsMenu(_ref) {
109
115
  type: "white",
110
116
  label: "Cancelar",
111
117
  size: 12,
112
- onClick: function onClick(event) {
113
- return setCancelAccept(event.target.textContent);
118
+ onClick: function onClick() {
119
+ return setCancelAccept("Cancelar");
114
120
  }
115
121
  }, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
116
122
  type: "pink",
117
123
  label: "Aceptar",
118
124
  size: 12,
119
- onClick: function onClick(event) {
120
- return setCancelAccept(event.target.textContent);
125
+ onClick: function onClick() {
126
+ return setCancelAccept("Aceptar");
121
127
  }
122
128
  }, "btn-Aceptar")]
123
129
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
@@ -40,9 +40,10 @@ var FullTabsMenu = function FullTabsMenu(_ref) {
40
40
  updatedDescriptions = _ref.updatedDescriptions,
41
41
  updatedDatasheets = _ref.updatedDatasheets,
42
42
  selectedImages = _ref.selectedImages,
43
+ setSelectedImages = _ref.setSelectedImages,
43
44
  setUpdatedDescriptions = _ref.setUpdatedDescriptions,
44
45
  setUpdatedDatasheets = _ref.setUpdatedDatasheets,
45
- setSelectedImages = _ref.setSelectedImages;
46
+ setImages = _ref.setImages;
46
47
 
47
48
  var _useState = (0, _react.useState)(false),
48
49
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -61,6 +62,7 @@ var FullTabsMenu = function FullTabsMenu(_ref) {
61
62
  selectedImages: selectedImages,
62
63
  setUpdatedDescriptions: setUpdatedDescriptions,
63
64
  setUpdatedDatasheets: setUpdatedDatasheets,
65
+ setImages: setImages,
64
66
  setSelectedImages: setSelectedImages
65
67
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.StatusAsignationInfo, {
66
68
  canAssign: canAssign,
@@ -5008,11 +5008,15 @@ var setSelected = function setSelected(arr) {
5008
5008
  selected = arr;
5009
5009
  };
5010
5010
 
5011
+ var onAssign = function onAssign(productData, assigneeID, assignationTarget, concept, target) {
5012
+ console.log(productData, assigneeID, assignationTarget, concept, target);
5013
+ };
5014
+
5011
5015
  GridProductsDefault.args = {
5012
5016
  gridView: false,
5013
5017
  selected: selected,
5014
5018
  setSelected: setSelected,
5015
- products: (0, _utils.getProductsToTable)(products, textSpecialists, imagesSpecialists, auditors, images),
5019
+ products: (0, _utils.getProductsToTable)(products, textSpecialists, imagesSpecialists, auditors, images, onAssign),
5016
5020
  images: images,
5017
5021
  auditors: auditors,
5018
5022
  textSpecialists: textSpecialists,
@@ -5077,8 +5081,8 @@ GridProductsDefault.args = {
5077
5081
  });
5078
5082
  return (productSelected === null || productSelected === void 0 ? void 0 : productSelected.length) > 0;
5079
5083
  },
5080
- onGridClick: function onGridClick(e) {
5081
- console.log(e);
5084
+ onGridClick: function onGridClick(e, product, i) {
5085
+ if (!e.target.closest("[id^=users]")) console.log(product, i);
5082
5086
  },
5083
5087
  chkCheckedAll: function chkCheckedAll() {
5084
5088
  return selected.length === products.length;
@@ -11,14 +11,8 @@ var _GridItem = require("../../molecules/GridItem");
11
11
 
12
12
  var _HeaderItem = require("../../molecules/HeaderItem");
13
13
 
14
- var _utils = require("./utils");
15
-
16
- var _react = require("react");
17
-
18
14
  var _RowItem = require("../../molecules/RowItem");
19
15
 
20
- var _CheckBox = require("../../atoms/CheckBox");
21
-
22
16
  var _jsxRuntime = require("react/jsx-runtime");
23
17
 
24
18
  var GridProducts = function GridProducts(_ref) {
@@ -42,6 +36,7 @@ var GridProducts = function GridProducts(_ref) {
42
36
  id = _ref2.id;
43
37
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridItem.GridItem, {
44
38
  id: id,
39
+ index: i,
45
40
  product: product,
46
41
  gridElement: gridElement,
47
42
  chkOnChange: chkOnChange,
@@ -17,6 +17,7 @@ var getProductsToTable = function getProductsToTable() {
17
17
  var imagesSpecialists = arguments.length > 2 ? arguments[2] : undefined;
18
18
  var auditors = arguments.length > 3 ? arguments[3] : undefined;
19
19
  var images = arguments.length > 4 ? arguments[4] : undefined;
20
+ var onAssign = arguments.length > 5 ? arguments[5] : undefined;
20
21
  var productsTableArray = [];
21
22
  products.forEach(function (product) {
22
23
  var article = product.article,
@@ -72,7 +73,8 @@ var getProductsToTable = function getProductsToTable() {
72
73
  textSpecialists: textSpecialists,
73
74
  imagesSpecialists: imagesSpecialists,
74
75
  auditors: auditors,
75
- id: "users-" + id
76
+ id: "users-" + id,
77
+ product: product
76
78
  }),
77
79
  flex: 1,
78
80
  minWidth: 100
@@ -123,7 +125,9 @@ var getProductsToTable = function getProductsToTable() {
123
125
  textSpecialists: textSpecialists,
124
126
  imagesSpecialists: imagesSpecialists,
125
127
  auditors: auditors,
126
- id: "users-" + id
128
+ id: "users-" + id,
129
+ onAssign: onAssign,
130
+ product: product
127
131
  })
128
132
  }
129
133
  },
@@ -2182,11 +2182,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2182
2182
  showSaveButton: enableActions(product.version_status),
2183
2183
  version: version,
2184
2184
  updatedDescriptions: updatedDescriptions,
2185
+ setUpdatedDescriptions: setUpdatedDescriptions,
2185
2186
  updatedDatasheets: updatedDatasheets,
2187
+ setUpdatedDatasheets: setUpdatedDatasheets,
2186
2188
  images: images,
2189
+ setImages: setImages,
2187
2190
  selectedImages: selectedImages,
2188
- setUpdatedDescriptions: setUpdatedDescriptions,
2189
- setUpdatedDatasheets: setUpdatedDatasheets,
2190
2191
  setSelectedImages: setSelectedImages,
2191
2192
  setShowVersionSelector: setShowVersionSelector,
2192
2193
  onClickSave: function onClickSave() {
@@ -1996,11 +1996,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1996
1996
  imag: imag,
1997
1997
  setImag: setImag,
1998
1998
  updatedDescriptions: updatedDescriptions,
1999
+ setUpdatedDescriptions: setUpdatedDescriptions,
1999
2000
  updatedDatasheets: updatedDatasheets,
2001
+ setUpdatedDatasheets: setUpdatedDatasheets,
2000
2002
  images: images,
2003
+ setImages: setImages,
2001
2004
  selectedImages: selectedImages,
2002
- setUpdatedDescriptions: setUpdatedDescriptions,
2003
- setUpdatedDatasheets: setUpdatedDatasheets,
2004
2005
  setSelectedImages: setSelectedImages,
2005
2006
  setShowVersionSelector: setShowVersionSelector,
2006
2007
  onClickSave: function onClickSave() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.3.98",
3
+ "version": "21.4.0",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -46,7 +46,7 @@ export const Container = styled.div`
46
46
  top: 50%;
47
47
  transform: translateY(-50%);
48
48
  background-image: url(${unchecked});
49
- z-index: 110;
49
+ z-index: 5;
50
50
  cursor: pointer;
51
51
  }
52
52
  }
@@ -16,13 +16,12 @@ export const RetailerCatalog = ({
16
16
 
17
17
  useEffect(() => {
18
18
  setRetLimit(limit);
19
- console.log("limit");
20
19
  }, [retailers]);
21
20
 
22
21
  return (
23
22
  <Container
24
- id={id}
25
- onClick={() => {
23
+ onClick={(e) => {
24
+ e.stopPropagation();
26
25
  setShowRetailers(true);
27
26
  }}
28
27
  >
@@ -43,7 +42,7 @@ export const RetailerCatalog = ({
43
42
  </div>
44
43
  )}
45
44
  {showRetailers && (
46
- <RetailersList retailers={retailers} article={article} />
45
+ <RetailersList retailers={retailers} article={article} id={id} />
47
46
  )}
48
47
  </Container>
49
48
  );
@@ -3,7 +3,7 @@ import { RetailerOption } from "../RetailerOption";
3
3
  import { useState, useEffect } from "react";
4
4
  import axios from "axios";
5
5
 
6
- export const RetailersList = ({ retailers, article }) => {
6
+ export const RetailersList = ({ retailers, article, id }) => {
7
7
  const [services, setServices] = useState({});
8
8
 
9
9
  useEffect(() => {
@@ -11,7 +11,7 @@ export const RetailersList = ({ retailers, article }) => {
11
11
  }, [article]);
12
12
 
13
13
  return (
14
- <Container>
14
+ <Container id={id}>
15
15
  {retailers.map((retailer, i) => (
16
16
  <RetailerOption key={i} retailer={retailer} services={services} />
17
17
  ))}
@@ -8,6 +8,7 @@ export default {
8
8
  const Template = (args) => <UserCatalog {...args} />;
9
9
  export const UserCatalogDefault = Template.bind({});
10
10
  UserCatalogDefault.args = {
11
+ product: "product",
11
12
  datasheet: 54,
12
13
  description: 54,
13
14
  images: 55,
@@ -2,8 +2,8 @@ import { Container } from "./styles";
2
2
  import { Avatar } from "../Avatar";
3
3
  import { getProfilePicture } from "../../../global-files/data";
4
4
  import { UserOption } from "../UserOption";
5
- import { useState } from "react";
6
5
  import { useCloseModal } from "../../../global-files/customHooks";
6
+ import { useState } from "react";
7
7
  import { useEffect } from "react";
8
8
 
9
9
  export const UserCatalog = ({
@@ -15,11 +15,18 @@ export const UserCatalog = ({
15
15
  textSpecialists = [],
16
16
  imagesSpecialists = [],
17
17
  id = "list-modal",
18
+ onAssign,
19
+ product,
18
20
  }) => {
19
21
  const [showList, setShowList] = useCloseModal(id);
20
22
 
21
23
  return (
22
- <Container onClick={() => setShowList(true)} id={id}>
24
+ <Container
25
+ id={id}
26
+ onClick={() => {
27
+ setShowList(true);
28
+ }}
29
+ >
23
30
  {datasheet && (
24
31
  <Avatar
25
32
  image={getProfilePicture(datasheet, 26, 26)}
@@ -51,24 +58,36 @@ export const UserCatalog = ({
51
58
  {showList && (
52
59
  <div className="users-assigned-list">
53
60
  <UserOption
61
+ onAssign={onAssign}
62
+ product={product}
54
63
  userId={datasheet}
55
64
  usersArray={textSpecialists}
56
65
  id={id + "-" + datasheet}
66
+ index={"datasheet"}
57
67
  />
58
68
  <UserOption
69
+ onAssign={onAssign}
70
+ product={product}
59
71
  userId={description}
60
72
  usersArray={textSpecialists}
61
73
  id={id + "-" + description}
74
+ index={"description"}
62
75
  />
63
76
  <UserOption
77
+ onAssign={onAssign}
78
+ product={product}
64
79
  userId={images}
65
80
  usersArray={imagesSpecialists}
66
81
  id={id + "-" + images}
82
+ index={"image"}
67
83
  />
68
84
  <UserOption
85
+ onAssign={onAssign}
86
+ product={product}
69
87
  userId={auditor}
70
88
  usersArray={auditors}
71
89
  id={id + "-" + auditor}
90
+ index={"auditor"}
72
91
  />
73
92
  </div>
74
93
  )}
@@ -7,9 +7,20 @@ import { servicesCodeIcon } from "../../organisms/OrderDetail/utils/Table/utils"
7
7
  import { UserSelector } from "../UserSelector";
8
8
  import { useCloseModal } from "../../../global-files/customHooks";
9
9
 
10
- export const UserOption = ({ userId, index, usersArray, id }) => {
10
+ export const UserOption = ({
11
+ userId,
12
+ index,
13
+ usersArray,
14
+ id,
15
+ onAssign,
16
+ product,
17
+ }) => {
11
18
  const [userAssigned, setUserAssigned] = useState({});
12
19
  const [showSelector, setShowSelector] = useCloseModal(id);
20
+ const [assignationTarget, setAssignationTarget] = useState("");
21
+ const [concept, setConcept] = useState("");
22
+ const [target, setTarget] = useState("");
23
+
13
24
  const icons = servicesCodeIcon;
14
25
 
15
26
  useEffect(() => {
@@ -22,6 +33,29 @@ export const UserOption = ({ userId, index, usersArray, id }) => {
22
33
  }
23
34
  }, [userId, usersArray]);
24
35
 
36
+ useEffect(() => {
37
+ switch (index) {
38
+ case "datasheet":
39
+ case "description":
40
+ setAssignationTarget(`id_${index}_specialist`);
41
+ setConcept(index);
42
+ setTarget("specialist");
43
+ break;
44
+ case "image":
45
+ setAssignationTarget(`id_${index}s_specialist`);
46
+ setConcept(index + "s");
47
+ setTarget("specialist");
48
+ break;
49
+ case "auditor":
50
+ setAssignationTarget(`id_${index}`);
51
+ setConcept(index);
52
+ setTarget(index);
53
+ break;
54
+ default:
55
+ break;
56
+ }
57
+ }, [index]);
58
+
25
59
  return (
26
60
  <Container onClick={() => setShowSelector(true)}>
27
61
  <div className="image-and-name">
@@ -42,6 +76,11 @@ export const UserOption = ({ userId, index, usersArray, id }) => {
42
76
  index={index}
43
77
  usersArray={usersArray}
44
78
  position="absolute"
79
+ onAssign={onAssign}
80
+ product={product}
81
+ assignationTarget={assignationTarget}
82
+ target={target}
83
+ concept={concept}
45
84
  />
46
85
  )}
47
86
  </Container>
@@ -14,7 +14,6 @@ export const Container = styled.div`
14
14
  cursor: pointer;
15
15
  position: relative;
16
16
  background-color: white;
17
- width: 217px;
18
17
 
19
18
  .image-and-name {
20
19
  display: flex;
@@ -22,6 +21,11 @@ export const Container = styled.div`
22
21
 
23
22
  div + p {
24
23
  margin-left: 10px;
24
+ white-space: nowrap;
25
+ }
26
+
27
+ & + * {
28
+ margin-left: 10px;
25
29
  }
26
30
  }
27
31
 
@@ -38,6 +42,9 @@ export const Container = styled.div`
38
42
  top: 50%;
39
43
  transform: translateY(-50%);
40
44
  white-space: nowrap;
45
+ border: 1px solid #f0f0f0;
46
+ padding: 5px;
47
+ background-color: white;
41
48
  }
42
49
 
43
50
  &:hover {
@@ -5,13 +5,18 @@ import { Avatar } from "../Avatar";
5
5
  import { getProfilePicture } from "../../../global-files/data";
6
6
  import { useState } from "react";
7
7
  import { useEffect } from "react";
8
+ import { useCloseModal } from "../../../global-files/customHooks";
8
9
 
9
10
  export const UserSelector = ({
10
11
  searchLabel,
11
- index,
12
12
  usersArray,
13
- onClick,
14
13
  position,
14
+ id,
15
+ onAssign,
16
+ product,
17
+ assignationTarget,
18
+ target,
19
+ concept,
15
20
  }) => {
16
21
  const [text, setText] = useState([]);
17
22
  const [userFiltered, setUsersFiltered] = useState([]);
@@ -33,7 +38,7 @@ export const UserSelector = ({
33
38
  };
34
39
 
35
40
  return (
36
- <Container position={position}>
41
+ <Container position={position} id={id + "users-list"}>
37
42
  <div className="search-cotainer">
38
43
  <Icon icon={faSearch} />
39
44
  <input
@@ -48,7 +53,20 @@ export const UserSelector = ({
48
53
  <div className="selector-container">
49
54
  {userFiltered.length ? (
50
55
  userFiltered.map((user) => (
51
- <div key={user.id_user} className="user-item" onClick={onClick}>
56
+ <div
57
+ key={user.id_user}
58
+ className="user-item"
59
+ onClick={(e) =>
60
+ onAssign &&
61
+ onAssign(
62
+ product,
63
+ user.id_user,
64
+ assignationTarget,
65
+ target,
66
+ concept
67
+ )
68
+ }
69
+ >
52
70
  <Avatar
53
71
  image={getProfilePicture(user.id_user, 26, 26)}
54
72
  altText={"profile image"}
@@ -16,11 +16,12 @@ export const GridItem = ({
16
16
  chkOnChange,
17
17
  onGridClick,
18
18
  chkChecked,
19
+ index,
19
20
  }) => {
20
21
  const { images = [], info = [], status = [], catalogs = {} } = gridElement;
21
22
 
22
23
  return (
23
- <Container onClick={() => onGridClick && onGridClick(product)}>
24
+ <Container onClick={(e) => onGridClick && onGridClick(e, product, index)}>
24
25
  <div className="chk-container" onClick={(e) => e.stopPropagation()}>
25
26
  <CheckBox
26
27
  id={id}
@@ -10,7 +10,7 @@ export const Container = styled.div`
10
10
  position: absolute;
11
11
  top: 5px;
12
12
  left: 5px;
13
- z-index: 10;
13
+ z-index: 5;
14
14
  height: 16px;
15
15
  }
16
16
 
@@ -4,6 +4,8 @@ import { FontFamily } from "../../../global-files/variables";
4
4
  export const Container = styled.div`
5
5
  background-color: #f0f0f0;
6
6
  display: flex;
7
+ width: 100%;
8
+ min-width: fit-content;
7
9
 
8
10
  .chk-global-container {
9
11
  display: flex;
@@ -10,11 +10,11 @@ export const RowItem = ({
10
10
  }) => {
11
11
  return (
12
12
  <Container>
13
- {productsArray.map(({ cols, id, product, article }, i) => (
13
+ {productsArray.map(({ cols, product, article }, i) => (
14
14
  <div
15
15
  className="row-container"
16
16
  key={article?.id_article + "-" + article?.id_order}
17
- onClick={(e) => onGridClick && onGridClick(product)}
17
+ onClick={(e) => onGridClick && onGridClick(e, product, i)}
18
18
  >
19
19
  <div
20
20
  className="chk-container"
@@ -13,6 +13,9 @@ export const TabsMenu = ({
13
13
  updatedDescriptions,
14
14
  updatedDatasheets,
15
15
  images,
16
+ setUpdatedDescriptions,
17
+ setUpdatedDatasheets,
18
+ setImages,
16
19
  }) => {
17
20
  const [sections, setSections] = useState(tabsSections);
18
21
 
@@ -32,11 +35,14 @@ export const TabsMenu = ({
32
35
  };
33
36
 
34
37
  useEffect(() => {
35
- if ((cancelAccept === "Aceptar") & (llave !== "")) {
38
+ if (cancelAccept === "Aceptar" && llave !== "") {
36
39
  setCancelAccept("");
37
40
  setModal(false);
38
41
  activeSection(llave, objeto);
39
- } else if ((cancelAccept === "Cancelar") & (llave !== "")) {
42
+ setUpdatedDescriptions([]);
43
+ setUpdatedDatasheets([]);
44
+ setImages({});
45
+ } else if (cancelAccept === "Cancelar" && llave !== "") {
40
46
  setModal(false);
41
47
  setCancelAccept("");
42
48
  }
@@ -70,18 +76,18 @@ export const TabsMenu = ({
70
76
  message="Estás cambiando de vista y aun no guardas cambios ¿Estás seguro?"
71
77
  buttons={[
72
78
  <ButtonV2
73
- key={"btn-Cancelar"}
74
- type={"white"}
75
- label={"Cancelar"}
79
+ key="btn-Cancelar"
80
+ type="white"
81
+ label="Cancelar"
76
82
  size={12}
77
- onClick={(event) => setCancelAccept(event.target.textContent)}
83
+ onClick={() => setCancelAccept("Cancelar")}
78
84
  />,
79
85
  <ButtonV2
80
- key={"btn-Aceptar"}
81
- type={"pink"}
82
- label={"Aceptar"}
86
+ key="btn-Aceptar"
87
+ type="pink"
88
+ label="Aceptar"
83
89
  size={12}
84
- onClick={(event) => setCancelAccept(event.target.textContent)}
90
+ onClick={() => setCancelAccept("Aceptar")}
85
91
  />,
86
92
  ]}
87
93
  />
@@ -23,9 +23,10 @@ export const FullTabsMenu = ({
23
23
  updatedDescriptions,
24
24
  updatedDatasheets,
25
25
  selectedImages,
26
+ setSelectedImages,
26
27
  setUpdatedDescriptions,
27
28
  setUpdatedDatasheets,
28
- setSelectedImages,
29
+ setImages,
29
30
  }) => {
30
31
  const [imagesSection, setImagesSection] = useState(false);
31
32
 
@@ -42,6 +43,7 @@ export const FullTabsMenu = ({
42
43
  selectedImages={selectedImages}
43
44
  setUpdatedDescriptions={setUpdatedDescriptions}
44
45
  setUpdatedDatasheets={setUpdatedDatasheets}
46
+ setImages={setImages}
45
47
  setSelectedImages={setSelectedImages}
46
48
  />
47
49
  <StatusAsignationInfo
@@ -5409,6 +5409,16 @@ const setSelected = (arr) => {
5409
5409
  selected = arr;
5410
5410
  };
5411
5411
 
5412
+ const onAssign = (
5413
+ productData,
5414
+ assigneeID,
5415
+ assignationTarget,
5416
+ concept,
5417
+ target
5418
+ ) => {
5419
+ console.log(productData, assigneeID, assignationTarget, concept, target);
5420
+ };
5421
+
5412
5422
  GridProductsDefault.args = {
5413
5423
  gridView: false,
5414
5424
  selected,
@@ -5418,7 +5428,8 @@ GridProductsDefault.args = {
5418
5428
  textSpecialists,
5419
5429
  imagesSpecialists,
5420
5430
  auditors,
5421
- images
5431
+ images,
5432
+ onAssign
5422
5433
  ),
5423
5434
  images,
5424
5435
  auditors,
@@ -5460,8 +5471,8 @@ GridProductsDefault.args = {
5460
5471
  );
5461
5472
  return productSelected?.length > 0;
5462
5473
  },
5463
- onGridClick: (e) => {
5464
- console.log(e);
5474
+ onGridClick: (e, product, i) => {
5475
+ if (!e.target.closest("[id^=users]")) console.log(product, i);
5465
5476
  },
5466
5477
  chkCheckedAll: () => {
5467
5478
  return selected.length === products.length;
@@ -1,11 +1,7 @@
1
1
  import { Container } from "./styles";
2
2
  import { GridItem } from "../../molecules/GridItem";
3
3
  import { HeaderItem } from "../../molecules/HeaderItem";
4
- import { getProductsToTable } from "./utils";
5
- import { useEffect } from "react";
6
- import { useState } from "react";
7
4
  import { RowItem } from "../../molecules/RowItem";
8
- import { CheckBox } from "../../atoms/CheckBox";
9
5
 
10
6
  export const GridProducts = ({
11
7
  products = [],
@@ -25,6 +21,7 @@ export const GridProducts = ({
25
21
  <GridItem
26
22
  key={i}
27
23
  id={id}
24
+ index={i}
28
25
  product={product}
29
26
  gridElement={gridElement}
30
27
  chkOnChange={chkOnChange}
@@ -6,7 +6,8 @@ export const getProductsToTable = (
6
6
  textSpecialists,
7
7
  imagesSpecialists,
8
8
  auditors,
9
- images
9
+ images,
10
+ onAssign
10
11
  ) => {
11
12
  const productsTableArray = [];
12
13
 
@@ -45,6 +46,7 @@ export const getProductsToTable = (
45
46
  imagesSpecialists={imagesSpecialists}
46
47
  auditors={auditors}
47
48
  id={"users-" + id}
49
+ product={product}
48
50
  />
49
51
  ),
50
52
  flex: 1,
@@ -87,6 +89,8 @@ export const getProductsToTable = (
87
89
  imagesSpecialists={imagesSpecialists}
88
90
  auditors={auditors}
89
91
  id={"users-" + id}
92
+ onAssign={onAssign}
93
+ product={product}
90
94
  />
91
95
  ),
92
96
  },
@@ -1,41 +1,31 @@
1
1
  export const servicesCodeIcon = {
2
2
  datasheet: (
3
3
  <div key="datasheet" className="tooltip">
4
- <span className="material-icons small">
5
- &#xf8ee;
6
- </span>
4
+ <span className="material-icons small">&#xf8ee;</span>
7
5
  <span className="tooltiptext">Ficha Técnica</span>
8
6
  </div>
9
7
  ),
10
8
  description: (
11
9
  <div key="description" className="tooltip">
12
- <span className="material-icons small">
13
- &#xe873;
14
- </span>
10
+ <span className="material-icons small">&#xe873;</span>
15
11
  <span className="tooltiptext">Descripción</span>
16
12
  </div>
17
13
  ),
18
14
  image: (
19
15
  <div key="image" className="tooltip">
20
- <span className="material-icons small">
21
- &#xe3f4;
22
- </span>
16
+ <span className="material-icons small">&#xe3f4;</span>
23
17
  <span className="tooltiptext">Imagen</span>
24
18
  </div>
25
19
  ),
26
20
  translate: (
27
21
  <div key="translate" className="tooltip">
28
- <span className="material-icons small">
29
- &#xe8e2;
30
- </span>
22
+ <span className="material-icons small">&#xe8e2;</span>
31
23
  <span className="tooltiptext">Traducción</span>
32
24
  </div>
33
25
  ),
34
26
  build: (
35
- <div key="build" className="tooltip">
36
- <span className="material-icons small">
37
- &#xe1bd;
38
- </span>
27
+ <div key="build" className="tooltip">
28
+ <span className="material-icons small">&#xe1bd;</span>
39
29
  <span className="tooltiptext">Construcción</span>
40
30
  </div>
41
31
  ),
@@ -1429,11 +1429,12 @@ export const ProviderProductEdition = ({
1429
1429
  showSaveButton={enableActions(product.version_status)}
1430
1430
  version={version}
1431
1431
  updatedDescriptions={updatedDescriptions}
1432
+ setUpdatedDescriptions={setUpdatedDescriptions}
1432
1433
  updatedDatasheets={updatedDatasheets}
1434
+ setUpdatedDatasheets={setUpdatedDatasheets}
1433
1435
  images={images}
1436
+ setImages={setImages}
1434
1437
  selectedImages={selectedImages}
1435
- setUpdatedDescriptions={setUpdatedDescriptions}
1436
- setUpdatedDatasheets={setUpdatedDatasheets}
1437
1438
  setSelectedImages={setSelectedImages}
1438
1439
  setShowVersionSelector={setShowVersionSelector}
1439
1440
  onClickSave={() => {
@@ -1364,11 +1364,12 @@ export const RetailerProductEdition = ({
1364
1364
  imag={imag}
1365
1365
  setImag={setImag}
1366
1366
  updatedDescriptions={updatedDescriptions}
1367
+ setUpdatedDescriptions={setUpdatedDescriptions}
1367
1368
  updatedDatasheets={updatedDatasheets}
1369
+ setUpdatedDatasheets={setUpdatedDatasheets}
1368
1370
  images={images}
1371
+ setImages={setImages}
1369
1372
  selectedImages={selectedImages}
1370
- setUpdatedDescriptions={setUpdatedDescriptions}
1371
- setUpdatedDatasheets={setUpdatedDatasheets}
1372
1373
  setSelectedImages={setSelectedImages}
1373
1374
  setShowVersionSelector={setShowVersionSelector}
1374
1375
  onClickSave={() => {