contentoh-components-library 21.4.51 → 21.4.52

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.
@@ -27,7 +27,6 @@ var BoxAttributeDefault = Template.bind({});
27
27
  exports.BoxAttributeDefault = BoxAttributeDefault;
28
28
  BoxAttributeDefault.args = {
29
29
  text: "texto prueba",
30
- isEditEnabled: true,
31
30
  titletool: "Porcentaje de requeridos",
32
31
  texttool: "Este porcentaje indica la completitud de los atributos requeridos para todos los servicios."
33
32
  };
@@ -32,7 +32,6 @@ var _jsxRuntime = require("react/jsx-runtime");
32
32
  var _excluded = ["className"];
33
33
 
34
34
  var BoxAttribute = function BoxAttribute(props) {
35
- // console.log({ props });
36
35
  var id = props.id,
37
36
  key = props.key,
38
37
  className = props.className,
@@ -70,14 +69,6 @@ var BoxAttribute = function BoxAttribute(props) {
70
69
  fontFamily: "".concat(_variables.FontFamily.Roboto, ", sans-serif")
71
70
  });
72
71
  });
73
- var formattedData = Object.keys(atributos).reduce(function (result, id) {
74
- result["box".concat(id)] = atributos[id];
75
- return result;
76
- }, {});
77
- console.log("description", description); //escucha los cambios
78
- // console.log(formattedData);
79
- // console.log("atributos id", atributos[props.id]);
80
-
81
72
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
82
73
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
83
74
  id: id,
