contentoh-components-library 21.4.41 → 21.4.42

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.
@@ -7,6 +7,10 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.BoxAttribute = void 0;
9
9
 
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
11
+
12
+ var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
13
+
10
14
  var _styles = require("./styles");
11
15
 
12
16
  var _info = _interopRequireDefault(require("../../../assets/images/Icons/info.svg"));
@@ -25,7 +29,20 @@ var BoxAttribute = function BoxAttribute(props) {
25
29
  borderType = props.borderType,
26
30
  isEditEnabled = props.isEditEnabled,
27
31
  titletool = props.titletool,
28
- texttool = props.texttool;
32
+ texttool = props.texttool,
33
+ atributos = props.atributos,
34
+ setAtributos = props.setAtributos;
35
+
36
+ var handleInputChange = function handleInputChange(event) {
37
+ var _event$target = event.target,
38
+ name = _event$target.name,
39
+ value = _event$target.value;
40
+ setAtributos(function (prevAtributos) {
41
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prevAtributos), {}, (0, _defineProperty2.default)({}, name, value));
42
+ });
43
+ };
44
+
45
+ console.log(atributos);
29
46
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
30
47
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
31
48
  id: id,
@@ -54,14 +71,18 @@ var BoxAttribute = function BoxAttribute(props) {
54
71
  children: text
55
72
  }), isEditEnabled ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
56
73
  hiddenLabel: true,
57
- id: "caja-borde",
58
- defaultValue: text,
74
+ name: props.id,
75
+ value: atributos[props.id],
76
+ onChange: handleInputChange,
77
+ className: "caja-borde",
59
78
  variant: "outlined",
60
79
  size: "small"
61
80
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
62
81
  hiddenLabel: true,
63
- id: "caja-borde",
64
- defaultValue: text,
82
+ name: props.id,
83
+ value: atributos[props.id],
84
+ onChange: handleInputChange,
85
+ className: "caja-borde",
65
86
  variant: "outlined",
66
87
  size: "small",
67
88
  disabled: true
@@ -15,7 +15,7 @@ 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 display: flex;\n align-items: center;\n gap:4px;\n #atr-alto {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n #caja-borde {\n font-family: ", ", sans-serif;\n font-size: 12px;\n line-height: 1.2;\n border-radius: ", ";\n }\n span {\n font-family: ", ", sans-serif;\n font-size: 12px;\n line-height: 1.2;\n font-weight: 600;\n }\n .icon {\n width: 8px;\n height: 8px;\n }\n"])), _variables.FontFamily.RobotoMedium, function (_ref) {
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n gap:4px;\n #atr-alto {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n .caja-borde {\n font-family: ", ", sans-serif;\n font-size: 12px;\n line-height: 1.2;\n border-radius: ", ";\n }\n span {\n font-family: ", ", sans-serif;\n font-size: 12px;\n line-height: 1.2;\n font-weight: 600;\n }\n .icon {\n width: 8px;\n height: 8px;\n }\n"])), _variables.FontFamily.RobotoMedium, function (_ref) {
19
19
  var borderType = _ref.borderType;
20
20
  return (borderType === null || borderType === void 0 ? void 0 : borderType.toLowerCase()) === "rectangle" ? "5px" : (borderType === null || borderType === void 0 ? void 0 : borderType.toLowerCase()) === "circle" ? "50%" : "none";
21
21
  }, _variables.FontFamily.RobotoMedium);
