contentoh-components-library 21.2.9 → 21.2.12

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.
@@ -38,11 +38,13 @@ var GalleryElement = function GalleryElement(_ref) {
38
38
  imageInputs = _ref.imageInputs,
39
39
  imageType = _ref.imageType,
40
40
  imagePackagingType = _ref.imagePackagingType,
41
+ imageShotType = _ref.imageShotType,
41
42
  changeImage = _ref.changeImage,
42
43
  selectedImages = _ref.selectedImages,
43
44
  setSelectedImages = _ref.setSelectedImages,
44
45
  setCheckAll = _ref.setCheckAll,
45
- setSocketType = _ref.setSocketType;
46
+ setSocketType = _ref.setSocketType,
47
+ shotThd = _ref.shotThd;
46
48
 
47
49
  var _useState = (0, _react.useState)(validation),
48
50
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -149,6 +151,19 @@ var GalleryElement = function GalleryElement(_ref) {
149
151
  index: number
150
152
  });
151
153
  }
154
+ }), shotThd && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
155
+ width: "100%",
156
+ placeholder: "Tipo de imagen THD",
157
+ options: imageShotType,
158
+ valueSelected: image.image_shot_type,
159
+ onChange: function onChange(e) {
160
+ changeImage({
161
+ action: "changeShotType",
162
+ attribute: "image_shot_type",
163
+ value: +e.target.value,
164
+ index: number
165
+ });
166
+ }
152
167
  })]
153
168
  })]
154
169
  })]
@@ -13,7 +13,8 @@ var _jsxRuntime = require("react/jsx-runtime");
13
13
 
14
14
  var GalleryHeader = function GalleryHeader(_ref) {
15
15
  var setCheckAll = _ref.setCheckAll,
16
- setSelectedImages = _ref.setSelectedImages;
16
+ setSelectedImages = _ref.setSelectedImages,
17
+ shotThd = _ref.shotThd;
17
18
 
18
19
  var checkAll = function checkAll(e) {
19
20
  var checkboxList = document.querySelectorAll("[id^='gallery-element-']");
@@ -53,6 +54,9 @@ var GalleryHeader = function GalleryHeader(_ref) {
53
54
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
54
55
  className: "",
55
56
  children: "Tipo de empaque"
57
+ }), shotThd && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
58
+ className: "",
59
+ children: "Tipo de imagen THD"
56
60
  })]
57
61
  });
58
62
  };
@@ -20,7 +20,7 @@ var _LabelToInput = _interopRequireDefault(require("../../atoms/LabelToInput"));
20
20
  var _jsxRuntime = require("react/jsx-runtime");
21
21
 
22
22
  var ImageDataTable = function ImageDataTable(_ref) {
23
- var _lists$inputs, _lists$inputs$find, _lists$imagePackaging, _lists$imagePackaging2, _lists$imageType, _lists$imageType$find, _lists$attrForImgs, _lists$attrForImgs$ge;
23
+ var _lists$inputs, _lists$inputs$find, _lists$imagePackaging, _lists$imagePackaging2, _lists$imageType, _lists$imageType$find, _lists$imageShotType, _lists$imageShotType$, _lists$attrForImgs, _lists$attrForImgs$ge;
24
24
 
25
25
  var activeImage = _ref.activeImage,
26
26
  darkMode = _ref.darkMode,
@@ -34,7 +34,8 @@ var ImageDataTable = function ImageDataTable(_ref) {
34
34
  onClickSave = _ref.onClickSave,
35
35
  showSaveButton = _ref.showSaveButton,
36
36
  version = _ref.version,
37
- setShowVersionSelector = _ref.setShowVersionSelector;
37
+ setShowVersionSelector = _ref.setShowVersionSelector,
38
+ shotThd = _ref.shotThd;
38
39
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
39
40
  darkMode: darkMode,
40
41
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TableHeader.TableHeader, {
@@ -77,6 +78,16 @@ var ImageDataTable = function ImageDataTable(_ref) {
77
78
  return f.id === +(activeImage === null || activeImage === void 0 ? void 0 : activeImage.image_type);
78
79
  })) === null || _lists$imageType$find === void 0 ? void 0 : _lists$imageType$find.name) || "-"
