contentoh-components-library 21.1.57 → 21.1.61

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.
@@ -62,7 +62,7 @@ var InputFormatter = function InputFormatter(_ref) {
62
62
  var maxLength = maxChar ? maxChar : 999;
63
63
 
64
64
  var getValue = function getValue(value) {
65
- var temp = value.replace(/\n/gm, "<br>");
65
+ var temp = value.replace(/\n/gm, "<br>").replace(/&/gm, "&amp;");
66
66
  return temp;
67
67
  }; //const quillRef = useRef();
68
68
 
@@ -74,11 +74,12 @@ var InputFormatter = function InputFormatter(_ref) {
74
74
  };
75
75
 
76
76
  var valueFormater = function valueFormater(value) {
77
- return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "");
77
+ return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "").replace(/&amp;/gm, "&");
78
78
  };
79
79
 
80
80
  var _onChange = function onChange(valueInput, delta, user, h) {
81
81
  var value = "";
82
+ console.log(valueInput, "valueInput");
82
83
 
83
84
  try {
84
85
  if (h.getLength() - 1 <= maxLength) {
@@ -49,13 +49,12 @@ var RetailerSelector = function RetailerSelector(_ref) {
49
49
  while (1) {
50
50
  switch (_context.prev = _context.next) {
51
51
  case 0:
52
- console.log("https://content-management-images.s3.amazonaws.com/retailers/".concat(activeRetailer.id, ".png"));
53
52
  activeRetailer.image = "https://content-management-images.s3.amazonaws.com/retailers/".concat(activeRetailer.id, ".png");
54
53
  retailers.forEach(function (retailer) {
55
54
  return retailer.image = "https://content-management-images.s3.amazonaws.com/retailers/".concat(retailer.id, ".png");
56
55
  });
57
56
 
58
- case 3:
57
+ case 2:
59
58
  case "end":
60
59
  return _context.stop();
61
60
  }
@@ -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$re;
23
+ var _lists$inputs, _lists$inputs$find, _lists$imagePackaging, _lists$imagePackaging2, _lists$imageType, _lists$imageType$find, _lists$attrForImgs, _lists$attrForImgs$ge;
24
24
 
25
25
  var activeImage = _ref.activeImage,
26
26
  darkMode = _ref.darkMode,
@@ -89,7 +89,7 @@ var ImageDataTable = function ImageDataTable(_ref) {
89
89
  headerType: "table-row-text",
90
90
  text: activeImage !== null && activeImage !== void 0 && activeImage.width && activeImage.height ? "".concat(activeImage === null || activeImage === void 0 ? void 0 : activeImage.width, "x").concat(activeImage === null || activeImage === void 0 ? void 0 : activeImage.height, "px") : "-"
91
91
  })]
92
- }), retailerSelected && (lists === null || lists === void 0 ? void 0 : lists.attrForImgs) && (lists === null || lists === void 0 ? void 0 : (_lists$attrForImgs$re = lists.attrForImgs[retailerSelected]) === null || _lists$attrForImgs$re === void 0 ? void 0 : _lists$attrForImgs$re.map(function (attr, index) {
92
+ }), retailerSelected && (lists === null || lists === void 0 ? void 0 : lists.attrForImgs) && (lists === null || lists === void 0 ? void 0 : (_lists$attrForImgs = lists.attrForImgs) === null || _lists$attrForImgs === void 0 ? void 0 : (_lists$attrForImgs$ge = _lists$attrForImgs.general) === null || _lists$attrForImgs$ge === void 0 ? void 0 : _lists$attrForImgs$ge.map(function (attr, index) {
93
93
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles2.Container, {
94
94
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
95
95
  headerType: "table-row-text",
@@ -100,11 +100,8 @@ var ImageDataTable = function ImageDataTable(_ref) {
100
100
  onChange: function onChange(e) {
101
101
  setImages({
102
102
  action: "changeAttrValue",
103
- retailer: retailerSelected,
104
- index: index,
105
103
  value: e.target.value || "-",
106
- name: attr.name,
107
- retailersId: Object.keys(lists.attrForImgs).slice(0, -1)
104
+ id: attr.id
108
105
  });
109
106
  }
110
107
  })]
@@ -31,61 +31,71 @@ RetailerProductEditionDefault.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: false
33
33
  },
34
- token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjOTRhNzMwNS05MzY1LTQ2ZmYtYTQyMy00YjRiYzNiOGIxODAiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjp0cnVlLCJjb2duaXRvOnVzZXJuYW1lIjoiYzk0YTczMDUtOTM2NS00NmZmLWE0MjMtNGI0YmMzYjhiMTgwIiwiY29nbml0bzpyb2xlcyI6WyJhcm46YXdzOmlhbTo6ODk4NjcwMjMyODA3OnJvbGVcL2NvbnRlbnRvaC1kZXYtdXMtZWFzdC0xLWxhbWJkYVJvbGUiXSwiYXVkIjoiNWFjOHRwZ3M2Z2JzcTEzZnJ2cnBpZWVwNDAiLCJldmVudF9pZCI6ImExY2QwOGQ3LTM0MTgtNGI0ZC1hODNmLTJlOWE0N2E2ZTQzYSIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjU2Mzc1MzQ5LCJuYW1lIjoiQ29sYWJvcmFkb3IiLCJwaG9uZV9udW1iZXIiOiIrNTIxMTExIiwiZXhwIjoxNjU2Mzc4OTQ5LCJpYXQiOjE2NTYzNzUzNDksImVtYWlsIjoic2FsbWVyb24uNUBob3RtYWlsLmNvbSJ9.AXD7CR-3bJz6vIdBBNB_3xLfaTvlFjHi-cwKdN5qCUSY4msn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ekBjb250ZW50b2guY29tIn0.tWAoYeUfaddnLMAqdIiprbAsq15l4By11WToXh_U7PcJGu1ym09ZjrcCjq4ZonVNAa1PHH8YT5o7ziRHOzn_HXtG2uvCaiwqZABZG_1DhbJEhUuH7zORWWcp9pbiE7bwJRfO1SWVE58rEETaAIxvq3aQKrUEjyXSZxPk1Aq9O1jaQnSBbDKVITEtPq9JU2vzCygWS3rAKx0PnjIBJwGwzqSJw5ToyNA2-0TvI_nbezPsVXXSrSM_WSsutZA54nnsS3HLnDukQLu1nRPD1IQhTbjfaLJr44OkTGq6G373LrZ6vrsquZeUiaOnVQdOT-ucSI1oJRGRq6CqLSQOb7fo1Q",
35
35
  productSelected: {
36
36
  services: {
37
- datasheets: 1,
38
- descriptions: 1,
37
+ datasheets: 0,
38
+ descriptions: 0,
39
39
  images: 1
40
40
  },
41
- orderId: 64,
42
- status: "AF",
43
- datasheet_status: "AF",
41
+ orderId: 1973,
42
+ status: "RECEIVED",
43
+ datasheet_status: "NS",
44
44
  prio: "none",
45
- version: 7,
46
- description_status: "AF",
47
- images_status: "AF",
45
+ version: 2,
46
+ description_status: "NS",
47
+ images_status: null,
48
48
  article: {
49
- id_article: 35707,
50
- id_category: "41",
51
- name: "chetos",
52
- upc: "1010101010",
53
- timestamp: "2022-06-16T18:12:42.000Z",
54
- id_user: 28,
49
+ id_article: 48873,
50
+ id_category: "2095",
51
+ name: '710 DISCO CORTE METAL 4 1/2"',
52
+ upc: "436882",
53
+ timestamp: "2022-06-18T12:16:21.000Z",
54
+ id_user: 1239,
55
55
  status: "NULL",
56
56
  active: 1,
57
- company_id: 1,
58
- company_name: "COMPANY DEV",
59
- country: "México",
60
- id_order: 64,
61
- id_datasheet_especialist: 54,
62
- id_datasheet_facilitator: 52,
63
- id_description_especialist: 54,
64
- id_description_facilitator: 52,
65
- id_images_especialist: 55,
66
- id_images_facilitator: 53,
67
- id_auditor: 30,
57
+ company_id: 308,
58
+ SKU: null,
59
+ Descripcion: null,
60
+ Proveedor: null,
61
+ id_proveedor: 0,
62
+ company_name: "The Home Depot",
63
+ country: null,
64
+ id_order: 1973,
65
+ id_datasheet_especialist: null,
66
+ id_datasheet_facilitator: null,
67
+ id_description_especialist: null,
68
+ id_description_facilitator: null,
69
+ id_images_especialist: null,
70
+ id_images_facilitator: null,
71
+ id_auditor: null,
68
72
  id_recepcionist: null,
69
- category: "ABARROTES|BOTANAS, GOLOSINAS Y CHOCOLATES|BOTANAS",
73
+ category: "Herramientas|Accesorios para Herramientas Eléctricas|Discos",
70
74
  missingAttributes: null,
71
75
  missingDescriptions: null,
72
76
  missingImages: null
73
77
  },
74
78
  retailers: [{
75
- id: 3,
76
- name: "Sam´s Club",
79
+ id: 58,
80
+ name: "The Home Depot Golden",
81
+ country: "México",
82
+ id_region: 1,
83
+ active: 1
84
+ }, {
85
+ id: 59,
86
+ name: "The Home Depot Platinum",
77
87
  country: "México",
78
88
  id_region: 1,
79
89
  active: 1
80
90
  }, {
81
- id: 8,
82
- name: "Fragua",
91
+ id: 61,
92
+ name: "Home Depot TAB",
83
93
  country: "México",
84
94
  id_region: 1,
85
95
  active: 1
86
96
  }],
87
- country: "México",
88
- upc: "1010101010"
97
+ country: null,
98
+ upc: "436882"
89
99
  },
90
100
  location: {
91
101
  product: {
@@ -94,36 +104,36 @@ RetailerProductEditionDefault.args = {
94
104
  }
95
105
  },
96
106
  user: {
97
- id_user: 30,
98
- name: "Admin",
99
- last_name: "Ulises",
100
- email: "salmeron.5@hotmail.com",
101
- position: "Admin",
107
+ id_user: 460,
108
+ name: "Ismael",
109
+ last_name: "López",
110
+ email: "ilopez@contentoh.com",
111
+ position: "Desarrollador",
102
112
  telephone: null,
103
113
  country: "México",
104
- id_company: 2,
105
- id_cognito: "c94a7305-9365-46ff-a423-4b4bc3b8b180",
106
- birth_Date: null,
114
+ id_company: 254,
115
+ id_cognito: "9d0cc5c8-a89e-4bdd-9e2d-358a01cc9a62",
116
+ birth_Date: "1997-08-15T00:00:00.000Z",
107
117
  about_me: null,
108
118
  zip_code: null,
109
119
  address: null,
110
120
  job: null,
111
121
  id_stripe: null,
112
- id_role: 6,
122
+ id_role: 1,
113
123
  active: 1,
114
124
  is_retailer: 0,
115
- email_notify: 0,
125
+ email_notify: null,
116
126
  membership: {
117
- id: 2,
118
- start_date: "2021-11-05T02:35:12.000Z",
119
- end_date: "2022-11-05T02:34:49.000Z",
120
- planID: 1,
121
- plan: "prod_KtkvuFFLpOdP6e",
122
- name: "Plan Free",
123
- user_limit: "1",
124
- products_limit: "3",
125
- type: "PyMES"
127
+ id: 750,
128
+ start_date: "2022-01-07T21:32:54.000Z",
129
+ end_date: "2023-01-07T21:32:54.000Z",
130
+ planID: 6,
131
+ plan: "prod_KvGd6YSTJyR3AP",
132
+ name: "Plan Small",
133
+ user_limit: "10",
134
+ products_limit: "1000",
135
+ type: "Enterprise"
126
136
  },
127
- src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1656375350443"
137
+ src: "https://content-management-profile-prod.s3.amazonaws.com/id-460/460.png?1658444769519"
128
138
  }
129
139
  };
@@ -98,9 +98,14 @@ var reducerImages = function reducerImages(state, action) {
98
98
  });
99
99
 
100
100
  case "changeAttrValue":
101
- action.retailersId.forEach(function (ret) {
102
- attrForImgs[ret][action.index].name === action.name && (attrForImgs[ret][action.index].value = action.value);
101
+ var index = attrForImgs.general.findIndex(function (f) {
102
+ return f.id = action.id;
103
103
  });
104
+
105
+ if (index !== -1) {
106
+ attrForImgs.general[index].value = action.value;
107
+ }
108
+
104
109
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
105
110
  attrForImgs: attrForImgs,
106
111
  values: values
@@ -824,16 +829,15 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
824
829
  duplicated = imagesList === null || imagesList === void 0 ? void 0 : imagesList.filter(function (image) {
825
830
  return imagesListTemp[image === null || image === void 0 ? void 0 : image.image_id];
826
831
  });
827
- attrForImgs = Object.values(images === null || images === void 0 ? void 0 : images.attrForImgs);
828
- attrForImgs.pop();
832
+ attrForImgs = Object.values(images === null || images === void 0 ? void 0 : images.attrForImgs).pop();
829
833
  data = {
830
834
  articleId: product === null || product === void 0 ? void 0 : (_product$article11 = product.article) === null || _product$article11 === void 0 ? void 0 : _product$article11.id_article,
831
835
  attrReqImgs: attrForImgs === null || attrForImgs === void 0 ? void 0 : attrForImgs.map(function (e) {
832
- var _e$, _e$2;
836
+ var _e$value;
833
837
 
834
838
  return {
835
- attrId: (_e$ = e[0]) === null || _e$ === void 0 ? void 0 : _e$.id,
836
- value: (_e$2 = e[0]) === null || _e$2 === void 0 ? void 0 : _e$2.value
839
+ attrId: e.id,
840
+ value: (_e$value = e.value) !== null && _e$value !== void 0 ? _e$value : "-"
837
841
  };
838
842
  }),
839
843
  articleData: imagesList === null || imagesList === void 0 ? void 0 : imagesList.filter(function (e) {
@@ -863,19 +867,19 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
863
867
  }
864
868
 
865
869
  if (!(valid && (duplicated === null || duplicated === void 0 ? void 0 : duplicated.length) === 0)) {
866
- _context7.next = 33;
870
+ _context7.next = 32;
867
871
  break;
868
872
  }
869
873
 
870
874
  setLoading(true);
871
- _context7.prev = 11;
875
+ _context7.prev = 10;
872
876
  data === null || data === void 0 ? void 0 : (_data$articleData3 = data.articleData) === null || _data$articleData3 === void 0 ? void 0 : _data$articleData3.forEach(function (e) {
873
877
  e.uuid = (0, _uuid.v4)();
874
878
  });
875
879
  setDataImages(data);
876
880
 
877
881
  if (!((data === null || data === void 0 ? void 0 : (_data$articleData4 = data.articleData) === null || _data$articleData4 === void 0 ? void 0 : _data$articleData4.length) > 0)) {
878
- _context7.next = 23;
882
+ _context7.next = 22;
879
883
  break;
880
884
  }
881
885
 
@@ -891,18 +895,18 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
891
895
  };
892
896
  promiseArray.push(myBucket.putObject(params).promise());
893
897
  });
894
- _context7.next = 20;
898
+ _context7.next = 19;
895
899
  return Promise.all(promiseArray);
896
900
 
897
- case 20:
901
+ case 19:
898
902
  setImagesUploaded(true);
899
- _context7.next = 24;
903
+ _context7.next = 23;
900
904
  break;
901
905
 
902
- case 23:
906
+ case 22:
903
907
  setImagesUploaded(true);
904
908
 
905
- case 24:
909
+ case 23:
906
910
  productTemp = product;
907
911
 
908
912
  if (productTemp.status === "ASSIGNED") {
@@ -911,28 +915,28 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
911
915
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
912
916
  }
913
917
 
914
- _context7.next = 31;
918
+ _context7.next = 30;
915
919
  break;
916
920
 
917
- case 28:
918
- _context7.prev = 28;
919
- _context7.t0 = _context7["catch"](11);
921
+ case 27:
922
+ _context7.prev = 27;
923
+ _context7.t0 = _context7["catch"](10);
920
924
  console.log(_context7.t0); // setMainLoading(false);
921
925
 
922
- case 31:
923
- _context7.next = 34;
926
+ case 30:
927
+ _context7.next = 33;
924
928
  break;
925
929
 
926
- case 33:
930
+ case 32:
927
931
  // setMainLoading(false);
928
932
  setMessage("Completa los campos que solicita cada una de la imágenes o hay imágenes con el mismo tipo de toma.\nRecuerda hay campos obligatorios y no podras avanzar si no estan completos.");
929
933
 
930
- case 34:
934
+ case 33:
931
935
  case "end":
932
936
  return _context7.stop();
933
937
  }
934
938
  }
935
- }, _callee7, null, [[11, 28]]);
939
+ }, _callee7, null, [[10, 27]]);
936
940
  })), [images, imagesUploaded]);
