@bjsdistribution/dms-client-return 0.0.35 → 0.0.37
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/dms-client-return.cjs.development.js +11 -11
- package/dist/dms-client-return.cjs.development.js.map +1 -1
- package/dist/dms-client-return.cjs.production.min.js +1 -1
- package/dist/dms-client-return.cjs.production.min.js.map +1 -1
- package/dist/dms-client-return.esm.js +11 -11
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +26 -19
package/package.json
CHANGED
|
@@ -106,19 +106,21 @@ function SelectionFilter() {
|
|
|
106
106
|
);
|
|
107
107
|
|
|
108
108
|
if (filteredClient) {
|
|
109
|
-
const mappedActions = filteredClient?.actions
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
const mappedActions = Array.isArray(filteredClient?.actions)
|
|
110
|
+
? filteredClient?.actions?.map((action: any) => ({
|
|
111
|
+
label: action,
|
|
112
|
+
value: action,
|
|
113
|
+
}))
|
|
114
|
+
: [];
|
|
113
115
|
|
|
114
116
|
setActionTypeOptions(mappedActions);
|
|
115
117
|
|
|
116
|
-
const mappedLocations = filteredClient?.return_locations
|
|
117
|
-
(location: any) => ({
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
const mappedLocations = Array.isArray(filteredClient?.return_locations)
|
|
119
|
+
? filteredClient?.return_locations?.map((location: any) => ({
|
|
120
|
+
label: location,
|
|
121
|
+
value: location,
|
|
122
|
+
}))
|
|
123
|
+
: [];
|
|
122
124
|
|
|
123
125
|
setLocationOptions(mappedLocations);
|
|
124
126
|
}
|
|
@@ -152,18 +154,23 @@ function SelectionFilter() {
|
|
|
152
154
|
const clientLocations = selectedClientValue?.return_locations || [];
|
|
153
155
|
|
|
154
156
|
setActionTypeOptions(
|
|
155
|
-
clientActions
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
Array.isArray(clientActions)
|
|
158
|
+
? clientActions?.map(action => ({
|
|
159
|
+
label: action,
|
|
160
|
+
value: action,
|
|
161
|
+
}))
|
|
162
|
+
: []
|
|
159
163
|
);
|
|
160
164
|
|
|
161
165
|
setLocationOptions(
|
|
162
|
-
clientLocations
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
+
Array.isArray(clientLocations)
|
|
167
|
+
? clientLocations?.map(location => ({
|
|
168
|
+
label: location,
|
|
169
|
+
value: location,
|
|
170
|
+
}))
|
|
171
|
+
: []
|
|
166
172
|
);
|
|
173
|
+
|
|
167
174
|
//client value
|
|
168
175
|
if (storedClientId) {
|
|
169
176
|
dispatch({
|
|
@@ -192,7 +199,7 @@ function SelectionFilter() {
|
|
|
192
199
|
});
|
|
193
200
|
}
|
|
194
201
|
//location value
|
|
195
|
-
if (selectedLocationValue && selectedLocationValue
|
|
202
|
+
if (selectedLocationValue && selectedLocationValue?.length > 0) {
|
|
196
203
|
dispatch({
|
|
197
204
|
type: 'SET_LOCATION_FILTER',
|
|
198
205
|
payload: selectedLocationValue,
|