contentoh-components-library 21.3.59 → 21.3.61
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 +25 -33
- package/dist/components/pages/RetailerProductEdition/index.js +19 -37
- 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 +24 -32
- package/src/components/pages/RetailerProductEdition/index.js +2 -21
|
@@ -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,
|
|
@@ -33,39 +33,24 @@ RetailerProductEditionDefault.args = {
|
|
|
33
33
|
},
|
|
34
34
|
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhNmM0ZDNkNi0yNGE0LTQxZDQtYWQwZi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|
productSelected: {
|
|
36
|
-
orderId:
|
|
37
|
-
status: "
|
|
38
|
-
datasheet_status: "
|
|
36
|
+
orderId: 15160,
|
|
37
|
+
status: "SAC",
|
|
38
|
+
datasheet_status: "SAC",
|
|
39
39
|
prio: "none",
|
|
40
|
-
version:
|
|
41
|
-
description_status: "
|
|
42
|
-
images_status: "
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
6: {
|
|
55
|
-
description: "RA/AC",
|
|
56
|
-
images: "RA/AC",
|
|
57
|
-
datasheet: "RA/AC"
|
|
58
|
-
},
|
|
59
|
-
12: {
|
|
60
|
-
datasheet: "RA/AC",
|
|
61
|
-
description: "RA/AC",
|
|
62
|
-
images: "RA/AC"
|
|
63
|
-
},
|
|
64
|
-
17: {
|
|
65
|
-
datasheet: "RA/AC",
|
|
66
|
-
description: "RA/AC",
|
|
67
|
-
images: "RA/AC"
|
|
68
|
-
}
|
|
40
|
+
version: 7,
|
|
41
|
+
description_status: "SAC",
|
|
42
|
+
images_status: "SAC",
|
|
43
|
+
brand: null,
|
|
44
|
+
retailerOrder: 1,
|
|
45
|
+
missing: {
|
|
46
|
+
datasheet: null,
|
|
47
|
+
descriptions: null,
|
|
48
|
+
images: null
|
|
49
|
+
},
|
|
50
|
+
services: {
|
|
51
|
+
datasheets: 1,
|
|
52
|
+
descriptions: 1,
|
|
53
|
+
images: 1
|
|
69
54
|
},
|
|
70
55
|
article: {
|
|
71
56
|
category: "Puertas y Ventanas|Molduras|Molduras Madera Blanda",
|
|
@@ -91,7 +76,14 @@ RetailerProductEditionDefault.args = {
|
|
|
91
76
|
}, {
|
|
92
77
|
id: 68,
|
|
93
78
|
name: "The Home Depot Merchants"
|
|
94
|
-
}]
|
|
79
|
+
}],
|
|
80
|
+
statusByRetailer: {
|
|
81
|
+
58: {
|
|
82
|
+
datasheet: "SAC",
|
|
83
|
+
description: "SAC",
|
|
84
|
+
images: "SAC"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
95
87
|
},
|
|
96
88
|
location: {
|
|
97
89
|
product: {
|
|
@@ -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,7 +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 evaluationArray,
|
|
1793
|
+
var evaluationArray, conceptArray, productTemp;
|
|
1794
1794
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1795
1795
|
while (1) {
|
|
1796
1796
|
switch (_context15.prev = _context15.next) {
|
|
@@ -1798,25 +1798,24 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1798
1798
|
_context15.prev = 0;
|
|
1799
1799
|
setLoading(true);
|
|
1800
1800
|
evaluationArray = [];
|
|
1801
|
-
sendAll = [];
|
|
1802
1801
|
conceptArray = [];
|
|
1803
1802
|
_context15.t0 = user.id_role;
|
|
1804
|
-
_context15.next = _context15.t0 === 4 ?
|
|
1803
|
+
_context15.next = _context15.t0 === 4 ? 7 : _context15.t0 === 5 ? 9 : 11;
|
|
1805
1804
|
break;
|
|
1806
1805
|
|
|
1807
|
-
case
|
|
1806
|
+
case 7:
|
|
1808
1807
|
conceptArray = ["description", "datasheet"];
|
|
1809
|
-
return _context15.abrupt("break",
|
|
1808
|
+
return _context15.abrupt("break", 13);
|
|
1810
1809
|
|
|
1811
|
-
case
|
|
1810
|
+
case 9:
|
|
1812
1811
|
conceptArray = ["images"];
|
|
1813
|
-
return _context15.abrupt("break",
|
|
1812
|
+
return _context15.abrupt("break", 13);
|
|
1814
1813
|
|
|
1815
|
-
case
|
|
1814
|
+
case 11:
|
|
1816
1815
|
conceptArray = ["description", "datasheet", "images"];
|
|
1817
|
-
return _context15.abrupt("break",
|
|
1816
|
+
return _context15.abrupt("break", 13);
|
|
1818
1817
|
|
|
1819
|
-
case
|
|
1818
|
+
case 13:
|
|
1820
1819
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1821
1820
|
if (conceptArray.includes(ret.service)) {
|
|
1822
1821
|
var _product$id_order;
|
|
@@ -1836,27 +1835,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1836
1835
|
}));
|
|
1837
1836
|
}
|
|
1838
1837
|
});
|
|
1839
|
-
_context15.next =
|
|
1838
|
+
_context15.next = 16;
|
|
1840
1839
|
return Promise.all(evaluationArray);
|
|
1841
1840
|
|
|
1842
|
-
case
|
|
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);
|
|
1841
|
+
case 16:
|
|
1860
1842
|
productTemp = product;
|
|
1861
1843
|
productTemp.status = "".concat(result, "A");
|
|
1862
1844
|
productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result, "A");
|
|
@@ -1864,24 +1846,24 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1864
1846
|
productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result, "A");
|
|
1865
1847
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1866
1848
|
setProduct(productTemp);
|
|
1867
|
-
_context15.next =
|
|
1849
|
+
_context15.next = 25;
|
|
1868
1850
|
return loadData();
|
|
1869
1851
|
|
|
1870
|
-
case
|
|
1871
|
-
_context15.next =
|
|
1852
|
+
case 25:
|
|
1853
|
+
_context15.next = 30;
|
|
1872
1854
|
break;
|
|
1873
1855
|
|
|
1874
|
-
case
|
|
1875
|
-
_context15.prev =
|
|
1856
|
+
case 27:
|
|
1857
|
+
_context15.prev = 27;
|
|
1876
1858
|
_context15.t1 = _context15["catch"](0);
|
|
1877
1859
|
console.log(_context15.t1);
|
|
1878
1860
|
|
|
1879
|
-
case
|
|
1861
|
+
case 30:
|
|
1880
1862
|
case "end":
|
|
1881
1863
|
return _context15.stop();
|
|
1882
1864
|
}
|
|
1883
1865
|
}
|
|
1884
|
-
}, _callee15, null, [[0,
|
|
1866
|
+
}, _callee15, null, [[0, 27]]);
|
|
1885
1867
|
}));
|
|
1886
1868
|
|
|
1887
1869
|
return function validateAll(_x7) {
|
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.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI3ZjNkZTM4Mi03NWE2LTRlNDAtYTI3NC00YmM5ODg2Nzk0YjYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4NDk1NTYzOCwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2ODQ5NTkyMzcsImlhdCI6MTY4NDk1NTYzOCwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.ALvhpSGVv34JV8vLSg0CznmsIzRMJ_BFcmDI4qYXzr0qwgLLihon0M0xmODMhIHKcZK4jODC01guliB6fTPoCb8kfPHrBgLnHMBU8PxU1Fcc2EqF5U8lh4fJK6Mc7kiJ4lCreKJL3kT_1ytC-7FdRAlhNXzuJW6aMQQ785ODQ8-1RtHKW6U_b9x88-WFxjltEKuw734LGBSkz9iKZSumNBJBP8HTMgwOgmRTJ6lR-hPsujvl7aF3maXhftpk2fI8S_FzjVRMsxY3T8hQHIXEYwQUv-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}
|
|
@@ -18,39 +18,24 @@ RetailerProductEditionDefault.args = {
|
|
|
18
18
|
token:
|
|
19
19
|
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhNmM0ZDNkNi0yNGE0LTQxZDQtYWQwZi1kMDg3NDM4YWI1YjYiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVz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21
|
+
orderId: 15160,
|
|
22
|
+
status: "SAC",
|
|
23
|
+
datasheet_status: "SAC",
|
|
24
24
|
prio: "none",
|
|
25
|
-
version:
|
|
26
|
-
description_status: "
|
|
27
|
-
images_status: "
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
6: {
|
|
40
|
-
description: "RA/AC",
|
|
41
|
-
images: "RA/AC",
|
|
42
|
-
datasheet: "RA/AC",
|
|
43
|
-
},
|
|
44
|
-
12: {
|
|
45
|
-
datasheet: "RA/AC",
|
|
46
|
-
description: "RA/AC",
|
|
47
|
-
images: "RA/AC",
|
|
48
|
-
},
|
|
49
|
-
17: {
|
|
50
|
-
datasheet: "RA/AC",
|
|
51
|
-
description: "RA/AC",
|
|
52
|
-
images: "RA/AC",
|
|
53
|
-
},
|
|
25
|
+
version: 7,
|
|
26
|
+
description_status: "SAC",
|
|
27
|
+
images_status: "SAC",
|
|
28
|
+
brand: null,
|
|
29
|
+
retailerOrder: 1,
|
|
30
|
+
missing: {
|
|
31
|
+
datasheet: null,
|
|
32
|
+
descriptions: null,
|
|
33
|
+
images: null,
|
|
34
|
+
},
|
|
35
|
+
services: {
|
|
36
|
+
datasheets: 1,
|
|
37
|
+
descriptions: 1,
|
|
38
|
+
images: 1,
|
|
54
39
|
},
|
|
55
40
|
article: {
|
|
56
41
|
category: "Puertas y Ventanas|Molduras|Molduras Madera Blanda",
|
|
@@ -80,6 +65,13 @@ RetailerProductEditionDefault.args = {
|
|
|
80
65
|
name: "The Home Depot Merchants",
|
|
81
66
|
},
|
|
82
67
|
],
|
|
68
|
+
statusByRetailer: {
|
|
69
|
+
58: {
|
|
70
|
+
datasheet: "SAC",
|
|
71
|
+
description: "SAC",
|
|
72
|
+
images: "SAC",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
83
75
|
},
|
|
84
76
|
location: {
|
|
85
77
|
product: { articleId: 39290, versionId: 7 },
|
|
@@ -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:
|
|
@@ -1193,7 +1193,6 @@ export const RetailerProductEdition = ({
|
|
|
1193
1193
|
try {
|
|
1194
1194
|
setLoading(true);
|
|
1195
1195
|
const evaluationArray = [];
|
|
1196
|
-
const sendAll = [];
|
|
1197
1196
|
let conceptArray = [];
|
|
1198
1197
|
switch (user.id_role) {
|
|
1199
1198
|
case 4:
|
|
@@ -1227,26 +1226,8 @@ export const RetailerProductEdition = ({
|
|
|
1227
1226
|
);
|
|
1228
1227
|
}
|
|
1229
1228
|
});
|
|
1230
|
-
await Promise.all(evaluationArray);
|
|
1231
1229
|
|
|
1232
|
-
|
|
1233
|
-
|
|
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
|
-
// );
|
|
1248
|
-
// });
|
|
1249
|
-
// await Promise.all(sendAll);
|
|
1230
|
+
await Promise.all(evaluationArray);
|
|
1250
1231
|
|
|
1251
1232
|
const productTemp = product;
|
|
1252
1233
|
productTemp.status = `${result}A`;
|