@@ -51,8 +51,6 @@ var Box = function Box(_ref) {
51
51
  setBoxOnboardingList = _useState6[1];
52
52
 
53
53
  (0, _react.useEffect)(function () {
54
- console.log("dataInputs:", dataInputs);
55
- console.log("inputGroup:", inputGroup);
56
54
  var temp = {};
57
55
  var maxBoxId = 0;
58
56
  inputGroup.inputs.forEach(function (attrId) {
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.InputGroup = void 0;
7
9
 
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
+
8
12
  var _styles = require("./styles");
9
13
 
10
14
  var _ScreenHeader = require("../../atoms/ScreenHeader");
@@ -20,7 +24,7 @@ var _react = require("react");
20
24
  var _jsxRuntime = require("react/jsx-runtime");
21
25
 
22
26
  var InputGroup = function InputGroup(_ref) {
23
- var _inputGroup$inputs;
27
+ var _activeRetailer$retai3, _inputGroup$inputs, _activeRetailer$retai4, _inputGroup$inputs2;
24
28
 
25
29
  var _ref$inputGroup = _ref.inputGroup,
26
30
  inputGroup = _ref$inputGroup === void 0 ? {} : _ref$inputGroup,
@@ -40,8 +44,8 @@ var InputGroup = function InputGroup(_ref) {
40
44
  compare = _ref.compare,
41
45
  _ref$groupData = _ref.groupData,
42
46
  groupData = _ref$groupData === void 0 ? [] : _ref$groupData,
43
- isShowbox = _ref.isShowbox,
44
- setUpdatedBoxData = _ref.setUpdatedBoxData;
47
+ setUpdatedBoxData = _ref.setUpdatedBoxData,
48
+ activeRetailer = _ref.activeRetailer;
45
49
 
46
50
  var inputTypeValue = function inputTypeValue(type) {
47
51
  switch (type) {
@@ -56,28 +60,47 @@ var InputGroup = function InputGroup(_ref) {
56
60
  }
57
61
  };
58
62
 
59
- var isOnboarding = function isOnboarding() {
60
- var contentBoxAttribute = groupData.find(function (_ref2) {
61
- var dataGroup = _ref2.dataGroup;
62
- return dataGroup === "Caja";
63
- });
64
-
65
- if (contentBoxAttribute) {
66
- console.log("content box attribute");
67
- } else {
68
- console.log("dont content box attribute");
69
- }
70
-
71
- return contentBoxAttribute;
72
- };
63
+ var _useState = (0, _react.useState)(false),
64
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
65
+ showBox = _useState2[0],
66
+ setShowBox = _useState2[1];
73
67
 
74
68
  var isEquals = function isEquals(dataInputsVal, auditInputsVal) {
75
69
  var result = dataInputsVal === auditInputsVal;
76
70
  return result;
77
71
  };
78
72
 
79
- return inputGroup.groupId !== "16" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
80
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
73
+ (0, _react.useEffect)(function () {
74
+ var _activeRetailer$retai;
75
+
76
+ if (inputGroup.groupId === "16" && activeRetailer && activeRetailer !== null && activeRetailer !== void 0 && (_activeRetailer$retai = activeRetailer.retailer) !== null && _activeRetailer$retai !== void 0 && _activeRetailer$retai.id) {
77
+ var _activeRetailer$retai2;
78
+
79
+ if ((activeRetailer === null || activeRetailer === void 0 ? void 0 : (_activeRetailer$retai2 = activeRetailer.retailer) === null || _activeRetailer$retai2 === void 0 ? void 0 : _activeRetailer$retai2.id) === 68) {
80
+ setShowBox(true);
81
+ } else {
82
+ setShowBox(false);
83
+ }
84
+ }
85
+ }, [activeRetailer, inputGroup.groupId]); // useEffect(() => {
86
+ // if (showBox) {
87
+ // // Realiza la acción que deseas cuando showBox es true
88
+ // console.log("showBox es true");
89
+ // } else {
90
+ // // Realiza la acción que deseas cuando showBox es false
91
+ // console.log("showBox es false");
92
+ // }
93
+ // }, [showBox]);
94
+
95
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
96
+ children: [inputGroup.groupId === "16" && (activeRetailer === null || activeRetailer === void 0 ? void 0 : (_activeRetailer$retai3 = activeRetailer.retailer) === null || _activeRetailer$retai3 === void 0 ? void 0 : _activeRetailer$retai3.id) === 68 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
97
+ className: activeSection === "Ficha técnica" ? "datasheets-layout" : "descriptions-layout",
98
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.Box, {
99
+ inputGroup: inputGroup,
100
+ dataInputs: dataInputs,
101
+ onChange: setUpdatedBoxData
102
+ })
103
+ }), inputGroup.groupId !== "16" && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
81
104
  className: activeSection === "Ficha técnica" ? "datasheets-layout" : "descriptions-layout",
82
105
  children: [(inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.dataGroup) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
83
106
  headerType: "retailer-name-header",
@@ -127,14 +150,57 @@ var InputGroup = function InputGroup(_ref) {
127
150
  }, index + "-" + (input === null || input === void 0 ? void 0 : input.value) + "-" + compare);
128
151
  })
129
152
  })]
130
- })
131
- }) : isShowbox && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
132
- className: activeSection === "Ficha técnica" ? "datasheets-layout" : "descriptions-layout",
133
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.Box, {
134
- inputGroup: inputGroup,
135
- dataInputs: dataInputs,
136
- onChange: setUpdatedBoxData
137
- })
153
+ }), inputGroup.groupId === "16" && (activeRetailer === null || activeRetailer === void 0 ? void 0 : (_activeRetailer$retai4 = activeRetailer.retailer) === null || _activeRetailer$retai4 === void 0 ? void 0 : _activeRetailer$retai4.id) === 74 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
154
+ className: activeSection === "Ficha técnica" ? "datasheets-layout" : "descriptions-layout",
155
+ children: [(inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.dataGroup) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
156
+ headerType: "retailer-name-header",
157
+ text: "".concat(inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.dataGroup)
158
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
159
+ className: "inputs-container",
160
+ children: inputGroup === null || inputGroup === void 0 ? void 0 : (_inputGroup$inputs2 = inputGroup.inputs) === null || _inputGroup$inputs2 === void 0 ? void 0 : _inputGroup$inputs2.map(function (input, index) {
161
+ var _dataInputs$input13, _dataInputs$input14, _dataInputs$input15, _dataInputs$input16, _dataInputs$input17, _dataInputs$input18, _auditInputs$input2, _dataInputs$input19, _dataInputs$input20, _dataInputs$input21, _dataInputs$input22, _dataInputs$input23, _dataInputs$input24, _auditInputGroup$inpu3, _auditInputGroup$inpu4;
162
+
163
+ return activeSection === "Ficha técnica" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
164
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
165
+ //disabled={input === 40001}
166
+ disabled: false,
167
+ inputId: (_dataInputs$input15 = dataInputs[input]) === null || _dataInputs$input15 === void 0 ? void 0 : _dataInputs$input15.id,
168
+ version: version,
169
+ inputType: inputTypeValue((_dataInputs$input16 = dataInputs[input]) === null || _dataInputs$input16 === void 0 ? void 0 : _dataInputs$input16.type),
170
+ label: ((_dataInputs$input17 = dataInputs[input]) === null || _dataInputs$input17 === void 0 ? void 0 : _dataInputs$input17.name) + ((_dataInputs$input18 = dataInputs[input]) !== null && _dataInputs$input18 !== void 0 && _dataInputs$input18.required ? "*" : ""),
171
+ value: compare ? (_auditInputs$input2 = auditInputs[input]) === null || _auditInputs$input2 === void 0 ? void 0 : _auditInputs$input2.value : (_dataInputs$input19 = dataInputs[input]) === null || _dataInputs$input19 === void 0 ? void 0 : _dataInputs$input19.value,
172
+ inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
173
+ articleId: articleId,
174
+ isRequired: (_dataInputs$input20 = dataInputs[input]) === null || _dataInputs$input20 === void 0 ? void 0 : _dataInputs$input20.required,
175
+ updatedDatasheets: updatedDatasheets,
176
+ setUpdatedDatasheets: setUpdatedDatasheets,
177
+ maxChar: (_dataInputs$input21 = dataInputs[input]) !== null && _dataInputs$input21 !== void 0 && _dataInputs$input21.max_chars ? (_dataInputs$input22 = dataInputs[input]) === null || _dataInputs$input22 === void 0 ? void 0 : _dataInputs$input22.max_chars : 999,
178
+ optionList: (_dataInputs$input23 = dataInputs[input]) === null || _dataInputs$input23 === void 0 ? void 0 : _dataInputs$input23.option_list,
179
+ description: (_dataInputs$input24 = dataInputs[input]) === null || _dataInputs$input24 === void 0 ? void 0 : _dataInputs$input24.description,
180
+ showTooltip: true,
181
+ auditClass: compare && !isEquals(dataInputs[input].value, auditInputs[input].value) ? "audit-class" : ""
182
+ }, index + "-" + ((_dataInputs$input13 = dataInputs[input]) === null || _dataInputs$input13 === void 0 ? void 0 : _dataInputs$input13.value) + "-" + ((_dataInputs$input14 = dataInputs[input]) === null || _dataInputs$input14 === void 0 ? void 0 : _dataInputs$input14.id) + "-" + compare)
183
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
184
+ inputId: input.id,
185
+ index: index,
186
+ inputType: "textarea",
187
+ label: (input === null || input === void 0 ? void 0 : input.name) + (input.required ? "*" : ""),
188
+ value: compare ? auditInputGroup === null || auditInputGroup === void 0 ? void 0 : (_auditInputGroup$inpu3 = auditInputGroup.inputs[index]) === null || _auditInputGroup$inpu3 === void 0 ? void 0 : _auditInputGroup$inpu3.value : input === null || input === void 0 ? void 0 : input.value,
189
+ isRequired: input.required,
190
+ maxChar: input.max_chars,
191
+ inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
192
+ updatedDescriptions: updatedDescriptions,
193
+ setUpdatedDescriptions: setUpdatedDescriptions,
194
+ articleId: articleId,
195
+ version: version,
196
+ dinamicHeight: dinamicHeight,
197
+ description: input === null || input === void 0 ? void 0 : input.description,
198
+ showTooltip: true,
199
+ auditClass: compare && !isEquals(input === null || input === void 0 ? void 0 : input.value, auditInputGroup === null || auditInputGroup === void 0 ? void 0 : (_auditInputGroup$inpu4 = auditInputGroup.inputs[index]) === null || _auditInputGroup$inpu4 === void 0 ? void 0 : _auditInputGroup$inpu4.value) ? "audit-class" : ""
200
+ }, index + "-" + (input === null || input === void 0 ? void 0 : input.value) + "-" + compare);
201
+ })
202
+ })]
203
+ })]
138
204
  });
