ordering-ui-admin-external 1.27.1 → 1.28.1
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/_bundles/{ordering-ui-admin.a9792b22d968cdf424d1.js → ordering-ui-admin.d6c72a98321193c34fe9.js} +2 -2
- package/_modules/components/BusinessIntelligence/AnalyticsOrdersStatus/index.js +2 -1
- package/_modules/components/BusinessIntelligence/BusinessAnalytics/index.js +4 -13
- package/_modules/components/BusinessIntelligence/CountryFilter/index.js +18 -4
- package/_modules/components/BusinessIntelligence/DriverAnalytics/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsBusinessDistance/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsBusinessSpend/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsDriverDistance/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsDriverOrder/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsDriverOrderTime/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsDriverSpend/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsGeneralSales/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsHeatMap/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsOrderDistance/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsOrderStatus/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsOrders/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsSaleAndCategory/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsSales/index.js +4 -13
- package/_modules/components/Delivery/DriversGroupAddForm/GeneralForm/index.js +3 -4
- package/_modules/components/Delivery/DriversGroupDetails/index.js +23 -33
- package/_modules/components/Delivery/DriversGroupGeneralForm/index.js +2 -23
- package/_modules/components/Delivery/DriversGroupGeneralForm/styles.js +3 -8
- package/_modules/components/Delivery/DriversGroupsList/index.js +8 -7
- package/_modules/components/Delivery/DriversGroupsList/styles.js +38 -35
- package/_modules/components/Delivery/UserAddForm/index.js +16 -4
- package/_modules/components/Delivery/UserFormDetails/index.js +17 -5
- package/_modules/components/MyProducts/AdvancedSettings/index.js +9 -1
- package/_modules/components/MyProducts/OrderingWebsite/index.js +7 -3
- package/_modules/components/OrderingProducts/SiteTheme/index.js +3 -3
- package/_modules/components/Orders/DeliveriesManager/index.js +6 -8
- package/_modules/components/Orders/OrdersManager/index.js +9 -11
- package/_modules/components/Stores/BusinessDeliveryGroupsDetails/index.js +15 -30
- package/_modules/components/Stores/BusinessDeliveryGroupsDetails/styles.js +4 -4
- package/_modules/components/Stores/BusinessProductsListing/index.js +6 -0
- package/_modules/components/Stores/ProductExtraOptionDetails/index.js +20 -2
- package/_modules/components/Stores/ProductExtraOptions/index.js +19 -5
- package/_modules/components/Stores/ProductExtraOptions/styles.js +19 -22
- package/_modules/components/Stores/ProductExtras/index.js +19 -18
- package/_modules/components/Stores/ProductExtras/styles.js +1 -1
- package/package.json +2 -2
- package/src/components/BusinessIntelligence/AnalyticsOrdersStatus/index.js +1 -1
- package/src/components/BusinessIntelligence/BusinessAnalytics/index.js +5 -12
- package/src/components/BusinessIntelligence/CountryFilter/index.js +72 -56
- package/src/components/BusinessIntelligence/DriverAnalytics/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsBusinessDistance/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsBusinessSpend/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsDriverDistance/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsDriverOrder/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsDriverOrderTime/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsDriverSpend/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsGeneralSales/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsHeatMap/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsOrderDistance/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsOrderStatus/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsOrders/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsSaleAndCategory/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsSales/index.js +5 -12
- package/src/components/Delivery/DriversGroupAddForm/GeneralForm/index.js +3 -2
- package/src/components/Delivery/DriversGroupDetails/index.js +2 -9
- package/src/components/Delivery/DriversGroupGeneralForm/index.js +3 -29
- package/src/components/Delivery/DriversGroupGeneralForm/styles.js +0 -15
- package/src/components/Delivery/DriversGroupsList/index.js +54 -42
- package/src/components/Delivery/DriversGroupsList/styles.js +12 -11
- package/src/components/Delivery/UserAddForm/index.js +32 -13
- package/src/components/Delivery/UserFormDetails/index.js +30 -13
- package/src/components/MyProducts/AdvancedSettings/index.js +3 -1
- package/src/components/MyProducts/OrderingWebsite/index.js +57 -50
- package/src/components/OrderingProducts/SiteTheme/index.js +4 -2
- package/src/components/Orders/DeliveriesManager/index.js +3 -2
- package/src/components/Orders/OrdersManager/index.js +3 -2
- package/src/components/Stores/BusinessDeliveryGroupsDetails/index.js +4 -16
- package/src/components/Stores/BusinessDeliveryGroupsDetails/styles.js +6 -10
- package/src/components/Stores/BusinessProductsListing/index.js +8 -0
- package/src/components/Stores/ProductExtraOptionDetails/index.js +15 -1
- package/src/components/Stores/ProductExtraOptions/index.js +16 -3
- package/src/components/Stores/ProductExtraOptions/styles.js +4 -7
- package/src/components/Stores/ProductExtras/index.js +14 -16
- package/src/components/Stores/ProductExtras/styles.js +4 -0
- /package/_bundles/{ordering-ui-admin.a9792b22d968cdf424d1.js.LICENSE.txt → ordering-ui-admin.d6c72a98321193c34fe9.js.LICENSE.txt} +0 -0
|
@@ -246,18 +246,11 @@ const DriverAnalyticsUI = (props) => {
|
|
|
246
246
|
onClose={() => setIsBrandFilter(false)}
|
|
247
247
|
/>
|
|
248
248
|
</Modal>
|
|
249
|
-
<
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
255
|
-
>
|
|
256
|
-
<CountryFilter
|
|
257
|
-
{...props}
|
|
258
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
259
|
-
/>
|
|
260
|
-
</Modal>
|
|
249
|
+
<CountryFilter
|
|
250
|
+
{...props}
|
|
251
|
+
openCountryFilter={openCountryFilter}
|
|
252
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
253
|
+
/>
|
|
261
254
|
</BusinessAnalyticsContainer>
|
|
262
255
|
)
|
|
263
256
|
}
|
|
@@ -276,18 +276,11 @@ const ReportsBusinessDistanceUI = (props) => {
|
|
|
276
276
|
{...props} onClose={() => setIsBrandFilter(false)}
|
|
277
277
|
/>
|
|
278
278
|
</Modal>
|
|
279
|
-
<
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
285
|
-
>
|
|
286
|
-
<CountryFilter
|
|
287
|
-
{...props}
|
|
288
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
289
|
-
/>
|
|
290
|
-
</Modal>
|
|
279
|
+
<CountryFilter
|
|
280
|
+
{...props}
|
|
281
|
+
openCountryFilter={openCountryFilter}
|
|
282
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
283
|
+
/>
|
|
291
284
|
</ReportsDistanceContainer>
|
|
292
285
|
)
|
|
293
286
|
}
|
|
@@ -222,18 +222,11 @@ const ReportsBusinessSpendUI = (props) => {
|
|
|
222
222
|
{...props} onClose={() => setIsBrandFilter(false)}
|
|
223
223
|
/>
|
|
224
224
|
</Modal>
|
|
225
|
-
<
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
231
|
-
>
|
|
232
|
-
<CountryFilter
|
|
233
|
-
{...props}
|
|
234
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
235
|
-
/>
|
|
236
|
-
</Modal>
|
|
225
|
+
<CountryFilter
|
|
226
|
+
{...props}
|
|
227
|
+
openCountryFilter={openCountryFilter}
|
|
228
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
229
|
+
/>
|
|
237
230
|
</ReportsBusinessSpendContainer>
|
|
238
231
|
)
|
|
239
232
|
}
|
|
@@ -242,18 +242,11 @@ const ReportsDriverDistanceUI = (props) => {
|
|
|
242
242
|
setAvailableDriverIds={setAvailableDriverIds}
|
|
243
243
|
/>
|
|
244
244
|
</Modal>
|
|
245
|
-
<
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
251
|
-
>
|
|
252
|
-
<CountryFilter
|
|
253
|
-
{...props}
|
|
254
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
255
|
-
/>
|
|
256
|
-
</Modal>
|
|
245
|
+
<CountryFilter
|
|
246
|
+
{...props}
|
|
247
|
+
openCountryFilter={openCountryFilter}
|
|
248
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
249
|
+
/>
|
|
257
250
|
</DriverDistanceContainer>
|
|
258
251
|
<Alert
|
|
259
252
|
title={t('DRIVER_SCHEDULE', 'Driver schedule')}
|
|
@@ -205,18 +205,11 @@ const ReportsDriverOrderUI = (props) => {
|
|
|
205
205
|
onClose={() => setIsBrandFilter(false)}
|
|
206
206
|
/>
|
|
207
207
|
</Modal>
|
|
208
|
-
<
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
214
|
-
>
|
|
215
|
-
<CountryFilter
|
|
216
|
-
{...props}
|
|
217
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
218
|
-
/>
|
|
219
|
-
</Modal>
|
|
208
|
+
<CountryFilter
|
|
209
|
+
{...props}
|
|
210
|
+
openCountryFilter={openCountryFilter}
|
|
211
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
212
|
+
/>
|
|
220
213
|
</ReportsBusinessSpendContainer>
|
|
221
214
|
)
|
|
222
215
|
}
|
|
@@ -229,18 +229,11 @@ const ReportsDriverOrderTimeUI = (props) => {
|
|
|
229
229
|
onClose={() => setIsOrderTypeFilter(false)}
|
|
230
230
|
/>
|
|
231
231
|
</Modal> */}
|
|
232
|
-
<
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
238
|
-
>
|
|
239
|
-
<CountryFilter
|
|
240
|
-
{...props}
|
|
241
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
242
|
-
/>
|
|
243
|
-
</Modal>
|
|
232
|
+
<CountryFilter
|
|
233
|
+
{...props}
|
|
234
|
+
openCountryFilter={openCountryFilter}
|
|
235
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
236
|
+
/>
|
|
244
237
|
</ReportsBusinessSpendContainer>
|
|
245
238
|
)
|
|
246
239
|
}
|
|
@@ -217,18 +217,11 @@ const ReportsDriverSpendUI = (props) => {
|
|
|
217
217
|
{...props} onClose={() => setIsBrandFilter(false)}
|
|
218
218
|
/>
|
|
219
219
|
</Modal>
|
|
220
|
-
<
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
226
|
-
>
|
|
227
|
-
<CountryFilter
|
|
228
|
-
{...props}
|
|
229
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
230
|
-
/>
|
|
231
|
-
</Modal>
|
|
220
|
+
<CountryFilter
|
|
221
|
+
{...props}
|
|
222
|
+
openCountryFilter={openCountryFilter}
|
|
223
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
224
|
+
/>
|
|
232
225
|
</ReportsBusinessSpendContainer>
|
|
233
226
|
)
|
|
234
227
|
}
|
|
@@ -241,18 +241,11 @@ const ReportsGeneralSalesUI = (props) => {
|
|
|
241
241
|
isFranchise
|
|
242
242
|
/>
|
|
243
243
|
</Modal>
|
|
244
|
-
<
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
250
|
-
>
|
|
251
|
-
<CountryFilter
|
|
252
|
-
{...props}
|
|
253
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
254
|
-
/>
|
|
255
|
-
</Modal>
|
|
244
|
+
<CountryFilter
|
|
245
|
+
{...props}
|
|
246
|
+
openCountryFilter={openCountryFilter}
|
|
247
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
248
|
+
/>
|
|
256
249
|
</ReportsBusinessSpendContainer>
|
|
257
250
|
)
|
|
258
251
|
}
|
|
@@ -217,18 +217,11 @@ const ReportsHeatMapUI = (props) => {
|
|
|
217
217
|
{...props} onClose={() => setIsBrandFilter(false)}
|
|
218
218
|
/>
|
|
219
219
|
</Modal>
|
|
220
|
-
<
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
226
|
-
>
|
|
227
|
-
<CountryFilter
|
|
228
|
-
{...props}
|
|
229
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
230
|
-
/>
|
|
231
|
-
</Modal>
|
|
220
|
+
<CountryFilter
|
|
221
|
+
{...props}
|
|
222
|
+
openCountryFilter={openCountryFilter}
|
|
223
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
224
|
+
/>
|
|
232
225
|
</HeatMapContainer>
|
|
233
226
|
<Alert
|
|
234
227
|
title={t('HEAT_MAP', 'Heat map')}
|
|
@@ -253,18 +253,11 @@ const ReportsOrderDistanceUI = (props) => {
|
|
|
253
253
|
{...props} onClose={() => setIsBrandFilter(false)}
|
|
254
254
|
/>
|
|
255
255
|
</Modal>
|
|
256
|
-
<
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
262
|
-
>
|
|
263
|
-
<CountryFilter
|
|
264
|
-
{...props}
|
|
265
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
266
|
-
/>
|
|
267
|
-
</Modal>
|
|
256
|
+
<CountryFilter
|
|
257
|
+
{...props}
|
|
258
|
+
openCountryFilter={openCountryFilter}
|
|
259
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
260
|
+
/>
|
|
268
261
|
</ReportsDistanceContainer>
|
|
269
262
|
)
|
|
270
263
|
}
|
|
@@ -295,18 +295,11 @@ const ReportsOrderStatusUI = (props) => {
|
|
|
295
295
|
onClose={() => setIsOrderTypeFilter(false)}
|
|
296
296
|
/>
|
|
297
297
|
</Modal>
|
|
298
|
-
<
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
304
|
-
>
|
|
305
|
-
<CountryFilter
|
|
306
|
-
{...props}
|
|
307
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
308
|
-
/>
|
|
309
|
-
</Modal>
|
|
298
|
+
<CountryFilter
|
|
299
|
+
{...props}
|
|
300
|
+
openCountryFilter={openCountryFilter}
|
|
301
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
302
|
+
/>
|
|
310
303
|
</OrderStatusContainer>
|
|
311
304
|
<Alert
|
|
312
305
|
title={t('DRIVER_SCHEDULE', 'Driver schedule')}
|
|
@@ -213,18 +213,11 @@ const ReportsOrdersUI = (props) => {
|
|
|
213
213
|
{...props} onClose={() => setIsBrandFilter(false)}
|
|
214
214
|
/>
|
|
215
215
|
</Modal>
|
|
216
|
-
<
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
222
|
-
>
|
|
223
|
-
<CountryFilter
|
|
224
|
-
{...props}
|
|
225
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
226
|
-
/>
|
|
227
|
-
</Modal>
|
|
216
|
+
<CountryFilter
|
|
217
|
+
{...props}
|
|
218
|
+
openCountryFilter={openCountryFilter}
|
|
219
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
220
|
+
/>
|
|
228
221
|
</ReportsOrdersContainer>
|
|
229
222
|
)
|
|
230
223
|
}
|
|
@@ -248,18 +248,11 @@ const ReportsSaleAndCategoryUI = (props) => {
|
|
|
248
248
|
{...props} onClose={() => setIsBrandFilter(false)}
|
|
249
249
|
/>
|
|
250
250
|
</Modal>
|
|
251
|
-
<
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
257
|
-
>
|
|
258
|
-
<CountryFilter
|
|
259
|
-
{...props}
|
|
260
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
261
|
-
/>
|
|
262
|
-
</Modal>
|
|
251
|
+
<CountryFilter
|
|
252
|
+
{...props}
|
|
253
|
+
openCountryFilter={openCountryFilter}
|
|
254
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
255
|
+
/>
|
|
263
256
|
</ReportsContainer>
|
|
264
257
|
)
|
|
265
258
|
}
|
|
@@ -215,18 +215,11 @@ const ReportsSalesUI = (props) => {
|
|
|
215
215
|
{...props} onClose={() => setIsBrandFilter(false)}
|
|
216
216
|
/>
|
|
217
217
|
</Modal>
|
|
218
|
-
<
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
224
|
-
>
|
|
225
|
-
<CountryFilter
|
|
226
|
-
{...props}
|
|
227
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
228
|
-
/>
|
|
229
|
-
</Modal>
|
|
218
|
+
<CountryFilter
|
|
219
|
+
{...props}
|
|
220
|
+
openCountryFilter={openCountryFilter}
|
|
221
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
222
|
+
/>
|
|
230
223
|
</ReportsOrdersContainer>
|
|
231
224
|
)
|
|
232
225
|
}
|
|
@@ -14,7 +14,8 @@ export const GeneralForm = (props) => {
|
|
|
14
14
|
const {
|
|
15
15
|
driversManagers,
|
|
16
16
|
changesState,
|
|
17
|
-
handleChangesState
|
|
17
|
+
handleChangesState,
|
|
18
|
+
handleChangeType
|
|
18
19
|
} = props
|
|
19
20
|
|
|
20
21
|
const [, t] = useLanguage()
|
|
@@ -79,7 +80,7 @@ export const GeneralForm = (props) => {
|
|
|
79
80
|
placeholder={t('SELECT_TYPE', 'Select type')}
|
|
80
81
|
options={typeOptions}
|
|
81
82
|
defaultValue={changesState?.type}
|
|
82
|
-
onChange={val =>
|
|
83
|
+
onChange={val => handleChangeType(val)}
|
|
83
84
|
/>
|
|
84
85
|
</InputWrapper>
|
|
85
86
|
|
|
@@ -50,7 +50,6 @@ const DriversGroupDetailsUI = (props) => {
|
|
|
50
50
|
const autoAssignType = configState?.configs?.autoassign_type?.value
|
|
51
51
|
|
|
52
52
|
const [showMenu, setShowMenu] = useState('general')
|
|
53
|
-
const [useAdvanced, setUseAdvanced] = useState(false)
|
|
54
53
|
const [driversGroupMenus, setDriversGroupMenus] = useState([])
|
|
55
54
|
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
56
55
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
@@ -63,7 +62,7 @@ const DriversGroupDetailsUI = (props) => {
|
|
|
63
62
|
{ key: 'general', value: t('GENERAL', 'General') },
|
|
64
63
|
{ key: 'businesses', value: t('BUSINESSES', 'Businesses') }
|
|
65
64
|
]
|
|
66
|
-
: (
|
|
65
|
+
: (autoAssignType !== 'basic')
|
|
67
66
|
? [
|
|
68
67
|
{ key: 'general', value: t('GENERAL', 'General') },
|
|
69
68
|
{ key: 'businesses', value: t('BUSINESSES', 'Businesses') },
|
|
@@ -80,7 +79,7 @@ const DriversGroupDetailsUI = (props) => {
|
|
|
80
79
|
{ key: 'logs', value: t('LOGS', 'Logs') }
|
|
81
80
|
]
|
|
82
81
|
setDriversGroupMenus(_driversGroupMenus)
|
|
83
|
-
}, [
|
|
82
|
+
}, [driversGroupState?.driversGroup])
|
|
84
83
|
|
|
85
84
|
const onDeleteGroup = () => {
|
|
86
85
|
setConfirm({
|
|
@@ -110,10 +109,6 @@ const DriversGroupDetailsUI = (props) => {
|
|
|
110
109
|
setIsExpand(prev => !prev)
|
|
111
110
|
}
|
|
112
111
|
|
|
113
|
-
useEffect(() => {
|
|
114
|
-
setUseAdvanced(!(driversGroupState.driversGroup?.autoassign_amount_drivers === 0 && driversGroupState.driversGroup?.orders_group_max_orders === 0))
|
|
115
|
-
}, [driversGroupState.driversGroup])
|
|
116
|
-
|
|
117
112
|
useEffect(() => {
|
|
118
113
|
handleParentSidebarMove(0)
|
|
119
114
|
setIsOpenDetails(false)
|
|
@@ -222,8 +217,6 @@ const DriversGroupDetailsUI = (props) => {
|
|
|
222
217
|
<DriversGroupGeneralForm
|
|
223
218
|
{...props}
|
|
224
219
|
curDriversGroup={driversGroupState.driversGroup}
|
|
225
|
-
useAdvanced={useAdvanced}
|
|
226
|
-
setUseAdvanced={setUseAdvanced}
|
|
227
220
|
handleNextClick={handleNextClick}
|
|
228
221
|
/>
|
|
229
222
|
)}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { useLanguage,
|
|
2
|
+
import { useLanguage, useSession } from 'ordering-components-admin-external'
|
|
3
3
|
import { useForm } from 'react-hook-form'
|
|
4
|
-
import { Input,
|
|
4
|
+
import { Input, Button, SecondSelect as DefaultSelect } from '../../../styles'
|
|
5
5
|
import { Alert } from '../../Shared'
|
|
6
6
|
import { DriversGroupDrivers } from '../DriversGroupDrivers'
|
|
7
7
|
import { DriversGroupCompanies } from '../DriversGroupCompanies'
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
10
|
Container,
|
|
11
|
-
InputWrapper
|
|
12
|
-
CheckboxContainer
|
|
11
|
+
InputWrapper
|
|
13
12
|
} from './styles'
|
|
14
13
|
|
|
15
14
|
export const DriversGroupGeneralForm = (props) => {
|
|
@@ -18,8 +17,6 @@ export const DriversGroupGeneralForm = (props) => {
|
|
|
18
17
|
driversManagers,
|
|
19
18
|
changesState,
|
|
20
19
|
handleChangesState,
|
|
21
|
-
useAdvanced,
|
|
22
|
-
setUseAdvanced,
|
|
23
20
|
handleUpdateDriversGroup,
|
|
24
21
|
handleAddDriversGroup,
|
|
25
22
|
actionDisabled,
|
|
@@ -30,11 +27,8 @@ export const DriversGroupGeneralForm = (props) => {
|
|
|
30
27
|
const [, t] = useLanguage()
|
|
31
28
|
const { handleSubmit, register, errors } = useForm()
|
|
32
29
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
33
|
-
const [configState] = useConfig()
|
|
34
30
|
const [{ user }] = useSession()
|
|
35
31
|
|
|
36
|
-
const autoAssignType = configState?.configs?.autoassign_type?.value
|
|
37
|
-
|
|
38
32
|
const typeOptions = [
|
|
39
33
|
{ value: 0, content: t('IN_HOUSE_DRIVERS', 'In house drivers') },
|
|
40
34
|
{ value: 1, content: t('DRIVER_COMPANIES', 'Driver companies') }
|
|
@@ -54,17 +48,6 @@ export const DriversGroupGeneralForm = (props) => {
|
|
|
54
48
|
{ value: 2, content: t('URGENT', 'Urgent') }
|
|
55
49
|
]
|
|
56
50
|
|
|
57
|
-
const handleLogistic = (checked) => {
|
|
58
|
-
setUseAdvanced(checked)
|
|
59
|
-
if (checked) return
|
|
60
|
-
const changes = {
|
|
61
|
-
autoassign_amount_drivers: 0,
|
|
62
|
-
orders_group_max_orders: 0
|
|
63
|
-
}
|
|
64
|
-
if (!driversGroupState.driversGroup) return
|
|
65
|
-
handleUpdateDriversGroup(changes)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
51
|
const onSubmit = () => {
|
|
69
52
|
if (driversGroupState.driversGroup) {
|
|
70
53
|
if (changesState?.drivers === '[]') {
|
|
@@ -184,15 +167,6 @@ export const DriversGroupGeneralForm = (props) => {
|
|
|
184
167
|
onChange={val => handleChangesState({ priority: val })}
|
|
185
168
|
/>
|
|
186
169
|
</InputWrapper>
|
|
187
|
-
{driversGroupState.driversGroup && autoAssignType !== 'basic' && (
|
|
188
|
-
<CheckboxContainer>
|
|
189
|
-
<Checkbox
|
|
190
|
-
checked={useAdvanced}
|
|
191
|
-
onChange={e => handleLogistic(e.target.checked)}
|
|
192
|
-
/>
|
|
193
|
-
<p>{t('USE_ADVANCED_LOGISTIC', 'Use advanced logistic')}</p>
|
|
194
|
-
</CheckboxContainer>
|
|
195
|
-
)}
|
|
196
170
|
<Button
|
|
197
171
|
borderRadius='8px'
|
|
198
172
|
color='primary'
|
|
@@ -42,18 +42,3 @@ export const InputWrapper = styled.div`
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
`
|
|
45
|
-
|
|
46
|
-
export const CheckboxContainer = styled.div`
|
|
47
|
-
display: flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
|
|
50
|
-
p {
|
|
51
|
-
font-size: 14px;
|
|
52
|
-
margin: 0px;
|
|
53
|
-
${props => props.theme?.rtl ? css`
|
|
54
|
-
padding-right: 10px;
|
|
55
|
-
` : css`
|
|
56
|
-
padding-left: 10px;
|
|
57
|
-
`}
|
|
58
|
-
}
|
|
59
|
-
`
|
|
@@ -96,7 +96,7 @@ export const DriversGroupsList = (props) => {
|
|
|
96
96
|
<>
|
|
97
97
|
<DriversGroupsContainer>
|
|
98
98
|
<TableWrapper>
|
|
99
|
-
<GroupsTable data-tour='tour_delivery_completed'>
|
|
99
|
+
<GroupsTable data-tour='tour_delivery_completed' disabled={isFromStore}>
|
|
100
100
|
<thead>
|
|
101
101
|
<tr>
|
|
102
102
|
<th>
|
|
@@ -105,11 +105,15 @@ export const DriversGroupsList = (props) => {
|
|
|
105
105
|
onClick={() => handleAllSelectGroup()}
|
|
106
106
|
isChecked={!driversGroupsState.loading && (selectedGroupList.length === driversGroupsState.groups.length)}
|
|
107
107
|
>
|
|
108
|
-
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
{!isFromStore && (
|
|
109
|
+
<>
|
|
110
|
+
{
|
|
111
|
+
!driversGroupsState.loading && (selectedGroupList.length === driversGroupsState.groups.length)
|
|
112
|
+
? <MdCheckBox />
|
|
113
|
+
: <MdCheckBoxOutlineBlank />
|
|
114
|
+
}
|
|
115
|
+
</>
|
|
116
|
+
)}
|
|
113
117
|
</CheckBoxWrapper>
|
|
114
118
|
<span>{t('ID', 'ID')}</span>
|
|
115
119
|
</GroupIdWrapper>
|
|
@@ -129,11 +133,13 @@ export const DriversGroupsList = (props) => {
|
|
|
129
133
|
{t('TYPE', 'Type')}
|
|
130
134
|
</DriverGroupTypeContainer>
|
|
131
135
|
</th>
|
|
132
|
-
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
{!isFromStore && (
|
|
137
|
+
<th>
|
|
138
|
+
<ActionsContainer>
|
|
139
|
+
{t('ACTIONS', 'Actions')}
|
|
140
|
+
</ActionsContainer>
|
|
141
|
+
</th>
|
|
142
|
+
)}
|
|
137
143
|
</tr>
|
|
138
144
|
</thead>
|
|
139
145
|
{driversGroupsState.loading ? (
|
|
@@ -142,7 +148,7 @@ export const DriversGroupsList = (props) => {
|
|
|
142
148
|
<tr>
|
|
143
149
|
<td>
|
|
144
150
|
<GroupIdWrapper>
|
|
145
|
-
<Skeleton width={18} height={18} />
|
|
151
|
+
{!isFromStore && <Skeleton width={18} height={18} />}
|
|
146
152
|
<Skeleton width={40} style={{ margin: '0px 5px' }} />
|
|
147
153
|
</GroupIdWrapper>
|
|
148
154
|
</td>
|
|
@@ -167,13 +173,15 @@ export const DriversGroupsList = (props) => {
|
|
|
167
173
|
<Skeleton width={70} />
|
|
168
174
|
</DriverGroupTypeContainer>
|
|
169
175
|
</td>
|
|
170
|
-
|
|
171
|
-
<
|
|
172
|
-
<
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
{!isFromStore && (
|
|
177
|
+
<td>
|
|
178
|
+
<ActionsContainer>
|
|
179
|
+
<EnableWrapper>
|
|
180
|
+
<Skeleton width={50} />
|
|
181
|
+
</EnableWrapper>
|
|
182
|
+
</ActionsContainer>
|
|
183
|
+
</td>
|
|
184
|
+
)}
|
|
177
185
|
</tr>
|
|
178
186
|
</tbody>
|
|
179
187
|
))
|
|
@@ -187,17 +195,19 @@ export const DriversGroupsList = (props) => {
|
|
|
187
195
|
<tr>
|
|
188
196
|
<td>
|
|
189
197
|
<GroupIdWrapper>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
{!isFromStore && (
|
|
199
|
+
<CheckBoxWrapper
|
|
200
|
+
className='group-checkbox'
|
|
201
|
+
onClick={() => handleSelectGroup(group.id)}
|
|
202
|
+
isChecked={selectedGroupList.includes(group.id)}
|
|
203
|
+
>
|
|
204
|
+
{
|
|
205
|
+
selectedGroupList.includes(group.id)
|
|
206
|
+
? <MdCheckBox />
|
|
207
|
+
: <MdCheckBoxOutlineBlank />
|
|
208
|
+
}
|
|
209
|
+
</CheckBoxWrapper>
|
|
210
|
+
)}
|
|
201
211
|
<span>{group?.id}</span>
|
|
202
212
|
</GroupIdWrapper>
|
|
203
213
|
</td>
|
|
@@ -230,18 +240,20 @@ export const DriversGroupsList = (props) => {
|
|
|
230
240
|
{getTypeTag(group?.type)}
|
|
231
241
|
</DriverGroupTypeContainer>
|
|
232
242
|
</td>
|
|
233
|
-
|
|
234
|
-
<
|
|
235
|
-
<
|
|
236
|
-
<
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
{!isFromStore && (
|
|
244
|
+
<td>
|
|
245
|
+
<ActionsContainer>
|
|
246
|
+
<EnableWrapper className='group-enabled'>
|
|
247
|
+
<span>{t('ENABLE', 'Enable')}</span>
|
|
248
|
+
<Switch
|
|
249
|
+
disabled={actionDisabled}
|
|
250
|
+
defaultChecked={group?.enabled}
|
|
251
|
+
onChange={enabled => handleUpdateDriversGroup?.(group.id, { enabled: enabled })}
|
|
252
|
+
/>
|
|
253
|
+
</EnableWrapper>
|
|
254
|
+
</ActionsContainer>
|
|
255
|
+
</td>
|
|
256
|
+
)}
|
|
245
257
|
</tr>
|
|
246
258
|
</tbody>
|
|
247
259
|
))
|