contentoh-components-library 21.1.3 → 21.1.6

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.
@@ -56,7 +56,6 @@ var GeneralInput = function GeneralInput(_ref) {
56
56
 
57
57
  var onHandleChange = function onHandleChange(evt) {
58
58
  if (validateInput) {
59
- console.log("here");
60
59
  setTextValue({
61
60
  value: validateInput(evt, position, inputsArray)
62
61
  });
@@ -36,107 +36,109 @@ ProviderProductEditionDefault.args = {
36
36
  category: 846,
37
37
  version: 2,
38
38
  productSelected: {
39
- orderId: 47,
40
- status: "AA",
41
- datasheet_status: "AA",
39
+ orderId: 27,
40
+ article_status: "AP",
41
+ datasheet_status: "AP",
42
+ description_status: "AP",
43
+ images_status: "AP",
42
44
  prio: "none",
43
45
  version: 2,
44
- description_status: "AA",
45
- images_status: "AA",
46
46
  brand: null,
47
- retailerOrder: 0,
48
- missing: {
49
- datasheet: 0,
50
- descriptions: 1,
51
- images: 0
47
+ article: {
48
+ category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
49
+ company_name: "THD Proveedor",
50
+ country: "México",
51
+ id_category: "2004",
52
+ id_article: 55108,
53
+ name: "Producto de prueba 10 THD",
54
+ upc: "SKU12314THD"
52
55
  },
56
+ retailers: [{
57
+ id: 58,
58
+ name: "The Home Depot Golden"
59
+ }, {
60
+ id: 59,
61
+ name: "The Home Depot Platinum"
62
+ }, {
63
+ id: 60,
64
+ name: "The Home Depot Resizing"
65
+ }, {
66
+ id: 61,
67
+ name: "Home Depot TAB"
68
+ }],
53
69
  services: {
54
70
  datasheets: 1,
55
71
  descriptions: 1,
56
72
  images: 1
57
73
  },
58
- article: {
59
- category: "ABARROTES|ABARROTES SECOS|GALLETAS",
60
- company_name: "COMPANY DEV",
61
- country: "México",
62
- id_category: "12",
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: 47,
70
- id_article: 55115,
71
- id_auditor: 30,
72
- name: "Galletas Oreo",
73
- upc: "42334242"
74
- },
75
- retailers: [{
76
- id: 4,
77
- name: "Walmart Super y Superama"
78
- }],
74
+ id_article: 55108,
79
75
  retailersAvailable: [{
80
- id: 4,
81
- name: "Walmart Super y Superama"
82
- }],
83
- categoryName: "ABARROTES|ABARROTES SECOS|GALLETAS",
84
- upc: "42334242",
85
- id_article: 55115,
86
- id_order: 47
76
+ id: 58,
77
+ name: "The Home Depot Golden"
78
+ }, {
79
+ id: 59,
80
+ name: "The Home Depot Platinum"
81
+ }, {
82
+ id: 60,
83
+ name: "The Home Depot Resizing"
84
+ }, {
85
+ id: 61,
86
+ name: "Home Depot TAB"
87
+ }]
87
88
  },
88
89
  productToEdit: {
89
- ArticleId: 55115,
90
- idCategory: "12",
90
+ ArticleId: 55108,
91
+ idCategory: "2004",
91
92
  product: {
92
- orderId: 47,
93
- status: "AA",
94
- datasheet_status: "AA",
93
+ orderId: 27,
94
+ article_status: "AP",
95
+ datasheet_status: "AP",
96
+ description_status: "AP",
97
+ images_status: "AP",
95
98
  prio: "none",
96
99
  version: 2,
97
- description_status: "AA",
98
- images_status: "AA",
99
100
  brand: null,
100
- retailerOrder: 0,
101
- missing: {
102
- datasheet: 0,
103
- descriptions: 1,
104
- images: 0
101
+ article: {
102
+ category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
103
+ company_name: "THD Proveedor",
104
+ country: "México",
105
+ id_category: "2004",
106
+ id_article: 55108,
107
+ name: "Producto de prueba 10 THD",
108
+ upc: "SKU12314THD"
105
109
  },
110
+ retailers: [{
111
+ id: 58,
112
+ name: "The Home Depot Golden"
113
+ }, {
114
+ id: 59,
115
+ name: "The Home Depot Platinum"
116
+ }, {
117
+ id: 60,
118
+ name: "The Home Depot Resizing"
119
+ }, {
120
+ id: 61,
121
+ name: "Home Depot TAB"
122
+ }],
106
123
  services: {
107
124
  datasheets: 1,
108
125
  descriptions: 1,
109
126
  images: 1
110
127
  },
111
- article: {
112
- category: "ABARROTES|ABARROTES SECOS|GALLETAS",
113
- company_name: "COMPANY DEV",
114
- country: "México",
115
- id_category: "12",
116
- id_datasheet_especialist: 54,
117
- id_datasheet_facilitator: 52,
118
- id_description_especialist: 54,
119
- id_description_facilitator: 52,
120
- id_images_especialist: 55,
121
- id_images_facilitator: 53,
122
- id_order: 47,
123
- id_article: 55115,
124
- id_auditor: 30,
125
- name: "Galletas Oreo",
126
- upc: "42334242"
127
- },
128
- retailers: [{
129
- id: 4,
130
- name: "Walmart Super y Superama"
131
- }],
128
+ id_article: 55108,
132
129
  retailersAvailable: [{
133
- id: 4,
134
- name: "Walmart Super y Superama"
135
- }],
136
- categoryName: "ABARROTES|ABARROTES SECOS|GALLETAS",
137
- upc: "42334242",
138
- id_article: 55115,
139
- id_order: 47
130
+ id: 58,
131
+ name: "The Home Depot Golden"
132
+ }, {
133
+ id: 59,
134
+ name: "The Home Depot Platinum"
135
+ }, {
136
+ id: 60,
137
+ name: "The Home Depot Resizing"
138
+ }, {
139
+ id: 61,
140
+ name: "Home Depot TAB"
141
+ }]
140
142
  }
141
143
  },
142
144
  location: {
@@ -145,39 +147,39 @@ ProviderProductEditionDefault.args = {
145
147
  versionId: 3
146
148
  },
147
149
  state: {
148
- origin: "Contentoh"
150
+ origin: "RequestWithContentoh"
149
151
  }
150
152
  },
151
153
  user: {
152
- id_user: 28,
153
- name: "Proveedor",
154
- last_name: "Colgate",
155
- email: "ilopez@contentoh.com",
156
- position: "Prueba Admin",
154
+ id_user: 59,
155
+ name: "The Home",
156
+ last_name: "Depot",
157
+ email: "cadena.ismael@allfreemail.net",
158
+ position: "Admin",
157
159
  telephone: "+523111366336",
158
160
  country: "México",
159
- id_company: 1,
160
- id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
161
+ id_company: 7,
162
+ id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
161
163
  birth_Date: null,
162
164
  about_me: null,
163
165
  zip_code: null,
164
166
  address: null,
165
167
  job: null,
166
- id_stripe: "cus_KuEt6R6vwmN09f",
168
+ id_stripe: "",
167
169
  id_role: 0,
168
170
  active: 1,
169
- is_retailer: 0,
171
+ is_retailer: 1,
170
172
  membership: {
171
- id: 38,
172
- start_date: "2022-01-18T17:25:35.000Z",
173
- end_date: "2023-01-18T17:25:35.000Z",
174
- planID: 8,
175
- plan: "prod_KtlhECVSFG2iro",
176
- name: "Plan Pro",
177
- user_limit: "20",
178
- products_limit: "5000",
173
+ id: 24,
174
+ start_date: "2021-11-23T03:35:50.000Z",
175
+ end_date: "2022-11-23T03:35:50.000Z",
176
+ planID: 9,
177
+ plan: "prod_KtlkzZVGq6bRTO",
178
+ name: "Plan Enterprise Full",
179
+ user_limit: "30",
180
+ products_limit: "10000",
179
181
  type: "Enterprise"
180
182
  },
181
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1655613379760"
183
+ src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1655616370073"
182
184
  }
183
185
  };
@@ -1441,22 +1441,20 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1441
1441
 
1442
1442
  var evaluationComplete = function evaluationComplete(tab) {
1443
1443
  var concept = getConcept(tab);
1444
- console.log(origin[concept], "origin[concept]");
1445
1444
  var serv = servicesData.filter(function (item) {
1446
1445
  return item.service === concept;
1447
1446
  });
1448
1447
 
1449
- if (["RequestWithContentoh", "RequestWithoutContentoh"].includes(origin[concept])) {
1448
+ if (["RequestWithContentoh", "RequestWithoutContentoh"].includes(origin[tab])) {
1450
1449
  serv = serv.filter(function (f) {
1451
1450
  return f.id_retailer === product.retailer_id;
1452
1451
  });
1453
1452
  }
1454
1453
 
1455
- var approved = user.is_retailer ? "AC" : "AP";
1456
- var rejected = user.is_retailer ? "RC" : "RP";
1457
- return serv.filter(function (item) {
1458
- return item.status === approved || item.status === rejected;
1459
- }).length === serv.length;
1454
+ var statusArray = user.is_retailer ? ["AC", "RC"] : ["AP", "RP", "AC"];
1455
+ return serv.every(function (item) {
1456
+ return statusArray.includes(item.status);
1457
+ });
1460
1458
  };
1461
1459
 
1462
1460
  var downloadImages = function downloadImages() {
@@ -1574,7 +1572,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1574
1572
  var datasheet_status = product.datasheet_status,
1575
1573
  description_status = product.description_status,
1576
1574
  images_status = product.images_status;
1577
- var completionStates = ["AP", "Evaluated", "NS"];
1575
+ var completionStates = user.is_retailer ? ["AC", "Evaluated", "NS"] : ["AP", "Evaluated", "NS"];
1578
1576
  var dsEvaluated = completionStates.includes(datasheet_status);
1579
1577
  var descsEvaluated = completionStates.includes(description_status);
1580
1578
  var imgsEvaluated = completionStates.includes(images_status);
@@ -1765,7 +1763,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1765
1763
  setActiveRetailer: setActiveRetailer,
1766
1764
  showValidationButtons: isRevision() && getSectionStatus(),
1767
1765
  approve: function approve() {
1768
- if (origin[getConcept(activeTab)] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1766
+ if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1769
1767
  setDataGenericModal(function (prev) {
1770
1768
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1771
1769
  button2: {
@@ -1800,7 +1798,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1800
1798
  }
1801
1799
  },
1802
1800
  reject: function reject() {
1803
- if (origin[getConcept(activeTab)] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1801
+ if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1804
1802
  return;
1805
1803
  } else {
1806
1804
  if (user.is_retailer) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.1.3",
3
+ "version": "21.1.6",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -32,7 +32,6 @@ export const GeneralInput = ({
32
32
 
33
33
  const onHandleChange = (evt) => {
34
34
  if (validateInput) {
35
- console.log("here");
36
35
  setTextValue({ value: validateInput(evt, position, inputsArray) });
37
36
  } else if (
38
37
  updatedDatasheets ||
@@ -21,151 +21,165 @@ ProviderProductEditionDefault.args = {
21
21
  category: 846,
22
22
  version: 2,
23
23
  productSelected: {
24
- orderId: 47,
25
- status: "AA",
26
- datasheet_status: "AA",
24
+ orderId: 27,
25
+ article_status: "AP",
26
+ datasheet_status: "AP",
27
+ description_status: "AP",
28
+ images_status: "AP",
27
29
  prio: "none",
28
30
  version: 2,
29
- description_status: "AA",
30
- images_status: "AA",
31
31
  brand: null,
32
- retailerOrder: 0,
33
- missing: {
34
- datasheet: 0,
35
- descriptions: 1,
36
- images: 0,
37
- },
38
- services: {
39
- datasheets: 1,
40
- descriptions: 1,
41
- images: 1,
42
- },
43
32
  article: {
44
- category: "ABARROTES|ABARROTES SECOS|GALLETAS",
45
- company_name: "COMPANY DEV",
33
+ category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
34
+ company_name: "THD Proveedor",
46
35
  country: "México",
47
- id_category: "12",
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: 47,
55
- id_article: 55115,
56
- id_auditor: 30,
57
- name: "Galletas Oreo",
58
- upc: "42334242",
36
+ id_category: "2004",
37
+ id_article: 55108,
38
+ name: "Producto de prueba 10 THD",
39
+ upc: "SKU12314THD",
59
40
  },
60
41
  retailers: [
61
42
  {
62
- id: 4,
63
- name: "Walmart Super y Superama",
43
+ id: 58,
44
+ name: "The Home Depot Golden",
45
+ },
46
+ {
47
+ id: 59,
48
+ name: "The Home Depot Platinum",
49
+ },
50
+ {
51
+ id: 60,
52
+ name: "The Home Depot Resizing",
53
+ },
54
+ {
55
+ id: 61,
56
+ name: "Home Depot TAB",
64
57
  },
65
58
  ],
59
+ services: {
60
+ datasheets: 1,
61
+ descriptions: 1,
62
+ images: 1,
63
+ },
64
+ id_article: 55108,
66
65
  retailersAvailable: [
67
66
  {
68
- id: 4,
69
- name: "Walmart Super y Superama",
67
+ id: 58,
68
+ name: "The Home Depot Golden",
69
+ },
70
+ {
71
+ id: 59,
72
+ name: "The Home Depot Platinum",
73
+ },
74
+ {
75
+ id: 60,
76
+ name: "The Home Depot Resizing",
77
+ },
78
+ {
79
+ id: 61,
80
+ name: "Home Depot TAB",
70
81
  },
71
82
  ],
72
- categoryName: "ABARROTES|ABARROTES SECOS|GALLETAS",
73
- upc: "42334242",
74
- id_article: 55115,
75
- id_order: 47,
76
83
  },
77
84
  productToEdit: {
78
- ArticleId: 55115,
79
- idCategory: "12",
85
+ ArticleId: 55108,
86
+ idCategory: "2004",
80
87
  product: {
81
- orderId: 47,
82
- status: "AA",
83
- datasheet_status: "AA",
88
+ orderId: 27,
89
+ article_status: "AP",
90
+ datasheet_status: "AP",
91
+ description_status: "AP",
92
+ images_status: "AP",
84
93
  prio: "none",
85
94
  version: 2,
86
- description_status: "AA",
87
- images_status: "AA",
88
95
  brand: null,
89
- retailerOrder: 0,
90
- missing: {
91
- datasheet: 0,
92
- descriptions: 1,
93
- images: 0,
94
- },
95
- services: {
96
- datasheets: 1,
97
- descriptions: 1,
98
- images: 1,
99
- },
100
96
  article: {
101
- category: "ABARROTES|ABARROTES SECOS|GALLETAS",
102
- company_name: "COMPANY DEV",
97
+ category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
98
+ company_name: "THD Proveedor",
103
99
  country: "México",
104
- id_category: "12",
105
- id_datasheet_especialist: 54,
106
- id_datasheet_facilitator: 52,
107
- id_description_especialist: 54,
108
- id_description_facilitator: 52,
109
- id_images_especialist: 55,
110
- id_images_facilitator: 53,
111
- id_order: 47,
112
- id_article: 55115,
113
- id_auditor: 30,
114
- name: "Galletas Oreo",
115
- upc: "42334242",
100
+ id_category: "2004",
101
+ id_article: 55108,
102
+ name: "Producto de prueba 10 THD",
103
+ upc: "SKU12314THD",
116
104
  },
117
105
  retailers: [
118
106
  {
119
- id: 4,
120
- name: "Walmart Super y Superama",
107
+ id: 58,
108
+ name: "The Home Depot Golden",
109
+ },
110
+ {
111
+ id: 59,
112
+ name: "The Home Depot Platinum",
113
+ },
114
+ {
115
+ id: 60,
116
+ name: "The Home Depot Resizing",
117
+ },
118
+ {
119
+ id: 61,
120
+ name: "Home Depot TAB",
121
121
  },
122
122
  ],
123
+ services: {
124
+ datasheets: 1,
125
+ descriptions: 1,
126
+ images: 1,
127
+ },
128
+ id_article: 55108,
123
129
  retailersAvailable: [
124
130
  {
125
- id: 4,
126
- name: "Walmart Super y Superama",
131
+ id: 58,
132
+ name: "The Home Depot Golden",
133
+ },
134
+ {
135
+ id: 59,
136
+ name: "The Home Depot Platinum",
137
+ },
138
+ {
139
+ id: 60,
140
+ name: "The Home Depot Resizing",
141
+ },
142
+ {
143
+ id: 61,
144
+ name: "Home Depot TAB",
127
145
  },
128
146
  ],
129
- categoryName: "ABARROTES|ABARROTES SECOS|GALLETAS",
130
- upc: "42334242",
131
- id_article: 55115,
132
- id_order: 47,
133
147
  },
134
148
  },
135
149
  location: {
136
150
  product: { articleId: 109485, versionId: 3 },
137
- state: { origin: "Contentoh" },
151
+ state: { origin: "RequestWithContentoh" },
138
152
  },
139
153
  user: {
140
- id_user: 28,
141
- name: "Proveedor",
142
- last_name: "Colgate",
143
- email: "ilopez@contentoh.com",
144
- position: "Prueba Admin",
154
+ id_user: 59,
155
+ name: "The Home",
156
+ last_name: "Depot",
157
+ email: "cadena.ismael@allfreemail.net",
158
+ position: "Admin",
145
159
  telephone: "+523111366336",
146
160
  country: "México",
147
- id_company: 1,
148
- id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
161
+ id_company: 7,
162
+ id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
149
163
  birth_Date: null,
150
164
  about_me: null,
151
165
  zip_code: null,
152
166
  address: null,
153
167
  job: null,
154
- id_stripe: "cus_KuEt6R6vwmN09f",
168
+ id_stripe: "",
155
169
  id_role: 0,
156
170
  active: 1,
157
- is_retailer: 0,
171
+ is_retailer: 1,
158
172
  membership: {
159
- id: 38,
160
- start_date: "2022-01-18T17:25:35.000Z",
161
- end_date: "2023-01-18T17:25:35.000Z",
162
- planID: 8,
163
- plan: "prod_KtlhECVSFG2iro",
164
- name: "Plan Pro",
165
- user_limit: "20",
166
- products_limit: "5000",
173
+ id: 24,
174
+ start_date: "2021-11-23T03:35:50.000Z",
175
+ end_date: "2022-11-23T03:35:50.000Z",
176
+ planID: 9,
177
+ plan: "prod_KtlkzZVGq6bRTO",
178
+ name: "Plan Enterprise Full",
179
+ user_limit: "30",
180
+ products_limit: "10000",
167
181
  type: "Enterprise",
168
182
  },
169
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1655613379760",
183
+ src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1655616370073",
170
184
  },
171
185
  };
@@ -944,22 +944,14 @@ export const ProviderProductEdition = ({
944
944
 
945
945
  const evaluationComplete = (tab) => {
946
946
  const concept = getConcept(tab);
947
- console.log(origin[concept], "origin[concept]");
948
947
  let serv = servicesData.filter((item) => item.service === concept);
949
948
  if (
950
- ["RequestWithContentoh", "RequestWithoutContentoh"].includes(
951
- origin[concept]
952
- )
949
+ ["RequestWithContentoh", "RequestWithoutContentoh"].includes(origin[tab])
953
950
  ) {
954
951
  serv = serv.filter((f) => f.id_retailer === product.retailer_id);
955
952
  }
956
- const approved = user.is_retailer ? "AC" : "AP";
957
- const rejected = user.is_retailer ? "RC" : "RP";
958
- return (
959
- serv.filter(
960
- (item) => item.status === approved || item.status === rejected
961
- ).length === serv.length
962
- );
953
+ const statusArray = user.is_retailer ? ["AC", "RC"] : ["AP", "RP", "AC"];
954
+ return serv.every((item) => statusArray.includes(item.status));
963
955
  };
964
956
 
965
957
  const downloadImages = () => {
@@ -1089,7 +1081,9 @@ export const ProviderProductEdition = ({
1089
1081
  // }, [services, servicesData, activeTab]);
1090
1082
  const confirmStatusComplete = () => {
1091
1083
  const { datasheet_status, description_status, images_status } = product;
1092
- const completionStates = ["AP", "Evaluated", "NS"];
1084
+ const completionStates = user.is_retailer
1085
+ ? ["AC", "Evaluated", "NS"]
1086
+ : ["AP", "Evaluated", "NS"];
1093
1087
  const dsEvaluated = completionStates.includes(datasheet_status);
1094
1088
  const descsEvaluated = completionStates.includes(description_status);
1095
1089
  const imgsEvaluated = completionStates.includes(images_status);
@@ -1230,7 +1224,7 @@ export const ProviderProductEdition = ({
1230
1224
  showValidationButtons={isRevision() && getSectionStatus()}
1231
1225
  approve={() => {
1232
1226
  if (
1233
- origin[getConcept(activeTab)] === "RequestWithoutContentoh" &&
1227
+ origin[activeTab] === "RequestWithoutContentoh" &&
1234
1228
  !user.is_retailer &&
1235
1229
  (!product.id_order || !product.orderId)
1236
1230
  ) {
@@ -1263,7 +1257,7 @@ export const ProviderProductEdition = ({
1263
1257
  }}
1264
1258
  reject={() => {
1265
1259
  if (
1266
- origin[getConcept(activeTab)] === "RequestWithoutContentoh" &&
1260
+ origin[activeTab] === "RequestWithoutContentoh" &&
1267
1261
  !user.is_retailer &&
1268
1262
  (!product.id_order || !product.orderId)
1269
1263
  ) {