79
80
  })]
81
+ }), shotThd && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles2.Container, {
82
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
83
+ headerType: "table-row-text",
84
+ text: "Tipo de imagen THD"
85
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
86
+ headerType: "table-row-text gray-table-row",
87
+ text: (lists === null || lists === void 0 ? void 0 : (_lists$imageShotType = lists.imageShotType) === null || _lists$imageShotType === void 0 ? void 0 : (_lists$imageShotType$ = _lists$imageShotType.find(function (f) {
88
+ return f.id === +(activeImage === null || activeImage === void 0 ? void 0 : activeImage.image_shot_type);
89
+ })) === null || _lists$imageShotType$ === void 0 ? void 0 : _lists$imageShotType$.type_shot) || "-"
90
+ })]
80
91
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles2.Container, {
81
92
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
82
93
  headerType: "table-row-text",
@@ -1509,7 +1509,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1509
1509
 
1510
1510
  var validateAll = /*#__PURE__*/function () {
1511
1511
  var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(result) {
1512
- var _product$id_order2, evaluationArray, sendAll, conceptArray, dataGeneral, productTemp, retailerStatusCopy;
1512
+ var _product$id_order2, evaluationArray, conceptArray, dataGeneral, evalResponse, userType, productTemp, retailerStatusCopy;
1513
1513
 
1514
1514
  return _regenerator.default.wrap(function _callee13$(_context13) {
1515
1515
  while (1) {
@@ -1518,17 +1518,18 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1518
1518
  _context13.prev = 0;
1519
1519
  setLoading(true);
1520
1520
  evaluationArray = [];
1521
- sendAll = [];
1522
1521
  conceptArray = ["description", "datasheet", "images"];
1523
1522
  dataGeneral = {
1524
1523
  articleId: product.id_article,
1525
1524
  orderId: (_product$id_order2 = product.id_order) !== null && _product$id_order2 !== void 0 ? _product$id_order2 : product.orderId,
1526
- result: result
1525
+ result: result,
1526
+ isAproved: result === "A"
1527
1527
  };
1528
1528
  servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
1529
1529
  var service = ret.service,
1530
1530
  id_retailer = ret.id_retailer;
1531
- var data = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, dataGeneral), {}, {
1531
+ var data = {};
1532
+ data = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, dataGeneral), {}, {
1532
1533
  concept: service,
1533
1534
  retailerId: id_retailer,
1534
1535
  evalStatus: retailerStatus[id_retailer][service]
@@ -1538,26 +1539,27 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1538
1539
  Authorization: token
1539
1540
  }
1540
1541
  }));
1541
- sendAll.push(_axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
1542
- headers: {
1543
- Authorization: token
1544
- }
1545
- }));
1546
1542
  });
1547
- _context13.next = 9;
1548
- return Promise.all([].concat(evaluationArray, sendAll));
1543
+ _context13.next = 8;
1544
+ return Promise.all(evaluationArray);
1549
1545
 
1550
- case 9:
1546
+ case 8:
1547
+ evalResponse = _context13.sent;
1548
+ console.log(evalResponse.map(function (_ref15) {
1549
+ var data = _ref15.data;
1550
+ return JSON.parse(data.body);
1551
+ }));
1552
+ userType = user.is_retailer === 1 ? "CA" : "P";
1551
1553
  productTemp = product;
1552
- productTemp.article_status = "".concat(result, "CA");
1553
- productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result, "CA");
1554
- productTemp.description_status = productTemp.description_status === "NA" ? "NA" : "".concat(result, "CA");
1555
- productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result, "CA");
1554
+ productTemp.article_status = "".concat(result).concat(userType);
1555
+ productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result).concat(userType);
1556
+ productTemp.description_status = productTemp.description_status === "NA" ? "NA" : "".concat(result).concat(userType);
1557
+ productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result).concat(userType);
1556
1558
  retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
1557
1559
  Object.keys(retailerStatusCopy).forEach(function (key) {
1558
1560
  conceptArray.forEach(function (concept) {
1559
1561
  if (retailerStatusCopy[key][concept]) {
1560
- retailerStatusCopy[key][concept] = "".concat(result, "CA");
1562
+ retailerStatusCopy[key][concept] = "".concat(result).concat(userType);
1561
1563
  }
1562
1564
  });
1563
1565
  });
