contentoh-components-library 21.3.56 → 21.3.58
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.
- package/dist/components/pages/Dashboard/Dashboard.stories.js +38 -45
- package/dist/components/pages/Dashboard/index.js +8 -4
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +23 -23
- package/dist/components/pages/RetailerProductEdition/index.js +38 -39
- package/package.json +1 -1
- package/src/components/pages/Dashboard/Dashboard.stories.js +38 -47
- package/src/components/pages/Dashboard/index.js +4 -3
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +26 -26
- package/src/components/pages/RetailerProductEdition/index.js +37 -37
|
@@ -27,64 +27,57 @@ var DashboardDeafult = Template.bind({});
|
|
|
27
27
|
exports.DashboardDeafult = DashboardDeafult;
|
|
28
28
|
DashboardDeafult.args = {
|
|
29
29
|
user: {
|
|
30
|
-
id_user:
|
|
31
|
-
name: "
|
|
32
|
-
last_name: "
|
|
33
|
-
email: "
|
|
34
|
-
position: "
|
|
35
|
-
telephone: "
|
|
30
|
+
id_user: 37,
|
|
31
|
+
name: "José",
|
|
32
|
+
last_name: "Castañeda",
|
|
33
|
+
email: "ismael97lopez@gmail.com",
|
|
34
|
+
position: "Auditor",
|
|
35
|
+
telephone: "",
|
|
36
36
|
country: "México",
|
|
37
|
-
id_company:
|
|
38
|
-
id_cognito: "
|
|
37
|
+
id_company: 2,
|
|
38
|
+
id_cognito: "9a213128-6482-4c16-a4b6-6e64f225b1bd",
|
|
39
39
|
birth_Date: null,
|
|
40
|
-
about_me:
|
|
41
|
-
zip_code:
|
|
42
|
-
address:
|
|
43
|
-
job:
|
|
44
|
-
id_stripe:
|
|
45
|
-
id_role:
|
|
40
|
+
about_me: "",
|
|
41
|
+
zip_code: "",
|
|
42
|
+
address: "",
|
|
43
|
+
job: "",
|
|
44
|
+
id_stripe: "",
|
|
45
|
+
id_role: 6,
|
|
46
46
|
active: 1,
|
|
47
47
|
is_retailer: 0,
|
|
48
48
|
email_notify: 1,
|
|
49
49
|
is_user_tech: null,
|
|
50
50
|
membership: {
|
|
51
|
-
id:
|
|
52
|
-
start_date: "
|
|
53
|
-
end_date: "
|
|
54
|
-
planID:
|
|
55
|
-
plan: "
|
|
56
|
-
name: "Plan
|
|
57
|
-
user_limit: "
|
|
58
|
-
products_limit: "
|
|
59
|
-
type: "
|
|
51
|
+
id: 2,
|
|
52
|
+
start_date: "2021-11-05T02:35:12.000Z",
|
|
53
|
+
end_date: "2022-11-05T02:34:49.000Z",
|
|
54
|
+
planID: 1,
|
|
55
|
+
plan: "prod_KtkvuFFLpOdP6e",
|
|
56
|
+
name: "Plan Free",
|
|
57
|
+
user_limit: "1",
|
|
58
|
+
products_limit: "3",
|
|
59
|
+
type: "PyMES"
|
|
60
60
|
},
|
|
61
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
61
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-37/37.png?1684953973972"
|
|
62
62
|
},
|
|
63
63
|
company: {
|
|
64
|
-
id_company:
|
|
65
|
-
trade_name: "
|
|
66
|
-
company_name: "
|
|
67
|
-
rfc: "
|
|
68
|
-
adress: "
|
|
69
|
-
about_company:
|
|
70
|
-
telephone:
|
|
71
|
-
web_site:
|
|
72
|
-
zip_code:
|
|
64
|
+
id_company: 1,
|
|
65
|
+
trade_name: "GRUPO BRAHMA",
|
|
66
|
+
company_name: "GRUPO BRAHMA",
|
|
67
|
+
rfc: "XAXX010101000",
|
|
68
|
+
adress: "AA",
|
|
69
|
+
about_company: "",
|
|
70
|
+
telephone: "",
|
|
71
|
+
web_site: "",
|
|
72
|
+
zip_code: "",
|
|
73
73
|
email: null,
|
|
74
|
-
social_link:
|
|
74
|
+
social_link: "",
|
|
75
75
|
is_retailer: 0,
|
|
76
|
-
financedRetailers: [{
|
|
77
|
-
id: 70,
|
|
78
|
-
name: "Bodega Aurrera",
|
|
79
|
-
country: "México",
|
|
80
|
-
id_region: 1,
|
|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251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2ODQ5NTkyMzcsImlhdCI6MTY4NDk1NTYzOCwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.ALvhpSGVv34JV8vLSg0CznmsIzRMJ_BFcmDI4qYXzr0qwgLLihon0M0xmODMhIHKcZK4jODC01guliB6fTPoCb8kfPHrBgLnHMBU8PxU1Fcc2EqF5U8lh4fJK6Mc7kiJ4lCreKJL3kT_1ytC-7FdRAlhNXzuJW6aMQQ785ODQ8-1RtHKW6U_b9x88-WFxjltEKuw734LGBSkz9iKZSumNBJBP8HTMgwOgmRTJ6lR-hPsujvl7aF3maXhftpk2fI8S_FzjVRMsxY3T8hQHIXEYwQUv-fC5SPOgc8XDuAp18MKfi0qkU1EYHQahC0qZmvgVGWEDcu5D36Xj0as4iAiFQ"
|
|
90
83
|
};
|
|
@@ -32,7 +32,7 @@ var _axios = _interopRequireDefault(require("axios"));
|
|
|
32
32
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
33
|
|
|
34
34
|
var Dashboard = function Dashboard(_ref) {
|
|
35
|
-
var _metricsData$;
|
|
35
|
+
var _company$financedReta, _metricsData$;
|
|
36
36
|
|
|
37
37
|
var jwt = _ref.jwt,
|
|
38
38
|
user = _ref.user,
|
|
@@ -137,6 +137,10 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
137
137
|
totalCount = _useState32[0],
|
|
138
138
|
setTotalCount = _useState32[1];
|
|
139
139
|
|
|
140
|
+
var _useState33 = (0, _react.useState)((company === null || company === void 0 ? void 0 : (_company$financedReta = company.financedRetailers) === null || _company$financedReta === void 0 ? void 0 : _company$financedReta.length) > 0),
|
|
141
|
+
_useState34 = (0, _slicedToArray2.default)(_useState33, 1),
|
|
142
|
+
isProviderFinanced = _useState34[0];
|
|
143
|
+
|
|
140
144
|
var loadProductVersions = /*#__PURE__*/function () {
|
|
141
145
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(queryObject) {
|
|
142
146
|
var keys, string, query, endpoint, response;
|
|
@@ -201,7 +205,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
201
205
|
parsed = JSON.parse(retailersResponse.data.body).data;
|
|
202
206
|
retailers = Object.values(parsed);
|
|
203
207
|
|
|
204
|
-
if (isRetailer) {
|
|
208
|
+
if (isRetailer || isProviderFinanced) {
|
|
205
209
|
retailersValid = company.retailers.map(function (e) {
|
|
206
210
|
return e.id;
|
|
207
211
|
});
|
|
@@ -455,7 +459,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
455
459
|
parameterArray: datesRange,
|
|
456
460
|
setParameterArray: setDatesRange,
|
|
457
461
|
isSingleSelect: true
|
|
458
|
-
}),
|
|
462
|
+
}), !isProviderFinanced && (providers === null || providers === void 0 ? void 0 : providers.length) > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomSelect.CustomSelect, {
|
|
459
463
|
showFilterString: true,
|
|
460
464
|
showSearchBar: true,
|
|
461
465
|
options: providers,
|
|
@@ -475,7 +479,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
475
479
|
parameterArray: categoryId,
|
|
476
480
|
setParameterArray: setCategoryId,
|
|
477
481
|
defaultOption: "Todas las categor\xEDas"
|
|
478
|
-
}),
|
|
482
|
+
}), !isProviderFinanced && (retailers === null || retailers === void 0 ? void 0 : retailers.length) > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomSelect.CustomSelect, {
|
|
479
483
|
showFilterString: true,
|
|
480
484
|
showSearchBar: true,
|
|
481
485
|
options: retailers,
|
|
@@ -38,12 +38,12 @@ RetailerProductEditionDefault.args = {
|
|
|
38
38
|
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhNmM0ZDNkNi0yNGE0LTQxZDQtYWQwZi1kMDg3NDM4YW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ected = {
|
|
40
40
|
orderId: 15160,
|
|
41
|
-
status: "
|
|
42
|
-
datasheet_status: "
|
|
41
|
+
status: "RA",
|
|
42
|
+
datasheet_status: "RA",
|
|
43
43
|
prio: "none",
|
|
44
44
|
version: 7,
|
|
45
|
-
description_status: "
|
|
46
|
-
images_status: "
|
|
45
|
+
description_status: "RA",
|
|
46
|
+
images_status: "RA",
|
|
47
47
|
brand: null,
|
|
48
48
|
retailerOrder: 1,
|
|
49
49
|
missing: {
|
|
@@ -51,31 +51,31 @@ RetailerProductEditionDefault.args = {
|
|
|
51
51
|
descriptions: null,
|
|
52
52
|
images: null
|
|
53
53
|
}
|
|
54
|
-
}, (0, _defineProperty2.default)(_productSelected, "orderId", 14606), (0, _defineProperty2.default)(_productSelected, "status", "
|
|
54
|
+
}, (0, _defineProperty2.default)(_productSelected, "orderId", 14606), (0, _defineProperty2.default)(_productSelected, "status", "RA"), (0, _defineProperty2.default)(_productSelected, "datasheet_status", "RA"), (0, _defineProperty2.default)(_productSelected, "prio", "none"), (0, _defineProperty2.default)(_productSelected, "version", 3), (0, _defineProperty2.default)(_productSelected, "description_status", "RA"), (0, _defineProperty2.default)(_productSelected, "images_status", "RA"), (0, _defineProperty2.default)(_productSelected, "statusByRetailer", {
|
|
55
55
|
4: {
|
|
56
|
-
datasheet: "AC",
|
|
57
|
-
description: "AC",
|
|
58
|
-
images: "AC"
|
|
56
|
+
datasheet: "RA/AC",
|
|
57
|
+
description: "RA/AC",
|
|
58
|
+
images: "RA/AC"
|
|
59
59
|
},
|
|
60
60
|
5: {
|
|
61
|
-
datasheet: "AC",
|
|
62
|
-
description: "AC",
|
|
63
|
-
images: "AC"
|
|
61
|
+
datasheet: "RA/AC",
|
|
62
|
+
description: "RA/AC",
|
|
63
|
+
images: "RA/AC"
|
|
64
64
|
},
|
|
65
65
|
6: {
|
|
66
|
-
description: "AC",
|
|
67
|
-
images: "AC",
|
|
68
|
-
datasheet: "AC"
|
|
66
|
+
description: "RA/AC",
|
|
67
|
+
images: "RA/AC",
|
|
68
|
+
datasheet: "RA/AC"
|
|
69
69
|
},
|
|
70
70
|
12: {
|
|
71
|
-
datasheet: "AC",
|
|
72
|
-
description: "AC",
|
|
73
|
-
images: "AC"
|
|
71
|
+
datasheet: "RA/AC",
|
|
72
|
+
description: "RA/AC",
|
|
73
|
+
images: "RA/AC"
|
|
74
74
|
},
|
|
75
75
|
17: {
|
|
76
|
-
datasheet: "AC",
|
|
77
|
-
description: "AC",
|
|
78
|
-
images: "AC"
|
|
76
|
+
datasheet: "RA/AC",
|
|
77
|
+
description: "RA/AC",
|
|
78
|
+
images: "RA/AC"
|
|
79
79
|
}
|
|
80
80
|
}), (0, _defineProperty2.default)(_productSelected, "article", {
|
|
81
81
|
category: "Puertas y Ventanas|Molduras|Molduras Madera Blanda",
|
|
@@ -102,9 +102,9 @@ RetailerProductEditionDefault.args = {
|
|
|
102
102
|
name: "The Home Depot Merchants"
|
|
103
103
|
}]), (0, _defineProperty2.default)(_productSelected, "statusByRetailer", {
|
|
104
104
|
58: {
|
|
105
|
-
datasheet: "
|
|
106
|
-
description: "
|
|
107
|
-
images: "
|
|
105
|
+
datasheet: "RA",
|
|
106
|
+
description: "RA",
|
|
107
|
+
images: "RA"
|
|
108
108
|
}
|
|
109
109
|
}), _productSelected),
|
|
110
110
|
location: {
|
|
@@ -709,7 +709,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
709
709
|
break;
|
|
710
710
|
|
|
711
711
|
case 12:
|
|
712
|
-
arr = ["AS", "CA", "RC", "RA", "RP", "RCA"];
|
|
712
|
+
arr = ["PA", "AS", "CA", "RC", "RA", "RP", "RCA"];
|
|
713
713
|
return _context6.abrupt("break", 20);
|
|
714
714
|
|
|
715
715
|
case 14:
|
|
@@ -1790,8 +1790,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1790
1790
|
|
|
1791
1791
|
var validateAll = /*#__PURE__*/function () {
|
|
1792
1792
|
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(result) {
|
|
1793
|
-
var
|
|
1794
|
-
|
|
1793
|
+
var evaluationArray, sendAll, conceptArray, productTemp;
|
|
1795
1794
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1796
1795
|
while (1) {
|
|
1797
1796
|
switch (_context15.prev = _context15.next) {
|
|
@@ -1818,46 +1817,46 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1818
1817
|
return _context15.abrupt("break", 14);
|
|
1819
1818
|
|
|
1820
1819
|
case 14:
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
// }
|
|
1840
|
-
// });
|
|
1841
|
-
// await Promise.all(evaluationArray);
|
|
1842
|
-
(_conceptArray = conceptArray) === null || _conceptArray === void 0 ? void 0 : _conceptArray.forEach(function (concept) {
|
|
1843
|
-
var _product$id_order;
|
|
1844
|
-
|
|
1845
|
-
var data = {
|
|
1846
|
-
articleId: product.article.id_article,
|
|
1847
|
-
orderId: (_product$id_order = product.id_order) !== null && _product$id_order !== void 0 ? _product$id_order : product.orderId,
|
|
1848
|
-
concept: concept,
|
|
1849
|
-
evalStatus: product["".concat(concept, "_status")]
|
|
1850
|
-
};
|
|
1851
|
-
sendAll.push(_axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1852
|
-
headers: {
|
|
1853
|
-
Authorization: token
|
|
1854
|
-
}
|
|
1855
|
-
}));
|
|
1820
|
+
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1821
|
+
if (conceptArray.includes(ret.service)) {
|
|
1822
|
+
var _product$id_order;
|
|
1823
|
+
|
|
1824
|
+
var data = {
|
|
1825
|
+
articleId: product.article.id_article,
|
|
1826
|
+
orderId: (_product$id_order = product.id_order) !== null && _product$id_order !== void 0 ? _product$id_order : product.orderId,
|
|
1827
|
+
concept: ret.service,
|
|
1828
|
+
result: result,
|
|
1829
|
+
evalStatus: product["".concat(ret.service, "_status")],
|
|
1830
|
+
retailerId: ret.id_retailer
|
|
1831
|
+
};
|
|
1832
|
+
evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1833
|
+
headers: {
|
|
1834
|
+
Authorization: token
|
|
1835
|
+
}
|
|
1836
|
+
}));
|
|
1837
|
+
}
|
|
1856
1838
|
});
|
|
1857
1839
|
_context15.next = 17;
|
|
1858
|
-
return Promise.all(
|
|
1840
|
+
return Promise.all(evaluationArray);
|
|
1859
1841
|
|
|
1860
1842
|
case 17:
|
|
1843
|
+
//We comment this part of the code because it does not match with the correct flow
|
|
1844
|
+
// conceptArray?.forEach((concept) => {
|
|
1845
|
+
// let data = {
|
|
1846
|
+
// articleId: product.article.id_article,
|
|
1847
|
+
// orderId: product.id_order ?? product.orderId,
|
|
1848
|
+
// concept,
|
|
1849
|
+
// evalStatus: product[`${concept}_status`],
|
|
1850
|
+
// };
|
|
1851
|
+
// sendAll.push(
|
|
1852
|
+
// axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
1853
|
+
// headers: {
|
|
1854
|
+
// Authorization: token,
|
|
1855
|
+
// },
|
|
1856
|
+
// })
|
|
1857
|
+
// );
|
|
1858
|
+
// });
|
|
1859
|
+
// await Promise.all(sendAll);
|
|
1861
1860
|
productTemp = product;
|
|
1862
1861
|
productTemp.status = "".concat(result, "A");
|
|
1863
1862
|
productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result, "A");
|
package/package.json
CHANGED
|
@@ -9,68 +9,59 @@ const Template = (args) => <Dashboard {...args} />;
|
|
|
9
9
|
export const DashboardDeafult = Template.bind({});
|
|
10
10
|
DashboardDeafult.args = {
|
|
11
11
|
user: {
|
|
12
|
-
id_user:
|
|
13
|
-
name: "
|
|
14
|
-
last_name: "
|
|
15
|
-
email: "
|
|
16
|
-
position: "
|
|
17
|
-
telephone: "
|
|
12
|
+
id_user: 37,
|
|
13
|
+
name: "José",
|
|
14
|
+
last_name: "Castañeda",
|
|
15
|
+
email: "ismael97lopez@gmail.com",
|
|
16
|
+
position: "Auditor",
|
|
17
|
+
telephone: "",
|
|
18
18
|
country: "México",
|
|
19
|
-
id_company:
|
|
20
|
-
id_cognito: "
|
|
19
|
+
id_company: 2,
|
|
20
|
+
id_cognito: "9a213128-6482-4c16-a4b6-6e64f225b1bd",
|
|
21
21
|
birth_Date: null,
|
|
22
|
-
about_me:
|
|
23
|
-
zip_code:
|
|
24
|
-
address:
|
|
25
|
-
job:
|
|
26
|
-
id_stripe:
|
|
27
|
-
id_role:
|
|
22
|
+
about_me: "",
|
|
23
|
+
zip_code: "",
|
|
24
|
+
address: "",
|
|
25
|
+
job: "",
|
|
26
|
+
id_stripe: "",
|
|
27
|
+
id_role: 6,
|
|
28
28
|
active: 1,
|
|
29
29
|
is_retailer: 0,
|
|
30
30
|
email_notify: 1,
|
|
31
31
|
is_user_tech: null,
|
|
32
32
|
membership: {
|
|
33
|
-
id:
|
|
34
|
-
start_date: "
|
|
35
|
-
end_date: "
|
|
36
|
-
planID:
|
|
37
|
-
plan: "
|
|
38
|
-
name: "Plan
|
|
39
|
-
user_limit: "
|
|
40
|
-
products_limit: "
|
|
41
|
-
type: "
|
|
33
|
+
id: 2,
|
|
34
|
+
start_date: "2021-11-05T02:35:12.000Z",
|
|
35
|
+
end_date: "2022-11-05T02:34:49.000Z",
|
|
36
|
+
planID: 1,
|
|
37
|
+
plan: "prod_KtkvuFFLpOdP6e",
|
|
38
|
+
name: "Plan Free",
|
|
39
|
+
user_limit: "1",
|
|
40
|
+
products_limit: "3",
|
|
41
|
+
type: "PyMES",
|
|
42
42
|
},
|
|
43
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
43
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-37/37.png?1684953973972",
|
|
44
44
|
},
|
|
45
45
|
company: {
|
|
46
|
-
id_company:
|
|
47
|
-
trade_name: "
|
|
48
|
-
company_name: "
|
|
49
|
-
rfc: "
|
|
50
|
-
adress: "
|
|
51
|
-
about_company:
|
|
52
|
-
telephone:
|
|
53
|
-
web_site:
|
|
54
|
-
zip_code:
|
|
46
|
+
id_company: 1,
|
|
47
|
+
trade_name: "GRUPO BRAHMA",
|
|
48
|
+
company_name: "GRUPO BRAHMA",
|
|
49
|
+
rfc: "XAXX010101000",
|
|
50
|
+
adress: "AA",
|
|
51
|
+
about_company: "",
|
|
52
|
+
telephone: "",
|
|
53
|
+
web_site: "",
|
|
54
|
+
zip_code: "",
|
|
55
55
|
email: null,
|
|
56
|
-
social_link:
|
|
56
|
+
social_link: "",
|
|
57
57
|
is_retailer: 0,
|
|
58
|
-
financedRetailers: [
|
|
59
|
-
{
|
|
60
|
-
id: 70,
|
|
61
|
-
name: "Bodega Aurrera",
|
|
62
|
-
country: "México",
|
|
63
|
-
id_region: 1,
|
|
64
|
-
active: 1,
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
58
|
retailers: [
|
|
68
59
|
{
|
|
69
|
-
id:
|
|
70
|
-
name:
|
|
71
|
-
country:
|
|
60
|
+
id: null,
|
|
61
|
+
name: null,
|
|
62
|
+
country: null,
|
|
72
63
|
},
|
|
73
64
|
],
|
|
74
65
|
},
|
|
75
|
-
jwt: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
66
|
+
jwt: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdW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8hQHIXEYwQUv-fC5SPOgc8XDuAp18MKfi0qkU1EYHQahC0qZmvgVGWEDcu5D36Xj0as4iAiFQ",
|
|
76
67
|
};
|
|
@@ -39,6 +39,7 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
39
39
|
];
|
|
40
40
|
const [applicantsFilter, setApplicantsFilter] = useState([]);
|
|
41
41
|
const [totalCount, setTotalCount] = useState(0);
|
|
42
|
+
const [isProviderFinanced] = useState(company?.financedRetailers?.length > 0);
|
|
42
43
|
|
|
43
44
|
const loadProductVersions = async (queryObject) => {
|
|
44
45
|
const keys = Object.keys(queryObject);
|
|
@@ -70,7 +71,7 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
70
71
|
);
|
|
71
72
|
const parsed = JSON.parse(retailersResponse.data.body).data;
|
|
72
73
|
let retailers = Object.values(parsed);
|
|
73
|
-
if (isRetailer) {
|
|
74
|
+
if (isRetailer || isProviderFinanced) {
|
|
74
75
|
const retailersValid = company.retailers.map((e) => e.id);
|
|
75
76
|
retailers = retailers.filter((value) =>
|
|
76
77
|
retailersValid.includes(value.id)
|
|
@@ -252,7 +253,7 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
252
253
|
setParameterArray={setDatesRange}
|
|
253
254
|
isSingleSelect
|
|
254
255
|
/>
|
|
255
|
-
{
|
|
256
|
+
{!isProviderFinanced && providers?.length > 1 && (
|
|
256
257
|
<CustomSelect
|
|
257
258
|
showFilterString={true}
|
|
258
259
|
showSearchBar={true}
|
|
@@ -276,7 +277,7 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
276
277
|
setParameterArray={setCategoryId}
|
|
277
278
|
defaultOption="Todas las categorías"
|
|
278
279
|
/>
|
|
279
|
-
{
|
|
280
|
+
{!isProviderFinanced && retailers?.length > 1 && (
|
|
280
281
|
<CustomSelect
|
|
281
282
|
showFilterString={true}
|
|
282
283
|
showSearchBar={true}
|
|
@@ -19,12 +19,12 @@ RetailerProductEditionDefault.args = {
|
|
|
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pI1ByptX3__UoTiZklnTXwIxM4JdU7yuhXLznaEH8NOSd2Jw-CV6FCUbYBHlnRYBQg7B5mwyVKtDQm6QpRgBTBPCvljJJpFjRKUcnon8WZiFXx1qVbkWPt2vCT1TZqqoSLdlP6lA",
|
|
20
20
|
productSelected: {
|
|
21
21
|
orderId: 15160,
|
|
22
|
-
status: "
|
|
23
|
-
datasheet_status: "
|
|
22
|
+
status: "RA",
|
|
23
|
+
datasheet_status: "RA",
|
|
24
24
|
prio: "none",
|
|
25
25
|
version: 7,
|
|
26
|
-
description_status: "
|
|
27
|
-
images_status: "
|
|
26
|
+
description_status: "RA",
|
|
27
|
+
images_status: "RA",
|
|
28
28
|
brand: null,
|
|
29
29
|
retailerOrder: 1,
|
|
30
30
|
missing: {
|
|
@@ -33,37 +33,37 @@ RetailerProductEditionDefault.args = {
|
|
|
33
33
|
images: null,
|
|
34
34
|
},
|
|
35
35
|
orderId: 14606,
|
|
36
|
-
status: "
|
|
37
|
-
datasheet_status: "
|
|
36
|
+
status: "RA",
|
|
37
|
+
datasheet_status: "RA",
|
|
38
38
|
prio: "none",
|
|
39
39
|
version: 3,
|
|
40
|
-
description_status: "
|
|
41
|
-
images_status: "
|
|
40
|
+
description_status: "RA",
|
|
41
|
+
images_status: "RA",
|
|
42
42
|
statusByRetailer: {
|
|
43
43
|
4: {
|
|
44
|
-
datasheet: "AC",
|
|
45
|
-
description: "AC",
|
|
46
|
-
images: "AC",
|
|
44
|
+
datasheet: "RA/AC",
|
|
45
|
+
description: "RA/AC",
|
|
46
|
+
images: "RA/AC",
|
|
47
47
|
},
|
|
48
48
|
5: {
|
|
49
|
-
datasheet: "AC",
|
|
50
|
-
description: "AC",
|
|
51
|
-
images: "AC",
|
|
49
|
+
datasheet: "RA/AC",
|
|
50
|
+
description: "RA/AC",
|
|
51
|
+
images: "RA/AC",
|
|
52
52
|
},
|
|
53
53
|
6: {
|
|
54
|
-
description: "AC",
|
|
55
|
-
images: "AC",
|
|
56
|
-
datasheet: "AC",
|
|
54
|
+
description: "RA/AC",
|
|
55
|
+
images: "RA/AC",
|
|
56
|
+
datasheet: "RA/AC",
|
|
57
57
|
},
|
|
58
58
|
12: {
|
|
59
|
-
datasheet: "AC",
|
|
60
|
-
description: "AC",
|
|
61
|
-
images: "AC",
|
|
59
|
+
datasheet: "RA/AC",
|
|
60
|
+
description: "RA/AC",
|
|
61
|
+
images: "RA/AC",
|
|
62
62
|
},
|
|
63
63
|
17: {
|
|
64
|
-
datasheet: "AC",
|
|
65
|
-
description: "AC",
|
|
66
|
-
images: "AC",
|
|
64
|
+
datasheet: "RA/AC",
|
|
65
|
+
description: "RA/AC",
|
|
66
|
+
images: "RA/AC",
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
article: {
|
|
@@ -96,9 +96,9 @@ RetailerProductEditionDefault.args = {
|
|
|
96
96
|
],
|
|
97
97
|
statusByRetailer: {
|
|
98
98
|
58: {
|
|
99
|
-
datasheet: "
|
|
100
|
-
description: "
|
|
101
|
-
images: "
|
|
99
|
+
datasheet: "RA",
|
|
100
|
+
description: "RA",
|
|
101
|
+
images: "RA",
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
104
|
},
|
|
@@ -337,7 +337,7 @@ export const RetailerProductEdition = ({
|
|
|
337
337
|
switch (user.id_role) {
|
|
338
338
|
case 7:
|
|
339
339
|
case 8:
|
|
340
|
-
arr = ["AS", "CA", "RC", "RA", "RP", "RCA"];
|
|
340
|
+
arr = ["PA", "AS", "CA", "RC", "RA", "RP", "RCA"];
|
|
341
341
|
break;
|
|
342
342
|
case 4:
|
|
343
343
|
case 5:
|
|
@@ -1208,46 +1208,46 @@ export const RetailerProductEdition = ({
|
|
|
1208
1208
|
break;
|
|
1209
1209
|
}
|
|
1210
1210
|
|
|
1211
|
+
servicesData?.forEach((ret) => {
|
|
1212
|
+
if (conceptArray.includes(ret.service)) {
|
|
1213
|
+
let data = {
|
|
1214
|
+
articleId: product.article.id_article,
|
|
1215
|
+
orderId: product.id_order ?? product.orderId,
|
|
1216
|
+
concept: ret.service,
|
|
1217
|
+
result: result,
|
|
1218
|
+
evalStatus: product[`${ret.service}_status`],
|
|
1219
|
+
retailerId: ret.id_retailer,
|
|
1220
|
+
};
|
|
1221
|
+
evaluationArray.push(
|
|
1222
|
+
axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
1223
|
+
headers: {
|
|
1224
|
+
Authorization: token,
|
|
1225
|
+
},
|
|
1226
|
+
})
|
|
1227
|
+
);
|
|
1228
|
+
}
|
|
1229
|
+
});
|
|
1230
|
+
await Promise.all(evaluationArray);
|
|
1231
|
+
|
|
1211
1232
|
//We comment this part of the code because it does not match with the correct flow
|
|
1212
1233
|
|
|
1213
|
-
//
|
|
1214
|
-
//
|
|
1215
|
-
//
|
|
1216
|
-
//
|
|
1217
|
-
//
|
|
1218
|
-
//
|
|
1219
|
-
//
|
|
1220
|
-
//
|
|
1221
|
-
//
|
|
1222
|
-
//
|
|
1223
|
-
//
|
|
1224
|
-
//
|
|
1225
|
-
//
|
|
1226
|
-
//
|
|
1227
|
-
// },
|
|
1228
|
-
// })
|
|
1229
|
-
// );
|
|
1230
|
-
// }
|
|
1234
|
+
// conceptArray?.forEach((concept) => {
|
|
1235
|
+
// let data = {
|
|
1236
|
+
// articleId: product.article.id_article,
|
|
1237
|
+
// orderId: product.id_order ?? product.orderId,
|
|
1238
|
+
// concept,
|
|
1239
|
+
// evalStatus: product[`${concept}_status`],
|
|
1240
|
+
// };
|
|
1241
|
+
// sendAll.push(
|
|
1242
|
+
// axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
1243
|
+
// headers: {
|
|
1244
|
+
// Authorization: token,
|
|
1245
|
+
// },
|
|
1246
|
+
// })
|
|
1247
|
+
// );
|
|
1231
1248
|
// });
|
|
1249
|
+
// await Promise.all(sendAll);
|
|
1232
1250
|
|
|
1233
|
-
// await Promise.all(evaluationArray);
|
|
1234
|
-
|
|
1235
|
-
conceptArray?.forEach((concept) => {
|
|
1236
|
-
let data = {
|
|
1237
|
-
articleId: product.article.id_article,
|
|
1238
|
-
orderId: product.id_order ?? product.orderId,
|
|
1239
|
-
concept,
|
|
1240
|
-
evalStatus: product[`${concept}_status`],
|
|
1241
|
-
};
|
|
1242
|
-
sendAll.push(
|
|
1243
|
-
axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
1244
|
-
headers: {
|
|
1245
|
-
Authorization: token,
|
|
1246
|
-
},
|
|
1247
|
-
})
|
|
1248
|
-
);
|
|
1249
|
-
});
|
|
1250
|
-
await Promise.all(sendAll);
|
|
1251
1251
|
const productTemp = product;
|
|
1252
1252
|
productTemp.status = `${result}A`;
|
|
1253
1253
|
productTemp.datasheet_status =
|