contentoh-components-library 21.2.0 → 21.2.3

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.
@@ -81,8 +81,8 @@ var DashboardMetric = function DashboardMetric(_ref) {
81
81
  setEndDate(end);
82
82
  if (end) setQueryObject(function (current) {
83
83
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, current), {}, {
84
- startDate: "".concat(start.getFullYear(), "-").concat(start.getDate(), "-").concat(start.getMonth() + 1),
85
- endDate: "".concat(end === null || end === void 0 ? void 0 : end.getFullYear(), "-").concat(end === null || end === void 0 ? void 0 : end.getDate(), "-").concat((end === null || end === void 0 ? void 0 : end.getMonth()) + 1)
84
+ startDate: "".concat(start.getFullYear(), "-").concat(start.getMonth() + 1, "-").concat(start.getDate()),
85
+ endDate: "".concat(end.getFullYear(), "-").concat(end.getMonth() + 1, "-").concat(end.getDate())
86
86
  });
87
87
  });
88
88
  };
@@ -21,6 +21,8 @@ var _DashboardMetric = require("../../organisms/DashboardMetric");
21
21
 
22
22
  var _react = require("react");
23
23
 
24
+ var _Loading = require("../../atoms/Loading");
25
+
24
26
  var _axios = _interopRequireDefault(require("axios"));
25
27
 
26
28
  var _jsxRuntime = require("react/jsx-runtime");
