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.
Files changed (79) hide show
  1. package/_bundles/{ordering-ui-admin.a9792b22d968cdf424d1.js → ordering-ui-admin.d6c72a98321193c34fe9.js} +2 -2
  2. package/_modules/components/BusinessIntelligence/AnalyticsOrdersStatus/index.js +2 -1
  3. package/_modules/components/BusinessIntelligence/BusinessAnalytics/index.js +4 -13
  4. package/_modules/components/BusinessIntelligence/CountryFilter/index.js +18 -4
  5. package/_modules/components/BusinessIntelligence/DriverAnalytics/index.js +4 -13
  6. package/_modules/components/BusinessIntelligence/ReportsBusinessDistance/index.js +4 -13
  7. package/_modules/components/BusinessIntelligence/ReportsBusinessSpend/index.js +4 -13
  8. package/_modules/components/BusinessIntelligence/ReportsDriverDistance/index.js +4 -13
  9. package/_modules/components/BusinessIntelligence/ReportsDriverOrder/index.js +4 -13
  10. package/_modules/components/BusinessIntelligence/ReportsDriverOrderTime/index.js +4 -13
  11. package/_modules/components/BusinessIntelligence/ReportsDriverSpend/index.js +4 -13
  12. package/_modules/components/BusinessIntelligence/ReportsGeneralSales/index.js +4 -13
  13. package/_modules/components/BusinessIntelligence/ReportsHeatMap/index.js +4 -13
  14. package/_modules/components/BusinessIntelligence/ReportsOrderDistance/index.js +4 -13
  15. package/_modules/components/BusinessIntelligence/ReportsOrderStatus/index.js +4 -13
  16. package/_modules/components/BusinessIntelligence/ReportsOrders/index.js +4 -13
  17. package/_modules/components/BusinessIntelligence/ReportsSaleAndCategory/index.js +4 -13
  18. package/_modules/components/BusinessIntelligence/ReportsSales/index.js +4 -13
  19. package/_modules/components/Delivery/DriversGroupAddForm/GeneralForm/index.js +3 -4
  20. package/_modules/components/Delivery/DriversGroupDetails/index.js +23 -33
  21. package/_modules/components/Delivery/DriversGroupGeneralForm/index.js +2 -23
  22. package/_modules/components/Delivery/DriversGroupGeneralForm/styles.js +3 -8
  23. package/_modules/components/Delivery/DriversGroupsList/index.js +8 -7
  24. package/_modules/components/Delivery/DriversGroupsList/styles.js +38 -35
  25. package/_modules/components/Delivery/UserAddForm/index.js +16 -4
  26. package/_modules/components/Delivery/UserFormDetails/index.js +17 -5
  27. package/_modules/components/MyProducts/AdvancedSettings/index.js +9 -1
  28. package/_modules/components/MyProducts/OrderingWebsite/index.js +7 -3
  29. package/_modules/components/OrderingProducts/SiteTheme/index.js +3 -3
  30. package/_modules/components/Orders/DeliveriesManager/index.js +6 -8
  31. package/_modules/components/Orders/OrdersManager/index.js +9 -11
  32. package/_modules/components/Stores/BusinessDeliveryGroupsDetails/index.js +15 -30
  33. package/_modules/components/Stores/BusinessDeliveryGroupsDetails/styles.js +4 -4
  34. package/_modules/components/Stores/BusinessProductsListing/index.js +6 -0
  35. package/_modules/components/Stores/ProductExtraOptionDetails/index.js +20 -2
  36. package/_modules/components/Stores/ProductExtraOptions/index.js +19 -5
  37. package/_modules/components/Stores/ProductExtraOptions/styles.js +19 -22
  38. package/_modules/components/Stores/ProductExtras/index.js +19 -18
  39. package/_modules/components/Stores/ProductExtras/styles.js +1 -1
  40. package/package.json +2 -2
  41. package/src/components/BusinessIntelligence/AnalyticsOrdersStatus/index.js +1 -1
  42. package/src/components/BusinessIntelligence/BusinessAnalytics/index.js +5 -12
  43. package/src/components/BusinessIntelligence/CountryFilter/index.js +72 -56
  44. package/src/components/BusinessIntelligence/DriverAnalytics/index.js +5 -12
  45. package/src/components/BusinessIntelligence/ReportsBusinessDistance/index.js +5 -12
  46. package/src/components/BusinessIntelligence/ReportsBusinessSpend/index.js +5 -12
  47. package/src/components/BusinessIntelligence/ReportsDriverDistance/index.js +5 -12
  48. package/src/components/BusinessIntelligence/ReportsDriverOrder/index.js +5 -12
  49. package/src/components/BusinessIntelligence/ReportsDriverOrderTime/index.js +5 -12
  50. package/src/components/BusinessIntelligence/ReportsDriverSpend/index.js +5 -12
  51. package/src/components/BusinessIntelligence/ReportsGeneralSales/index.js +5 -12
  52. package/src/components/BusinessIntelligence/ReportsHeatMap/index.js +5 -12
  53. package/src/components/BusinessIntelligence/ReportsOrderDistance/index.js +5 -12
  54. package/src/components/BusinessIntelligence/ReportsOrderStatus/index.js +5 -12
  55. package/src/components/BusinessIntelligence/ReportsOrders/index.js +5 -12
  56. package/src/components/BusinessIntelligence/ReportsSaleAndCategory/index.js +5 -12
  57. package/src/components/BusinessIntelligence/ReportsSales/index.js +5 -12
  58. package/src/components/Delivery/DriversGroupAddForm/GeneralForm/index.js +3 -2
  59. package/src/components/Delivery/DriversGroupDetails/index.js +2 -9
  60. package/src/components/Delivery/DriversGroupGeneralForm/index.js +3 -29
  61. package/src/components/Delivery/DriversGroupGeneralForm/styles.js +0 -15
  62. package/src/components/Delivery/DriversGroupsList/index.js +54 -42
  63. package/src/components/Delivery/DriversGroupsList/styles.js +12 -11
  64. package/src/components/Delivery/UserAddForm/index.js +32 -13
  65. package/src/components/Delivery/UserFormDetails/index.js +30 -13
  66. package/src/components/MyProducts/AdvancedSettings/index.js +3 -1
  67. package/src/components/MyProducts/OrderingWebsite/index.js +57 -50
  68. package/src/components/OrderingProducts/SiteTheme/index.js +4 -2
  69. package/src/components/Orders/DeliveriesManager/index.js +3 -2
  70. package/src/components/Orders/OrdersManager/index.js +3 -2
  71. package/src/components/Stores/BusinessDeliveryGroupsDetails/index.js +4 -16
  72. package/src/components/Stores/BusinessDeliveryGroupsDetails/styles.js +6 -10
  73. package/src/components/Stores/BusinessProductsListing/index.js +8 -0
  74. package/src/components/Stores/ProductExtraOptionDetails/index.js +15 -1
  75. package/src/components/Stores/ProductExtraOptions/index.js +16 -3
  76. package/src/components/Stores/ProductExtraOptions/styles.js +4 -7
  77. package/src/components/Stores/ProductExtras/index.js +14 -16
  78. package/src/components/Stores/ProductExtras/styles.js +4 -0
  79. /package/_bundles/{ordering-ui-admin.a9792b22d968cdf424d1.js.LICENSE.txt → ordering-ui-admin.d6c72a98321193c34fe9.js.LICENSE.txt} +0 -0
