contentoh-components-library 21.4.3 → 21.4.5

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/.env.development CHANGED
@@ -17,7 +17,6 @@ REACT_APP_RETAILER_REQUEST = https://fc069ovhuk.execute-api.us-east-1.amazonaws.
17
17
  REACT_APP_VERSIONS_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/versions
18
18
  REACT_APP_RETAILER_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/retailers
19
19
  REACT_APP_READ_ORDERS_BY_STATUS=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/read-orders-by-status
20
- REACT_APP_READ_REQUIRED_ORDERS=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/read-required-orders
21
20
  REACT_APP_CATEGORY_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/categories
22
21
  REACT_APP_READ_PROVIDERS=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/providers
23
22
  REACT_APP_PENDING_INVITATIONS=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/pending-invitations
package/.env.production CHANGED
@@ -17,7 +17,6 @@ REACT_APP_RETAILER_REQUEST = https://3v43slee1m.execute-api.us-east-1.amazonaws.
17
17
  REACT_APP_VERSIONS_ENDPOINT = https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/versions
18
18
  REACT_APP_RETAILER_ENDPOINT=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/retailers
19
19
  REACT_APP_READ_ORDERS_BY_STATUS=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/read-orders-by-status
20
- REACT_APP_READ_REQUIRED_ORDERS=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/read-required-orders
21
20
  REACT_APP_CATEGORY_ENDPOINT=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/categories
22
21
  REACT_APP_READ_PROVIDERS=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/providers
23
22
  REACT_APP_PENDING_INVITATIONS=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/pending-invitations
@@ -13,6 +13,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
14
  var _templateObject;
15
15
 
16
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 175px;\n height: 175px;\n border-radius: 5px 5px 0px 0px;\n position: relative;\n overflow: hidden;\n display: flex;\n background-color: #f0f0f0;\n\n .slide-container {\n display: flex;\n width: 100%;\n\n .image-container {\n width: 100%;\n height: 100%;\n\n img {\n width: 100%;\n height: 100%;\n object-fit: fill;\n }\n\n &.slide {\n flex: 0 0 100%;\n opacity: 0;\n transition: opacity 0.5s ease-in-out;\n\n &.active {\n opacity: 1;\n }\n }\n }\n\n & > img {\n width: 100%;\n }\n }\n\n button {\n position: absolute;\n top: 0;\n border: none;\n cursor: pointer;\n background-color: transparent;\n color: white;\n z-index: 1;\n height: 100%;\n width: 30px;\n\n svg {\n font-size: 24px;\n }\n\n &.prev {\n left: 0;\n\n &:hover {\n background: linear-gradient(90deg, darkgray, transparent);\n }\n }\n &.next {\n right: 0;\n\n svg {\n transform: rotate(180deg);\n }\n &:hover {\n background: linear-gradient(-90deg, darkgray, transparent);\n }\n }\n }\n\n button:focus {\n outline: none;\n }\n"])));
16
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 174px;\n height: 175px;\n border-radius: 5px 5px 0px 0px;\n position: relative;\n overflow: hidden;\n display: flex;\n background-color: #f0f0f0;\n\n .slide-container {\n display: flex;\n width: 100%;\n\n .image-container {\n width: 100%;\n height: 100%;\n\n img {\n width: 100%;\n height: 100%;\n object-fit: fill;\n }\n\n &.slide {\n flex: 0 0 100%;\n opacity: 0;\n transition: opacity 0.5s ease-in-out;\n\n &.active {\n opacity: 1;\n }\n }\n }\n\n & > img {\n width: 100%;\n }\n }\n\n button {\n position: absolute;\n top: 0;\n border: none;\n cursor: pointer;\n background-color: transparent;\n color: white;\n z-index: 1;\n height: 100%;\n width: 30px;\n\n svg {\n font-size: 24px;\n }\n\n &.prev {\n left: 0;\n\n &:hover {\n background: linear-gradient(90deg, darkgray, transparent);\n }\n }\n &.next {\n right: 0;\n\n svg {\n transform: rotate(180deg);\n }\n &:hover {\n background: linear-gradient(-90deg, darkgray, transparent);\n }\n }\n }\n\n button:focus {\n outline: none;\n }\n"])));
17
17
 
