contentoh-components-library 21.2.7 → 21.2.10

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.
Files changed (59) hide show
  1. package/.env.development +3 -1
  2. package/.env.production +3 -1
  3. package/dist/components/atoms/FeatureTag/styles.js +1 -1
  4. package/dist/components/atoms/Graphic/Graphic.stories.js +9 -1
  5. package/dist/components/atoms/Graphic/index.js +4 -9
  6. package/dist/components/atoms/Graphic/styles.js +1 -1
  7. package/dist/components/atoms/MetricCard/MetricCard.stories.js +31 -0
  8. package/dist/components/atoms/MetricCard/index.js +24 -0
  9. package/dist/components/atoms/MetricCard/styles.js +20 -0
  10. package/dist/components/atoms/MetricSelect/MetricSelect.stories.js +46 -0
  11. package/dist/components/atoms/MetricSelect/index.js +37 -0
  12. package/dist/components/atoms/MetricSelect/styles.js +20 -0
  13. package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
  14. package/dist/components/atoms/StatusTag/index.js +58 -0
  15. package/dist/components/atoms/StatusTag/styles.js +20 -0
  16. package/dist/components/organisms/Calendar/Calendar.stories.js +28 -0
  17. package/dist/components/organisms/Calendar/index.js +33 -0
  18. package/dist/components/organisms/Calendar/styles.js +20 -0
  19. package/dist/components/organisms/DashboardMetric/DashboardMetric.stories.js +45 -0
  20. package/dist/components/organisms/DashboardMetric/index.js +168 -0
  21. package/dist/components/organisms/DashboardMetric/styles.js +20 -0
  22. package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
  23. package/dist/components/pages/Dashboard/Dashboard.stories.js +28 -0
  24. package/dist/components/pages/Dashboard/index.js +292 -0
  25. package/dist/components/pages/Dashboard/styles.js +18 -0
  26. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +73 -121
  27. package/dist/components/pages/ProviderProductEdition/index.js +30 -27
  28. package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
  29. package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
  30. package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
  31. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +55 -55
  32. package/dist/components/pages/RetailerProductEdition/index.js +3 -3
  33. package/dist/index.js +13 -0
  34. package/package.json +2 -1
  35. package/src/components/atoms/FeatureTag/styles.js +6 -0
  36. package/src/components/atoms/Graphic/Graphic.stories.js +8 -0
  37. package/src/components/atoms/Graphic/index.js +3 -9
  38. package/src/components/atoms/Graphic/styles.js +1 -2
  39. package/src/components/atoms/MetricCard/MetricCard.stories.js +14 -0
  40. package/src/components/atoms/MetricCard/index.js +10 -0
  41. package/src/components/atoms/MetricCard/styles.js +30 -0
  42. package/src/components/atoms/MetricSelect/MetricSelect.stories.js +37 -0
  43. package/src/components/atoms/MetricSelect/index.js +22 -0
  44. package/src/components/atoms/MetricSelect/styles.js +20 -0
  45. package/src/components/organisms/Calendar/Calendar.stories.js +10 -0
  46. package/src/components/organisms/Calendar/index.js +17 -0
  47. package/src/components/organisms/Calendar/styles.js +851 -0
  48. package/src/components/organisms/DashboardMetric/DashboardMetric.stories.js +28 -0
  49. package/src/components/organisms/DashboardMetric/index.js +128 -0
  50. package/src/components/organisms/DashboardMetric/styles.js +60 -0
  51. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  52. package/src/components/pages/Dashboard/Dashboard.stories.js +10 -0
  53. package/src/components/pages/Dashboard/index.js +146 -0
  54. package/src/components/pages/Dashboard/styles.js +24 -0
  55. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +80 -146
  56. package/src/components/pages/ProviderProductEdition/index.js +12 -16
  57. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +58 -58
  58. package/src/components/pages/RetailerProductEdition/index.js +3 -2
  59. package/src/index.js +1 -0