@@ -27,18 +27,19 @@ export const GroupsTable = styled.table`
27
27
 
28
28
  tbody {
29
29
  border-bottom: 1px solid ${props => props.theme.colors.borderColor};
30
- cursor: pointer;
31
-
32
- &:hover {
33
- background-color: ${props => props.theme.colors.lightPrimary};
34
- }
35
- &.active {
36
- background-color: ${props => props.theme.colors.lightPrimary};
37
- td {
38
- border-top: 1px solid ${props => props.theme.colors.primary};
39
- border-bottom: 1px solid ${props => props.theme.colors.primary};
30
+ ${({ disabled }) => !disabled && css`
31
+ cursor: pointer;
32
+ &:hover {
33
+ background-color: ${props => props.theme.colors.lightPrimary};
40
34
  }
41
- }
35
+ &.active {
36
+ background-color: ${props => props.theme.colors.lightPrimary};
37
+ td {
38
+ border-top: 1px solid ${props => props.theme.colors.primary};
39
+ border-bottom: 1px solid ${props => props.theme.colors.primary};
40
+ }
41
+ }
42
+ `}
42
43
  }
43
44
  `
44
45
 
@@ -340,20 +340,39 @@ const UserAddFormUI = (props) => {
340
340
  )
341
341
  )}
