contentoh-components-library 21.2.4 → 21.2.5
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.
|
@@ -22,6 +22,7 @@ var MetricSelect = function MetricSelect(_ref) {
|
|
|
22
22
|
onChange: onChange,
|
|
23
23
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
24
24
|
value: "",
|
|
25
|
+
disabled: true,
|
|
25
26
|
children: label
|
|
26
27
|
}), options === null || options === void 0 ? void 0 : options.map(function (option) {
|
|
27
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
@@ -117,7 +117,7 @@ var Dashboard = function Dashboard() {
|
|
|
117
117
|
|
|
118
118
|
var getRetailers = /*#__PURE__*/function () {
|
|
119
119
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
120
|
-
var retailersResponse;
|
|
120
|
+
var retailersResponse, parsed, retailers;
|
|
121
121
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
122
122
|
while (1) {
|
|
123
123
|
switch (_context2.prev = _context2.next) {
|
|
@@ -131,9 +131,15 @@ var Dashboard = function Dashboard() {
|
|
|
131
131
|
|
|
132
132
|
case 2:
|
|
133
133
|
retailersResponse = _context2.sent;
|
|
134
|
-
|
|
134
|
+
parsed = JSON.parse(retailersResponse.data.body).data;
|
|
135
|
+
retailers = Object.keys(parsed).map(function (key) {
|
|
136
|
+
if (key.includes('The Home Depot')) return parsed[key];
|
|
137
|
+
}).filter(function (f) {
|
|
138
|
+
return f;
|
|
139
|
+
});
|
|
140
|
+
setRetailers(retailers);
|
|
135
141
|
|
|
136
|
-
case
|
|
142
|
+
case 6:
|
|
137
143
|
case "end":
|
|
138
144
|
return _context2.stop();
|
|
139
145
|
}
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ export const MetricSelect = ({
|
|
|
10
10
|
return (
|
|
11
11
|
<Container className={className}>
|
|
12
12
|
<select value={optionSelected} onChange={onChange}>
|
|
13
|
-
<option value="">{label}</option>
|
|
13
|
+
<option value="" disabled>{label}</option>
|
|
14
14
|
{options?.map((option) => (
|
|
15
15
|
<option key={option.name} value={option.id}>
|
|
16
16
|
{option.name}
|
|
@@ -43,7 +43,11 @@ export const Dashboard = () => {
|
|
|
43
43
|
},
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
|
-
|
|
46
|
+
const parsed = JSON.parse(retailersResponse.data.body).data;
|
|
47
|
+
const retailers = Object.keys(parsed).map((key) => {
|
|
48
|
+
if (key.includes('The Home Depot')) return parsed[key];
|
|
49
|
+
}).filter((f) => f);
|
|
50
|
+
setRetailers(retailers);
|
|
47
51
|
};
|
|
48
52
|
|
|
49
53
|
const loadProductsByStatus = async (orderByStatus) => {
|