@@ -913,16 +913,17 @@ export const ProviderProductEdition = ({
913
913
  try {
914
914
  setLoading(true);
915
915
  const evaluationArray = [];
916
- const sendAll = [];
917
916
  const conceptArray = ["description", "datasheet", "images"];
918
917
  const dataGeneral = {
919
918
  articleId: product.id_article,
920
919
  orderId: product.id_order ?? product.orderId,
921
920
  result,
921
+ isAproved: result === "A",
922
922
  };
923
923
  servicesData?.forEach((ret) => {
924
924
  const { service, id_retailer } = ret;
925
- const data = {
925
+ let data = {};
926
+ data = {
926
927
  ...dataGeneral,
927
928
  concept: service,
928
929
  retailerId: id_retailer,
@@ -935,31 +936,25 @@ export const ProviderProductEdition = ({
935
936
  },
936
937
  })
937
938
  );
938
- sendAll.push(
939
- axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
940
- headers: {
941
- Authorization: token,
942
- },
943
- })
944
- );
945
939
  });
946
-
947
- await Promise.all([...evaluationArray, ...sendAll]);
940
+ const evalResponse = await Promise.all(evaluationArray);
941
+ console.log(evalResponse.map(({ data }) => JSON.parse(data.body)));
942
+ const userType = user.is_retailer === 1 ? "CA" : "P";
948
943
 
949
944
  const productTemp = product;
950
- productTemp.article_status = `${result}CA`;
945
+ productTemp.article_status = `${result}${userType}`;
951
946
  productTemp.datasheet_status =
952
- productTemp.datasheet_status === "NA" ? "NA" : `${result}CA`;
947
+ productTemp.datasheet_status === "NA" ? "NA" : `${result}${userType}`;
953
948
  productTemp.description_status =
954
- productTemp.description_status === "NA" ? "NA" : `${result}CA`;
949
+ productTemp.description_status === "NA" ? "NA" : `${result}${userType}`;
955
950
  productTemp.images_status =
956
- productTemp.images_status === "NA" ? "NA" : `${result}CA`;
951
+ productTemp.images_status === "NA" ? "NA" : `${result}${userType}`;
957
952
 
958
953
  const retailerStatusCopy = { ...retailerStatus };
959
954
  Object.keys(retailerStatusCopy).forEach((key) => {
960
955
  conceptArray.forEach((concept) => {
961
956
  if (retailerStatusCopy[key][concept]) {
962
- retailerStatusCopy[key][concept] = `${result}CA`;
957
+ retailerStatusCopy[key][concept] = `${result}${userType}`;
963
958
  }
964
959
  });
965
960
  });
@@ -1494,6 +1489,7 @@ export const ProviderProductEdition = ({
1494
1489
  companyName={company.company_name}
1495
1490
  currentVersion={version}
1496
1491
  setShowCreateVersion={setShowCreateVersion}
1492
+ setShowVersionSelector={setShowVersionSelector}
1497
1493
  />
1498
1494
  )}
1499
1495
  {showCreateVersion && (
@@ -16,82 +16,82 @@ RetailerProductEditionDefault.args = {
16
16
  Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwYjY2YTRhOS03NzkwLTQwMzQtYTMwYS1jMDA4MDg5NjI4NjciLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjBiNjZhNGE5LTc3OTAtNDAzNC1hMzBhLWMwMDgwODk2Mjg2NyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiI4ZjA2YmU0NC04ZWEzLTQ5OWMtOGFjZC0xMDlmMDZiZWI1MjAiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MDA3NjQ5MywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2MDA4MDA5MywiaWF0IjoxNjYwMDc2NDkzLCJlbWFpbCI6ImJheWFkaTE1MzhAbW5xbG0uY29tIn0.aw_x1A8WR2MCp_Kz-T2Jcg0ZtuKwyzQ23yT_OoKr-aGJmEjSPihmksWgLZr9hJXyfvU0JndaVMM_3DRly1TdtJ264zwH4dZ7Cp9gF4TSXG16HQxIIPUA4NnwdpOnlBdE9E27mCXs4XYnC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qDbBw3KxfkqSMxdZUIHLWECGL-u2ATCYU2J4KRVQi8XSP1qbfv1hu9dh-vID8Fq641ccQwEqUDC13pshDPlR08legg7AAPJqoilV7wuvxqTYAK6fGqMS5jcdW2iDmU0ti9gkydXkYRIC-jg446VOmRCpwzKsk4UAPwlrGeodQ0LV1bfWn_-KVspWCRQd6U5WbFxHn0umYe3CvvPpyVmHzD3F_EMxaVyqV5aW5IoIQ",
20
20
  productSelected: {
21
- services: {
22
- datasheets: 0,
23
- descriptions: 0,
24
- images: 1,
21
+ "services": {
22
+ "datasheets": 1,
23
+ "descriptions": 1,
24
+ "images": 1
25
25
  },
26
- orderId: 1789,
27
- status: "ACA",
28
- datasheet_status: "NS",
29
- prio: "none",
30
- version: 2,
31
- description_status: "NS",
32
- images_status: "ACA",
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,
43
- SKU: null,
44
- Descripcion: null,
45
- Proveedor: null,
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,
57
- id_recepcionist: null,
58
- category: "Resizing|Resizing|Resizing",
59
- missingAttributes: null,
60
- missingDescriptions: null,
61
- missingImages: null,
26
+ "orderId": 1810,
27
+ "status": "RP",
28
+ "datasheet_status": "RP",
29
+ "prio": "none",
30
+ "version": 2,
31
+ "description_status": "RP",
32
+ "images_status": "RP",
33
+ "article": {
34
+ "id_article": 68934,
35
+ "id_category": "2290",
36
+ "name": "SCOTCHBLUE  3PACK MASKING TAPE 24MMX55M",
37
+ "upc": "167907",
38
+ "timestamp": "2022-06-22T15:44:57.000Z",
39
+ "id_user": 704,
40
+ "status": "NULL",
41
+ "active": 1,
42
+ "company_id": 437,
43
+ "SKU": null,
44
+ "Descripcion": null,
45
+ "Proveedor": null,
46
+ "id_proveedor": 0,
47
+ "company_name": "",
48
+ "country": null,
49
+ "id_order": 1810,
50
+ "id_datasheet_especialist": 1248,
51
+ "id_datasheet_facilitator": 1252,
52
+ "id_description_especialist": 1248,
53
+ "id_description_facilitator": 1252,
54
+ "id_images_especialist": 1251,
55
+ "id_images_facilitator": 1286,
56
+ "id_auditor": 514,
57
+ "id_recepcionist": null,
58
+ "category": "Pinturas|Herramientas y accesorios para pintar|Cintas",
59
+ "missingAttributes": null,
60
+ "missingDescriptions": null,
61
+ "missingImages": null
62
62
  },
63
- retailers: [
64
- {
65
- id: 60,
66
- name: "The Home Depot Resizing",
67
- country: "México",
68
- id_region: 1,
69
- active: 1,
70
- },
63
+ "retailers": [
64
+ {
65
+ "id": 58,
66
+ "name": "The Home Depot Golden",
67
+ "country": "México",
68
+ "id_region": 1,
69
+ "active": 1
70
+ }
71
71
  ],
72
- country: "México",
73
- upc: "169955",
74
- },
72
+ "country": null,
73
+ "upc": "167907"
74
+ },
75
75
  location: {
76
76
  product: { articleId: 109485, versionId: 3 },
77
77
  },
78
78
  user: {
79
- id_user: 425,
80
- name: "Auditor QA",
79
+ id_user: 1248,
80
+ name: "Facilitador Textos",
81
81
  last_name: " ",
82
- email: "ladiboh785@mi166.com",
82
+ email: "bayadi1538@mnqlm.com",
83
83
  position: "Tester",
84
84
  telephone: null,
85
85
  country: null,
86
86
  id_company: 254,
87
- id_cognito: "23a3f496-4e38-4e12-9bf5-7f90b77a2f35",
87
+ id_cognito: "0b66a4a9-7790-4034-a30a-c00808962867",
88
88
  birth_Date: null,
89
89
  about_me: null,
90
90
  zip_code: null,
91
91
  address: null,
92
92
  job: null,
93
93
  id_stripe: null,
94
- id_role: 1,
94
+ id_role: 7,
95
95
  active: 1,
96
96
  is_retailer: 0,
97
97
  email_notify: null,
@@ -106,6 +106,6 @@ RetailerProductEditionDefault.args = {
106
106
  products_limit: "1000",
107
107
  type: "Enterprise",
108
108
  },
109
- src: "https://content-management-profile-prod.s3.amazonaws.com/id-425/425.png?1659649029658",
109
+ src: "https://content-management-profile-prod.s3.amazonaws.com/id-423/423.png?1660182839373",
110
110
  },
111
111
  };
@@ -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
  }
@@ -648,7 +648,7 @@ export const RetailerProductEdition = ({
648
648
  statusArray.includes(srvActive) &&
649
649
  (["RA", "RC"].includes(product?.status) ||
650
650
  srv.filter((serv) =>
651
- statusArray.includes(serv.status?.replace(/.*\//, ""))
651
+ ["CA"].includes(serv.status?.replace(/.*\//, ""))
652
652
  ).length === srv.length)
653
653
  );
654
654
  case 4:
@@ -1387,6 +1387,7 @@ export const RetailerProductEdition = ({
1387
1387
  </>
1388
1388
  )}
1389
1389
  </div>
1390
+ {console.log(userAssigned(activeTab), auditorAssigned())}
1390
1391
  {(userAssigned(activeTab) || auditorAssigned()) &&
1391
1392
  product[`${getConcept(activeTab)}_status`] !== "NS" && (
1392
1393
  <div className="commentary-box">
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";