342
342
  {isDriversPage && (
343
- <InputWrapper>
344
- <DefaultSelect
345
- placeholder={t('SELECT_TIMEZONE', 'Select a timezone')}
346
- defaultValue={formState?.changes?.timezone}
347
- options={timezonesOptions}
348
- onChange={val => handleChangeSwtich('timezone', val)}
349
- optionInnerMaxHeight='300px'
350
- isShowSearchBar
351
- searchBarIsCustomLayout
352
- searchBarIsNotLazyLoad
353
- searchValue={timezoneSearchValue}
354
- handleChangeSearch={setTimezoneSearchValue}
343
+ <>
344
+ <Input
345
+ name='external_id'
346
+ className='form'
347
+ placeholder={t('EXTERNAL_ID', 'External Id')}
348
+ defaultValue={
349
+ formState?.result?.result
350
+ ? formState?.result?.result?.external_id
351
+ : formState?.changes?.external_id ?? ''
352
+ }
353
+ onChange={handleChangeInput}
354
+ autoComplete='off'
355
+ onKeyPress={(e) => {
356
+ if (!/^[0-9]$/.test(e.key)) {
357
+ e.preventDefault()
358
+ }
359
+ }}
355
360
  />
356
- </InputWrapper>
361
+ <InputWrapper>
362
+ <DefaultSelect
363
+ placeholder={t('SELECT_TIMEZONE', 'Select a timezone')}
364
+ defaultValue={formState?.changes?.timezone}
365
+ options={timezonesOptions}
366
+ onChange={val => handleChangeSwtich('timezone', val)}
367
+ optionInnerMaxHeight='300px'
368
+ isShowSearchBar
369
+ searchBarIsCustomLayout
370
+ searchBarIsNotLazyLoad
371
+ searchValue={timezoneSearchValue}
372
+ handleChangeSearch={setTimezoneSearchValue}
373
+ />
374
+ </InputWrapper>
375
+ </>
357
376
  )}
358
377
  {!!showInputPhoneNumber && (
359
378
  <InputPhoneNumber
@@ -274,20 +274,37 @@ export const UserFormDetailsUI = (props) => {
274
274
  )
275
275
  )}
276
276
  {isDriversPage && (
277
- <InputWrapper isTimezone>
278
- <DefaultSelect
279
- placeholder={t('SELECT_TIMEZONE', 'Select a timezone')}
280
- defaultValue={formState?.changes?.timezone ?? user?.timezone ?? ''}
281
- options={timezonesOptions}
282
- onChange={val => handleChangeSwtich('timezone', val)}
283
- optionInnerMaxHeight='300px'
284
- isShowSearchBar
285
- searchBarIsCustomLayout
286
- searchBarIsNotLazyLoad
287
- searchValue={timezoneSearchValue}
288
- handleChangeSearch={setTimezoneSearchValue}
277
+ <>
278
+ <Input
279
+ name='external_id'
280
+ className='form'
281
+ placeholder={t('EXTERNAL_ID', 'External Id')}
282
+ defaultValue={
283
+ formState?.changes?.external_id ?? (user && user?.external_id) ?? ''
284
+ }
285
+ onChange={handleChangeInput}
286
+ autoComplete='off'
287
+ onKeyPress={(e) => {
288
+ if (!/^[0-9]$/.test(e.key)) {
289
+ e.preventDefault()
290
+ }
291
+ }}
289
292
  />
290
- </InputWrapper>
293
+ <InputWrapper isTimezone>
294
+ <DefaultSelect
295
+ placeholder={t('SELECT_TIMEZONE', 'Select a timezone')}
296
+ defaultValue={formState?.changes?.timezone ?? user?.timezone ?? ''}
297
+ options={timezonesOptions}
298
+ onChange={val => handleChangeSwtich('timezone', val)}
299
+ optionInnerMaxHeight='300px'
300
+ isShowSearchBar
301
+ searchBarIsCustomLayout
302
+ searchBarIsNotLazyLoad
303
+ searchValue={timezoneSearchValue}
304
+ handleChangeSearch={setTimezoneSearchValue}
305
+ />
306
+ </InputWrapper>
307
+ </>
291
308
  )}