18
18
  exports.Container = Container;
@@ -45,9 +45,9 @@ var RetailerCatalog = function RetailerCatalog(_ref) {
45
45
  }, [retailers]);
46
46
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
47
47
  onClick: function onClick(e) {
48
- e.stopPropagation();
49
- setShowRetailers(true);
48
+ setShowRetailers(!showRetailers);
50
49
  },
50
+ id: id,
51
51
  children: [retailers.map(function (retailer, i) {
52
52
  return i < limit && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
53
53
  image: "https://content-management-images.s3.amazonaws.com/retailers/".concat(retailer.id, ".png"),
@@ -61,8 +61,7 @@ var RetailerCatalog = function RetailerCatalog(_ref) {
61
61
  })
62
62
  }), showRetailers && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RetailersList.RetailersList, {
63
63
  retailers: retailers,
64
- article: article,
65
- id: id
64
+ article: article
66
65
  })]
67
66
  });
68
67
  };
@@ -19,8 +19,6 @@ var _UserOption = require("../UserOption");
19
19
 
20
20
  var _customHooks = require("../../../global-files/customHooks");
21
21
 
22
- var _react = require("react");
23
-
24
22
  var _jsxRuntime = require("react/jsx-runtime");
25
23
 
26
24
  var UserCatalog = function UserCatalog(_ref) {
@@ -46,8 +44,8 @@ var UserCatalog = function UserCatalog(_ref) {
46
44
 
47
45
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
48
46
  id: id,
49
- onClick: function onClick() {
50
- setShowList(true);
47
+ onClick: function onClick(e) {
48
+ if (!e.target.closest("#".concat(id, " .users-assigned-list"))) setShowList(!showList);
51
49
  },
52
50
  children: [datasheet && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
53
51
  image: (0, _data.getProfilePicture)(datasheet, 26, 26),
@@ -32,6 +32,7 @@ var UserOption = function UserOption(_ref) {
32
32
  id = _ref.id,
33
33
  onAssign = _ref.onAssign,
34
34
  product = _ref.product;
35
+ index === "auditor" && console.log(userId);
35
36
 
36
37
  var _useState = (0, _react.useState)({}),
37
38
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -72,15 +73,15 @@ var UserOption = function UserOption(_ref) {
72
73
  switch (index) {
73
74
  case "datasheet":
74
75
  case "description":
75
- setAssignationTarget("id_".concat(index, "_specialist"));
76
+ setAssignationTarget("id_".concat(index, "_especialist"));
76
77
  setConcept(index);
77
- setTarget("specialist");
78
+ setTarget("especialist");
78
79
  break;
79
80
 
80
81
  case "image":
81
- setAssignationTarget("id_".concat(index, "s_specialist"));
82
+ setAssignationTarget("id_".concat(index, "s_especialist"));
82
83
  setConcept(index + "s");
83
- setTarget("specialist");
84
+ setTarget("especialist");
84
85
  break;
85
86
 
86
87
  case "auditor":
@@ -94,15 +95,16 @@ var UserOption = function UserOption(_ref) {
94
95
  }
95
96
  }, [index]);
96
97
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
97
- onClick: function onClick() {
98
- return setShowSelector(true);
98
+ onClick: function onClick(e) {
99
+ setShowSelector(!showSelector);
100
+ e.stopPropagation();
99
101
  },
100
102
  id: id,
101
103
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
102
104
  className: "image-and-name",
103
105
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
104
106
  image: (0, _data.getProfilePicture)(userAssigned === null || userAssigned === void 0 ? void 0 : userAssigned.id_user, 26, 26),
105
- altText: "datasheet specialist",
107
+ altText: "datasheet especialist",
106
108
  imageType: "medium-image"
107
109
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
108
110
  children: [userAssigned === null || userAssigned === void 0 ? void 0 : userAssigned.name, " ", userAssigned === null || userAssigned === void 0 ? void 0 : userAssigned.last_name]
@@ -21,8 +21,6 @@ var _data = require("../../../global-files/data");
21
21
 
22
22
  var _react = require("react");
23
23
 
24
- var _customHooks = require("../../../global-files/customHooks");
25
-
26
24
  var _jsxRuntime = require("react/jsx-runtime");
27
25
 
28
26
  var UserSelector = function UserSelector(_ref) {
@@ -74,11 +72,11 @@ var UserSelector = function UserSelector(_ref) {
74
72
  })]
75
73
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
76
74
  className: "selector-container",
77
- children: userFiltered.length ? userFiltered.map(function (user) {
75
+ children: userFiltered.length ? userFiltered.map(function (user, i) {
78
76
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
79
77
  className: "user-item",
80
- onClick: function onClick(e) {
81
- return onAssign && onAssign(product, user.id_user, assignationTarget, target, concept);
78
+ onClick: function onClick() {
79
+ onAssign(product, user.id_user, assignationTarget, target, concept);
82
80
  },
83
81
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
84
82
  image: (0, _data.getProfilePicture)(user.id_user, 26, 26),
@@ -87,7 +85,7 @@ var UserSelector = function UserSelector(_ref) {
87
85
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
88
86
  children: [user.name, " ", user.last_name]
89
87
  })]
90
- }, user.id_user);
88
+ }, user.id_user + "-" + i);
91
89
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
92
90
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
93
91
  children: "Sin usuarios para asignar"
@@ -43,6 +43,20 @@ var GridItem = function GridItem(_ref) {
43
43
  status = _gridElement$status === void 0 ? [] : _gridElement$status,
44
44
  _gridElement$catalogs = gridElement.catalogs,
45
45
  catalogs = _gridElement$catalogs === void 0 ? {} : _gridElement$catalogs;
46
+
47
+ var getSrvName = function getSrvName(srv) {
48
+ switch (srv) {
49
+ case "datasheet":
50
+ return "F.T.";
51
+
52
+ case "description":
53
+ return "D.C.";
54
+
55
+ case "images":
56
+ return "IMG";
57
+ }
58
+ };
59
+
46
60
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
47
61
  onClick: function onClick(e) {
48
62
  return onGridClick && onGridClick(e, product, index);
@@ -75,8 +89,14 @@ var GridItem = function GridItem(_ref) {
75
89
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
76
90
  className: "status-slider",
77
91
  children: status === null || status === void 0 ? void 0 : status.map(function (item) {
78
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
79
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Status.Status, {
92
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
93
+ className: "status-element",
94
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
95
+ className: "srv-name",
96
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
97
+ children: getSrvName(item.title)
98
+ })
99
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Status.Status, {
80
100
  statusType: item.value
81
101
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PercentTag.PercentTag, {
82
102
  percent: item.percent,
@@ -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: 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);
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 175px;\n border: 1px solid #f0f0f0;\n position: relative;\n height: fit-content;\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 .srv-name {\n background-color: #808080;\n padding: 0 10px;\n border-radius: 5px;\n p {\n font-family: ", ";\n font-size: 12px;\n line-height: 20px;\n font-weight: 700;\n color: #fff;\n }\n }\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\n &:hover {\n cursor: pointer;\n box-shadow: 1px 2px 5px black;\n }\n"])), _variables.FontFamily.Lato, _variables.FontFamily.AvenirNext);
19
19
 
20
20
  exports.Container = Container;
@@ -19,7 +19,7 @@ var Container = _styledComponents.default.div(_templateObject || (_templateObjec
19
19
 
20
20
  exports.Container = Container;
21
21
 
22
- var Column = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex: ", ";\n min-width: ", "px;\n text-align: center;\n color: #262626;\n font-family: ", ";\n font-size: 12px;\n line-height: 16px;\n padding: 10px 5px;\n"])), function (_ref) {
22
+ var Column = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex: ", ";\n min-width: ", "px;\n text-align: center;\n color: #262626;\n font-family: ", ";\n font-size: 12px;\n line-height: 16px;\n padding: 10px 5px;\n display: flex;\n justify-content: center;\n"])), function (_ref) {
23
23
  var flex = _ref.flex;
24
24
  return flex ? flex : 1;
25
25
  }, function (_ref2) {
@@ -62,7 +62,7 @@ var getProductsToTable = function getProductsToTable() {
62
62
  flex: 1,
63
63
  minWidth: 100
64
64
  }, {
65
- name: "none",
65
+ name: product.prio,
66
66
  flex: 1,
67
67
  minWidth: 100
68
68
  }, {
@@ -75,7 +75,8 @@ var getProductsToTable = function getProductsToTable() {
75
75
  imagesSpecialists: imagesSpecialists,
76
76
  auditors: auditors,
77
77
  id: "users-" + id,
78
- product: product
78
+ product: product,
79
+ onAssign: onAssign
79
80
  }),
80
81
  flex: 1,
81
82
  minWidth: 100
@@ -89,6 +90,9 @@ var getProductsToTable = function getProductsToTable() {
89
90
  info: [{
90
91
  title: "name",
91
92
  value: (article === null || article === void 0 ? void 0 : article.name) || "-"
93
+ }, {
94
+ title: "order",
95
+ value: orderId || "-"
92
96
  }, {
93
97
  title: "category",
94
98
  value: (article === null || article === void 0 ? void 0 : article.category) || "-"
@@ -123,12 +127,13 @@ var getProductsToTable = function getProductsToTable() {
123
127
  datasheet: article.id_datasheet_especialist,
124
128
  description: article.id_description_especialist,
125
129
  images: article.id_images_especialist,
130
+ auditor: article.id_auditor,
126
131
  textSpecialists: textSpecialists,
127
132
  imagesSpecialists: imagesSpecialists,
128
133
  auditors: auditors,
129
134
  id: "users-" + id,
130
- onAssign: onAssign,
131
- product: product
135
+ product: product,
136
+ onAssign: onAssign
132
137
  })
133
138
  }
134
139
  },
@@ -21,7 +21,6 @@ var useCloseModal = function useCloseModal(id) {
21
21
  e.stopPropagation();
22
22
 
23
23
  if (!e.target.closest("#".concat(id)) && showModal) {
24
- console.log(id);
25
24
  document.removeEventListener("click", closeModal, false);
26
25
  setShowModal(false);
27
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.4.3",
3
+ "version": "21.4.5",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -1,7 +1,7 @@
1
1
  import styled from "styled-components";
2
2
 
3
3
  export const Container = styled.div`
4
- width: 175px;
4
+ width: 174px;
5
5
  height: 175px;
6
6
  border-radius: 5px 5px 0px 0px;
7
7
  position: relative;
@@ -21,9 +21,9 @@ export const RetailerCatalog = ({
21
21
  return (
22
22
  <Container
23
23
  onClick={(e) => {
24
- e.stopPropagation();
25
- setShowRetailers(true);
24
+ setShowRetailers(!showRetailers);
26
25
  }}
26
+ id={id}
27
27
  >
28
28
  {retailers.map(
29
29
  (retailer, i) =>
@@ -42,7 +42,7 @@ export const RetailerCatalog = ({
42
42
  </div>
43
43
  )}
44
44
  {showRetailers && (
45
- <RetailersList retailers={retailers} article={article} id={id} />
45
+ <RetailersList retailers={retailers} article={article} />
46
46
  )}
47
47
  </Container>
48
48
  );
@@ -3,9 +3,6 @@ import { Avatar } from "../Avatar";
3
3
  import { getProfilePicture } from "../../../global-files/data";
4
4
  import { UserOption } from "../UserOption";
5
5
  import { useCloseModal } from "../../../global-files/customHooks";
6
- import { useState } from "react";
7
- import { useEffect } from "react";
8
-
9
6
  export const UserCatalog = ({
10
7
  datasheet,
11
8
  description,
@@ -23,8 +20,9 @@ export const UserCatalog = ({
23
20
  return (
24
21
  <Container
25
22
  id={id}
26
- onClick={() => {
27
- setShowList(true);
23
+ onClick={(e) => {
24
+ if (!e.target.closest(`#${id} .users-assigned-list`))
25
+ setShowList(!showList);
28
26
  }}
29
27
  >
30
28
  {datasheet && (
@@ -15,6 +15,7 @@ export const UserOption = ({
15
15
  onAssign,
16
16
  product,
17
17
  }) => {
18
+ index === "auditor" && console.log(userId);
18
19
  const [userAssigned, setUserAssigned] = useState({});
19
20
  const [showSelector, setShowSelector] = useCloseModal(id);
20
21
  const [assignationTarget, setAssignationTarget] = useState("");
@@ -37,14 +38,14 @@ export const UserOption = ({
37
38
  switch (index) {
38
39
  case "datasheet":
39
40
  case "description":
40
- setAssignationTarget(`id_${index}_specialist`);
41
+ setAssignationTarget(`id_${index}_especialist`);
41
42
  setConcept(index);
42
- setTarget("specialist");
43
+ setTarget("especialist");
43
44
  break;
44
45
  case "image":
45
- setAssignationTarget(`id_${index}s_specialist`);
46
+ setAssignationTarget(`id_${index}s_especialist`);
46
47
  setConcept(index + "s");
47
- setTarget("specialist");
48
+ setTarget("especialist");
48
49
  break;
49
50
  case "auditor":
50
51
  setAssignationTarget(`id_${index}`);
@@ -57,11 +58,17 @@ export const UserOption = ({
57
58
  }, [index]);
58
59
 
59
60
  return (
60
- <Container onClick={() => setShowSelector(true)} id={id}>
61
+ <Container
62
+ onClick={(e) => {
63
+ setShowSelector(!showSelector);
64
+ e.stopPropagation();
65
+ }}
66
+ id={id}
67
+ >
61
68
  <div className="image-and-name">
62
69
  <Avatar
63
70
  image={getProfilePicture(userAssigned?.id_user, 26, 26)}
64
- altText={"datasheet specialist"}
71
+ altText={"datasheet especialist"}
65
72
  imageType={"medium-image"}
66
73
  />
67
74
  <p>
@@ -5,7 +5,6 @@ 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";
9
8
 
10
9
  export const UserSelector = ({
11
10
  searchLabel,
@@ -52,20 +51,19 @@ export const UserSelector = ({
52
51
  </div>
53
52
  <div className="selector-container">
54
53
  {userFiltered.length ? (
55
- userFiltered.map((user) => (
54
+ userFiltered.map((user, i) => (
56
55
  <div
57
- key={user.id_user}
56
+ key={user.id_user + "-" + i}
58
57
  className="user-item"
59
- onClick={(e) =>
60
- onAssign &&
58
+ onClick={() => {
61
59
  onAssign(
62
60
  product,
63
61
  user.id_user,
64
62
  assignationTarget,
65
63
  target,
66
64
  concept
67
- )
68
- }
65
+ );
66
+ }}
69
67
  >
70
68
  <Avatar
71
69
  image={getProfilePicture(user.id_user, 26, 26)}
@@ -20,6 +20,17 @@ export const GridItem = ({
20
20
  }) => {
21
21
  const { images = [], info = [], status = [], catalogs = {} } = gridElement;
22
22
 
23
+ const getSrvName = (srv) => {
24
+ switch (srv) {
25
+ case "datasheet":
26
+ return "F.T.";
27
+ case "description":
28
+ return "D.C.";
29
+ case "images":
30
+ return "IMG";
31
+ }
32
+ };
33
+
23
34
  return (
24
35
  <Container onClick={(e) => onGridClick && onGridClick(e, product, index)}>
25
36
  <div className="chk-container" onClick={(e) => e.stopPropagation()}>
@@ -39,10 +50,13 @@ export const GridItem = ({
39
50
  </div>
40
51
  <div className="status-slider">
41
52
  {status?.map((item) => (
42
- <>
53
+ <div className="status-element">
54
+ <div className="srv-name">
55
+ <p>{getSrvName(item.title)}</p>
56
+ </div>
43
57
  <Status statusType={item.value} />
44
58
  <PercentTag percent={item.percent} progressBarType={item.value} />
45
- </>
59
+ </div>
46
60
  ))}
47
61
  </div>
48
62
  {isMerchans ? (
@@ -5,6 +5,7 @@ export const Container = styled.div`
5
5
  width: 175px;
6
6
  border: 1px solid #f0f0f0;
7
7
  position: relative;
8
+ height: fit-content;
8
9
 
9
10
  .chk-container {
10
11
  position: absolute;
@@ -48,6 +49,19 @@ export const Container = styled.div`
48
49
 
49
50
  .status-element {
50
51
  display: flex;
52
+
53
+ .srv-name {
54
+ background-color: #808080;
55
+ padding: 0 10px;
56
+ border-radius: 5px;
57
+ p {
58
+ font-family: ${FontFamily.AvenirNext};
59
+ font-size: 12px;
60
+ line-height: 20px;
61
+ font-weight: 700;
62
+ color: #fff;
63
+ }
64
+ }
51
65
  }
52
66
 
53
67
  * + * {
@@ -82,4 +96,9 @@ export const Container = styled.div`
82
96
  border-right: 1px solid #f0f0f0;
83
97
  }
84
98
  }
99
+
100
+ &:hover {
101
+ cursor: pointer;
102
+ box-shadow: 1px 2px 5px black;
103
+ }
85
104
  `;
@@ -35,4 +35,6 @@ export const Column = styled.div`
35
35
  font-size: 12px;
36
36
  line-height: 16px;
37
37
  padding: 10px 5px;
38
+ display: flex;
39
+ justify-content: center;
38
40
  `;
@@ -35,7 +35,7 @@ export const getProductsToTable = (
35
35
  flex: 1,
36
36
  minWidth: 100,
37
37
  },
38
- { name: "none", flex: 1, minWidth: 100 },
38
+ { name: product.prio, flex: 1, minWidth: 100 },
39
39
  {
40
40
  name: (
41
41
  <UserCatalog
@@ -48,6 +48,7 @@ export const getProductsToTable = (
48
48
  auditors={auditors}
49
49
  id={"users-" + id}
50
50
  product={product}
51
+ onAssign={onAssign}
51
52
  />
52
53
  ),
53
54
  flex: 1,
@@ -59,6 +60,7 @@ export const getProductsToTable = (
59
60
  images: imgArray,
60
61
  info: [
61
62
  { title: "name", value: article?.name || "-" },
63
+ { title: "order", value: orderId || "-" },
62
64
  { title: "category", value: article?.category || "-" },
63
65
  { title: "company", value: article?.company_name || "-" },
64
66
  { title: "price", value: article?.price || "-" },
@@ -86,12 +88,13 @@ export const getProductsToTable = (
86
88
  datasheet={article.id_datasheet_especialist}
87
89
  description={article.id_description_especialist}
88
90
  images={article.id_images_especialist}
91
+ auditor={article.id_auditor}
89
92
  textSpecialists={textSpecialists}
90
93
  imagesSpecialists={imagesSpecialists}
91
94
  auditors={auditors}
92
95
  id={"users-" + id}
93
- onAssign={onAssign}
94
96
  product={product}
97
+ onAssign={onAssign}
95
98
  />
96
99
  ),
97
100
  },
@@ -6,7 +6,6 @@ export const useCloseModal = (id) => {
6
6
  const closeModal = (e) => {
7
7
  e.stopPropagation();
8
8
  if (!e.target.closest(`#${id}`) && showModal) {
9
- console.log(id);
10
9
  document.removeEventListener("click", closeModal, false);
11
10
  setShowModal(false);
12
11
  }