@@ -1575,24 +1577,24 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1575
1577
  idCategory: productTemp.article.id_category,
1576
1578
  product: productTemp
1577
1579
  }));
1578
- _context13.next = 24;
1580
+ _context13.next = 26;
1579
1581
  return loadData();
1580
1582
 
1581
- case 24:
1582
- _context13.next = 29;
1583
+ case 26:
1584
+ _context13.next = 31;
1583
1585
  break;
1584
1586
 
1585
- case 26:
1586
- _context13.prev = 26;
1587
+ case 28:
1588
+ _context13.prev = 28;
1587
1589
  _context13.t0 = _context13["catch"](0);
1588
1590
  console.log(_context13.t0);
1589
1591
 
1590
- case 29:
1592
+ case 31:
1591
1593
  case "end":
1592
1594
  return _context13.stop();
1593
1595
  }
1594
1596
  }
1595
- }, _callee13, null, [[0, 26]]);
1597
+ }, _callee13, null, [[0, 28]]);
1596
1598
  }));
1597
1599
 
1598
1600
  return function validateAll(_x8) {
@@ -1601,7 +1603,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1601
1603
  }();
1602
1604
 
1603
1605
  var evaluationToRetailer = /*#__PURE__*/function () {
1604
- var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(result) {
1606
+ var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(result) {
1605
1607
  var data, prod, statusComplete;
1606
1608
  return _regenerator.default.wrap(function _callee14$(_context14) {
1607
1609
  while (1) {
@@ -1643,7 +1645,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1643
1645
  }));
1644
1646
 
1645
1647
  return function evaluationToRetailer(_x9) {
1646
- return _ref15.apply(this, arguments);
1648
+ return _ref16.apply(this, arguments);
1647
1649
  };
1648
1650
  }();
1649
1651
 
@@ -31,59 +31,55 @@ RetailerProductEditionDefault.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: false
33
33
  },
34
- token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwYjY2YTRhOS03NzkwLTQwMzQtYTMwYS1jMDA4MDg5NjI4NjciLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjBiNjZhNGE5LTc3OTAtNDAzNC1hMzBhLWMwMDgwODk2Mjg2NyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiIzNmIxMmUwMy0xOWJhLTRiMDktYWJiYS1kZjk3ZTFkNThjZTQiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MDE4MjgzNywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2MDE4NjQzNywiaWF0IjoxNjYwMTgyODM3LCJlbWFpbCI6ImJheWFkaTE1MzhAbW5xbG0uY29tIn0.MM9nIHkrRIS2o8_s4BR6VTLgyw3ryvPrr-mf6RtnQ4smng2Q3fmtK07zInNcvcrv8EXO5J9z47_NZ5MOJDo1Pz1CV2cOYM7PT5tEn3F-W4SitqDbBw3KxfkqSMxdZUIHLWECGL-u2ATCYU2J4KRVQi8XSP1qbfv1hu9dh-vID8Fq641ccQwEqUDC13pshDPlR08legg7AAPJqoilV7wuvxqTYAK6fGqMS5jcdW2iDmU0ti9gkydXkYRIC-jg446VOmRCpwzKsk4UAPwlrGeodQ0LV1bfWn_-KVspWCRQd6U5WbFxHn0umYe3CvvPpyVmHzD3F_EMxaVyqV5aW5IoIQ",
34
+ token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI3MTNhNzQ1Ny1mOTQzLTRiYzktOGViMC04NmI0MWY1YmQ0ZjgiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjcxM2E3NDU3LWY5NDMtNGJjOS04ZWIwLTg2YjQxZjViZDRmOCIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJlM2ExZmQ2OC02OTAwLTRjNWYtYjM5MC1jNjY0MDZhZjkyMGYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MTU0ODI4NSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2MTU1MTg4NSwiaWF0IjoxNjYxNTQ4Mjg1LCJlbWFpbCI6ImhjYXJyaWxsb0Bjb250ZW50b2guY29tIn0.GUmPbOrd8-llRODdaidjReKHBwrVbGV5LP37aD_o14BQ67VSmH2pxLvrZRBNsZhvP0vZuetXt19pyiFgCr1-SF5CMHD3dcnPq2Ka0PUEf8raNEoseCPGaDUugu-waz1qPadZN1OrlhQTm9mOWoGj4u0gQv5FGAbC6xMcRernAo4QX41-Pfjvp2u7p62BYkp6rafzTjazUHZiG-ueqPI9QQQ-2zkbTo46l7TFYz6ATNSiZEvezc52L1nzWDhI5Q8xbNA546WC-leLr30SV9vrXBTGdvLdCKeqEYPrVG1L3nXXZ9CvtHJjdkb60irWZjXT1LbpulfL3IqO2_PKHTUpHQ",
35
35
  productSelected: {
36
- "services": {
37
- "datasheets": 1,
38
- "descriptions": 1,
39
- "images": 1
36
+ services: {
37
+ datasheets: 1,
38
+ descriptions: 1,
39
+ images: 1
40
40
  },
41
- "orderId": 1810,
42
- "status": "RP",
43
- "datasheet_status": "RP",
44
- "prio": "none",
45
- "version": 2,
46
- "description_status": "RP",
47
- "images_status": "RP",
48
- "article": {
49
- "id_article": 68934,
50
- "id_category": "2290",
51
- "name": "SCOTCHBLUE  3PACK MASKING TAPE 24MMX55M",
52
- "upc": "167907",
53
- "timestamp": "2022-06-22T15:44:57.000Z",
54
- "id_user": 704,
55
- "status": "NULL",
56
- "active": 1,
57
- "company_id": 437,
58
- "SKU": null,
59
- "Descripcion": null,
60
- "Proveedor": null,
61
- "id_proveedor": 0,
62
- "company_name": "",
63
- "country": null,
64
- "id_order": 1810,
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": 514,
72
- "id_recepcionist": null,
73
- "category": "Pinturas|Herramientas y accesorios para pintar|Cintas",
74
- "missingAttributes": null,
75
- "missingDescriptions": null,
76
- "missingImages": null
41
+ orderId: 127,
42
+ status: "AS",
43
+ datasheet_status: "AS",
44
+ prio: "none",
45
+ version: 2,
46
+ description_status: "AS",
47
+ images_status: "AS",
48
+ article: {
49
+ id_article: 76186,
50
+ id_category: "399",
51
+ name: "Croquetas Dog Chow",
52
+ upc: "4535354",
53
+ timestamp: "2022-07-21T15:20:25.000Z",
54
+ id_user: 28,
55
+ status: "NULL",
56
+ active: 1,
57
+ company_id: 1,
58
+ company_name: "COMPANY DEV",
59
+ country: "México",
60
+ id_order: 127,
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,
68
+ id_recepcionist: null,
69
+ category: "Mascotas|Alimentos y Premios|Alimento para Perros",
70
+ missingAttributes: null,
71
+ missingDescriptions: null,
72
+ missingImages: null
77
73
  },
78
- "retailers": [{
79
- "id": 58,
80
- "name": "The Home Depot Golden",
81
- "country": "México",
82
- "id_region": 1,
83
- "active": 1
74
+ retailers: [{
75
+ id: 2,
76
+ name: "Walmart Mercancías Generales",
77
+ country: "México",
78
+ id_region: 1,
79
+ active: 1
84
80
  }],
85
- "country": null,
86
- "upc": "167907"
81
+ country: "México",
82
+ upc: "4535354"
87
83
  },
88
84
  location: {
89
85
  product: {
@@ -92,36 +88,36 @@ RetailerProductEditionDefault.args = {
92
88
  }
93
89
  },
94
90
  user: {
95
- id_user: 1248,
96
- name: "Facilitador Textos",
97
- last_name: " ",
98
- email: "bayadi1538@mnqlm.com",
99
- position: "Tester",
91
+ id_user: 65,
92
+ name: "Oscar",
93
+ last_name: "Arenas",
94
+ email: "oarenas@contentoh.com",
95
+ position: null,
100
96
  telephone: null,
101
97
  country: null,
102
- id_company: 254,
103
- id_cognito: "0b66a4a9-7790-4034-a30a-c00808962867",
98
+ id_company: 2,
99
+ id_cognito: "73cc8d40-c841-422a-a2f2-e69d7fe26ebf",
104
100
  birth_Date: null,
105
101
  about_me: null,
106
102
  zip_code: null,
107
103
  address: null,
108
104
  job: null,
109
105
  id_stripe: null,
110
- id_role: 7,
106
+ id_role: 1,
111
107
  active: 1,
112
108
  is_retailer: 0,
113
- email_notify: null,
109
+ email_notify: 0,
114
110
  membership: {
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"
111
+ id: 2,
112
+ start_date: "2021-11-05T02:35:12.000Z",
113
+ end_date: "2022-11-05T02:34:49.000Z",
114
+ planID: 1,
115
+ plan: "prod_KtkvuFFLpOdP6e",
116
+ name: "Plan Free",
117
+ user_limit: "1",
118
+ products_limit: "3",
119
+ type: "PyMES"
124
120
  },
125
- src: "https://content-management-profile-prod.s3.amazonaws.com/id-423/423.png?1660182839373"
121
+ src: "https://content-management-profile.s3.amazonaws.com/id-65/65.png?1661554813155"
126
122
  }
127
123
  };
@@ -116,6 +116,12 @@ var reducerImages = function reducerImages(state, action) {
116
116
  values: values
117
117
  });
118
118
 
119
+ case "changeShotType":
120
+ values[action.index][action.attribute] = action.value;
121
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
122
+ values: values
123
+ });
124
+
119
125
  case "changeAttrValue":
120
126
  var index = attrForImgs.general.findIndex(function (f) {
121
127
  return f.id === action.id;
@@ -445,6 +451,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
445
451
  showVersionSelector = _useCloseModal2[0],
446
452
  setShowVersionSelector = _useCloseModal2[1];
447
453
 
454
+ var shotThd = [58, 59, 60, 61].includes(activeRetailer.id);
448
455
  (0, _react.useEffect)(function () {
449
456
  checkAll && setSelectedImages(images.values);
450
457
  }, [checkAll]);
@@ -719,7 +726,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
719
726
  }, [activeRetailer, services]);
720
727
 
721
728
  var thumbs = function thumbs() {
722
- var _images$imageType, _images$imagePackagin, _images$values;
729
+ var _images$imageType, _images$imagePackagin, _images$imageShotType, _images$values;
723
730
 
724
731
  var imageInputs = socketType === null || socketType === void 0 ? void 0 : socketType.slice();
725
732
  var imageType = images === null || images === void 0 ? void 0 : (_images$imageType = images.imageType) === null || _images$imageType === void 0 ? void 0 : _images$imageType.map(function (e) {
@@ -734,6 +741,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
734
741
  name: e === null || e === void 0 ? void 0 : e.name
735
742
  };
736
743
  });
744
+ var imageShotType = images === null || images === void 0 ? void 0 : (_images$imageShotType = images.imageShotType) === null || _images$imageShotType === void 0 ? void 0 : _images$imageShotType.map(function (e) {
745
+ return {
746
+ value: e === null || e === void 0 ? void 0 : e.id,
747
+ name: e === null || e === void 0 ? void 0 : e.type_shot
748
+ };
749
+ });
737
750
  return images === null || images === void 0 ? void 0 : (_images$values = images.values) === null || _images$values === void 0 ? void 0 : _images$values.map(function (image, index) {
738
751
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryElement.GalleryElement, {
739
752
  setCheckAll: setCheckAll,
@@ -745,10 +758,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
745
758
  imageType: imageType,
746
759
  imagePackagingType: imagePackagingType,
747
760
  imageInputs: imageInputs,
761
+ imageShotType: imageShotType,
748
762
  setSocketType: setSocketType,
749
763
  changeImage: setImages,
750
764
  selectedImages: selectedImages,
751
- setSelectedImages: setSelectedImages
765
+ setSelectedImages: setSelectedImages,
766
+ shotThd: shotThd
752
767
  }, index + "-" + imageType.name);
753
768
  });
754
769
  };