292
309
  {!!showInputPhoneNumber && (
293
310
  <InputPhoneNumber
@@ -151,7 +151,9 @@ export const AdvancedSettings = (props) => {
151
151
  ]
152
152
 
153
153
  const buttonList = [
154
- { name: t('BORDER_RADIUS', 'Border Radius'), type: 'input', path: 'general.components.buttons.borderRadius' }
154
+ { name: t('BUTTON_COLOR', 'Button color'), type: 'input', path: 'general.components.buttons.color' },
155
+ { name: t('BORDER_RADIUS', 'Border radius'), type: 'input', path: 'general.components.buttons.borderRadius' },
156
+ { name: t('BUTTON_TEXT_COLOR', 'Button text color'), type: 'input', path: 'general.components.buttons.buttonTextColor' }
155
157
  ]
156
158
 
157
159
  const homeImageFullScreen = [
@@ -188,6 +188,11 @@ const OrderingWebsiteUI = (props) => {
188
188
  orderingTheme.themes[0]?.values && setAdvancedValues(JSON.parse(JSON.stringify(orderingTheme.themes[0]?.values)))
189
189
  }
190
190
 
191
+ const handleChangeTab = (key) => {
192
+ setSelectedSetting(key)
193
+ setSelectedSubSetting('')
194
+ }
195
+
191
196
  return (
192
197
  <>
193
198
  <Container>
@@ -240,7 +245,7 @@ const OrderingWebsiteUI = (props) => {
240
245
  <Tab
241
246
  key={setting.key}
242
247
  active={selectedSetting === setting.key}
243
- onClick={() => !orderingTheme?.loading && setSelectedSetting(setting.key)}
248
+ onClick={() => !orderingTheme?.loading && handleChangeTab(setting.key)}
244
249
  >
245
250
  {setting.name}
246
251
  </Tab>
@@ -340,14 +345,14 @@ const OrderingWebsiteUI = (props) => {
340
345
  {orderingTheme?.loading ? (
341
346
  <Skeleton height={40} style={{ width: '100%' }} />
342
347
  ) : (
343
- <Button
344
- color='primary'
345
- outline
346
- borderRadius='8px'
348
+ <Button
349
+ color='primary'
350
+ outline
351
+ borderRadius='8px'
347
352
  onClick={() => window.open('https://www.ordering.co/custom-domain-change', '_blank')}
348
- >
353
+ >
349
354
  {t('REQUEST_CUSTOM_DOMAIN', 'Request custom domain')}
350
- </Button>
355
+ </Button>
351
356
  // <>
352
357
  // {site?.domain && site?.ssl_status !== 'error' && (
353
358
  // <TemporalDomail isDisabled={site?.ssl_process_status === 'pending'} marginBottom={site?.ssl_process_status === 'ended'}>
@@ -628,49 +633,51 @@ const OrderingWebsiteUI = (props) => {
628
633
  </FormWrapper>
629
634
  )}
630
635
  {selectedSetting === 'advanced' && (
631
- <InputFormWrapper>
632
- <TitleWrapper isMargin>
633
- <h4>{t('SETTINGS', 'Settings')}</h4>
634
- <CustomDomainInfo>
635
- <IconButton
636
- color='primary'
637
- >
638
- <InfoCircleFill />
639
- </IconButton>
640
- <CustomDomainInfoContent>
641
- <span>{t('ADVANCED_SETTING_HELP', 'For now you can\'t use layouts and advanced setting together, if you change between layouts and advance settings the settings will be reset to default')}</span>
642
- </CustomDomainInfoContent>
643
- </CustomDomainInfo>
644
- </TitleWrapper>
645
- <RadioItem
646
- onClick={() => handleChangeSubSetting('advanced')}
647
- >
648
- {selectedSubSetting === 'advanced' ? <RecordCircleFill className='active' /> : <Circle />}
649
- <span>{t('ADVANCED_SETTINGS', 'Advanced Settings')}</span>
650
- </RadioItem>
651
- <RadioItem
652
- onClick={() => handleChangeSubSetting('advanced_layouts')}
653
- >
654
- {selectedSubSetting === 'advanced_layouts' ? <RecordCircleFill className='active' /> : <Circle />}
655
- <span>{t('ADVANCED_LAYOUTS', 'Advanced Layouts')}</span>
656
- </RadioItem>
657
- </InputFormWrapper>
658
- )}
659
- {selectedSubSetting === 'advanced' && !orderingTheme?.loading && (
660
- <AdvancedSettings
661
- themesList={themesList}
662
- advancedValues={advancedValues}
663
- setAdvancedValues={setAdvancedValues}
664
- handleUpdateSiteTheme={handleUpdateSiteTheme}
665
- />
666
- )}
667
- {selectedSubSetting === 'advanced_layouts' && !orderingTheme?.loading && (
668
- <AdvancedLayouts
669
- themesList={themesList}
670
- advancedValues={advancedValues}
671
- setAdvancedValues={setAdvancedValues}
672
- handleUpdateSiteTheme={handleUpdateSiteTheme}
673
- />
636
+ <>
637
+ <InputFormWrapper>
638
+ <TitleWrapper isMargin>
639
+ <h4>{t('SETTINGS', 'Settings')}</h4>
640
+ <CustomDomainInfo>
641
+ <IconButton
642
+ color='primary'
643
+ >
644
+ <InfoCircleFill />
645
+ </IconButton>
646
+ <CustomDomainInfoContent>
647
+ <span>{t('ADVANCED_SETTING_HELP', 'For now you can\'t use layouts and advanced setting together, if you change between layouts and advance settings the settings will be reset to default')}</span>
648
+ </CustomDomainInfoContent>
649
+ </CustomDomainInfo>
650
+ </TitleWrapper>
651
+ <RadioItem
652
+ onClick={() => handleChangeSubSetting('advanced')}
653
+ >
654
+ {selectedSubSetting === 'advanced' ? <RecordCircleFill className='active' /> : <Circle />}
655
+ <span>{t('ADVANCED_SETTINGS', 'Advanced Settings')}</span>
656
+ </RadioItem>
657
+ <RadioItem
658
+ onClick={() => handleChangeSubSetting('advanced_layouts')}
659
+ >
660
+ {selectedSubSetting === 'advanced_layouts' ? <RecordCircleFill className='active' /> : <Circle />}
661
+ <span>{t('ADVANCED_LAYOUTS', 'Advanced Layouts')}</span>
662
+ </RadioItem>
663
+ </InputFormWrapper>
664
+ {selectedSubSetting === 'advanced' && !orderingTheme?.loading && (
665
+ <AdvancedSettings
666
+ themesList={themesList}
667
+ advancedValues={advancedValues}
668
+ setAdvancedValues={setAdvancedValues}
669
+ handleUpdateSiteTheme={handleUpdateSiteTheme}
670
+ />
671
+ )}
672
+ {selectedSubSetting === 'advanced_layouts' && !orderingTheme?.loading && (
673
+ <AdvancedLayouts
674
+ themesList={themesList}
675
+ advancedValues={advancedValues}
676
+ setAdvancedValues={setAdvancedValues}
677
+ handleUpdateSiteTheme={handleUpdateSiteTheme}
678
+ />
679
+ )}
680
+ </>
674
681
  )}
675
682
  </Container>
676
683
  <Alert
@@ -144,7 +144,8 @@ const SiteThemeUI = (props) => {
144
144
  </PageHiddenCheckWrapper>
145
145
  )}
146
146
  <PageBlockTitle>{t('PAGE_BLOCKS', 'Page blocks')}</PageBlockTitle>
147
- {Object.keys(themeStructure[selectedPage]?.components).map(block => {
147
+ {!!themeStructure[selectedPage]?.components && (
148
+ Object.keys(themeStructure[selectedPage]?.components)?.map(block => {
148
149
  const components = themeStructure[selectedPage].components
149
150
  return (
150
151
  <BlockContainer key={block}>
@@ -203,7 +204,8 @@ const SiteThemeUI = (props) => {
203
204
  )}
204
205
  </BlockContainer>
205
206
  )
206
- })}
207
+ })
208
+ )}
207
209
  </>
208
210
  )}
209
211
  </ThemeStructureContainer>
@@ -30,7 +30,9 @@ const DeliveriesManagerUI = (props) => {
30
30
  handleSelectedSubOrderStatus,
31
31
  onOrderRedirect,
32
32
  numberOfOrdersByStatus,
33
- numberOfOrdersBySubstatus
33
+ numberOfOrdersBySubstatus,
34
+ timeStatus,
35
+ setTimeStatus
34
36
  } = props
35
37
 
36
38
  const [, t] = useLanguage()
@@ -39,7 +41,6 @@ const DeliveriesManagerUI = (props) => {
39
41
  const [orderDetailId, setOrderDetailId] = useState(null)
40
42
  const [detailsOrder, setDetailsOrder] = useState(null)
41
43
  const [filterModalOpen, setFilterModalOpen] = useState(false)
42
- const [timeStatus, setTimeStatus] = useState(null)
43
44
  const [slaSettingTime, setSlaSettingTime] = useState(60000)
44
45
 
45
46
  const [configState] = useConfig()
@@ -47,7 +47,9 @@ const OrdersManagerUI = (props) => {
47
47
  setSelectedOrderIds,
48
48
  numberOfOrdersByStatus,
49
49
  allowColumns,
50
- setAllowColumns
50
+ setAllowColumns,
51
+ timeStatus,
52
+ setTimeStatus
51
53
  } = props
52
54
 
53
55
  const [, t] = useLanguage()
@@ -63,7 +65,6 @@ const OrdersManagerUI = (props) => {
63
65
  const [currentTourStep, setCurrentTourStep] = useState(0)
64
66
  const [isTourFlag, setIsTourFlag] = useState(false)
65
67
  const [alertState, setAlertState] = useState({ open: false, content: [] })
66
- const [timeStatus, setTimeStatus] = useState(null)
67
68
  const [slaSettingTime, setSlaSettingTime] = useState(60000)
68
69
 
69
70
  const [totalSelectedOrder, setTotalSelectedOrder] = useState(0)
@@ -2,13 +2,13 @@ import React, { useState, useEffect } from 'react'
2
2
  import { useHistory } from 'react-router-dom'
3
3
  import { useLanguage, DriversGroupsList as DriversGroupsListController } from 'ordering-components-admin-external'
4
4
  import { getStorageItem, removeStorageItem } from '../../../utils'
5
- import { Alert, Confirm, SearchBar } from '../../Shared'
5
+ import { Alert, Confirm } from '../../Shared'
6
6
  import { WizardDelivery } from '../../Delivery/WizardDelivery'
7
7
  import { DriversGroupsList } from '../../Delivery/DriversGroupsList'
8
8
 
9
9
  import {
10
10
  DriversGroupsListingContainer,
11
- SearchContainer
11
+ Description
12
12
  } from './styles'
13
13
 
14
14
  const DriversGroupsListingDetailsUI = (props) => {
@@ -18,12 +18,11 @@ const DriversGroupsListingDetailsUI = (props) => {
18
18
  handleSelectGroup,
19
19
  handleAllSelectGroup,
20
20
  actionState,
21
- handleUpdateDriversGroup,
21
+ handleUpdateDriversGroup
22
22
  } = props
23
23
 
24
24
  const history = useHistory()
25
25
  const [, t] = useLanguage()
26
- const [searchValue, setSearchValue] = useState(null)
27
26
  const [alertState, setAlertState] = useState({ open: false, content: [] })
28
27
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
29
28
 
@@ -39,7 +38,6 @@ const DriversGroupsListingDetailsUI = (props) => {
39
38
  }, [actionState?.error])
40
39
 
41
40
  const handleOpenTour = () => {
42
- setOpenDetails(false)
43
41
  setCurrentTourStep(4)
44
42
  setIsTourOpen(true)
45
43
  }
@@ -63,21 +61,11 @@ const DriversGroupsListingDetailsUI = (props) => {
63
61
 
64
62
  return (
65
63
  <>
66
- <SearchContainer>
67
- <SearchBar
68
- lazyLoad
69
- isCustomLayout
70
- onSearch={val => setSearchValue(val)}
71
- search={searchValue}
72
- placeholder={t('SEARCH', 'Search')}
73
- customClass='searchBar'
74
- />
75
- </SearchContainer>
64
+ <Description>{t('BUSINESS_IN_FOLLOWING_DRIVER_GROUPS', 'This business is in the following driver groups')}</Description>
76
65
  <DriversGroupsListingContainer>
77
66
  <DriversGroupsList
78
67
  isFromStore
79
68
  driversGroupsState={driversGroupsState}
80
- searchValue={searchValue}
81
69
  handleUpdateDriversGroup={handleUpdateDriversGroup}
82
70
  selectedGroupList={selectedGroupList}
83
71
  handleSelectGroup={handleSelectGroup}
@@ -1,16 +1,12 @@
1
1
  import styled from 'styled-components'
2
2
 
3
3
  export const DriversGroupsListingContainer = styled.div`
4
- flex: 1;
5
- padding: 20px;
6
- box-sizing: border-box;
7
- transition: all 0.5s;
8
- max-height: 100vh;
9
- overflow: auto;
4
+ > div {
5
+ padding: 0;
6
+ margin-bottom: 30px;
7
+ }
10
8
  `
11
9
 
12
- export const SearchContainer = styled.div`
13
- input {
14
- width: 100%
15
- }
10
+ export const Description = styled.p`
11
+ font-size: 14px;
16
12
  `
@@ -109,6 +109,14 @@ const BusinessProductsListingUI = (props) => {
109
109
  {
110
110
  value: 'cost_price',
111
111
  content: t('PRODUCT_COST', 'Product cost')
112
+ },
113
+ {
114
+ value: 'inventoried',
115
+ content: t('INVENTORY', 'Inventory')
116
+ },
117
+ {
118
+ value: 'quantity',
119
+ content: t('QUANTITY', 'Quantity')
112
120
  }
113
121
  ]
114
122
  const handleChangeAllowSpreadColumns = (type) => {
@@ -89,6 +89,7 @@ const ProductExtraOptionDetailsUI = (props) => {
89
89
  const { handleSubmit, register, errors, control, setValue } = useForm()
90
90
  const [cropState, setCropState] = useState({ name: null, data: null, open: false })
91
91
  const [externalId, setExternalId] = useState()
92
+ const [timer, setTimer] = useState(null)
92
93
 
93
94
  const handleClickSubOptionImage = (id) => {
94
95
  document.getElementById(id).click()
@@ -151,6 +152,17 @@ const ProductExtraOptionDetailsUI = (props) => {
151
152
  }
152
153
  }
153
154
 
155
+ const onChangeAddModifierName = (e) => {
156
+ e.persist()
157
+ clearTimeout(timer)
158
+ const _timer = setTimeout(function () {
159
+ if (e.target.value) {
160
+ handleSubmit(handleAddOption)()
161
+ }
162
+ }, 750)
163
+ setTimer(_timer)
164
+ }
165
+
154
166
  const handleUpdateExternalId = () => {
155
167
  handleUpdateOption({ external_id: externalId })
156
168
  setOpenModal({ ...openModal, externalId: false })
@@ -325,6 +337,8 @@ const ProductExtraOptionDetailsUI = (props) => {
325
337
  ref={register({
326
338
  required: t('NAME_REQUIRED', 'The name is required.')
327
339
  })}
340
+ onChange={(e) => onChangeAddModifierName(e)}
341
+ readOnly={optionState?.loading}
328
342
  />
329
343
  </InputWrapper>
330
344
  </LeftSubOptionContent>
@@ -334,7 +348,7 @@ const ProductExtraOptionDetailsUI = (props) => {
334
348
  name='price'
335
349
  placeholder={t('PRICE', 'Price')}
336
350
  defaultValue={
337
- ((editSubOptionId === null) && changesState?.changes?.price) || ''
351
+ ((editSubOptionId === null) && changesState?.changes?.price) || 0
338
352
  }
339
353
  ref={register()}
340
354
  onKeyPress={(e) => {
@@ -136,8 +136,19 @@ const ProductExtraOptionsUI = (props) => {
136
136
  setIsMenuOpen(value)
137
137
  }
138
138
 
139
- const onSubmit = () => {
140
- handleAddOption()
139
+ const onSubmit = (formValues) => {
140
+ handleAddOption(formValues)
141
+ }
142
+
143
+ const onChangeAddExtraOptionName = (e) => {
144
+ e.persist()
145
+ clearTimeout(timer)
146
+ const _timer = setTimeout(function () {
147
+ if (e.target.value) {
148
+ handleSubmit(onSubmit)()
149
+ }
150
+ }, 750)
151
+ setTimer(_timer)
141
152
  }
142
153
 
143
154
  useEffect(() => {
@@ -313,9 +324,10 @@ const ProductExtraOptionsUI = (props) => {
313
324
  value={value}
314
325
  onChange={(e) => {
315
326
  onChange(e)
316
- handleChangeAddOption(e)
327
+ onChangeAddExtraOptionName(e)
317
328
  }}
318
329
  autoComplete='off'
330
+ readOnly={extraState?.loading}
319
331
  />
320
332
  )}
321
333
  rules={{
@@ -371,6 +383,7 @@ const ProductExtraOptionsUI = (props) => {
371
383
  />
372
384
  <IconButton
373
385
  type='submit'
386
+ style={{ visibility: 'hidden' }}
374
387
  >
375
388
  <PlusCircle />
376
389
  </IconButton>
@@ -80,6 +80,10 @@ export const OptionNameContainer = styled.div`
80
80
  &:focus {
81
81
  border: 1px dashed ${props => props.theme.colors.lightGray};
82
82
  }
83
+ &:read-only {
84
+ background-color: #F8F9FA;
85
+ cursor: not-allowed;
86
+ }
83
87
  ${props => props.theme?.rtl ? css`
84
88
  margin-right: 5px;
85
89
  ` : css`
@@ -214,13 +218,6 @@ export const AddOptionForm = styled.form`
214
218
  border: 1px dashed ${props => props.theme.colors.lightGray};
215
219
  }
216
220
  }
217
- > button {
218
- ${props => props.theme?.rtl ? css`
219
- margin-right: 10px;
220
- ` : css`
221
- margin-left: 10px;
222
- `}
223
- }
224
221
 
225
222
  @media (min-width: 450px) {
226
223
  > input {
@@ -25,12 +25,10 @@ const ProductExtrasUI = (props) => {
25
25
  const {
26
26
  productState,
27
27
  extrasState,
28
- changesState,
29
28
  isAddMode,
30
29
  handleOpenAddForm,
31
30
  handleChangeExtraInput,
32
31
  handleAddExtra,
33
- handleChangeAddExtraInput,
34
32
  setIsExtendExtraOpen,
35
33
  business,
36
34
  handleUpdateBusinessState,
@@ -56,6 +54,7 @@ const ProductExtrasUI = (props) => {
56
54
  const [currentExtra, setCurrentExtra] = useState(null)
57
55
  const [extraIds, setExtraIds] = useState([])
58
56
  const [isCheckboxClicked, setIsCheckboxClicked] = useState(false)
57
+ const [timer, setTimer] = useState(null)
59
58
 
60
59
  const handleOpenExtraDetails = (e, extra, isInitialRender) => {
61
60
  if (e?.target?.closest('.extra-checkbox') || e?.target?.closest('.draggable-dots')) return
@@ -80,13 +79,6 @@ const ProductExtrasUI = (props) => {
80
79
  history.replace(`${location.pathname}?category=${category}&product=${product}&section=${section}`)
81
80
  }
82
81
 
83
- const addExtraListener = (e) => {
84
- const outsideDropdown = !conatinerRef.current?.contains(e.target)
85
- if (outsideDropdown) {
86
- handleAddExtra()
87
- }
88
- }
89
-
90
82
  const handleExtraState = (id, checked) => {
91
83
  if (checked) {
92
84
  setExtraIds(prevState => ([...prevState, id]))
@@ -96,6 +88,17 @@ const ProductExtrasUI = (props) => {
96
88
  setIsCheckboxClicked(true)
97
89
  }
98
90
 
91
+ const onChangeAddExtraInput = (e) => {
92
+ e.persist()
93
+ clearTimeout(timer)
94
+ const _timer = setTimeout(function () {
95
+ if (e.target.value) {
96
+ handleAddExtra({ name: e.target.value })
97
+ }
98
+ }, 750)
99
+ setTimer(_timer)
100
+ }
101
+
99
102
  useEffect(() => {
100
103
  let _extraIds = []
101
104
  if (productState.product?.extras) {
@@ -110,12 +113,6 @@ const ProductExtrasUI = (props) => {
110
113
  handleProductExtraState(extraIds)
111
114
  }, [isCheckboxClicked, extraIds])
112
115
 
113
- useEffect(() => {
114
- if (!isAddMode) return
115
- document.addEventListener('click', addExtraListener)
116
- return () => document.removeEventListener('click', addExtraListener)
117
- }, [isAddMode, changesState])
118
-
119
116
  useEffect(() => {
120
117
  if (productState?.product?.error || extrasState?.extras?.error) {
121
118
  setAlertState({
@@ -196,8 +193,9 @@ const ProductExtrasUI = (props) => {
196
193
  <input
197
194
  name='name'
198
195
  placeholder={t('WRITE_A_NAME', 'Write a name')}
199
- onChange={(e) => handleChangeAddExtraInput(e)}
196
+ onChange={(e) => onChangeAddExtraInput(e)}
200
197
  autoComplete='off'
198
+ readOnly={extrasState?.loading}
201
199
  />
202
200
  </ExtraAddForm>
203
201
  )}
@@ -123,6 +123,10 @@ export const ExtraAddForm = styled.form`
123
123
  &:-ms-input-placeholder {
124
124
  color: #B1BCCC;
125
125
  }
126
+ &:read-only {
127
+ background-color: #F8F9FA;
128
+ cursor: not-allowed;
129
+ }
126
130
  }
127
131
  `
128
132
  export const DragImageWrapper = styled.div`