@@ -28,6 +28,16 @@ var BoxOnboarding = function BoxOnboarding(_ref) {
28
28
  boxAttributesActive = _useState2[0],
29
29
  setBoxAttributesActive = _useState2[1];
30
30
 
31
+ var _useState3 = (0, _react.useState)({
32
+ largo: '',
33
+ alto: '',
34
+ ancho: '',
35
+ peso: ''
36
+ }),
37
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
38
+ atributos = _useState4[0],
39
+ setAtributos = _useState4[1];
40
+
31
41
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
32
42
  panelColor: panelColor,
33
43
  fontFamily: _variables.FontFamily.Raleway,
@@ -38,29 +48,37 @@ var BoxOnboarding = function BoxOnboarding(_ref) {
38
48
  fontFamily: _variables.FontFamily.Raleway,
39
49
  children: "Caja 1, chica"
40
50
  }), boxAttributesActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxAttribute.BoxAttribute, {
41
- id: "atr-alto",
51
+ id: "largo",
42
52
  borderType: "rectangle",
43
53
  className: "caja",
44
54
  text: "Largo",
45
- isEditEnabled: isEditEnabled
55
+ isEditEnabled: isEditEnabled,
56
+ atributos: atributos,
57
+ setAtributos: setAtributos
46
58
  }), boxAttributesActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxAttribute.BoxAttribute, {
47
- id: "atr-alto",
59
+ id: "alto",
48
60
  borderType: "rectangle",
49
61
  className: "caja",
50
62
  text: "Alto",
51
- isEditEnabled: isEditEnabled
63
+ isEditEnabled: isEditEnabled,
64
+ atributos: atributos,
65
+ setAtributos: setAtributos
52
66
  }), boxAttributesActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxAttribute.BoxAttribute, {
53
- id: "atr-alto",
67
+ id: "ancho",
54
68
  borderType: "rectangle",
55
69
  className: "caja",
56
70
  text: "Ancho",
57
- isEditEnabled: isEditEnabled
71
+ isEditEnabled: isEditEnabled,
72
+ atributos: atributos,
73
+ setAtributos: setAtributos
58
74
  }), boxAttributesActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxAttribute.BoxAttribute, {
59
- id: "atr-alto",
75
+ id: "peso",
60
76
  borderType: "rectangle",
61
77
  className: "caja",
62
78
  text: "Peso",
63
- isEditEnabled: isEditEnabled
79
+ isEditEnabled: isEditEnabled,
80
+ atributos: atributos,
81
+ setAtributos: setAtributos
64
82
  })]
65
83
  })
66
84
  });
@@ -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 _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/typeof"));
11
+
8
12
  var _styles = require("./styles");
9
13
 
10
14
  var _ScreenHeader = require("../../atoms/ScreenHeader");
@@ -36,8 +40,11 @@ var InputGroup = function InputGroup(_ref) {
36
40
  version = _ref.version,
37
41
  dinamicHeight = _ref.dinamicHeight,
38
42
  compare = _ref.compare,
39
- _ref$dataGroup = _ref.dataGroup,
40
- dataGroup = _ref$dataGroup === void 0 ? 12 : _ref$dataGroup;
43
+ _ref$groupData = _ref.groupData,
44
+ groupData = _ref$groupData === void 0 ? [] : _ref$groupData,
45
+ isShowbox = _ref.isShowbox;
46
+ console.log('groupData: ', (0, _typeof2.default)(groupData));
47
+ console.log('groupData: ', groupData);
41
48
 
42
49
  var inputTypeValue = function inputTypeValue(type) {
43
50
  switch (type) {
@@ -52,9 +59,19 @@ var InputGroup = function InputGroup(_ref) {
52
59
  }
53
60
  };
54
61
 
55
- var isOnboarding = function isOnboarding(dataGroup, group) {
56
- var result = dataGroup === group;
57
- return result;
62
+ var isOnboarding = function isOnboarding() {
63
+ var contentBoxAttribute = groupData.find(function (_ref2) {
64
+ var dataGroup = _ref2.dataGroup;
65
+ return dataGroup === 'Caja';
66
+ });
67
+
68
+ if (contentBoxAttribute) {
69
+ console.log('content box attribute');
70
+ } else {
71
+ console.log('dont content box attribute');
72
+ }
73
+
74
+ return contentBoxAttribute;
58
75
  };
59
76
 
60
77
  var isEquals = function isEquals(dataInputsVal, auditInputsVal) {
@@ -115,7 +132,7 @@ var InputGroup = function InputGroup(_ref) {
115
132
  })]
116
133
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
117
134
  className: activeSection === "Ficha técnica" ? "datasheets-layout" : "descriptions-layout",
118
- children: isOnboarding && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.Box, {})
135
+ children: isShowbox && isOnboarding && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.Box, {})
119
136
  })]
120
137
  });
121
138
  };