937
941
  (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
938
942
  return _regenerator.default.wrap(function _callee8$(_context8) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.1.57",
3
+ "version": "21.1.61",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -22,7 +22,7 @@ export const InputFormatter = ({
22
22
  const maxLength = maxChar ? maxChar : 999;
23
23
 
24
24
  const getValue = (value) => {
25
- let temp = value.replace(/\n/gm, "<br>");
25
+ let temp = value.replace(/\n/gm, "<br>").replace(/&/gm, "&amp;");
26
26
  return temp;
27
27
  };
28
28
 
@@ -34,11 +34,15 @@ export const InputFormatter = ({
34
34
  };
35
35
 
36
36
  const valueFormater = (value) => {
37
- return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "");
37
+ return value
38
+ .replace(/<\/p><p>/gm, "\n")
39
+ .replace(/<\/?br>|<\/?p>/gm, "")
40
+ .replace(/&amp;/gm, "&");
38
41
  };
39
42
 
40
43
  const onChange = (valueInput, delta, user, h) => {
41
44
  let value = "";
45
+ console.log(valueInput, "valueInput");
42
46
  try {
43
47
  if (h.getLength() - 1 <= maxLength) {
44
48
  let unformattedText = valueInput
@@ -20,9 +20,6 @@ export const RetailerSelector = ({
20
20
  };
21
21
 
22
22
  const getRetailerImage = async () => {
23
- console.log(
24
- `https://content-management-images.s3.amazonaws.com/retailers/${activeRetailer.id}.png`
25
- );
26
23
  activeRetailer.image = `https://content-management-images.s3.amazonaws.com/retailers/${activeRetailer.id}.png`;
27
24
  retailers.forEach(
28
25
  (retailer) =>
@@ -79,7 +79,7 @@ export const ImageDataTable = ({
79
79
  </Row>
80
80
  {retailerSelected &&
81
81
  lists?.attrForImgs &&
82
- lists?.attrForImgs[retailerSelected]?.map((attr, index) => (
82
+ lists?.attrForImgs?.general?.map((attr, index) => (
83
83
  <Row key={"row-" + index + "-" + attr?.name}>
84
84
  <ScreenHeader
85
85
  headerType={"table-row-text"}
@@ -91,11 +91,8 @@ export const ImageDataTable = ({
91
91
  onChange={(e) => {
92
92
  setImages({
93
93
  action: "changeAttrValue",
94
- retailer: retailerSelected,
95
- index,
96
94
  value: e.target.value || "-",
97
- name: attr.name,
98
- retailersId: Object.keys(lists.attrForImgs).slice(0, -1),
95
+ id: attr.id,
99
96
  });
100
97
  }}
101
98
  />
@@ -16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q15l4By11WToXh_U7PcJGu1ym09ZjrcCjq4ZonVNAa1PHH8YT5o7ziRHOzn_HXtG2uvCaiwqZABZG_1DhbJEhUuH7zORWWcp9pbiE7bwJRfO1SWVE58rEETaAIxvq3aQKrUEjyXSZxPk1Aq9O1jaQnSBbDKVITEtPq9JU2vzCygWS3rAKx0PnjIBJwGwzqSJw5ToyNA2-0TvI_nbezPsVXXSrSM_WSsutZA54nnsS3HLnDukQLu1nRPD1IQhTbjfaLJr44OkTGq6G373LrZ6vrsquZeUiaOnVQdOT-ucSI1oJRGRq6CqLSQOb7fo1Q",
20
20
  productSelected: {
21
21
  services: {
22
- datasheets: 1,
23
- descriptions: 1,
22
+ datasheets: 0,
23
+ descriptions: 0,
24
24
  images: 1,
25
25
  },
26
- orderId: 64,
27
- status: "AF",
28
- datasheet_status: "AF",
26
+ orderId: 1973,
27
+ status: "RECEIVED",
28
+ datasheet_status: "NS",
29
29
  prio: "none",
30
- version: 7,
31
- description_status: "AF",
32
- images_status: "AF",
30
+ version: 2,
31
+ description_status: "NS",
32
+ images_status: null,
33
33
  article: {
34
- id_article: 35707,
35
- id_category: "41",
36
- name: "chetos",
37
- upc: "1010101010",
38
- timestamp: "2022-06-16T18:12:42.000Z",
39
- id_user: 28,
34
+ id_article: 48873,
35
+ id_category: "2095",
36
+ name: '710 DISCO CORTE METAL 4 1/2"',
37
+ upc: "436882",
38
+ timestamp: "2022-06-18T12:16:21.000Z",
39
+ id_user: 1239,
40
40
  status: "NULL",
41
41
  active: 1,
42
- company_id: 1,
43
- company_name: "COMPANY DEV",
44
- country: "México",
45
- id_order: 64,
46
- id_datasheet_especialist: 54,
47
- id_datasheet_facilitator: 52,
48
- id_description_especialist: 54,
49
- id_description_facilitator: 52,
50
- id_images_especialist: 55,
51
- id_images_facilitator: 53,
52
- id_auditor: 30,
42
+ company_id: 308,
43
+ SKU: null,
44
+ Descripcion: null,
45
+ Proveedor: null,
46
+ id_proveedor: 0,
47
+ company_name: "The Home Depot",
48
+ country: null,
49
+ id_order: 1973,
50
+ id_datasheet_especialist: null,
51
+ id_datasheet_facilitator: null,
52
+ id_description_especialist: null,
53
+ id_description_facilitator: null,
54
+ id_images_especialist: null,
55
+ id_images_facilitator: null,
56
+ id_auditor: null,
53
57
  id_recepcionist: null,
54
- category: "ABARROTES|BOTANAS, GOLOSINAS Y CHOCOLATES|BOTANAS",
58
+ category: "Herramientas|Accesorios para Herramientas Eléctricas|Discos",
55
59
  missingAttributes: null,
56
60
  missingDescriptions: null,
57
61
  missingImages: null,
58
62
  },
59
63
  retailers: [
60
64
  {
61
- id: 3,
62
- name: "Sam´s Club",
65
+ id: 58,
66
+ name: "The Home Depot Golden",
63
67
  country: "México",
64
68
  id_region: 1,
65
69
  active: 1,
66
70
  },
67
71
  {
68
- id: 8,
69
- name: "Fragua",
72
+ id: 59,
73
+ name: "The Home Depot Platinum",
74
+ country: "México",
75
+ id_region: 1,
76
+ active: 1,
77
+ },
78
+ {
79
+ id: 61,
80
+ name: "Home Depot TAB",
70
81
  country: "México",
71
82
  id_region: 1,
72
83
  active: 1,
73
84
  },
74
85
  ],
75
- country: "México",
76
- upc: "1010101010",
86
+ country: null,
87
+ upc: "436882",
77
88
  },
78
89
  location: {
79
90
  product: { articleId: 109485, versionId: 3 },
80
91
  },
81
92
  user: {
82
- id_user: 30,
83
- name: "Admin",
84
- last_name: "Ulises",
85
- email: "salmeron.5@hotmail.com",
86
- position: "Admin",
93
+ id_user: 460,
94
+ name: "Ismael",
95
+ last_name: "López",
96
+ email: "ilopez@contentoh.com",
97
+ position: "Desarrollador",
87
98
  telephone: null,
88
99
  country: "México",
89
- id_company: 2,
90
- id_cognito: "c94a7305-9365-46ff-a423-4b4bc3b8b180",
91
- birth_Date: null,
100
+ id_company: 254,
101
+ id_cognito: "9d0cc5c8-a89e-4bdd-9e2d-358a01cc9a62",
102
+ birth_Date: "1997-08-15T00:00:00.000Z",
92
103
  about_me: null,
93
104
  zip_code: null,
94
105
  address: null,
95
106
  job: null,
96
107
  id_stripe: null,
97
- id_role: 6,
108
+ id_role: 1,
98
109
  active: 1,
99
110
  is_retailer: 0,
100
- email_notify: 0,
111
+ email_notify: null,
101
112
  membership: {
102
- id: 2,
103
- start_date: "2021-11-05T02:35:12.000Z",
104
- end_date: "2022-11-05T02:34:49.000Z",
105
- planID: 1,
106
- plan: "prod_KtkvuFFLpOdP6e",
107
- name: "Plan Free",
108
- user_limit: "1",
109
- products_limit: "3",
110
- type: "PyMES",
113
+ id: 750,
114
+ start_date: "2022-01-07T21:32:54.000Z",
115
+ end_date: "2023-01-07T21:32:54.000Z",
116
+ planID: 6,
117
+ plan: "prod_KvGd6YSTJyR3AP",
118
+ name: "Plan Small",
119
+ user_limit: "10",
120
+ products_limit: "1000",
121
+ type: "Enterprise",
111
122
  },
112
- src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1656375350443",
123
+ src: "https://content-management-profile-prod.s3.amazonaws.com/id-460/460.png?1658444769519",
113
124
  },
114
- };
125
+ };
@@ -44,10 +44,10 @@ const reducerImages = (state, action) => {
44
44
  values[action.index][action.attribute] = action.value;
45
45
  return { ...state, values };
46
46
  case "changeAttrValue":
47
- action.retailersId.forEach((ret) => {
48
- attrForImgs[ret][action.index].name === action.name &&
49
- (attrForImgs[ret][action.index].value = action.value);
50
- });
47
+ const index = attrForImgs.general.findIndex((f) => (f.id = action.id));
48
+ if (index !== -1) {
49
+ attrForImgs.general[index].value = action.value;
50
+ }
51
51
 
52
52
  return { ...state, attrForImgs, values };
53
53
  case "deleteImage":
@@ -469,13 +469,12 @@ export const RetailerProductEdition = ({
469
469
  return imagesListTemp[image?.image_id];
470
470
  });
471
471
 
472
- const attrForImgs = Object.values(images?.attrForImgs);
473
- attrForImgs.pop();
472
+ const attrForImgs = Object.values(images?.attrForImgs).pop();
474
473
  const data = {
475
474
  articleId: product?.article?.id_article,
476
475
  attrReqImgs: attrForImgs?.map((e) => ({
477
- attrId: e[0]?.id,
478
- value: e[0]?.value,
476
+ attrId: e.id,
477
+ value: e.value ?? "-",
479
478
  })),
480
479
  articleData: imagesList?.filter((e) => !e.id),
481
480
  updateImages: imagesList?.filter((e) => e.id),