139
205
  };
140
206
 
@@ -32,47 +32,40 @@ ProviderProductEditionDefault.args = {
32
32
  Imágenes: false
33
33
  },
34
34
  token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIyM2Q1NTlmYi1jMzIwLTRhMjItYjJmNy1lOThhYTFhZGEyNmYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MzkyNjgyMSwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2ODM5MzA0MjEsImlhdCI6MTY4MzkyNjgyMSwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.TvCoaKoctj5mypXWMz3NyV1Vm1ToBV0vJmpVyZSQw4-ikTChkxcZ5tFYvqhk1GdvNCFttfSQIqM-14dAYYBc28YwwKP86gqOuzB1fG41rN5x1Yx3tkJq6hiVRgiBbSHWtThA9c8VnxNQbrJiaRTvvkDiM5KNTEst1oxQHL5Ct9_iKQMJMRFie7Xv0xnyS0qZ6QHK4Q2A9OHsnDkAuumALZJcE19Zh6VgSitgWrZiz3x5Text4Q-U-R48NUAzUFirAzYZzJN_fCme5pGf1AnUaZjeUjPsmrV5TBVzPEYwXO0KG8lYjL8id80D7tbGs28ZIK6B4rf3-eqI_ngmBB4CjQ",
35
- articleId: 39550,
36
- category: 287,
35
+ articleId: 112668,
36
+ category: 905,
37
37
  version: 1,
38
38
  productSelected: {
39
- id_article: 39550,
40
- upc: 43654697,
41
- name: "Campana de Cocina",
42
- timestamp: "2023-08-04T22:23:40.000Z",
43
- categoryName: "Ferretería|Ferretería General|Tornillos, Tuercas y Arandelas",
44
- id_category: 287,
39
+ id_article: 112668,
40
+ upc: "137091",
41
+ name: "Audifonos Bose",
42
+ timestamp: "2023-10-14T01:12:45.000Z",
43
+ categoryName: "Audio|Audífonos|In Ear",
44
+ id_category: 905,
45
45
  version: 1,
46
46
  retailersAvailable: [{
47
- name: "The Home Depot Golden",
48
- "id": 58
49
- }, {
50
- name: "The Home Depot Onboarding",
51
- "id": 68
47
+ name: "Radioshack",
48
+ id: 74
52
49
  }],
53
- percentage: "89"
50
+ percentage: "33"
54
51
  },
55
52
  productToEdit: {
56
- idCategory: 287,
57
- ArticleId: 39550,
53
+ idCategory: 905,
54
+ ArticleId: 112668,
58
55
  product: [{
59
- id_article: 39550,
60
- upc: 43654697,
61
- name: "Campana de Cocina",
62
- timestamp: "2023-08-04T22:23:40.000Z",
63
- categoryName: "Ferretería|Ferretería General|Tornillos, Tuercas y Arandelas",
64
- id_category: 287,
56
+ id_article: 112668,
57
+ upc: "137091",
58
+ name: "Audifonos Bose",
59
+ timestamp: "2023-10-14T01:12:45.000Z",
60
+ categoryName: "Audio|Audífonos|In Ear",
61
+ id_category: 905,
65
62
  version: 1,
66
63
  retailersAvailable: [{
67
- name: "The Home Depot Golden",
68
- id: 58,
69
- percentage: 100
70
- }, {
71
- name: "The Home Depot Onboarding",
72
- id: 68,
73
- percentage: 78
64
+ name: "Radioshack",
65
+ id: 74,
66
+ percentage: 33
74
67
  }],
75
- percentage: "89"
68
+ percentage: "33"
76
69
  }]
77
70
  },