@@ -1098,11 +1113,11 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1098
1113
  switch (userId) {
1099
1114
  case 7:
1100
1115
  case 8:
1101
- return statusArray.includes(srvActive) && (["RA", "RC"].includes(product === null || product === void 0 ? void 0 : product.status) || srv.filter(function (serv) {
1116
+ return statusArray.includes(srvActive) && statusArray.includes(product === null || product === void 0 ? void 0 : product.status) || srv.filter(function (serv) {
1102
1117
  var _serv$status;
1103
1118
 
1104
- return ["CA"].includes((_serv$status = serv.status) === null || _serv$status === void 0 ? void 0 : _serv$status.replace(/.*\//, ""));
1105
- }).length === srv.length);
1119
+ return statusArray.includes((_serv$status = serv.status) === null || _serv$status === void 0 ? void 0 : _serv$status.replace(/.*\//, ""));
1120
+ }).length === srv.length;
1106
1121
 
1107
1122
  case 4:
1108
1123
  case 5:
@@ -1752,7 +1767,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1752
1767
  },
1753
1768
  showSaveButton: auditorAssigned() || userAssigned(),
1754
1769
  setShowVersionSelector: setShowVersionSelector,
1755
- version: version
1770
+ version: version,
1771
+ shotThd: shotThd
1756
1772
  })]
1757
1773
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1758
1774
  className: "product-information",
@@ -1858,7 +1874,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1858
1874
  children: [!imageLayout && activeTab === "Imágenes" && (product === null || product === void 0 ? void 0 : (_product$services2 = product.services) === null || _product$services2 === void 0 ? void 0 : _product$services2.images) === 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
1859
1875
  setSelectedImages: setSelectedImages,
1860
1876
  checkAll: checkAll,
1861
- setCheckAll: setCheckAll
1877
+ setCheckAll: setCheckAll,
1878
+ shotThd: shotThd
1862
1879
  }), activeTab === "Ficha técnica" && ((product === null || product === void 0 ? void 0 : product.datasheet_status) !== "NS" ? (_datasheets$ = datasheets[0]) === null || _datasheets$ === void 0 ? void 0 : (_datasheets$$data = _datasheets$.data) === null || _datasheets$$data === void 0 ? void 0 : _datasheets$$data.map(function (dataGroup, index) {
1863
1880
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1864
1881
  articleId: product.article.id_article,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.2.9",
3
+ "version": "21.2.12",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -16,11 +16,13 @@ export const GalleryElement = ({
16
16
  imageInputs,
17
17
  imageType,
18
18
  imagePackagingType,
19
+ imageShotType,
19
20
  changeImage,
20
21
  selectedImages,
21
22
  setSelectedImages,
22
23
  setCheckAll,
23
24
  setSocketType,
25
+ shotThd,
24
26
  }) => {
25
27
  const [statusValidation, setStatusValidation] = useState(validation);
26
28
  const [showValidationPanel, setShowValidationPanel] = useState(false);
@@ -118,6 +120,22 @@ export const GalleryElement = ({
118
120
  });
119
121
  }}
120
122
  />
123
+ {shotThd && (
124
+ <Select
125
+ width="100%"
126
+ placeholder="Tipo de imagen THD"
127
+ options={imageShotType}
128
+ valueSelected={image.image_shot_type}
129
+ onChange={(e) => {
130
+ changeImage({
131
+ action: "changeShotType",
132
+ attribute: "image_shot_type",
133
+ value: +e.target.value,
134
+ index: number,
135
+ });
136
+ }}
137
+ />
138
+ )}
121
139
  </>
122
140
  )}