@@ -32,128 +32,48 @@ 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: 238,
36
- category: 846,
37
- version: 2,
35
+ articleId: 39550,
36
+ category: 287,
37
+ version: 1,
38
38
  productSelected: {
39
- orderId: 15275,
40
- status: "AA",
41
- datasheet_status: "AA",
42
- prio: "none",
43
- version: 3,
44
- description_status: "AA",
45
- images_status: "AA",
46
- brand: null,
47
- retailerOrder: 0,
48
- missing: {
49
- datasheet: null,
50
- descriptions: null,
51
- images: null
52
- },
53
- services: {
54
- datasheets: 1,
55
- descriptions: 1,
56
- images: 1
57
- },
58
- article: {
59
- category: "Abarrotes|Abarrotes Secos|Frutos Secos",
60
- company_name: "GRUPO BRAHMA",
61
- country: "México",
62
- id_category: "11",
63
- id_datasheet_especialist: 54,
64
- id_datasheet_facilitator: 52,
65
- id_description_especialist: 54,
66
- id_description_facilitator: 52,
67
- id_images_especialist: 55,
68
- id_images_facilitator: 53,
69
- id_order: 15275,
70
- id_article: 39485,
71
- id_auditor: 37,
72
- name: "Mix de nueces",
73
- timestamp: "2023-07-14T21:03:19.000Z",
74
- upc: "7543453453"
75
- },
76
- retailers: [{
77
- id: 34,
78
- name: "San Pablo"
79
- }],
80
- statusByRetailer: {
81
- 34: {
82
- datasheet: "AA",
83
- description: "AA",
84
- images: "AA"
85
- }
86
- },
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,
45
+ version: 1,
87
46
  retailersAvailable: [{
88
- id: 34,
89
- name: "San Pablo"
47
+ name: "The Home Depot Golden",
48
+ "id": 58
49
+ }, {
50
+ name: "The Home Depot Onboarding",
51
+ "id": 68
90
52
  }],
91
- categoryName: "Abarrotes|Abarrotes Secos|Frutos Secos",
92
- upc: "7543453453",
93
- id_article: 39485,
94
- id_order: 15275
53
+ percentage: "89"
95
54
  },
96
55
  productToEdit: {
97
- ArticleId: 39485,
98
- idCategory: "11",
99
- product: {
100
- orderId: 15275,
101
- status: "AA",
102
- datasheet_status: "AA",
103
- prio: "none",
104
- version: 3,
105
- description_status: "AA",
106
- images_status: "AA",
107
- brand: null,
108
- retailerOrder: 0,
109
- missing: {
110
- datasheet: null,
111
- descriptions: null,
112
- images: null
113
- },
114
- services: {
115
- datasheets: 1,
116
- descriptions: 1,
117
- images: 1
118
- },
119
- article: {
120
- category: "Abarrotes|Abarrotes Secos|Frutos Secos",
121
- company_name: "GRUPO BRAHMA",
122
- country: "México",
123
- id_category: "11",
124
- id_datasheet_especialist: 54,
125
- id_datasheet_facilitator: 52,
126
- id_description_especialist: 54,
127
- id_description_facilitator: 52,
128
- id_images_especialist: 55,
129
- id_images_facilitator: 53,
130
- id_order: 15275,
131
- id_article: 39485,
132
- id_auditor: 37,
133
- name: "Mix de nueces",
134
- timestamp: "2023-07-14T21:03:19.000Z",
135
- upc: "7543453453"
136
- },
137
- retailers: [{
138
- id: 34,
139
- name: "San Pablo"
140
- }],
141
- statusByRetailer: {
142
- 34: {
143
- datasheet: "AA",
144
- description: "AA",
145
- images: "AA"
146
- }
147
- },
56
+ idCategory: 287,
57
+ ArticleId: 39550,
58
+ 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,
65
+ version: 1,
148
66
  retailersAvailable: [{
149
- id: 34,
150
- name: "San Pablo"
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
151
74
  }],
152
- categoryName: "Abarrotes|Abarrotes Secos|Frutos Secos",
153
- upc: "7543453453",
154
- id_article: 39485,
155
- id_order: 15275
156
- }
75
+ percentage: "89"
76
+ }]
157
77
  },