@@ -41,12 +43,20 @@ var Dashboard = function Dashboard() {
41
43
  requiredProducts = _useState6[0],
42
44
  setRequiredProducts = _useState6[1];
43
45
 
44
- var _useState7 = (0, _react.useState)({}),
46
+ var _useState7 = (0, _react.useState)({
47
+ retailerId: null,
48
+ startDate: null,
49
+ endDate: null
50
+ }),
45
51
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
46
52
  orderByStatus = _useState8[0],
47
53
  setOrderByStatus = _useState8[1];
48
54
 
49
- var _useState9 = (0, _react.useState)({}),
55
+ var _useState9 = (0, _react.useState)({
56
+ retailerId: null,
57
+ startDate: null,
58
+ endDate: null
59
+ }),
50
60
  _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
51
61
  orderByRequired = _useState10[0],
52
62
  setOrderByRequired = _useState10[1];
@@ -56,6 +66,11 @@ var Dashboard = function Dashboard() {
56
66
  retailers = _useState12[0],
57
67
  setRetailers = _useState12[1];
58
68
 
69
+ var _useState13 = (0, _react.useState)(true),
70
+ _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
71
+ loading = _useState14[0],
72
+ setLoading = _useState14[1];
73
+
59
74
  var loadProductVersions = /*#__PURE__*/function () {
60
75
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(byStatus, queryObject) {
61
76
  var retailerId, startDate, endDate, fullData, query, response, versionList;
@@ -198,8 +213,8 @@ var Dashboard = function Dashboard() {
198
213
  (0, _react.useEffect)(function () {
199
214
  var today = new Date();
200
215
  var firstWeekDay = today.getDate() - today.getDay();
201
- var startDate = "".concat(today.getFullYear(), "-").concat(firstWeekDay, "-").concat(today.getMonth() + 1);
202
- var endDate = "".concat(today.getFullYear(), "-").concat(today.getDate(), "-").concat(today.getMonth() + 1);
216
+ var startDate = "".concat(today.getFullYear(), "-").concat(today.getMonth() + 1, "-").concat(firstWeekDay);
217
+ var endDate = "".concat(today.getFullYear(), "-").concat(today.getMonth() + 1, "-").concat(today.getDate());
203
218
  var queryObject = {
204
219
  retailerId: "58",
205
220
  startDate: startDate,
@@ -215,7 +230,10 @@ var Dashboard = function Dashboard() {
215
230
  (0, _react.useEffect)(function () {
216
231
  loadRequiredProducts(orderByRequired);
217
232
  }, [orderByRequired]);
218
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
233
+ (0, _react.useEffect)(function () {
234
+ (orderByRequired === null || orderByRequired === void 0 ? void 0 : orderByRequired.retailerId) && (orderByStatus === null || orderByStatus === void 0 ? void 0 : orderByStatus.retailerId) && metricsData.length > 0 && setLoading(false);
235
+ }, [orderByRequired, orderByStatus, metricsData]);
236
+ return loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
219
237
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
220
238
  className: "metric-cards",
221
239
  children: metricsData.map(function (metric, index) {
@@ -31,59 +31,233 @@ RetailerProductEditionDefault.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: false
33
33
  },
34
- token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwYjY2YTRhOS03NzkwLTQwMzQtYTMwYS1jMDA4MDg5NjI4NjciLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjBiNjZhNGE5LTc3OTAtNDAzNC1hMzBhLWMwMDgwODk2Mjg2NyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiI4ZjA2YmU0NC04ZWEzLTQ5OWMtOGFjZC0xMDlmMDZiZWI1MjAiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MDA3NjQ5MywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2MDA4MDA5MywiaWF0IjoxNjYwMDc2NDkzLCJlbWFpbCI6ImJheWFkaTE1MzhAbW5xbG0uY29tIn0.aw_x1A8WR2MCp_Kz-T2Jcg0ZtuKwyzQ23yT_OoKr-aGJmEjSPihmksWgLZr9hJXyfvU0JndaVMM_3DRly1TdtJ264zwH4dZ7Cp9gF4TSXG16HQxIIPUA4NnwdpOnlBdE9E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T5tEn3F-W4SitqDbBw3KxfkqSMxdZUIHLWECGL-u2ATCYU2J4KRVQi8XSP1qbfv1hu9dh-vID8Fq641ccQwEqUDC13pshDPlR08legg7AAPJqoilV7wuvxqTYAK6fGqMS5jcdW2iDmU0ti9gkydXkYRIC-jg446VOmRCpwzKsk4UAPwlrGeodQ0LV1bfWn_-KVspWCRQd6U5WbFxHn0umYe3CvvPpyVmHzD3F_EMxaVyqV5aW5IoIQ",
35
35
  productSelected: {
36
36
  services: {
37
- datasheets: 0,
38
- descriptions: 0,
37
+ datasheets: 1,
38
+ descriptions: 1,
39
39
  images: 1
40
40
  },
41
- orderId: 1789,
42
- status: "ACA",
43
- datasheet_status: "NS",
41
+ orderId: 2296,
42
+ status: "AP",
43
+ datasheet_status: "AP",
44
44
  prio: "none",
45
- version: 2,
46
- description_status: "NS",
47
- images_status: "ACA",
45
+ version: 8,
46
+ description_status: "ACA",
47
+ images_status: "AP",
48
48
  article: {
49
- id_article: 68865,
50
- id_category: "2999",
51
- name: "RESIZE",
52
- upc: "169955",
53
- timestamp: "2022-06-21T16:03:10.000Z",
54
- id_user: 1238,
55
- status: "NULL",
56
- active: 0,
57
- company_id: 819,
49
+ id_article: 14701,
50
+ id_category: "684",
51
+ name: "Pasta Dental Colgate Total 12 Clean Mint de 100 ml",
52
+ upc: "7501035911369",
53
+ timestamp: "2021-10-09T16:33:17.000Z",
54
+ id_user: 203,
55
+ status: "Ex",
56
+ active: 1,
57
+ company_id: 226,
58
58
  SKU: null,
59
59
  Descripcion: null,
60
60
  Proveedor: null,
61
61
  id_proveedor: 0,
62
- company_name: "The Home Depot Resize",
63
- country: "México",
64
- id_order: 1789,
65
- id_datasheet_especialist: null,
66
- id_datasheet_facilitator: null,
67
- id_description_especialist: null,
68
- id_description_facilitator: null,
69
- id_images_especialist: 1250,
70
- id_images_facilitator: 424,
71
- id_auditor: null,
62
+ company_name: "Prueba Test S.A de C.V.",
63
+ country: "null",
64
+ id_order: 2296,
65
+ id_datasheet_especialist: 405,
66
+ id_datasheet_facilitator: 158,
67
+ id_description_especialist: 405,
68
+ id_description_facilitator: 158,
69
+ id_images_especialist: 366,
70
+ id_images_facilitator: 160,
71
+ id_auditor: 9,
72
72
  id_recepcionist: null,
73
- category: "Resizing|Resizing|Resizing",
74
- missingAttributes: null,
75
- missingDescriptions: null,
76
- missingImages: null
73
+ category: "Salud y Belleza|Cuidado Bucal|Pastas Dentales y Aseo Bucal",
74
+ missingAttributes: -1,
75
+ missingDescriptions: 3,
76
+ missingImages: -9
77
77
  },
78
78
  retailers: [{
79
- id: 60,
80
- name: "The Home Depot Resizing",
79
+ id: 4,
80
+ name: "Walmart Super y Superama",
81
81
  country: "México",
82
82
  id_region: 1,
83
- active: 1
83
+ active: 1,
84
+ percentage: 97.61904761904763,
85
+ image: "https://content-management-images.s3.amazonaws.com/retailers/4.png",
86
+ services: ["NA", "NA", "NA"]
87
+ }, {
88
+ id: 5,
89
+ name: "Chedraui",
90
+ country: "México",
91
+ id_region: 1,
92
+ active: 1,
93
+ percentage: 100,
94
+ image: "https://content-management-images.s3.amazonaws.com/retailers/5.png",
95
+ services: ["NA", "NA", "NA"]
96
+ }, {
97
+ id: 6,
98
+ name: "HEB",
99
+ country: "México",
100
+ id_region: 1,
101
+ active: 1,
102
+ percentage: 100,
103
+ image: "https://content-management-images.s3.amazonaws.com/retailers/6.png",
104
+ services: ["AP", "ACA", "AP"]
105
+ }, {
106
+ id: 7,
107
+ name: "Mega",
108
+ country: "México",
109
+ id_region: 1,
110
+ active: 1,
111
+ percentage: 100,
112
+ image: "https://content-management-images.s3.amazonaws.com/retailers/7.png",
113
+ services: ["NA", "NA", "NA"]
114
+ }, {
115
+ id: 8,
116
+ name: "Fragua",
117
+ country: "México",
118
+ id_region: 1,
119
+ active: 1,
120
+ percentage: null,
121
+ image: "https://content-management-images.s3.amazonaws.com/retailers/8.png",
122
+ services: ["NA", "NA", "NA"]
123
+ }, {
124
+ id: 9,
125
+ name: "Amazon",
126
+ country: "México",
127
+ id_region: 1,
128
+ active: 1,
129
+ percentage: 85.18518518518518,
130
+ image: "https://content-management-images.s3.amazonaws.com/retailers/9.png",
131
+ services: ["NA", "NA", "NA"]
132
+ }, {
133
+ id: 12,
134
+ name: "La Comer",
135
+ country: "México",
136
+ id_region: 1,
137
+ active: 1,
138
+ percentage: 100,
139
+ image: "https://content-management-images.s3.amazonaws.com/retailers/12.png",
140
+ services: ["NA", "NA", "NA"]
141
+ }, {
142
+ id: 13,
143
+ name: "Soriana",
144
+ country: "México",
145
+ id_region: 1,
146
+ active: 1,
147
+ percentage: 100,
148
+ image: "https://content-management-images.s3.amazonaws.com/retailers/13.png",
149
+ services: ["NA", "NA", "NA"]
150
+ }, {
151
+ id: 16,
152
+ name: "Rappi",
153
+ country: "México",
154
+ id_region: 1,
155
+ active: 1,
156
+ percentage: 93.33333333333333,
157
+ image: "https://content-management-images.s3.amazonaws.com/retailers/16.png",
158
+ services: ["NA", "NA", "NA"]
159
+ }, {
160
+ id: 17,
161
+ name: "Genérico",
162
+ country: "México",
163
+ id_region: 1,
164
+ active: 1,
165
+ percentage: 100,
166
+ image: "https://content-management-images.s3.amazonaws.com/retailers/17.png",
167
+ services: ["NA", "NA", "NA"]
168
+ }, {
169
+ id: 18,
170
+ name: "Google",
171
+ country: "México",
172
+ id_region: 1,
173
+ active: 1,
174
+ percentage: 96.66666666666667,
175
+ image: "https://content-management-images.s3.amazonaws.com/retailers/18.png",
176
+ services: ["NA", "NA", "NA"]
177
+ }, {
178
+ id: 20,
179
+ name: "Cornershop",
180
+ country: "México",
181
+ id_region: 1,
182
+ active: 1,
183
+ percentage: 91.66666666666667,
184
+ image: "https://content-management-images.s3.amazonaws.com/retailers/20.png",
185
+ services: ["NA", "NA", "NA"]
186
+ }, {
187
+ id: 24,
188
+ name: "Alsuper",
189
+ country: "México",
190
+ id_region: 1,
191
+ active: 1,
192
+ percentage: 95.83333333333333,
193
+ image: "https://content-management-images.s3.amazonaws.com/retailers/24.png",
194
+ services: ["NA", "NA", "NA"]
195
+ }, {
196
+ id: 27,
197
+ name: "IMPIRA México",
198
+ country: "México",
199
+ id_region: 1,
200
+ active: 1,
201
+ percentage: 100,
202
+ image: "https://content-management-images.s3.amazonaws.com/retailers/27.png",
203
+ services: ["NA", "NA", "NA"]
204
+ }, {
205
+ id: 29,
206
+ name: "Farmacias del Ahorro",
207
+ country: "México",
208
+ id_region: 1,
209
+ active: 1,
210
+ percentage: 81.48148148148148,
211
+ image: "https://content-management-images.s3.amazonaws.com/retailers/29.png",
212
+ services: ["NA", "NA", "NA"]
213
+ }, {
214
+ id: 33,
215
+ name: "Merza",
216
+ country: "México",
217
+ id_region: 1,
218
+ active: 1,
219
+ percentage: 66.66666666666667,
220
+ image: "https://content-management-images.s3.amazonaws.com/retailers/33.png",
221
+ services: ["NA", "NA", "NA"]
222
+ }, {
223
+ id: 34,
224
+ name: "San Pablo",
225
+ country: "México",
226
+ id_region: 1,
227
+ active: 1,
228
+ percentage: 95.16666666666667,
229
+ image: "https://content-management-images.s3.amazonaws.com/retailers/34.png",
230
+ services: ["NA", "NA", "NA"]
231
+ }, {
232
+ id: 38,
233
+ name: "Del Sol",
234
+ country: "México",
235
+ id_region: 1,
236
+ active: 1,
237
+ percentage: 100,
238
+ image: "https://content-management-images.s3.amazonaws.com/retailers/38.png",
239
+ services: ["NA", "NA", "NA"]
240
+ }, {
241
+ id: 39,
242
+ name: "Justo",
243
+ country: "México",
244
+ id_region: 1,
245
+ active: 1,
246
+ percentage: 94.73684210526316,
247
+ image: "https://content-management-images.s3.amazonaws.com/retailers/39.png",
248
+ services: ["NA", "NA", "NA"]
249
+ }, {
250
+ id: 62,
251
+ name: "Sanborns Café",
252
+ country: "México",
253
+ id_region: 1,
254
+ active: 1,
255
+ percentage: 100,
256
+ image: "https://content-management-images.s3.amazonaws.com/retailers/62.png",
257
+ services: ["NA", "NA", "NA"]
84
258
  }],
85
- country: "México",
86
- upc: "169955"
259
+ country: "null",
260
+ upc: "7501035911369"
87
261
  },
88
262
  location: {
89
263
  product: {
@@ -92,15 +266,15 @@ RetailerProductEditionDefault.args = {
92
266
  }
93
267
  },
94
268
  user: {
95
- id_user: 425,
96
- name: "Auditor QA",
269
+ id_user: 423,
270
+ name: "Facilitador Textos",
97
271
  last_name: " ",
98
- email: "ladiboh785@mi166.com",
272
+ email: "bayadi1538@mnqlm.com",
99
273
  position: "Tester",
100
274
  telephone: null,
101
275
  country: null,
102
276
  id_company: 254,
103
- id_cognito: "23a3f496-4e38-4e12-9bf5-7f90b77a2f35",
277
+ id_cognito: "0b66a4a9-7790-4034-a30a-c00808962867",
104
278
  birth_Date: null,
105
279
  about_me: null,
106
280
  zip_code: null,
@@ -122,6 +296,6 @@ RetailerProductEditionDefault.args = {
122
296
  products_limit: "1000",
123
297
  type: "Enterprise"
124
298
  },
125
- src: "https://content-management-profile-prod.s3.amazonaws.com/id-425/425.png?1659649029658"
299
+ src: "https://content-management-profile-prod.s3.amazonaws.com/id-423/423.png?1660182839373"
126
300
  }
127
301
  };
@@ -118,7 +118,7 @@ var reducerImages = function reducerImages(state, action) {
118
118
 
119
119
  case "changeAttrValue":
120
120
  var index = attrForImgs.general.findIndex(function (f) {
121
- return f.id = action.id;
121
+ return f.id === action.id;
122
122
  });
123
123
 
124
124
  if (index !== -1) {
package/dist/index.js CHANGED
@@ -758,6 +758,19 @@ Object.keys(_CustomerType).forEach(function (key) {
758
758
  });
759
759
  });
760
760
 
761
+ var _Dashboard = require("./components/pages/Dashboard");
762
+
763
+ Object.keys(_Dashboard).forEach(function (key) {
764
+ if (key === "default" || key === "__esModule") return;
765
+ if (key in exports && exports[key] === _Dashboard[key]) return;
766
+ Object.defineProperty(exports, key, {
767
+ enumerable: true,
768
+ get: function get() {
769
+ return _Dashboard[key];
770
+ }
771
+ });
772
+ });
773
+
761
774
  var _EmailResetPassword = require("./components/pages/EmailResetPassword");
762
775
 
763
776
  Object.keys(_EmailResetPassword).forEach(function (key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.2.0",
3
+ "version": "21.2.3",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -41,12 +41,10 @@ export const DashboardMetric = ({
41
41
  if (end)
42
42
  setQueryObject((current) => ({
43
43
  ...current,
44
- startDate: `${start.getFullYear()}-${start.getDate()}-${
44
+ startDate: `${start.getFullYear()}-${
45
45
  start.getMonth() + 1
46
- }`,
47
- endDate: `${end?.getFullYear()}-${end?.getDate()}-${
48
- end?.getMonth() + 1
49
- }`,
46
+ }-${start.getDate()}`,
47
+ endDate: `${end.getFullYear()}-${end.getMonth() + 1}-${end.getDate()}`,
50
48
  }));
51
49
  };
52
50
 
@@ -2,15 +2,25 @@ import { Container } from "./styles";
2
2
  import { MetricCard } from "../../atoms/MetricCard";
3
3
  import { DashboardMetric } from "../../organisms/DashboardMetric";
4
4
  import { useEffect, useState } from "react";
5
+ import { Loading } from "../../atoms/Loading";
5
6
  import axios from "axios";
6
7
 
7
8
  export const Dashboard = () => {
8
9
  const [metricsData, setMetricsData] = useState([]);
9
10
  const [productsByStatus, setProductsByStatus] = useState({});
10
11
  const [requiredProducts, setRequiredProducts] = useState([]);
11
- const [orderByStatus, setOrderByStatus] = useState({});
12
- const [orderByRequired, setOrderByRequired] = useState({});
12
+ const [orderByStatus, setOrderByStatus] = useState({
13
+ retailerId: null,
14
+ startDate: null,
15
+ endDate: null,
16
+ });
17
+ const [orderByRequired, setOrderByRequired] = useState({
18
+ retailerId: null,
19
+ startDate: null,
20
+ endDate: null,
21
+ });
13
22
  const [retailers, setRetailers] = useState({});
23
+ const [loading, setLoading] = useState(true);
14
24
 
15
25
  const loadProductVersions = async (byStatus, queryObject) => {
16
26
  const { retailerId, startDate, endDate, fullData } = queryObject;
@@ -62,12 +72,12 @@ export const Dashboard = () => {
62
72
  useEffect(() => {
63
73
  const today = new Date();
64
74
  const firstWeekDay = today.getDate() - today.getDay();
65
- const startDate = `${today.getFullYear()}-${firstWeekDay}-${
75
+ const startDate = `${today.getFullYear()}-${
66
76
  today.getMonth() + 1
67
- }`;
68
- const endDate = `${today.getFullYear()}-${today.getDate()}-${
77
+ }-${firstWeekDay}`;
78
+ const endDate = `${today.getFullYear()}-${
69
79
  today.getMonth() + 1
70
- }`;
80
+ }-${today.getDate()}`;
71
81
  const queryObject = { retailerId: "58", startDate, endDate };
72
82
  setOrderByStatus(queryObject);
73
83
  setOrderByRequired(queryObject);
@@ -82,7 +92,16 @@ export const Dashboard = () => {
82
92
  loadRequiredProducts(orderByRequired);
83
93
  }, [orderByRequired]);
84
94
 
85
- return (
95
+ useEffect(() => {
96
+ orderByRequired?.retailerId &&
97
+ orderByStatus?.retailerId &&
98
+ metricsData.length > 0 &&
99
+ setLoading(false);
100
+ }, [orderByRequired, orderByStatus, metricsData]);
101
+
102
+ return loading ? (
103
+ <Loading />
104
+ ) : (
86
105
  <Container>
87
106
  <div className="metric-cards">
88
107
  {metricsData.map((metric, index) => (
@@ -16,75 +16,288 @@ RetailerProductEditionDefault.args = {
16
16
  Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwYjY2YTRhOS03NzkwLTQwMzQtYTMwYS1jMDA4MDg5NjI4NjciLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjBiNjZhNGE5LTc3OTAtNDAzNC1hMzBhLWMwMDgwODk2Mjg2NyIsImF1ZCI6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zNC1hMzBhLWMwMDgwODk2Mjg2NyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiIzNmIxMmUwMy0xOWJhLTRiMDktYWJiYS1kZjk3ZTFkNThjZTQiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MDE4MjgzNywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2MDE4NjQzNywiaWF0IjoxNjYwMTgyODM3LCJlbWFpbCI6ImJheWFkaTE1MzhAbW5xbG0uY29tIn0.MM9nIHkrRIS2o8_s4BR6VTLgyw3ryvPrr-mf6RtnQ4smng2Q3fmtK07zInNcvcrv8EXO5J9z47_NZ5MOJDo1Pz1CV2cOYM7PT5tEn3F-W4SitqDbBw3KxfkqSMxdZUIHLWECGL-u2ATCYU2J4KRVQi8XSP1qbfv1hu9dh-vID8Fq641ccQwEqUDC13pshDPlR08legg7AAPJqoilV7wuvxqTYAK6fGqMS5jcdW2iDmU0ti9gkydXkYRIC-jg446VOmRCpwzKsk4UAPwlrGeodQ0LV1bfWn_-KVspWCRQd6U5WbFxHn0umYe3CvvPpyVmHzD3F_EMxaVyqV5aW5IoIQ",
20
20
  productSelected: {
21
21
  services: {
22
- datasheets: 0,
23
- descriptions: 0,
22
+ datasheets: 1,
23
+ descriptions: 1,
24
24
  images: 1,
25
25
  },
26
- orderId: 1789,
27
- status: "ACA",
28
- datasheet_status: "NS",
26
+ orderId: 2296,
27
+ status: "AP",
28
+ datasheet_status: "AP",
29
29
  prio: "none",
30
- version: 2,
31
- description_status: "NS",
32
- images_status: "ACA",
30
+ version: 8,
31
+ description_status: "ACA",
32
+ images_status: "AP",
33
33
  article: {
34
- id_article: 68865,
35
- id_category: "2999",
36
- name: "RESIZE",
37
- upc: "169955",
38
- timestamp: "2022-06-21T16:03:10.000Z",
39
- id_user: 1238,
40
- status: "NULL",
41
- active: 0,
42
- company_id: 819,
34
+ id_article: 14701,
35
+ id_category: "684",
36
+ name: "Pasta Dental Colgate Total 12 Clean Mint de 100 ml",
37
+ upc: "7501035911369",
38
+ timestamp: "2021-10-09T16:33:17.000Z",
39
+ id_user: 203,
40
+ status: "Ex",
41
+ active: 1,
42
+ company_id: 226,
43
43
  SKU: null,
44
44
  Descripcion: null,
45
45
  Proveedor: null,
46
46
  id_proveedor: 0,
47
- company_name: "The Home Depot Resize",
48
- country: "México",
49
- id_order: 1789,
50
- id_datasheet_especialist: null,
51
- id_datasheet_facilitator: null,
52
- id_description_especialist: null,
53
- id_description_facilitator: null,
54
- id_images_especialist: 1250,
55
- id_images_facilitator: 424,
56
- id_auditor: null,
47
+ company_name: "Prueba Test S.A de C.V.",
48
+ country: "null",
49
+ id_order: 2296,
50
+ id_datasheet_especialist: 405,
51
+ id_datasheet_facilitator: 158,
52
+ id_description_especialist: 405,
53
+ id_description_facilitator: 158,
54
+ id_images_especialist: 366,
55
+ id_images_facilitator: 160,
56
+ id_auditor: 9,
57
57
  id_recepcionist: null,
58
- category: "Resizing|Resizing|Resizing",
59
- missingAttributes: null,
60
- missingDescriptions: null,
61
- missingImages: null,
58
+ category: "Salud y Belleza|Cuidado Bucal|Pastas Dentales y Aseo Bucal",
59
+ missingAttributes: -1,
60
+ missingDescriptions: 3,
61
+ missingImages: -9,
62
62
  },
63
63
  retailers: [
64
64
  {
65
- id: 60,
66
- name: "The Home Depot Resizing",
65
+ id: 4,
66
+ name: "Walmart Super y Superama",
67
67
  country: "México",
68
68
  id_region: 1,
69
69
  active: 1,
70
+ percentage: 97.61904761904763,
71
+ image:
72
+ "https://content-management-images.s3.amazonaws.com/retailers/4.png",
73
+ services: ["NA", "NA", "NA"],
74
+ },
75
+ {
76
+ id: 5,
77
+ name: "Chedraui",
78
+ country: "México",
79
+ id_region: 1,
80
+ active: 1,
81
+ percentage: 100,
82
+ image:
83
+ "https://content-management-images.s3.amazonaws.com/retailers/5.png",
84
+ services: ["NA", "NA", "NA"],
85
+ },
86
+ {
87
+ id: 6,
88
+ name: "HEB",
89
+ country: "México",
90
+ id_region: 1,
91
+ active: 1,
92
+ percentage: 100,
93
+ image:
94
+ "https://content-management-images.s3.amazonaws.com/retailers/6.png",
95
+ services: ["AP", "ACA", "AP"],
96
+ },
97
+ {
98
+ id: 7,
99
+ name: "Mega",
100
+ country: "México",
101
+ id_region: 1,
102
+ active: 1,
103
+ percentage: 100,
104
+ image:
105
+ "https://content-management-images.s3.amazonaws.com/retailers/7.png",
106
+ services: ["NA", "NA", "NA"],
107
+ },
108
+ {
109
+ id: 8,
110
+ name: "Fragua",
111
+ country: "México",
112
+ id_region: 1,
113
+ active: 1,
114
+ percentage: null,
115
+ image:
116
+ "https://content-management-images.s3.amazonaws.com/retailers/8.png",
117
+ services: ["NA", "NA", "NA"],
118
+ },
119
+ {
120
+ id: 9,
121
+ name: "Amazon",
122
+ country: "México",
123
+ id_region: 1,
124
+ active: 1,
125
+ percentage: 85.18518518518518,
126
+ image:
127
+ "https://content-management-images.s3.amazonaws.com/retailers/9.png",
128
+ services: ["NA", "NA", "NA"],
129
+ },
130
+ {
131
+ id: 12,
132
+ name: "La Comer",
133
+ country: "México",
134
+ id_region: 1,
135
+ active: 1,
136
+ percentage: 100,
137
+ image:
138
+ "https://content-management-images.s3.amazonaws.com/retailers/12.png",
139
+ services: ["NA", "NA", "NA"],
140
+ },
141
+ {
142
+ id: 13,
143
+ name: "Soriana",
144
+ country: "México",
145
+ id_region: 1,
146
+ active: 1,
147
+ percentage: 100,
148
+ image:
149
+ "https://content-management-images.s3.amazonaws.com/retailers/13.png",
150
+ services: ["NA", "NA", "NA"],
151
+ },
152
+ {
153
+ id: 16,
154
+ name: "Rappi",
155
+ country: "México",
156
+ id_region: 1,
157
+ active: 1,
158
+ percentage: 93.33333333333333,
159
+ image:
160
+ "https://content-management-images.s3.amazonaws.com/retailers/16.png",
161
+ services: ["NA", "NA", "NA"],
162
+ },
163
+ {
164
+ id: 17,
165
+ name: "Genérico",
166
+ country: "México",
167
+ id_region: 1,
168
+ active: 1,
169
+ percentage: 100,
170
+ image:
171
+ "https://content-management-images.s3.amazonaws.com/retailers/17.png",
172
+ services: ["NA", "NA", "NA"],
173
+ },
174
+ {
175
+ id: 18,
176
+ name: "Google",
177
+ country: "México",
178
+ id_region: 1,
179
+ active: 1,
180
+ percentage: 96.66666666666667,
181
+ image:
182
+ "https://content-management-images.s3.amazonaws.com/retailers/18.png",
183
+ services: ["NA", "NA", "NA"],
184
+ },
185
+ {
186
+ id: 20,
187
+ name: "Cornershop",
188
+ country: "México",
189
+ id_region: 1,
190
+ active: 1,
191
+ percentage: 91.66666666666667,
192
+ image:
193
+ "https://content-management-images.s3.amazonaws.com/retailers/20.png",
194
+ services: ["NA", "NA", "NA"],
195
+ },
196
+ {
197
+ id: 24,
198
+ name: "Alsuper",
199
+ country: "México",
200
+ id_region: 1,
201
+ active: 1,
202
+ percentage: 95.83333333333333,
203
+ image:
204
+ "https://content-management-images.s3.amazonaws.com/retailers/24.png",
205
+ services: ["NA", "NA", "NA"],
206
+ },
207
+ {
208
+ id: 27,
209
+ name: "IMPIRA México",
210
+ country: "México",
211
+ id_region: 1,
212
+ active: 1,
213
+ percentage: 100,
214
+ image:
215
+ "https://content-management-images.s3.amazonaws.com/retailers/27.png",
216
+ services: ["NA", "NA", "NA"],
217
+ },
218
+ {
219
+ id: 29,
220
+ name: "Farmacias del Ahorro",
221
+ country: "México",
222
+ id_region: 1,
223
+ active: 1,
224
+ percentage: 81.48148148148148,
225
+ image:
226
+ "https://content-management-images.s3.amazonaws.com/retailers/29.png",
227
+ services: ["NA", "NA", "NA"],
228
+ },
229
+ {
230
+ id: 33,
231
+ name: "Merza",
232
+ country: "México",
233
+ id_region: 1,
234
+ active: 1,
235
+ percentage: 66.66666666666667,
236
+ image:
237
+ "https://content-management-images.s3.amazonaws.com/retailers/33.png",
238
+ services: ["NA", "NA", "NA"],
239
+ },
240
+ {
241
+ id: 34,
242
+ name: "San Pablo",
243
+ country: "México",
244
+ id_region: 1,
245
+ active: 1,
246
+ percentage: 95.16666666666667,
247
+ image:
248
+ "https://content-management-images.s3.amazonaws.com/retailers/34.png",
249
+ services: ["NA", "NA", "NA"],
250
+ },
251
+ {
252
+ id: 38,
253
+ name: "Del Sol",
254
+ country: "México",
255
+ id_region: 1,
256
+ active: 1,
257
+ percentage: 100,
258
+ image:
259
+ "https://content-management-images.s3.amazonaws.com/retailers/38.png",
260
+ services: ["NA", "NA", "NA"],
261
+ },
262
+ {
263
+ id: 39,
264
+ name: "Justo",
265
+ country: "México",
266
+ id_region: 1,
267
+ active: 1,
268
+ percentage: 94.73684210526316,
269
+ image:
270
+ "https://content-management-images.s3.amazonaws.com/retailers/39.png",
271
+ services: ["NA", "NA", "NA"],
272
+ },
273
+ {
274
+ id: 62,
275
+ name: "Sanborns Café",
276
+ country: "México",
277
+ id_region: 1,
278
+ active: 1,
279
+ percentage: 100,
280
+ image:
281
+ "https://content-management-images.s3.amazonaws.com/retailers/62.png",
282
+ services: ["NA", "NA", "NA"],
70
283
  },
71
284
  ],
72
- country: "México",
73
- upc: "169955",
285
+ country: "null",
286
+ upc: "7501035911369",
74
287
  },
75
288
  location: {
76
289
  product: { articleId: 109485, versionId: 3 },
77
290
  },
78
291
  user: {
79
- id_user: 425,
80
- name: "Auditor QA",
292
+ id_user: 423,
293
+ name: "Facilitador Textos",
81
294
  last_name: " ",
82
- email: "ladiboh785@mi166.com",
295
+ email: "bayadi1538@mnqlm.com",
83
296
  position: "Tester",
84
297
  telephone: null,
85
298
  country: null,
86
299
  id_company: 254,
87
- id_cognito: "23a3f496-4e38-4e12-9bf5-7f90b77a2f35",
300
+ id_cognito: "0b66a4a9-7790-4034-a30a-c00808962867",
88
301
  birth_Date: null,
89
302
  about_me: null,
90
303
  zip_code: null,
@@ -106,6 +319,6 @@ RetailerProductEditionDefault.args = {
106
319
  products_limit: "1000",
107
320
  type: "Enterprise",
108
321
  },
109
- src: "https://content-management-profile-prod.s3.amazonaws.com/id-425/425.png?1659649029658",
322
+ src: "https://content-management-profile-prod.s3.amazonaws.com/id-423/423.png?1660182839373",
110
323
  },
111
324
  };
@@ -60,7 +60,7 @@ const reducerImages = (state, action) => {
60
60
  values[action.index][action.attribute] = action.value;
61
61
  return { ...state, values };
62
62
  case "changeAttrValue":
63
- const index = attrForImgs.general.findIndex((f) => (f.id = action.id));
63
+ const index = attrForImgs.general.findIndex((f) => f.id === action.id);
64
64
  if (index !== -1) {
65
65
  attrForImgs.general[index].value = action.value;
66
66
  }
package/src/index.js CHANGED
@@ -63,6 +63,7 @@ export * from "./components/organisms/ProductImageModal/index";
63
63
  export * from "./components/pages/ChangePasswordLogin";
64
64
  export * from "./components/pages/CustomerLogin";
65
65
  export * from "./components/pages/CustomerType";
66
+ export * from "./components/pages/Dashboard";
66
67
  export * from "./components/pages/EmailResetPassword";
67
68
  export * from "./components/pages/OnboardPlan";
68
69
  export * from "./components/pages/RegistrationLoginSecondStep";