ordering-ui-admin-external 1.43.30 → 1.43.32

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.
Files changed (39) hide show
  1. package/_bundles/{ordering-ui-admin.2175191dd9617085f573.js → ordering-ui-admin.395af03194f63ca488ce.js} +2 -2
  2. package/_modules/components/Delivery/DriverGroupSelectorHeader/index.js +14 -13
  3. package/_modules/components/Delivery/DriversGroupLogs/index.js +2 -75
  4. package/_modules/components/Delivery/DriversTimeDisplay/UserList.js +10 -18
  5. package/_modules/components/Delivery/DriversTimeDisplay/index.js +63 -16
  6. package/_modules/components/Delivery/DriversTimeDisplay/styles.js +7 -6
  7. package/_modules/components/Orders/DriverMultiSelector/index.js +46 -17
  8. package/_modules/components/Stores/BusinessDetails/index.js +4 -1
  9. package/_modules/components/Stores/BusinessLogs/index.js +185 -0
  10. package/_modules/components/Stores/BusinessLogs/styles.js +73 -0
  11. package/_modules/components/Stores/BusinessSummary/index.js +8 -7
  12. package/_modules/components/Stores/index.js +7 -0
  13. package/_modules/components/Users/UserFormDetails/index.js +48 -13
  14. package/_modules/components/Users/UserFormDetails/styles.js +8 -2
  15. package/_modules/index.js +6 -0
  16. package/_modules/styles/MultiSelect/index.js +56 -10
  17. package/_modules/styles/MultiSelect/styles.js +16 -5
  18. package/_modules/styles/Selects/index.js +62 -51
  19. package/_modules/utils/index.js +107 -30
  20. package/package.json +2 -2
  21. package/src/components/Delivery/DriverGroupSelectorHeader/index.js +21 -21
  22. package/src/components/Delivery/DriversGroupLogs/index.js +1 -32
  23. package/src/components/Delivery/DriversTimeDisplay/UserList.js +35 -41
  24. package/src/components/Delivery/DriversTimeDisplay/index.js +89 -34
  25. package/src/components/Delivery/DriversTimeDisplay/styles.js +22 -4
  26. package/src/components/Orders/DriverMultiSelector/index.js +46 -10
  27. package/src/components/Stores/BusinessDetails/index.js +6 -0
  28. package/src/components/Stores/BusinessLogs/index.js +304 -0
  29. package/src/components/Stores/BusinessLogs/styles.js +224 -0
  30. package/src/components/Stores/BusinessSummary/index.js +7 -5
  31. package/src/components/Stores/index.js +2 -0
  32. package/src/components/Users/UserFormDetails/index.js +32 -2
  33. package/src/components/Users/UserFormDetails/styles.js +26 -0
  34. package/src/index.js +2 -0
  35. package/src/styles/MultiSelect/index.js +104 -33
  36. package/src/styles/MultiSelect/styles.js +16 -1
  37. package/src/styles/Selects/index.js +14 -10
  38. package/src/utils/index.js +62 -29
  39. /package/_bundles/{ordering-ui-admin.2175191dd9617085f573.js.LICENSE.txt → ordering-ui-admin.395af03194f63ca488ce.js.LICENSE.txt} +0 -0
@@ -17,21 +17,21 @@ const DriverGroupsListingUI = (props) => {
17
17
  pagination,
18
18
  searchValue,
19
19
  onSearch,
20
- getPageBusinesses,
20
+ getHeaderDriversGroups,
21
21
  isOpen,
22
22
  close,
23
- changeDriverGroupState,
23
+ changeDriverGroupState
24
24
  } = props
25
25
  const [, t] = useLanguage()
26
26
  const dropdownReference = useRef()
27
27
 
28
28
  const handleChangePage = (page) => {
29
- getPageBusinesses(pagination.pageSize, page)
29
+ getHeaderDriversGroups(page, pagination.pageSize)
30
30
  }
31
31
 