158
78
  location: {
159
79
  pathname: "/EditProducts",
@@ -167,30 +87,30 @@ ProviderProductEditionDefault.args = {
167
87
  key: "24vwut"
168
88
  },
169
89
  user: {
170
- id_user: 28,
171
- name: "Ismael",
172
- last_name: "López",
173
- email: "ilopez@contentoh.com",
174
- position: "Test States",
175
- telephone: "+523111366336",
90
+ id_user: 191,
91
+ name: "Demo",
92
+ last_name: "Demo",
93
+ email: "merchants24feb@allfreemail.net",
94
+ position: "Test",
95
+ telephone: "+52123456789",
176
96
  country: "México",
177
- id_company: 1,
178
- id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
97
+ id_company: 923,
98
+ id_cognito: "c3cd160c-76c2-497c-9357-5ef949307e1e",
179
99
  birth_Date: null,
180
- about_me: "",
181
- zip_code: "",
182
- address: "",
183
- job: "",
184
- id_stripe: "cus_KuEt6R6vwmN09f",
100
+ about_me: null,
101
+ zip_code: null,
102
+ address: null,
103
+ job: null,
104
+ id_stripe: null,
185
105
  id_role: 0,
186
106
  active: 1,
187
107
  is_retailer: 0,
188
108
  email_notify: 1,
189
- is_user_tech: "ADMIN-AS",
109
+ is_user_tech: null,
190
110
  membership: {
191
- id: 76,
192
- start_date: "2022-01-18T17:25:35.000Z",
193
- end_date: "2023-01-18T17:25:35.000Z",
111
+ id: 114,
112
+ start_date: "2023-02-24T18:14:43.000Z",
113
+ end_date: "2024-02-24T18:14:43.000Z",
194
114
  planID: 8,
195
115
  plan: "prod_KtlhECVSFG2iro",
196
116
  name: "Plan Pro",
@@ -198,23 +118,37 @@ ProviderProductEditionDefault.args = {
198
118
  products_limit: "5000",
199
119
  type: "Enterprise"
200
120
  },
201
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1693338334183"
121
+ src: "https://content-management-profile.s3.amazonaws.com/id-191/191.png?1697171804447"
202
122
  },
203
123
  company: {
204
- id_company: 1,
205
- trade_name: "GRUPO BRAHMA",
206
- company_name: "GRUPO BRAHMA",
207
- rfc: "XAXX010101000",
208
- adress: "AA",
209
- about_company: "",
210
- telephone: "",
211
- web_site: "",
212
- zip_code: "",
124
+ id_company: 923,
125
+ trade_name: "Demo",
126
+ company_name: "Demo",
127
+ rfc: "Demo",
128
+ adress: "Demo",
129
+ about_company: null,
130
+ telephone: null,
131
+ web_site: null,
132
+ zip_code: null,
213
133
  email: null,
214
- social_link: "",
134
+ social_link: null,
215
135
  is_retailer: 0,
216
- financedRetailers: [],
217
- retailers: []
136
+ financedRetailers: [{
137
+ id: 68,
138
+ name: "The Home Depot Onboarding",
139
+ country: "México",
140
+ id_region: 1,
141
+ active: 1,
142
+ flow: 1
143
+ }],
144
+ retailers: [{
145
+ id: 68,
146
+ name: "The Home Depot Onboarding",
147
+ country: "México",
148
+ id_region: 1,
149
+ "active": 1,
150
+ flow: 1
151
+ }]
218
152
  },
219
153
  showSurvey: function showSurvey(v) {
220
154
  return v && alert("se muestra");
@@ -1083,6 +1083,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1083
1083
 
1084
1084
  if ((_services$0$activeRet = services[0][activeRetailer.id]) !== null && _services$0$activeRet !== void 0 && _services$0$activeRet.data) services[0][activeRetailer.id].data = Object.values(services[0][activeRetailer.id].data);
1085
1085
  setActivePercentage(Math.round(activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.percentage, 0));
1086
+ console.log("loadInputs: ", services[0]);
1086
1087
  var datagroups = services[0][activeRetailer.id];
1087
1088
  var inputs = (_services$2 = services[0]) === null || _services$2 === void 0 ? void 0 : _services$2.inputs;
1088
1089
 
@@ -2195,7 +2196,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2195
2196
  inputGroup: dataGroup,
2196
2197
  dataInputs: datasheets[1],
2197
2198
  updatedDatasheets: updatedDatasheets,
2198
- setUpdatedDatasheets: setUpdatedDatasheets //enableActions={enableActions(product.version_status)} ADD THIS VALIDATION
2199
+ setUpdatedDatasheets: setUpdatedDatasheets,
2200
+ isShowbox: true,
2201
+ groupData: services[0][activeRetailer.id].data //enableActions={enableActions(product.version_status)} ADD THIS VALIDATION
2199
2202
 
2200
2203
  }, index + "-" + activeRetailer.name);
2201
2204
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
@@ -2208,6 +2211,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2208
2211
  setUpdatedDescriptions: setUpdatedDescriptions,
2209
2212
  articleId: product === null || product === void 0 ? void 0 : product.id_article,
2210
2213
  version: version,
2214
+ isShowbox: false,
2211
2215
  dinamicHeight: true
2212
2216
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
2213
2217
  text: "No cuentas con este servicio",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.4.41",
3
+ "version": "21.4.42",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -13,7 +13,17 @@ export const BoxAttribute = (props) => {
13
13
  isEditEnabled,
14
14
  titletool,
15
15
  texttool,
16
+ atributos,
17
+ setAtributos
16
18
  } = props;
19
+ const handleInputChange = (event) => {
20
+ const { name, value } = event.target;
21
+ setAtributos((prevAtributos) => ({
22
+ ...prevAtributos,
23
+ [name]: value,
24
+ }));
25
+ };
26
+ console.log(atributos)
17
27
 
18
28
  return (
19
29
  <>
@@ -42,29 +52,26 @@ export const BoxAttribute = (props) => {
42
52
  <span>{text}</span>
43
53
  {isEditEnabled ? (
44
54
  <TextField
45
- hiddenLabel
46
- id="caja-borde"
47
- defaultValue={text}
48
- variant="outlined"
49
- size="small"
50
- />
55
+ hiddenLabel
56
+ name={props.id}
57
+ value={atributos[props.id]}
58
+ onChange={handleInputChange}
59
+ className="caja-borde"
60
+ variant="outlined"
61
+ size="small"
62
+ />
51
63
  ) : (
52
64
  <TextField
53
65
  hiddenLabel
54
- id="caja-borde"
55
- defaultValue={text}
66
+ name={props.id}
67
+ value={atributos[props.id]}
68
+ onChange={handleInputChange}
69
+ className="caja-borde"
56
70
  variant="outlined"
57
71
  size="small"
58
72
  disabled
59
- />
73
+ />
60
74
  )}
61
- {/* <TextField
62
- hiddenLabel
63
- id="caja-borde"
64
- defaultValue={text}
65
- variant="outlined"
66
- size="small"
67
- /> */}
68
75
  </Container>
69
76
  </>
70
77
  );
@@ -10,7 +10,7 @@ export const Container = styled.div`
10
10
  align-items: center;
11
11
  justify-content: space-between;
12
12
  }
13
- #caja-borde {
13
+ .caja-borde {
14
14
  font-family: ${FontFamily.RobotoMedium}, sans-serif;
15
15
  font-size: 12px;
16
16
  line-height: 1.2;
@@ -5,6 +5,12 @@ import { useState } from "react";
5
5
 
6
6
  export const BoxOnboarding = ({ panelColor, isEditEnabled }) => {
7
7
  const [boxAttributesActive, setBoxAttributesActive] = useState(true);
8
+ const [atributos, setAtributos] = useState({
9
+ largo: '',
10
+ alto: '',
11
+ ancho: '',
12
+ peso: ''
13
+ });
8
14
 
9
15
  return (
10
16
  <Container
@@ -16,47 +22,46 @@ export const BoxOnboarding = ({ panelColor, isEditEnabled }) => {
16
22
  <p fontFamily={FontFamily.Raleway}>Caja 1, chica</p>
17
23
  {boxAttributesActive && (
18
24
  <BoxAttribute
19
- id="atr-alto"
25
+ id="largo"
20
26
  borderType="rectangle"
21
27
  className="caja"
22
28
  text="Largo"
23
29
  isEditEnabled={isEditEnabled}
30
+ atributos={atributos}
31
+ setAtributos={setAtributos}
24
32
  ></BoxAttribute>
25
33
  )}
26
34
  {boxAttributesActive &&
27
35
  <BoxAttribute
28
- id="atr-alto"
36
+ id="alto"
29
37
  borderType="rectangle"
30
38
  className="caja"
31
39
  text="Alto"
32
40
  isEditEnabled={isEditEnabled}
41
+ atributos={atributos}
42
+ setAtributos={setAtributos}
33
43
  ></BoxAttribute>
34
44
  }
35
45
  {boxAttributesActive &&
36
46
  <BoxAttribute
37
- id="atr-alto"
47
+ id="ancho"
38
48
  borderType="rectangle"
39
49
  className="caja"
40
50
  text="Ancho"
41
51
  isEditEnabled={isEditEnabled}
52
+ atributos={atributos}
53
+ setAtributos={setAtributos}
42
54
  ></BoxAttribute>}
43
55
  {boxAttributesActive &&
44
56
  <BoxAttribute
45
- id="atr-alto"
57
+ id="peso"
46
58
  borderType="rectangle"
47
59
  className="caja"
48
60
  text="Peso"
49
61
  isEditEnabled={isEditEnabled}
62
+ atributos={atributos}
63
+ setAtributos={setAtributos}
50
64
  ></BoxAttribute>}
51
- {/* {boxAttributes.map((attr, index) => (
52
- <BoxAttribute
53
- key={attr.id}
54
- id={`atr-alto-${index}`}
55
- borderType="rectangle"
56
- className="caja"
57
- text="Largo"
58
- ></BoxAttribute>
59
- ))} */}
60
65
  </div>
61
66
  </Container>
62
67
  );
@@ -18,8 +18,12 @@ export const InputGroup = ({
18
18
  version,
19
19
  dinamicHeight,
20
20
  compare,
21
- dataGroup=12,
21
+ groupData = [],
22
+ isShowbox
22
23
  }) => {
24
+
25
+ console.log('groupData: ', typeof groupData);
26
+ console.log('groupData: ', groupData);
23
27
  const inputTypeValue = (type) => {
24
28
  switch (type) {
25
29
  case "Booleano":
@@ -31,9 +35,14 @@ export const InputGroup = ({
31
35
  }
32
36
  };
33
37
 
34
- const isOnboarding = (dataGroup, group) => {
35
- const result = dataGroup === group;
36
- return result;
38
+ const isOnboarding = () => {
39
+ const contentBoxAttribute = groupData.find(({dataGroup}) => dataGroup === 'Caja')
40
+ if(contentBoxAttribute) {
41
+ console.log('content box attribute');
42
+ } else {
43
+ console.log('dont content box attribute');
44
+ }
45
+ return contentBoxAttribute;
37
46
  }
38
47
 
39
48
 
@@ -142,7 +151,7 @@ export const InputGroup = ({
142
151
  ? "datasheets-layout"
143
152
  : "descriptions-layout"
144
153
  }>
145
- { isOnboarding && <Box/>}
154
+ { isShowbox && isOnboarding && <Box/>}
146
155
  </Container>
147
156
  </>
148
157
  );
@@ -17,137 +17,43 @@ ProviderProductEditionDefault.args = {
17
17
  },
18
18
  token:
19
19
  "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIyM2Q1NTlmYi1jMzIwLTRhMjItYjJmNy1lOThhYTFhZGEyNmYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MzkyNjgyMSwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2ODM5MzA0MjEsImlhdCI6MTY4MzkyNjgyMSwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.TvCoaKoctj5mypXWMz3NyV1Vm1ToBV0vJmpVyZSQw4-ikTChkxcZ5tFYvqhk1GdvNCFttfSQIqM-14dAYYBc28YwwKP86gqOuzB1fG41rN5x1Yx3tkJq6hiVRgiBbSHWtThA9c8VnxNQbrJiaRTvvkDiM5KNTEst1oxQHL5Ct9_iKQMJMRFie7Xv0xnyS0qZ6QHK4Q2A9OHsnDkAuumALZJcE19Zh6VgSitgWrZiz3x5Text4Q-U-R48NUAzUFirAzYZzJN_fCme5pGf1AnUaZjeUjPsmrV5TBVzPEYwXO0KG8lYjL8id80D7tbGs28ZIK6B4rf3-eqI_ngmBB4CjQ",
20
- articleId: 238,
21
- category: 846,
22
- version: 2,
20
+ articleId: 39550,
21
+ category: 287,
22
+ version: 1,
23
23
  productSelected: {
24
- orderId: 15275,
25
- status: "AA",
26
- datasheet_status: "AA",
27
- prio: "none",
28
- version: 3,
29
- description_status: "AA",
30
- images_status: "AA",
31
- brand: null,
32
- retailerOrder: 0,
33
- missing: {
34
- datasheet: null,
35
- descriptions: null,
36
- images: null,
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,
30
+ version:1,
31
+ retailersAvailable:[
32
+ {name:"The Home Depot Golden","id":58},
33
+ {name:"The Home Depot Onboarding","id":68}],
34
+ percentage:"89"
37
35
  },
38
- services: {
39
- datasheets: 1,
40
- descriptions: 1,
41
- images: 1,
42
- },
43
- article: {
44
- category: "Abarrotes|Abarrotes Secos|Frutos Secos",
45
- company_name: "GRUPO BRAHMA",
46
- country: "México",
47
- id_category: "11",
48
- id_datasheet_especialist: 54,
49
- id_datasheet_facilitator: 52,
50
- id_description_especialist: 54,
51
- id_description_facilitator: 52,
52
- id_images_especialist: 55,
53
- id_images_facilitator: 53,
54
- id_order: 15275,
55
- id_article: 39485,
56
- id_auditor: 37,
57
- name: "Mix de nueces",
58
- timestamp: "2023-07-14T21:03:19.000Z",
59
- upc: "7543453453",
60
- },
61
- retailers: [
62
- {
63
- id: 34,
64
- name: "San Pablo",
65
- },
66
- ],
67
- statusByRetailer: {
68
- 34: {
69
- datasheet: "AA",
70
- description: "AA",
71
- images: "AA",
72
- },
73
- },
74
- retailersAvailable: [
75
- {
76
- id: 34,
77
- name: "San Pablo",
78
- },
79
- ],
80
- categoryName: "Abarrotes|Abarrotes Secos|Frutos Secos",
81
- upc: "7543453453",
82
- id_article: 39485,
83
- id_order: 15275,
84
- },
85
36
  productToEdit: {
86
- ArticleId: 39485,
87
- idCategory: "11",
88
- product: {
89
- orderId: 15275,
90
- status: "AA",
91
- datasheet_status: "AA",
92
- prio: "none",
93
- version: 3,
94
- description_status: "AA",
95
- images_status: "AA",
96
- brand: null,
97
- retailerOrder: 0,
98
- missing: {
99
- datasheet: null,
100
- descriptions: null,
101
- images: null,
102
- },
103
- services: {
104
- datasheets: 1,
105
- descriptions: 1,
106
- images: 1,
107
- },
108
- article: {
109
- category: "Abarrotes|Abarrotes Secos|Frutos Secos",
110
- company_name: "GRUPO BRAHMA",
111
- country: "México",
112
- id_category: "11",
113
- id_datasheet_especialist: 54,
114
- id_datasheet_facilitator: 52,
115
- id_description_especialist: 54,
116
- id_description_facilitator: 52,
117
- id_images_especialist: 55,
118
- id_images_facilitator: 53,
119
- id_order: 15275,
120
- id_article: 39485,
121
- id_auditor: 37,
122
- name: "Mix de nueces",
123
- timestamp: "2023-07-14T21:03:19.000Z",
124
- upc: "7543453453",
125
- },
126
- retailers: [
127
- {
128
- id: 34,
129
- name: "San Pablo",
130
- },
131
- ],
132
- statusByRetailer: {
133
- 34: {
134
- datasheet: "AA",
135
- description: "AA",
136
- images: "AA",
137
- },
138
- },
139
- retailersAvailable: [
140
- {
141
- id: 34,
142
- name: "San Pablo",
143
- },
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}
144
54
  ],
145
- categoryName: "Abarrotes|Abarrotes Secos|Frutos Secos",
146
- upc: "7543453453",
147
- id_article: 39485,
148
- id_order: 15275,
55
+ percentage:"89"}]
149
56
  },
150
- },
151
57
  location: {
152
58
  pathname: "/EditProducts",
153
59
  search: "",
@@ -160,54 +66,57 @@ ProviderProductEditionDefault.args = {
160
66
  key: "24vwut",
161
67
  },
162
68
  user: {
163
- id_user: 28,
164
- name: "Ismael",
165
- last_name: "López",
166
- email: "ilopez@contentoh.com",
167
- position: "Test States",
168
- telephone: "+523111366336",
169
- country: "México",
170
- id_company: 1,
171
- id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
172
- birth_Date: null,
173
- about_me: "",
174
- zip_code: "",
175
- address: "",
176
- job: "",
177
- id_stripe: "cus_KuEt6R6vwmN09f",
178
- id_role: 0,
179
- active: 1,
180
- is_retailer: 0,
181
- email_notify: 1,
182
- is_user_tech: "ADMIN-AS",
183
- membership: {
184
- id: 76,
185
- start_date: "2022-01-18T17:25:35.000Z",
186
- end_date: "2023-01-18T17:25:35.000Z",
187
- planID: 8,
188
- plan: "prod_KtlhECVSFG2iro",
189
- name: "Plan Pro",
190
- user_limit: "50",
191
- products_limit: "5000",
192
- type: "Enterprise",
193
- },
194
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1693338334183",
195
- },
69
+ id_user:191,
70
+ name:"Demo",
71
+ last_name:"Demo",
72
+ email:"merchants24feb@allfreemail.net",
73
+ position:"Test",
74
+ telephone:"+52123456789",
75
+ country:"México",
76
+ id_company:923,
77
+ id_cognito:"c3cd160c-76c2-497c-9357-5ef949307e1e",
78
+ birth_Date:null,
79
+ about_me:null,
80
+ zip_code:null,
81
+ address:null,
82
+ job:null,
83
+ id_stripe:null,
84
+ id_role:0,
85
+ active:1,
86
+ is_retailer:0,
87
+ email_notify:1,
88
+ 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",
93
+ planID:8,
94
+ plan:"prod_KtlhECVSFG2iro",
95
+ name:"Plan Pro",
96
+ user_limit:"50",
97
+ products_limit:"5000",
98
+ type:"Enterprise"},
99
+ src:"https://content-management-profile.s3.amazonaws.com/id-191/191.png?1697171804447"},
196
100
  company: {
197
- id_company: 1,
198
- trade_name: "GRUPO BRAHMA",
199
- company_name: "GRUPO BRAHMA",
200
- rfc: "XAXX010101000",
201
- adress: "AA",
202
- about_company: "",
203
- telephone: "",
204
- web_site: "",
205
- zip_code: "",
206
- email: null,
207
- social_link: "",
208
- is_retailer: 0,
209
- financedRetailers: [],
210
- retailers: [],
211
- },
101
+ id_company:923,
102
+ trade_name:"Demo",
103
+ company_name:"Demo",
104
+ rfc:"Demo",
105
+ adress:"Demo",
106
+ about_company:null,
107
+ telephone:null,
108
+ web_site:null,
109
+ zip_code:null,
110
+ email:null,
111
+ social_link:null,
112
+ is_retailer:0,
113
+ financedRetailers:
114
+ [{id:68,
115
+ name:"The Home Depot Onboarding",
116
+ country:"México",
117
+ id_region:1,
118
+ active:1,
119
+ flow:1}],
120
+ retailers:[{id:68,name:"The Home Depot Onboarding",country:"México",id_region:1,"active":1,flow:1}]},
212
121
  showSurvey: (v) => v && alert("se muestra"),
213
122
  };
@@ -596,6 +596,7 @@ export const ProviderProductEdition = ({
596
596
  );
597
597
  setActivePercentage(Math.round(activeRetailer?.percentage, 0));
598
598
 
599
+ console.log("loadInputs: ", services[0]);
599
600
  const datagroups = services[0][activeRetailer.id];
600
601
  const inputs = services[0]?.inputs;
601
602
  const descriptions = services[1]?.filter(
@@ -1462,6 +1463,8 @@ export const ProviderProductEdition = ({
1462
1463
  dataInputs={datasheets[1]}
1463
1464
  updatedDatasheets={updatedDatasheets}
1464
1465
  setUpdatedDatasheets={setUpdatedDatasheets}
1466
+ isShowbox={true}
1467
+ groupData = { services[0][activeRetailer.id].data }
1465
1468
  //enableActions={enableActions(product.version_status)} ADD THIS VALIDATION
1466
1469
  />
1467
1470
  ))
@@ -1480,6 +1483,7 @@ export const ProviderProductEdition = ({
1480
1483
  setUpdatedDescriptions={setUpdatedDescriptions}
1481
1484
  articleId={product?.id_article}
1482
1485
  version={version}
1486
+ isShowbox={false}
1483
1487
  dinamicHeight={true}
1484
1488
  />
1485
1489
  ) : (