78
71
  location: {
@@ -87,15 +80,15 @@ ProviderProductEditionDefault.args = {
87
80
  key: "24vwut"
88
81
  },
89
82
  user: {
90
- id_user: 191,
91
- name: "Demo",
92
- last_name: "Demo",
93
- email: "merchants24feb@allfreemail.net",
94
- position: "Test",
95
- telephone: "+52123456789",
83
+ id_user: 350,
84
+ name: "Proveedor Uno",
85
+ last_name: "Radioshack",
86
+ email: "proveedorradioshackuno@allfreemail.net",
87
+ position: "proveedor",
88
+ telephone: "+521234567898",
96
89
  country: "México",
97
- id_company: 923,
98
- id_cognito: "c3cd160c-76c2-497c-9357-5ef949307e1e",
90
+ id_company: 950,
91
+ id_cognito: "0f4247df-f02f-4cb8-909a-e62649d34782",
99
92
  birth_Date: null,
100
93
  about_me: null,
101
94
  zip_code: null,
@@ -108,9 +101,9 @@ ProviderProductEditionDefault.args = {
108
101
  email_notify: 1,
109
102
  is_user_tech: null,
110
103
  membership: {
111
- id: 114,
112
- start_date: "2023-02-24T18:14:43.000Z",
113
- end_date: "2024-02-24T18:14:43.000Z",
104
+ id: 146,
105
+ start_date: "2023-10-14T00:49:16.000Z",
106
+ end_date: "2024-10-14T00:49:16.000Z",
114
107
  planID: 8,
115
108
  plan: "prod_KtlhECVSFG2iro",
116
109
  name: "Plan Pro",
@@ -118,14 +111,14 @@ ProviderProductEditionDefault.args = {
118
111
  products_limit: "5000",
119
112
  type: "Enterprise"
120
113
  },
121
- src: "https://content-management-profile.s3.amazonaws.com/id-191/191.png?1697171804447"
114
+ src: "https://content-management-profile.s3.amazonaws.com/id-350/350.png?1697569749878"
122
115
  },
123
116
  company: {
124
- id_company: 923,
125
- trade_name: "Demo",
126
- company_name: "Demo",
127
- rfc: "Demo",
128
- adress: "Demo",
117
+ id_company: 950,
118
+ trade_name: "Radioshack",
119
+ company_name: "Radioshack",
120
+ rfc: "ASDASD",
121
+ adress: "CDMX",
129
122
  about_company: null,
130
123
  telephone: null,
131
124
  web_site: null,
@@ -134,19 +127,19 @@ ProviderProductEditionDefault.args = {
134
127
  social_link: null,
135
128
  is_retailer: 0,
136
129
  financedRetailers: [{
137
- id: 68,
138
- name: "The Home Depot Onboarding",
130
+ id: 74,
131
+ name: "Radioshack",
139
132
  country: "México",
140
133
  id_region: 1,
141
134
  active: 1,
142
135
  flow: 1
143
136
  }],
144
137
  retailers: [{
145
- id: 68,
146
- name: "The Home Depot Onboarding",
138
+ id: 74,
139
+ name: "Radioshack",
147
140
  country: "México",
148
141
  id_region: 1,
149
- "active": 1,
142
+ active: 1,
150
143
  flow: 1
151
144
  }]
152
145
  },
@@ -2225,6 +2225,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2225
2225
  updatedDatasheets: updatedDatasheets,
2226
2226
  setUpdatedDatasheets: setUpdatedDatasheets,
2227
2227
  isShowbox: true,
2228
+ activeRetailer: services[0][activeRetailer.id],
2228
2229
  groupData: services[0][activeRetailer.id].data,
2229
2230
  setUpdatedBoxData: function setUpdatedBoxData(e) {
2230
2231
  setBoxData(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.4.51",
3
+ "version": "21.4.52",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -11,7 +11,6 @@ export const BoxAttributeDefault = Template.bind({});
11
11
 
12
12
  BoxAttributeDefault.args = {
13
13
  text:"texto prueba",
14
- isEditEnabled:true,
15
14
  titletool:"Porcentaje de requeridos",
16
15
  texttool:"Este porcentaje indica la completitud de los atributos requeridos para todos los servicios.",
17
16
  };
@@ -6,7 +6,6 @@ import { styled } from '@mui/material/styles';
6
6
  import { FontFamily, GlobalColors } from "../../../global-files/variables";
7
7
 
8
8
  export const BoxAttribute = (props) => {
9
- // console.log({ props });
10
9
  const {
11
10
  id,
12
11
  key,
@@ -36,15 +35,6 @@ export const BoxAttribute = (props) => {
36
35
  fontFamily: `${FontFamily.Roboto}, sans-serif`,
37
36
  },
38
37
  }));
39
-
40
- const formattedData = Object.keys(atributos).reduce((result, id) => {
41
- result[`box${id}`] = atributos[id];
42
- return result;
43
- }, {});
44
- console.log("description",description)
45
- //escucha los cambios
46
- // console.log(formattedData);
47
- // console.log("atributos id", atributos[props.id]);
48
38
  return (
49
39
  <>
50
40
  <Container
@@ -15,8 +15,6 @@ export const Box = ({ onChange, dataInputs, inputGroup }) => {
15
15
  ]);
16
16
 
17
17
  useEffect(() => {
18
- console.log("dataInputs:", dataInputs);
19
- console.log("inputGroup:", inputGroup);
20
18
  const temp = {};
21
19
  let maxBoxId = 0;
22
20
  inputGroup.inputs.forEach((attrId) => {
@@ -1,4 +1,4 @@
1
- import { Container, ContainerIcon } from "./styles";
1
+ import { Container } from "./styles";
2
2
  import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
3
  import { BoxAttribute } from "../../molecules/BoxAttribute";
4
4
  import { useState, useEffect, memo } from "react";
@@ -3,7 +3,7 @@ import { ScreenHeader } from "../../atoms/ScreenHeader";
3
3
  import { TagAndInput } from "../../molecules/TagAndInput";
4
4
  import { BoxOnboarding } from "../BoxOnboarding";
5
5
  import { Box } from "../Box";
6
- import { useEffect } from "react";
6
+ import { useEffect, useState } from "react";
7
7
 
8
8
  export const InputGroup = ({
9
9
  inputGroup = {},
@@ -20,8 +20,8 @@ export const InputGroup = ({
20
20
  dinamicHeight,
21
21
  compare,
22
22
  groupData = [],
23
- isShowbox,
24
- setUpdatedBoxData
23
+ setUpdatedBoxData,
24
+ activeRetailer
25
25
  }) => {
26
26
  const inputTypeValue = (type) => {
27
27
  switch (type) {
@@ -33,134 +33,241 @@ export const InputGroup = ({
33
33
  return "text";
34
34
  }
35
35
  };
36
-
37
- const isOnboarding = () => {
38
- const contentBoxAttribute = groupData.find(
39
- ({ dataGroup }) => dataGroup === "Caja"
40
- );
41
- if (contentBoxAttribute) {
42
- console.log("content box attribute");
43
- } else {
44
- console.log("dont content box attribute");
45
- }
46
- return contentBoxAttribute;
47
- };
36
+ const [showBox, setShowBox] = useState(false);
48
37
 
49
38
  const isEquals = (dataInputsVal, auditInputsVal) => {
50
39
  const result = dataInputsVal === auditInputsVal;
51
40
  return result;
52
41
  };
53
- return inputGroup.groupId !== "16" ? (
42
+
43
+
44
+ useEffect(() => {
45
+ if (inputGroup.groupId === "16" && activeRetailer && activeRetailer?.retailer?.id) {
46
+ if (activeRetailer?.retailer?.id === 68) {
47
+ setShowBox(true);
48
+ } else {
49
+ setShowBox(false);
50
+ }
51
+ }
52
+ }, [activeRetailer, inputGroup.groupId]);
53
+
54
+ // useEffect(() => {
55
+ // if (showBox) {
56
+ // // Realiza la acción que deseas cuando showBox es true
57
+ // console.log("showBox es true");
58
+ // } else {
59
+ // // Realiza la acción que deseas cuando showBox es false
60
+ // console.log("showBox es false");
61
+ // }
62
+ // }, [showBox]);
63
+
64
+ return (
54
65
  <>
55
- <Container
56
- className={
57
- activeSection === "Ficha técnica"
58
- ? "datasheets-layout"
59
- : "descriptions-layout"
60
- }
61
- >
62
- {inputGroup?.dataGroup && (
63
- <ScreenHeader
64
- headerType={"retailer-name-header"}
65
- text={`${inputGroup?.dataGroup}`}
66
+ {inputGroup.groupId === "16" && activeRetailer?.retailer?.id === 68 && (
67
+ <Container
68
+ className={
69
+ activeSection === "Ficha técnica"
70
+ ? "datasheets-layout"
71
+ : "descriptions-layout"
72
+ }
73
+ >
74
+ <Box
75
+ inputGroup={inputGroup}
76
+ dataInputs={dataInputs}
77
+ onChange={setUpdatedBoxData}
66
78
  />
67
- )}
68
- <div className="inputs-container">
69
- {inputGroup?.inputs?.map((input, index) =>
70
- activeSection === "Ficha técnica" ? (
71
- <>
79
+ </Container>
80
+ )}
81
+ {(inputGroup.groupId !== "16") && (
82
+ <Container
83
+ className={
84
+ activeSection === "Ficha técnica"
85
+ ? "datasheets-layout"
86
+ : "descriptions-layout"
87
+ }
88
+ >
89
+ {inputGroup?.dataGroup && (
90
+ <ScreenHeader
91
+ headerType={"retailer-name-header"}
92
+ text={`${inputGroup?.dataGroup}`}
93
+ />
94
+ )}
95
+ <div className="inputs-container">
96
+ {inputGroup?.inputs?.map((input, index) =>
97
+ activeSection === "Ficha técnica" ? (
98
+ <>
99
+ <TagAndInput
100
+ key={
101
+ index +
102
+ "-" +
103
+ dataInputs[input]?.value +
104
+ "-" +
105
+ dataInputs[input]?.id +
106
+ "-" +
107
+ compare
108
+ }
109
+ //disabled={input === 40001}
110
+ disabled={false}
111
+ inputId={dataInputs[input]?.id}
112
+ version={version}
113
+ inputType={inputTypeValue(dataInputs[input]?.type)}
114
+ label={
115
+ dataInputs[input]?.name +
116
+ (dataInputs[input]?.required ? "*" : "")
117
+ }
118
+ value={
119
+ compare
120
+ ? auditInputs[input]?.value
121
+ : dataInputs[input]?.value
122
+ }
123
+ inputPlaceHolder={input?.placeholder}
124
+ articleId={articleId}
125
+ isRequired={dataInputs[input]?.required}
126
+ updatedDatasheets={updatedDatasheets}
127
+ setUpdatedDatasheets={setUpdatedDatasheets}
128
+ maxChar={
129
+ dataInputs[input]?.max_chars
130
+ ? dataInputs[input]?.max_chars
131
+ : 999
132
+ }
133
+ optionList={dataInputs[input]?.option_list}
134
+ description={dataInputs[input]?.description}
135
+ showTooltip={true}
136
+ auditClass={
137
+ compare &&
138
+ !isEquals(dataInputs[input].value, auditInputs[input].value)
139
+ ? "audit-class"
140
+ : ""
141
+ }
142
+ />
143
+ </>
144
+ ) : (
72
145
  <TagAndInput
73
- key={
74
- index +
75
- "-" +
76
- dataInputs[input]?.value +
77
- "-" +
78
- dataInputs[input]?.id +
79
- "-" +
80
- compare
146
+ key={index + "-" + input?.value + "-" + compare}
147
+ inputId={input.id}
148
+ index={index}
149
+ inputType={"textarea"}
150
+ label={input?.name + (input.required ? "*" : "")}
151
+ value={
152
+ compare ? auditInputGroup?.inputs[index]?.value : input?.value
81
153
  }
82
- //disabled={input === 40001}
83
- disabled={false}
84
- inputId={dataInputs[input]?.id}
154
+ isRequired={input.required}
155
+ maxChar={input.max_chars}
156
+ inputPlaceHolder={input?.placeholder}
157
+ updatedDescriptions={updatedDescriptions}
158
+ setUpdatedDescriptions={setUpdatedDescriptions}
159
+ articleId={articleId}
85
160
  version={version}
86
- inputType={inputTypeValue(dataInputs[input]?.type)}
87
- label={
88
- dataInputs[input]?.name +
89
- (dataInputs[input]?.required ? "*" : "")
161
+ dinamicHeight={dinamicHeight}
162
+ description={input?.description}
163
+ showTooltip={true}
164
+ auditClass={
165
+ compare &&
166
+ !isEquals(input?.value, auditInputGroup?.inputs[index]?.value)
167
+ ? "audit-class"
168
+ : ""
90
169
  }
170
+ />
171
+ )
172
+ )}
173
+ </div>
174
+ </Container>
175
+ )}
176
+ {(inputGroup.groupId === "16" && activeRetailer?.retailer?.id === 74) && (
177
+ <Container
178
+ className={
179
+ activeSection === "Ficha técnica"
180
+ ? "datasheets-layout"
181
+ : "descriptions-layout"
182
+ }
183
+ >
184
+ {inputGroup?.dataGroup && (
185
+ <ScreenHeader
186
+ headerType={"retailer-name-header"}
187
+ text={`${inputGroup?.dataGroup}`}
188
+ />
189
+ )}
190
+ <div className="inputs-container">
191
+ {inputGroup?.inputs?.map((input, index) =>
192
+ activeSection === "Ficha técnica" ? (
193
+ <>
194
+ <TagAndInput
195
+ key={
196
+ index +
197
+ "-" +
198
+ dataInputs[input]?.value +
199
+ "-" +
200
+ dataInputs[input]?.id +
201
+ "-" +
202
+ compare
203
+ }
204
+ //disabled={input === 40001}
205
+ disabled={false}
206
+ inputId={dataInputs[input]?.id}
207
+ version={version}
208
+ inputType={inputTypeValue(dataInputs[input]?.type)}
209
+ label={
210
+ dataInputs[input]?.name +
211
+ (dataInputs[input]?.required ? "*" : "")
212
+ }
213
+ value={
214
+ compare
215
+ ? auditInputs[input]?.value
216
+ : dataInputs[input]?.value
217
+ }
218
+ inputPlaceHolder={input?.placeholder}
219
+ articleId={articleId}
220
+ isRequired={dataInputs[input]?.required}
221
+ updatedDatasheets={updatedDatasheets}
222
+ setUpdatedDatasheets={setUpdatedDatasheets}
223
+ maxChar={
224
+ dataInputs[input]?.max_chars
225
+ ? dataInputs[input]?.max_chars
226
+ : 999
227
+ }
228
+ optionList={dataInputs[input]?.option_list}
229
+ description={dataInputs[input]?.description}
230
+ showTooltip={true}
231
+ auditClass={
232
+ compare &&
233
+ !isEquals(dataInputs[input].value, auditInputs[input].value)
234
+ ? "audit-class"
235
+ : ""
236
+ }
237
+ />
238
+ </>
239
+ ) : (
240
+ <TagAndInput
241
+ key={index + "-" + input?.value + "-" + compare}
242
+ inputId={input.id}
243
+ index={index}
244
+ inputType={"textarea"}
245
+ label={input?.name + (input.required ? "*" : "")}
91
246
  value={
92
- compare
93
- ? auditInputs[input]?.value
94
- : dataInputs[input]?.value
247
+ compare ? auditInputGroup?.inputs[index]?.value : input?.value
95
248
  }
249
+ isRequired={input.required}
250
+ maxChar={input.max_chars}
96
251
  inputPlaceHolder={input?.placeholder}
252
+ updatedDescriptions={updatedDescriptions}
253
+ setUpdatedDescriptions={setUpdatedDescriptions}
97
254
  articleId={articleId}
98
- isRequired={dataInputs[input]?.required}
99
- updatedDatasheets={updatedDatasheets}
100
- setUpdatedDatasheets={setUpdatedDatasheets}
101
- maxChar={
102
- dataInputs[input]?.max_chars
103
- ? dataInputs[input]?.max_chars
104
- : 999
105
- }
106
- optionList={dataInputs[input]?.option_list}
107
- description={dataInputs[input]?.description}
255
+ version={version}
256
+ dinamicHeight={dinamicHeight}
257
+ description={input?.description}
108
258
  showTooltip={true}
109
259
  auditClass={
110
260
  compare &&
111
- !isEquals(dataInputs[input].value, auditInputs[input].value)
261
+ !isEquals(input?.value, auditInputGroup?.inputs[index]?.value)
112
262
  ? "audit-class"
113
263
  : ""
114
264
  }
115
265
  />
116
- </>
117
- ) : (
118
- <TagAndInput
119
- key={index + "-" + input?.value + "-" + compare}
120
- inputId={input.id}
121
- index={index}
122
- inputType={"textarea"}
123
- label={input?.name + (input.required ? "*" : "")}
124
- value={
125
- compare ? auditInputGroup?.inputs[index]?.value : input?.value
126
- }
127
- isRequired={input.required}
128
- maxChar={input.max_chars}
129
- inputPlaceHolder={input?.placeholder}
130
- updatedDescriptions={updatedDescriptions}
131
- setUpdatedDescriptions={setUpdatedDescriptions}
132
- articleId={articleId}
133
- version={version}
134
- dinamicHeight={dinamicHeight}
135
- description={input?.description}
136
- showTooltip={true}
137
- auditClass={
138
- compare &&
139
- !isEquals(input?.value, auditInputGroup?.inputs[index]?.value)
140
- ? "audit-class"
141
- : ""
142
- }
143
- />
144
- )
145
- )}
146
- </div>
147
- </Container>
266
+ )
267
+ )}
268
+ </div>
269
+ </Container>
270
+ )}
148
271
  </>
149
- ) : (
150
- isShowbox && (
151
- <Container
152
- className={
153
- activeSection === "Ficha técnica"
154
- ? "datasheets-layout"
155
- : "descriptions-layout"
156
- }
157
- >
158
- <Box
159
- inputGroup={inputGroup}
160
- dataInputs={dataInputs}
161
- onChange={setUpdatedBoxData}
162
- />
163
- </Container>
164
- )
165
272
  );
166
- };
273
+ }
@@ -17,42 +17,40 @@ ProviderProductEditionDefault.args = {
17
17
  },
18
18
  token:
19
19
  "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIyM2Q1NTlmYi1jMzIwLTRhMjItYjJmNy1lOThhYTFhZGEyNmYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MzkyNjgyMSwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2ODM5MzA0MjEsImlhdCI6MTY4MzkyNjgyMSwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.TvCoaKoctj5mypXWMz3NyV1Vm1ToBV0vJmpVyZSQw4-ikTChkxcZ5tFYvqhk1GdvNCFttfSQIqM-14dAYYBc28YwwKP86gqOuzB1fG41rN5x1Yx3tkJq6hiVRgiBbSHWtThA9c8VnxNQbrJiaRTvvkDiM5KNTEst1oxQHL5Ct9_iKQMJMRFie7Xv0xnyS0qZ6QHK4Q2A9OHsnDkAuumALZJcE19Zh6VgSitgWrZiz3x5Text4Q-U-R48NUAzUFirAzYZzJN_fCme5pGf1AnUaZjeUjPsmrV5TBVzPEYwXO0KG8lYjL8id80D7tbGs28ZIK6B4rf3-eqI_ngmBB4CjQ",
20
- articleId: 39550,
21
- category: 287,
20
+ articleId: 112668,
21
+ category: 905,
22
22
  version: 1,
23
23
  productSelected: {
24
- id_article:39550,
25
- upc:43654697,
26
- name:"Campana de Cocina",
27
- timestamp:"2023-08-04T22:23:40.000Z",
28
- categoryName:"Ferretería|Ferretería General|Tornillos, Tuercas y Arandelas",
29
- id_category:287,
24
+ id_article:112668,
25
+ upc:"137091",
26
+ name:"Audifonos Bose",
27
+ timestamp:"2023-10-14T01:12:45.000Z",
28
+ categoryName:"Audio|Audífonos|In Ear",
29
+ id_category:905,
30
30
  version:1,
31
31
  retailersAvailable:[
32
- {name:"The Home Depot Golden","id":58},
33
- {name:"The Home Depot Onboarding","id":68}],
34
- percentage:"89"
35
- },
32
+ {name:"Radioshack",
33
+ id:74}
34
+ ],
35
+ percentage:"33"
36
+ },
36
37
  productToEdit: {
37
- idCategory:287,
38
- ArticleId:39550,
39
- product:[{
40
- id_article:39550,
41
- upc:43654697,
42
- name:"Campana de Cocina",
43
- timestamp:"2023-08-04T22:23:40.000Z",
44
- categoryName:"Ferretería|Ferretería General|Tornillos, Tuercas y Arandelas",
45
- id_category:287,
46
- version:1,
47
- retailersAvailable:[
48
- {name:"The Home Depot Golden",
49
- id:58,
50
- percentage:100},
51
- {name:"The Home Depot Onboarding",
52
- id:68,
53
- percentage:78}
54
- ],
55
- percentage:"89"}]
38
+ idCategory:905,
39
+ ArticleId:112668,
40
+ product:[{
41
+ id_article:112668,
42
+ upc:"137091",
43
+ name:"Audifonos Bose",
44
+ timestamp:"2023-10-14T01:12:45.000Z",
45
+ categoryName:"Audio|Audífonos|In Ear",
46
+ id_category:905,
47
+ version:1,
48
+ retailersAvailable:[
49
+ {name:"Radioshack",
50
+ id:74,
51
+ percentage:33}
52
+ ],
53
+ percentage:"33"}]
56
54
  },
57
55
  location: {
58
56
  pathname: "/EditProducts",
@@ -66,43 +64,43 @@ ProviderProductEditionDefault.args = {
66
64
  key: "24vwut",
67
65
  },
68
66
  user: {
69
- id_user:191,
70
- name:"Demo",
71
- last_name:"Demo",
72
- email:"merchants24feb@allfreemail.net",
73
- position:"Test",
74
- telephone:"+52123456789",
67
+ id_user:350,
68
+ name:"Proveedor Uno",
69
+ last_name:"Radioshack",
70
+ email:"proveedorradioshackuno@allfreemail.net",
71
+ position:"proveedor",
72
+ telephone:"+521234567898",
75
73
  country:"México",
76
- id_company:923,
77
- id_cognito:"c3cd160c-76c2-497c-9357-5ef949307e1e",
74
+ id_company:950,
75
+ id_cognito:"0f4247df-f02f-4cb8-909a-e62649d34782",
78
76
  birth_Date:null,
79
77
  about_me:null,
80
78
  zip_code:null,
81
79
  address:null,
82
- job:null,
83
- id_stripe:null,
80
+ job:null,id_stripe:null,
84
81
  id_role:0,
85
82
  active:1,
86
83
  is_retailer:0,
87
84
  email_notify:1,
88
85
  is_user_tech:null,
89
- membership:
90
- {id:114,
91
- start_date:"2023-02-24T18:14:43.000Z",
92
- end_date:"2024-02-24T18:14:43.000Z",
86
+ membership:{
87
+ id:146,
88
+ start_date:"2023-10-14T00:49:16.000Z",
89
+ end_date:"2024-10-14T00:49:16.000Z",
93
90
  planID:8,
94
91
  plan:"prod_KtlhECVSFG2iro",
95
92
  name:"Plan Pro",
96
93
  user_limit:"50",
97
94
  products_limit:"5000",
98
95
  type:"Enterprise"},
99
- src:"https://content-management-profile.s3.amazonaws.com/id-191/191.png?1697171804447"},
96
+ src:"https://content-management-profile.s3.amazonaws.com/id-350/350.png?1697569749878"
97
+ },
100
98
  company: {
101
- id_company:923,
102
- trade_name:"Demo",
103
- company_name:"Demo",
104
- rfc:"Demo",
105
- adress:"Demo",
99
+ id_company:950,
100
+ trade_name:"Radioshack",
101
+ company_name:"Radioshack",
102
+ rfc:"ASDASD",
103
+ adress:"CDMX",
106
104
  about_company:null,
107
105
  telephone:null,
108
106
  web_site:null,
@@ -110,13 +108,22 @@ ProviderProductEditionDefault.args = {
110
108
  email:null,
111
109
  social_link:null,
112
110
  is_retailer:0,
113
- financedRetailers:
114
- [{id:68,
115
- name:"The Home Depot Onboarding",
111
+ financedRetailers:[
112
+ {id:74,
113
+ name:"Radioshack",
114
+ country:"México",
115
+ id_region:1,
116
+ active:1,
117
+ flow:1}
118
+ ],
119
+ retailers:[
120
+ {id:74,
121
+ name:"Radioshack",
116
122
  country:"México",
117
123
  id_region:1,
118
124
  active:1,
119
- flow:1}],
120
- retailers:[{id:68,name:"The Home Depot Onboarding",country:"México",id_region:1,"active":1,flow:1}]},
125
+ flow:1}
126
+ ]},
121
127
  showSurvey: (v) => v && alert("se muestra"),
122
128
  };
129
+
@@ -1484,6 +1484,7 @@ export const ProviderProductEdition = ({
1484
1484
  updatedDatasheets={updatedDatasheets}
1485
1485
  setUpdatedDatasheets={setUpdatedDatasheets}
1486
1486
  isShowbox={true}
1487
+ activeRetailer={services[0][activeRetailer.id]}
1487
1488
  groupData={services[0][activeRetailer.id].data}
1488
1489
  setUpdatedBoxData={(e) => {
1489
1490
  setBoxData(e);