123
141
  </div>
@@ -1,7 +1,7 @@
1
1
  import { Container } from "./styles";
2
2
  import { CheckBox } from "../../atoms/CheckBox";
3
3
 
4
- export const GalleryHeader = ({ setCheckAll, setSelectedImages }) => {
4
+ export const GalleryHeader = ({ setCheckAll, setSelectedImages, shotThd }) => {
5
5
  const checkAll = (e) => {
6
6
  const checkboxList = document.querySelectorAll("[id^='gallery-element-']");
7
7
  checkboxList.forEach((chk) => (chk.checked = e.target.checked));
@@ -20,6 +20,7 @@ export const GalleryHeader = ({ setCheckAll, setSelectedImages }) => {
20
20
  <p className="">Tipo de toma</p>
21
21
  <p className="">Tipo de imagen</p>
22
22
  <p className="">Tipo de empaque</p>
23
+ {shotThd && <p className="">Tipo de imagen THD</p>}
23
24
  </Container>
24
25
  );
25
26
  };
@@ -18,6 +18,7 @@ export const ImageDataTable = ({
18
18
  showSaveButton,
19
19
  version,
20
20
  setShowVersionSelector,
21
+ shotThd,
21
22
  }) => {
22
23
  return (
23
24
  <Container darkMode={darkMode}>
@@ -63,6 +64,22 @@ export const ImageDataTable = ({
63
64
  }
64
65
  />
65
66
  </Row>
67
+ {shotThd && (
68
+ <Row>
69
+ <ScreenHeader
70
+ headerType={"table-row-text"}
71
+ text="Tipo de imagen THD"
72
+ />
73
+ <ScreenHeader
74
+ headerType={"table-row-text gray-table-row"}
75
+ text={
76
+ lists?.imageShotType?.find(
77
+ (f) => f.id === +activeImage?.image_shot_type
78
+ )?.type_shot || "-"
79
+ }
80
+ />
81
+ </Row>
82
+ )}
66
83
  <Row>
67
84
  <ScreenHeader headerType={"table-row-text"} text="Formato" />
68
85
  <ScreenHeader
@@ -913,16 +913,17 @@ export const ProviderProductEdition = ({
913
913
  try {
914
914
  setLoading(true);
915
915
  const evaluationArray = [];
916
- const sendAll = [];
917
916
  const conceptArray = ["description", "datasheet", "images"];
918
917
  const dataGeneral = {
919
918
  articleId: product.id_article,
920
919
  orderId: product.id_order ?? product.orderId,
921
920
  result,
921
+ isAproved: result === "A",
922
922
  };
923
923
  servicesData?.forEach((ret) => {
924
924
  const { service, id_retailer } = ret;
925
- const data = {
925
+ let data = {};
926
+ data = {
926
927
  ...dataGeneral,
927
928
  concept: service,
928
929
  retailerId: id_retailer,
@@ -935,31 +936,25 @@ export const ProviderProductEdition = ({
935
936
  },
936
937
  })
937
938
  );
938
- sendAll.push(
939
- axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
940
- headers: {
941
- Authorization: token,
942
- },
943
- })
944
- );
945
939
  });
946
-
947
- await Promise.all([...evaluationArray, ...sendAll]);
940
+ const evalResponse = await Promise.all(evaluationArray);
941
+ console.log(evalResponse.map(({ data }) => JSON.parse(data.body)));
942
+ const userType = user.is_retailer === 1 ? "CA" : "P";
948
943
 
949
944
  const productTemp = product;
950
- productTemp.article_status = `${result}CA`;
945
+ productTemp.article_status = `${result}${userType}`;
951
946
  productTemp.datasheet_status =
952
- productTemp.datasheet_status === "NA" ? "NA" : `${result}CA`;
947
+ productTemp.datasheet_status === "NA" ? "NA" : `${result}${userType}`;
953
948
  productTemp.description_status =
954
- productTemp.description_status === "NA" ? "NA" : `${result}CA`;
949
+ productTemp.description_status === "NA" ? "NA" : `${result}${userType}`;
955
950
  productTemp.images_status =
956
- productTemp.images_status === "NA" ? "NA" : `${result}CA`;
951
+ productTemp.images_status === "NA" ? "NA" : `${result}${userType}`;
957
952
 
958
953
  const retailerStatusCopy = { ...retailerStatus };
959
954
  Object.keys(retailerStatusCopy).forEach((key) => {
960
955
  conceptArray.forEach((concept) => {
961
956
  if (retailerStatusCopy[key][concept]) {
962
- retailerStatusCopy[key][concept] = `${result}CA`;
957
+ retailerStatusCopy[key][concept] = `${result}${userType}`;
963
958
  }
964
959
  });
965
960
  });