32
32
  const handleChangePageSize = (pageSize) => {
33
33
  const expectedPage = Math.ceil(pagination.from / pageSize)
34
- getPageBusinesses(pageSize, expectedPage)
34
+ getHeaderDriversGroups(expectedPage, pageSize)
35
35
  }
36
36
 
37
37
  const closeSelect = (e) => {
@@ -74,31 +74,30 @@ const DriverGroupsListingUI = (props) => {
74
74
  ))
75
75
  ) : (
76
76
  <>
77
- {driversGroupsState.groups.map(driver_group => (
78
- <OptionItem key={driver_group.id}
79
- onClick={() => changeDriverGroupState(driver_group)}
77
+ {driversGroupsState.groups.map(driverGroup => (
78
+ <OptionItem
79
+ key={driverGroup.id}
80
+ onClick={() => changeDriverGroupState(driverGroup)}
80
81
  >
81
82
  <div>
82
- <b>{driver_group?.name}</b>
83
- <p>{t('DRIVERS', 'Drivers:')} {driver_group?.drivers?.length}</p>
83
+ <b>{driverGroup?.name}</b>
84
+ <p>{t('DRIVERS', 'Drivers:')} {driverGroup?.drivers?.length}</p>
84
85
  </div>
85
86
  </OptionItem>
86
87
  ))}
87
88
  </>
88
89
  )}
89
90
  </DriverGroupList>
90
- {pagination && pagination?.total > 0 && (
91
+ {pagination && pagination?.totalPages > 0 && (
91
92
  <WrapperPagination className='pagination-container'>
92
- {pagination?.total && (
93
- <Pagination
94
- currentPage={pagination.currentPage}
95
- totalPages={Math.ceil(pagination?.total / pagination.pageSize)}
96
- handleChangePage={handleChangePage}
97
- defaultPageSize={pagination.pageSize}
98
- handleChangePageSize={handleChangePageSize}
99
- isHidePagecontrol
100
- />
101
- )}
93
+ <Pagination
94
+ currentPage={pagination.currentPage}
95
+ totalPages={pagination?.totalPages}
96
+ handleChangePage={handleChangePage}
97
+ defaultPageSize={pagination.pageSize}
98
+ handleChangePageSize={handleChangePageSize}
99
+ isHidePagecontrol
100
+ />
102
101
  </WrapperPagination>
103
102
  )}
104
103
  </SelectHeaderContent>
@@ -114,9 +113,10 @@ export const DriverGroupSelectHeader = (props) => {
114
113
  isHeaderComponent: true,
115
114
  paginationSettings: {
116
115
  initialPage: 1,
117
- pageSize: 6,
116
+ pageSize: 5,
118
117
  controlType: 'pages'
119
118
  },
119
+ propsToFetch: ['id', 'enabled', 'drivers', 'name']
120
120
  }
121
121
  return (
122
122
  <DriverGroupsListController {...driverGroupsListingProps} />
@@ -2,6 +2,7 @@ import React, { useEffect } from 'react'
2
2
  import { useLanguage, useUtils, DriversGroupLogs as DriversGroupLogsController, useConfig } from 'ordering-components-admin-external'
3
3
  import Skeleton from 'react-loading-skeleton'
4
4
  import { Modal, Pagination } from '../../Shared'
5
+ import { getAttributeName } from '../../../utils'
5
6
 
6
7
  import {
7
8
  DriversGroupLogsContainer,
@@ -40,38 +41,6 @@ export const DriversGroupLogsUI = (props) => {
40
41
  const [{ configs }] = useConfig()
41
42
  const formatTime = configs?.general_hour_format?.value
42
43
 
43
- const getAttributeName = (key) => {
44
- const attributes = [
45
- { key: 'autoassign_amount_drivers', content: t('AUTO_ASSIGN_GROUP_ORDERS_TO_DRIVERS', 'Auto assign the order of group to this amount of drivers') },
46
- { key: 'orders_group_max_orders', content: t('MAX_NUMBER_ORDERS', 'Maximum Number of Orders') },
47
- { key: 'autoassign_autoaccept_by_driver', content: t('ORDER_CONFIRMED_ACCEPTED_BY_DRIVER', 'Accepted by Driver') },
48
- { key: 'orders_group_max_time_between', content: t('MAX_ORDER_TIME_BETWEEN', 'Maximum time between orders in seconds') },
49
- { key: 'orders_group_max_distance_between_pickup', content: t('MAX_DISTANCE_BETWEEN_BUSINESS', 'Maximum distance between businesses in meters') },
50
- { key: 'orders_group_max_distance_between_delivery', content: t('MAX_DISTANCE_BETWEEN_DELIVERY', 'Maximum distance between deliveries in meters') },
51
- { key: 'orders_group_use_maps_api', content: t('USE_MAPS_API', 'Use maps api') },
52
- { key: 'orders_group_max_time_between_pickup', content: t('MAX_DISTANCE_BETWEEN_BUSINESS', 'Maximum distance between businesses in meters') },
53
- { key: 'orders_group_max_time_between_delivery', content: t('MAX_DISTANCE_BETWEEN_DELIVERY', 'Maximum distance between deliveries in meters') },
54
- { key: 'autoassign_forced_assignment', content: t('AUTO_ASSIGN_FORCED_ASSIGNMENT', 'Forced assignment') },
55
- { key: 'autoassign_customer_max_distance_from_business', content: t('MAX_CUSTOMER_DISTANCE_FROM_BUSINESS', 'Max distance between customer and business') },
56
- { key: 'autoassign_initial_radius', content: t('INITIAL_RADIUS', 'Initial radius in meters') },
57
- { key: 'autoassign_increment_radius', content: t('INCREMENT_RADIUS', 'Radius increase in meters') },
58
- { key: 'autoassign_max_radius', content: t('MAX_RADIUS', 'Maximum radius in meters') },
59
- { key: 'autoassign_autoreject_time', content: t('AUTO_REJECT_ORDER_GROUP_AFTER', 'Auto reject Orders After') },
60
- { key: 'autoassign_max_orders', content: t('MAX_AMOUNT_ORDERS_PER_DRIVER', 'Maximum amount of orders per drivers') },
61
- { key: 'autoassign_max_in_pending', content: t('ORDER_PENDING', 'Pending') },
62
- { key: 'available', content: t('AVAILABLE', 'Available') },
63
- { key: 'enabled', content: t('ENABLED', 'Enabled') },
64
- { key: 'last_available_at', content: t('LAST_AVAILABLE_AT', 'Last available at') },
65
- { key: 'busy', content: t('BUSY', 'Busy') }
66
- ]
67
- const found = attributes.find(attribute => attribute.key === key)
68
- if (found) {
69
- return found.content
70
- } else {
71
- return key
72
- }
73
- }
74
-
75
44
  const handleChangePage = (page) => {
76
45
  getDriversGroupLogs(page, 10)
77
46
  }
@@ -60,19 +60,19 @@ export const DeliveryUsersListing = (props) => {
60
60
  getDrivers(expectedPage, pageSize, selectedGroup?.id)
61
61
  }
62
62
 
63
- const getDatesInRange = (date_range) => {
64
- const start = moment(date_range[0])
65
- const end = moment(date_range[1])
66
- const dates = [];
63
+ const getDatesInRange = (dateRange) => {
64
+ const start = moment(dateRange[0])
65
+ const end = moment(dateRange[1])
66
+ const dates = []
67
67
 
68
- let current = start;
68
+ let current = start
69
69
 
70
70
  while (current <= end) {
71
71
  dates.push(current.format('YYYY-MM-DD'))
72
72
  current = current.clone().add(1, 'days')
73
73
  }
74
74
 
75
- return dates;
75
+ return dates
76
76
  }
77
77
 
78
78
  const handleHourBlockWidth = (block) => {
@@ -103,7 +103,7 @@ export const DeliveryUsersListing = (props) => {
103
103
  cellSections={21.5}
104
104
  onClick={() => handleSelectDriver(user, block)}
105
105
  >
106
- <UserName>{`${!!user?.name ? user?.name : ''} ${!!user?.lastname ? user?.lastname : ''}`}</UserName>
106
+ <UserName>{`${user?.name ?? ''} ${user?.lastname ?? ''}`}</UserName>
107
107
  <p>{moment(block.start).format(hourFormat)} - {moment(block.end).format(hourFormat)}</p>
108
108
  </Block>
109
109
  </td>
@@ -112,32 +112,35 @@ export const DeliveryUsersListing = (props) => {
112
112
  const handleBlockWeekToShow = (block, user, allBlocks, blockByDay) => {
113
113
  if (!block) return
114
114
  return block.start && block.end && (
115
- blockByDay?.length === 1 ?
116
- <Block
117
- innerWidth={106}
118
- rowPosition={allBlocks.indexOf(moment(block?.start).format('YYYY-MM-DD'))}
119
- cellPosition={4}
120
- cellWidth={160}
121
- cellSections={6.67}
122
- onClick={() => handleSelectDriver(user, block)}
123
- >
124
- <p>{moment(block.start).format(hourFormat)} - {moment(block.end).format(hourFormat)}</p>
125
- </Block>
126
- :
127
- <ButtonWrapper
128
- rowPosition={allBlocks.indexOf(moment(block?.start).format('YYYY-MM-DD'))}
129
- cellPosition={moment(block?.start).hour()}
130
- cellWidth={160}
131
- cellSections={6.67}
132
- >
133
- <Button
134
- color='lightPrimary'
135
- borderRadius='8px'
136
- onClick={() => setStackEventsState({ open: true, events: blockByDay, user: user })}
115
+ blockByDay?.length === 1
116
+ ? (
117
+ <Block
118
+ innerWidth={106}
119
+ rowPosition={allBlocks.indexOf(moment(block?.start).format('YYYY-MM-DD'))}
120
+ cellPosition={4}
121
+ cellWidth={160}
122
+ cellSections={6.67}
123
+ onClick={() => handleSelectDriver(user, block)}
124
+ >
125
+ <p>{moment(block.start).format(hourFormat)} - {moment(block.end).format(hourFormat)}</p>
126
+ </Block>
127
+ )
128
+ : (
129
+ <ButtonWrapper
130
+ rowPosition={allBlocks.indexOf(moment(block?.start).format('YYYY-MM-DD'))}
131
+ cellPosition={moment(block?.start).hour()}
132
+ cellWidth={160}
133
+ cellSections={6.67}
137
134
  >
138
- {blockByDay?.length} {t('BLOCKS', 'Blocks')}
139
- </Button>
140
- </ButtonWrapper>
135
+ <Button
136
+ color='lightPrimary'
137
+ borderRadius='8px'
138
+ onClick={() => setStackEventsState({ open: true, events: blockByDay, user: user })}
139
+ >
140
+ {blockByDay?.length} {t('BLOCKS', 'Blocks')}
141
+ </Button>
142
+ </ButtonWrapper>
143
+ )
141
144
  )
142
145
  }
143
146
 
@@ -148,15 +151,6 @@ export const DeliveryUsersListing = (props) => {
148
151
  })
149
152
  }
150
153
 
151
- useEffect(() => {
152
- if (driversList.loading || driversList?.users?.length > 0 || paginationProps.totalPages <= 1) return
153
- if (paginationProps.currentPage !== paginationProps.totalPages) {
154
- handleChangePage(paginationProps.currentPage)
155
- } else {
156
- handleChangePage(paginationProps.currentPage - 1)
157
- }
158
- }, [driversList?.users, paginationProps])
159
-
160
154
  return (
161
155
  <UsersListingContainer>
162
156
  <UsersConatiner>
@@ -26,13 +26,13 @@ import {
26
26
  DeleteWrapper,
27
27
  OrderStatusTypeSelectWrapper,
28
28
  StackedBlock,
29
- DriverMultiSelectorContainer,
30
- WrapperRow,
31
- WarningMessage
29
+ WarningMessage,
30
+ FiltContainer
32
31
  } from './styles'
33
32
  import { Select } from '../../../styles/Select'
34
33
  import { DriverMultiSelector } from '../../Orders/DriverMultiSelector'
35
34
  import TiWarningOutline from '@meronex/icons/ti/TiWarningOutline'
35
+ import MdClose from '@meronex/icons/md/MdClose'
36
36
 
37
37
  const DriversTimeDisplayUI = (props) => {
38
38
  const {
@@ -78,7 +78,10 @@ const DriversTimeDisplayUI = (props) => {
78
78
  handleSetInitialStates,
79
79
  filterValues,
80
80
  handleChangeDriver,
81
- handleClearFilters
81
+ handleClearFilters,
82
+ setFiltOption,
83
+ filtOption,
84
+ handleClearDriversList
82
85
  } = props
83
86
 
84
87
  const [, t] = useLanguage()
@@ -128,11 +131,24 @@ const DriversTimeDisplayUI = (props) => {
128
131
  }
129
132
  ]
130
133
 
131
- const changeDriverGroupState = (_driverGroup) => {
134
+ const handleCleanFilters = () => {
132
135
  setShowSelectHeader(false)
136
+ handleClearFilters()
137
+ }
138
+
139
+ const changeDriverGroupState = (_driverGroup) => {
140
+ if (_driverGroup?.id === selectedGroup?.id) return
141
+ handleCleanFilters()
133
142
  setSelectedGroup(_driverGroup)
134
143
  }
135
144
 
145
+ const handleCloseFiltOption = () => {
146
+ setSelectedGroup(null)
147
+ setFiltOption(null)
148
+ handleClearDriversList()
149
+ handleCleanFilters()
150
+ }
151
+
136
152
  const handleChangeDate = (date1, date2) => {
137
153
  const diff = moment(date2).diff(date1, 'days')
138
154
  if (diff > 31) {
@@ -269,6 +285,11 @@ const DriversTimeDisplayUI = (props) => {
269
285
  setScheduleOptions(_scheduleOptions)
270
286
  }
271
287
 
288
+ const handleChangeFiltOption = (option) => {
289
+ setFiltOption(option)
290
+ option === 'driver_groups' && setShowSelectHeader(true)
291
+ }
292
+
272
293
  useEffect(() => {
273
294
  const isTodayOrPastDate = moment(selectedDate).format('YYYY-MM-DD') <= moment().format('YYYY-MM-DD')
274
295
  const date = moment(selectedDate).format('YYYY-MM-DD')
@@ -388,9 +409,61 @@ const DriversTimeDisplayUI = (props) => {
388
409
  <div>
389
410
  <h1>{t('DRIVERS_TIME_DISPLAY', 'Drivers time display')}</h1>
390
411
  <DriverGroupSelectorWrapper>
391
- <DriverGroupName onClick={() => setShowSelectHeader(!showSelectHeader)}>
392
- {t('SELECT_DRIVER_GROUP', 'Select a driver group')}
393
- </DriverGroupName>
412
+ <span className='calendar'>{t('CALENDAR', 'Calendar')}</span>
413
+ <ChevronRight />
414
+ {!filtOption ? (
415
+ <>
416
+ <DriverGroupName className='calendar' onClick={() => handleChangeFiltOption('driver_groups')}>{t('SELECT_DRIVER_GROUPS', 'Select driver groups')}</DriverGroupName>
417
+ <span> {t('OR', 'Or')} </span>
418
+ <DriverGroupName className='calendar' onClick={() => handleChangeFiltOption('drivers')}>{t('SELECT_DRIVERS', 'Select drivers')}</DriverGroupName>
419
+ </>
420
+ ) : (
421
+ <FiltContainer>
422
+ <DriverGroupName
423
+ className='calendar'
424
+ onClick={() => filtOption === 'driver_groups' ? setShowSelectHeader(!showSelectHeader) : {}}
425
+ >
426
+ {filtOption === 'driver_groups' ? t('DRIVER_GROUPS', 'driver groups') : t('DRIVERS', 'drivers')}
427
+ </DriverGroupName>
428
+ <Button
429
+ circle
430
+ outline
431
+ color='primary'
432
+ type='reset'
433
+ className='remove_option'
434
+ onClick={() => handleCloseFiltOption()}
435
+ >
436
+ <MdClose />
437
+ </Button>
438
+ </FiltContainer>
439
+ )}
440
+ <ChevronRight />
441
+ {(selectedGroup || (filtOption === 'drivers')) && (
442
+ <>
443
+ {selectedGroup && (
444
+ <>
445
+ <span>{selectedGroup?.name}</span>
446
+ <ChevronRight />
447
+ <span>{t('DRIVERS', 'DRIVERS')}</span>
448
+ <ChevronRight />
449
+ </>
450
+ )}
451
+ <DriverMultiSelector
452
+ isSearchByName
453
+ useDriversByProps={selectedGroup}
454
+ drivers={selectedGroup?.drivers}
455
+ disableSocketRoomDriver
456
+ useTextStyle
457
+ hideChevronIcon
458
+ autoOpen={filtOption === 'drivers'}
459
+ filterValues={filterValues}
460
+ handleChangeDriver={handleChangeDriver}
461
+ andText={t('AND', 'And')}
462
+ textClassnames='calendar'
463
+ optionsPosition='left'
464
+ />
465
+ </>
466
+ )}
394
467
  {showSelectHeader && (
395
468
  <DriverGroupSelectHeader
396
469
  close={() => setShowSelectHeader(false)}
@@ -398,36 +471,17 @@ const DriversTimeDisplayUI = (props) => {
398
471
  changeDriverGroupState={changeDriverGroupState}
399
472
  />
400
473
  )}
401
- <ChevronRight />
402
- <span className='calendar'>{t('CALENDAR', 'Calendar')}</span>
403
- {selectedGroup && (
404
- <>
405
- <ChevronRight />
406
- <span>{selectedGroup?.name}</span>
407
- </>
474
+ {(filterValues?.driverIds?.length > 0) && (
475
+ <WarningMessage>
476
+ <TiWarningOutline />
477
+ <span>{t('FILTER_APPLIED', 'Filters applied')}</span>
478
+ <LinkButton onClick={() => handleClearFilters()}>{t('CLEAR_FILTERS', 'Clear filters')}</LinkButton>
479
+ </WarningMessage>
408
480
  )}
409
481
  </DriverGroupSelectorWrapper>
410
482
  </div>
411
483
 
412
- {(filterValues?.driverIds?.length > 0) && (
413
- <WarningMessage>
414
- <TiWarningOutline />
415
- <span>{t('WARNING_FILTER_APPLIED', 'Filters applied. You may miss new orders.')}</span>
416
- <LinkButton onClick={() => handleClearFilters()}>{t('CLEAR_FILTERS', 'Clear filters')}</LinkButton>
417
- </WarningMessage>
418
- )}
419
484
  <DriversGroupCalendarWrapper>
420
- {selectedGroup && (
421
- <WrapperRow wrapperWidth={400}>
422
- <DriverMultiSelectorContainer>
423
- <DriverMultiSelector
424
- disableSocketRoomDriver
425
- filterValues={filterValues}
426
- handleChangeDriver={handleChangeDriver}
427
- />
428
- </DriverMultiSelectorContainer>
429
- </WrapperRow>
430
- )}
431
485
  <AnalyticsCalendar {...props} handleChangeDate={handleChangeDate} />
432
486
  </DriversGroupCalendarWrapper>
433
487
  </HeaderWrapper>
@@ -554,7 +608,8 @@ export const DriversTimeDisplay = (props) => {
554
608
  initialPage: 1,
555
609
  pageSize: 10,
556
610
  controlType: 'pages'
557
- }
611
+ },
612
+ propsToFetch: ['id', 'enabled', 'name', 'email', 'level', 'lastname', 'delivery_blocks', 'photo']
558
613
  }
559
614
  return (
560
615
  <CalendarDriversListController {...driversTimeDisplayProps} />
@@ -63,7 +63,7 @@ export const DriverGroupSelectorWrapper = styled.div`
63
63
  width: fit-content;
64
64
  margin: 3px 0;
65
65
 
66
- > span {
66
+ span {
67
67
  font-size: 14px;
68
68
  color: ${props => props.theme.colors.secundaryLight};
69
69
  &.calendar {
@@ -942,10 +942,10 @@ export const WarningMessage = styled.div`
942
942
  padding: 0px 15px;
943
943
  box-sizing: border-box;
944
944
  margin: 10px 0px 0px 0px !important;
945
-
946
- right: 0px;
945
+ max-width: 250px;
946
+ left: 0px;
947
947
  ${props => props.theme?.rtl && css`
948
- left: 0px;
948
+ right: 0px;
949
949
  right: initial;
950
950
  `}
951
951
 
@@ -991,3 +991,21 @@ export const WarningMessage = styled.div`
991
991
  }
992
992
  }
993
993
  `
994
+
995
+ export const FiltContainer = styled.div`
996
+ display: inline-block;
997
+ position: relative;
998
+ button {
999
+ position: absolute;
1000
+ display: flex;
1001
+ align-items: center;
1002
+ justify-content: center;
1003
+ position: absolute;
1004
+ background: transparent;
1005
+ width: 20px;
1006
+ height: 20px;
1007
+ transform: translate(140%, -50%);
1008
+ top: 5px;
1009
+ right: 10px;
1010
+ }
1011
+ `
@@ -21,14 +21,29 @@ const DriverMultiSelectorUI = (props) => {
21
21
  small,
22
22
  padding,
23
23
  handleChangeDriver,
24
- filterValues
24
+ filterValues,
25
+ useTextStyle,
26
+ hideChevronIcon,
27
+ andText,
28
+ textClassnames,
29
+ pagination,
30
+ handleChangePage,
31
+ handleChangePageSize,
32
+ useDriversByProps,
33
+ setSearchValue,
34
+ searchValue,
35
+ optionsPosition
25
36
  } = props
26
37
 
27
38
  const [{ dictionary }] = useLanguage()
28
39
  const theme = useTheme()
29
40
  const [driversMultiOptionList, setDriversMultiOptionList] = useState([])
30
- const [searchValue, setSearchValue] = useState(null)
31
- const driversLoading = [{ value: 'default', content: <Option small={small}>{dictionary?.LOADING ?? 'loading'}...</Option> }]
41
+
42
+ const driversLoading = [{
43
+ value: 'default',
44
+ content: <Option small={small}>{dictionary?.LOADING ?? 'loading'}...</Option>,
45
+ showOnSelected: useTextStyle ? dictionary?.LOADING ?? 'loading' : null
46
+ }]
32
47
 
33
48
  useEffect(() => {
34
49
  const _driversOptionList = [
@@ -36,7 +51,8 @@ const DriverMultiSelectorUI = (props) => {
36
51
  value: 'default',
37
52
  content: <Option padding='0px'><span>{dictionary?.SELECT_DRIVER ?? 'Select driver'}</span></Option>,
38
53
  color: 'primary',
39
- showDisable: true
54
+ showDisable: true,
55
+ showOnSelected: useTextStyle ? dictionary?.SELECT_DRIVER ?? 'Select driver' : null
40
56
  }
41
57
  ]
42
58
  if (!driversList.loading) {
@@ -62,7 +78,8 @@ const DriverMultiSelectorUI = (props) => {
62
78
  </DriverNameContainer>
63
79
  </OptionContent>
64
80
  </Option>
65
- )
81
+ ),
82
+ showOnSelected: useTextStyle ? driver.name : null
66
83
  }
67
84
  })
68
85
 
@@ -78,22 +95,37 @@ const DriverMultiSelectorUI = (props) => {
78
95
 
79
96
  return (
80
97
  <>
81
- {!driversList.loading ? (
98
+ {!driversList.loading || (!useDriversByProps && pagination) ? (
82
99
  <MultiSelect
83
- defaultValue={filterValues.driverIds}
100
+ isLoading={driversList.loading}
101
+ useLazyPagination={!useDriversByProps}
102
+ searchBarIsNotLazyLoad={useDriversByProps}
103
+ useTextStyle={useTextStyle}
104
+ hideChevronIcon={hideChevronIcon}
105
+ andText={andText}
106
+ textClassnames={textClassnames}
107
+ defaultValue={driversList.loading && !useDriversByProps ? 'loading' : filterValues.driverIds}
84
108
  placeholder={Placeholder}
85
- options={driversMultiOptionList}
109
+ options={driversList.loading && !useDriversByProps ? driversLoading : driversMultiOptionList}
86
110
  optionInnerMargin='10px'
87
111
  optionInnerMaxHeight='150px'
112
+ optionsPosition={optionsPosition}
88
113
  onChange={(driver) => handleChangeDriver(driver)}
89
114
  isShowSearchBar
90
115
  searchBarIsCustomLayout
91
- searchBarIsNotLazyLoad
92
116
  searchValue={searchValue}
93
117
  handleChangeSearch={(val) => setSearchValue(val)}
118
+ pagination={pagination}
119
+ handleChangePage={handleChangePage}
120
+ handleChangePageSize={handleChangePageSize}
94
121
  />
95
122
  ) : (
96
123
  <MultiSelect
124
+ searchBarIsNotLazyLoad={useDriversByProps}
125
+ useTextStyle={useTextStyle}
126
+ hideChevronIcon={hideChevronIcon}
127
+ andText={andText}
128
+ textClassnames={textClassnames}
97
129
  defaultValue='default'
98
130
  options={driversLoading}
99
131
  optionInnerMargin='10px'
@@ -101,7 +133,6 @@ const DriverMultiSelectorUI = (props) => {
101
133
  className='driver-select'
102
134
  isShowSearchBar
103
135
  searchBarIsCustomLayout
104
- searchBarIsNotLazyLoad
105
136
  searchValue={searchValue}
106
137
  handleChangeSearch={(val) => setSearchValue(val)}
107
138
  />
@@ -114,6 +145,11 @@ export const DriverMultiSelector = (props) => {
114
145
  const DriversControlProps = {
115
146
  ...props,
116
147
  UIComponent: DriverMultiSelectorUI,
148
+ paginationSettings: {
149
+ initialPage: 1,
150
+ pageSize: 10,
151
+ controlType: 'pages'
152
+ },
117
153
  propsToFetch: ['id', 'name', 'lastname', 'cellphone', 'photo']
118
154
  }
119
155
  return (
@@ -19,6 +19,7 @@ import { BusinessOrderingChannels } from '../BusinessOrderingChannels'
19
19
  import { BusinessFrontLayout } from '../BusinessFrontLayout'
20
20
  // import { BusinessPublishing } from '../BusinessPublishing'
21
21
  import { BusinessPlaceGroupList } from '../BusinessPlaceGroupList'
22
+ import { BusinessLogs } from '../BusinessLogs'
22
23
  import { SpoonityApiKey } from '../SpoonityApiKey'
23
24
 
24
25
  import { MoreSidebarLayout, Personalization, Alert } from '../../Shared'
@@ -348,6 +349,11 @@ export const BusinessDetailsUI = (props) => {
348
349
  spoonityKeyState={spoonityKeyState}
349
350
  />
350
351
  )}
352
+ {selectedItem === 'logs' && (
353
+ <BusinessLogs
354
+ businessId={businessState?.business?.id}
355
+ />
356
+ )}
351
357
  </MoreSidebarLayout>
352
358
  )}
353
359