ordering-ui-admin-external 1.14.3 → 1.15.0

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 (134) hide show
  1. package/package.json +2 -2
  2. package/src/components/BusinessIntelligence/BusinessReviewDetails/index.js +4 -4
  3. package/src/components/BusinessIntelligence/BusinessReviewList/index.js +29 -6
  4. package/src/components/BusinessIntelligence/InvoiceBusinessManager/index.js +17 -1
  5. package/src/components/BusinessIntelligence/InvoiceDriverManager/index.js +17 -1
  6. package/src/components/BusinessIntelligence/InvoiceManager/index.js +16 -2
  7. package/src/components/BusinessIntelligence/InvoiceOrdertype/styles.js +1 -0
  8. package/src/components/BusinessIntelligence/ProductReviewDetails/index.js +4 -4
  9. package/src/components/BusinessIntelligence/Reports/index.js +16 -2
  10. package/src/components/BusinessIntelligence/ReviewProductsListing/index.js +34 -6
  11. package/src/components/BusinessIntelligence/ReviewsListing/index.js +31 -5
  12. package/src/components/BusinessIntelligence/UserReviewDetails/index.js +4 -4
  13. package/src/components/BusinessIntelligence/UsersReviewList/index.js +32 -11
  14. package/src/components/CartRecovery/RecoveryActionDetail/index.js +19 -1
  15. package/src/components/CartRecovery/RecoveryActionListing/index.js +21 -3
  16. package/src/components/Delivery/DeliveryUsersListing/index.js +3 -1
  17. package/src/components/Delivery/DriversCompaniesListing/index.js +27 -9
  18. package/src/components/Delivery/DriversCompanyDetailsForm/index.js +37 -8
  19. package/src/components/Delivery/DriversGroupDetails/index.js +36 -4
  20. package/src/components/Delivery/DriversGroupLogistics/index.js +18 -2
  21. package/src/components/Delivery/DriversGroupsListing/index.js +20 -6
  22. package/src/components/Delivery/UserDetails/index.js +26 -1
  23. package/src/components/Loyalty/GiftCardDetail/styles.js +192 -0
  24. package/src/components/Loyalty/GiftCards/index.js +22 -2
  25. package/src/components/Loyalty/PointsWalletBusinessList/index.js +24 -1
  26. package/src/components/Loyalty/PointsWalletLevels/index.js +21 -1
  27. package/src/components/Loyalty/RewardsPrograms/index.js +30 -3
  28. package/src/components/Loyalty/Wallet/index.js +22 -1
  29. package/src/components/Marketing/AdBannersListing/index.js +25 -8
  30. package/src/components/Marketing/BannerImageDetails/index.js +2 -1
  31. package/src/components/Marketing/CampaignDetail/index.js +22 -1
  32. package/src/components/Marketing/CampaignEmail/styles.js +3 -0
  33. package/src/components/Marketing/CampaignListing/index.js +18 -1
  34. package/src/components/Marketing/CampaignNotification/styles.js +3 -0
  35. package/src/components/Marketing/CampaignSMS/styles.js +3 -0
  36. package/src/components/Marketing/EnterprisePromotionGeneralDetails/index.js +2 -1
  37. package/src/components/Marketing/EnterprisePromotionListing/index.js +19 -1
  38. package/src/components/Marketing/PageBanner/index.js +26 -3
  39. package/src/components/Messages/MessagesListing/index.js +17 -0
  40. package/src/components/MyProducts/AdvancedSettings/FontStyleGroup.js +64 -0
  41. package/src/components/MyProducts/AdvancedSettings/OrderType.js +40 -0
  42. package/src/components/MyProducts/AdvancedSettings/SettingComponent.js +104 -0
  43. package/src/components/MyProducts/AdvancedSettings/index.js +541 -0
  44. package/src/components/MyProducts/AdvancedSettings/styles.js +388 -0
  45. package/src/components/MyProducts/AppLayout/index.js +19 -2
  46. package/src/components/MyProducts/AppLayout/styles.js +65 -0
  47. package/src/components/MyProducts/CallCenterApp/index.js +1 -1
  48. package/src/components/MyProducts/CustomerApp/index.js +2 -2
  49. package/src/components/MyProducts/DriverApp/index.js +2 -2
  50. package/src/components/MyProducts/KioskApp/index.js +1 -1
  51. package/src/components/MyProducts/OrderingWebsite/index.js +309 -255
  52. package/src/components/MyProducts/OrderingWebsite/styles.js +99 -2
  53. package/src/components/MyProducts/PosApp/index.js +1 -1
  54. package/src/components/MyProducts/StoreApp/index.js +2 -2
  55. package/src/components/OrderingProducts/OrderingProductDetails/index.js +24 -2
  56. package/src/components/OrderingProducts/OrderingProductsListing/index.js +17 -1
  57. package/src/components/Orders/DeliveriesManager/index.js +0 -1
  58. package/src/components/Orders/Messages/index.js +31 -11
  59. package/src/components/Orders/OrderDetails/index.js +34 -20
  60. package/src/components/Orders/OrderDetailsHeader/index.js +2 -3
  61. package/src/components/Orders/OrdersContentHeader/index.js +1 -1
  62. package/src/components/Orders/OrdersFilterGroup/index.js +111 -13
  63. package/src/components/Orders/OrdersFilterGroup/styles.js +26 -0
  64. package/src/components/Orders/OrdersManager/index.js +0 -1
  65. package/src/components/Settings/CountriesList/index.js +26 -6
  66. package/src/components/Settings/Deliverect/index.js +26 -2
  67. package/src/components/Settings/DoordashConnect/index.js +26 -2
  68. package/src/components/Settings/DropdownOptionList/index.js +27 -6
  69. package/src/components/Settings/IntegrationListing/index.js +3 -3
  70. package/src/components/Settings/ItsaCheckmate/index.js +26 -2
  71. package/src/components/Settings/LalamoveConnect/index.js +26 -2
  72. package/src/components/Settings/PickerExpress/index.js +26 -2
  73. package/src/components/Settings/PlaceListing/index.js +38 -6
  74. package/src/components/Settings/Settings/index.js +79 -37
  75. package/src/components/Settings/SettingsDetail/index.js +15 -1
  76. package/src/components/Settings/SitesAuthSettings/index.js +18 -1
  77. package/src/components/SidebarMenu/index.js +0 -2
  78. package/src/components/Stores/BusinessAdd/BusinessDetails/index.js +1 -10
  79. package/src/components/Stores/BusinessAdd/BusinessDetails/styles.js +4 -0
  80. package/src/components/Stores/BusinessAdd/DeliveryZone/index.js +120 -109
  81. package/src/components/Stores/BusinessAdd/DeliveryZone/styles.js +22 -1
  82. package/src/components/Stores/BusinessAdd/PaymentMethods/index.js +8 -2
  83. package/src/components/Stores/BusinessAdd/PaymentMethods/styles.js +4 -0
  84. package/src/components/Stores/BusinessAdd/ReceiveOrders/index.js +11 -6
  85. package/src/components/Stores/BusinessAdd/ReceiveOrders/styles.js +4 -0
  86. package/src/components/Stores/BusinessAdd/index.js +47 -16
  87. package/src/components/Stores/BusinessAdd/styles.js +27 -1
  88. package/src/components/Stores/BusinessAddStore/index.js +1 -1
  89. package/src/components/Stores/BusinessBrandListing/index.js +37 -4
  90. package/src/components/Stores/BusinessDeliveryPickupMore/index.js +22 -1
  91. package/src/components/Stores/BusinessDeliveryZoneDetails/index.js +25 -2
  92. package/src/components/Stores/BusinessDeliveryZoneList/index.js +30 -3
  93. package/src/components/Stores/BusinessDetail/index.js +20 -1
  94. package/src/components/Stores/BusinessDetails/index.js +18 -1
  95. package/src/components/Stores/BusinessFrontLayout/index.js +13 -1
  96. package/src/components/Stores/BusinessFrontLayout/styles.js +11 -0
  97. package/src/components/Stores/BusinessMenu/index.js +56 -11
  98. package/src/components/Stores/BusinessMenuOptions/index.js +28 -3
  99. package/src/components/Stores/BusinessOrderingChannels/index.js +19 -2
  100. package/src/components/Stores/BusinessPaymentMethods/index.js +24 -2
  101. package/src/components/Stores/BusinessPlaceGroupList/index.js +193 -0
  102. package/src/components/Stores/BusinessPlaceGroupList/styles.js +143 -0
  103. package/src/components/Stores/BusinessProductsCategoyDetails/index.js +21 -1
  104. package/src/components/Stores/BusinessProductsListing/index.js +49 -8
  105. package/src/components/Stores/BusinessPromotionGeneralForm/index.js +2 -2
  106. package/src/components/Stores/BusinessSharedMenuProducts/index.js +29 -3
  107. package/src/components/Stores/BusinessSync/index.js +18 -2
  108. package/src/components/Stores/BusinessTypes/index.js +26 -4
  109. package/src/components/Stores/BusinessWalletsList/index.js +23 -1
  110. package/src/components/Stores/BusinessesListing/index.js +11 -2
  111. package/src/components/Stores/ImportersButton/index.js +24 -3
  112. package/src/components/Stores/PaymentOption/index.js +29 -8
  113. package/src/components/Stores/PaymentOptionMethods/index.js +25 -3
  114. package/src/components/Stores/PaymentOptionPaypal/index.js +25 -3
  115. package/src/components/Stores/PaymentOptionSquare/index.js +25 -3
  116. package/src/components/Stores/PaymentOptionStripeDirect/index.js +25 -3
  117. package/src/components/Stores/PaymethodOptionPaypalExpress/index.js +25 -3
  118. package/src/components/Stores/PaymethodOptionStripeConnect/index.js +25 -3
  119. package/src/components/Stores/PaymethodOptionStripeRedirect/index.js +25 -3
  120. package/src/components/Stores/ProductDetails/index.js +19 -1
  121. package/src/components/Stores/ProductExtras/index.js +23 -2
  122. package/src/components/Stores/ProductIngredient/index.js +23 -2
  123. package/src/components/Stores/ProductMainDetails/index.js +20 -2
  124. package/src/components/Stores/ProductTagsList/index.js +28 -3
  125. package/src/components/Users/CustomerCashWallet/index.js +25 -3
  126. package/src/components/Users/CustomerDetails/index.js +20 -1
  127. package/src/components/Users/CustomerPointsWallet/index.js +25 -3
  128. package/src/components/Users/CustomersListing/index.js +9 -4
  129. package/src/components/Users/ProfessionalDetail/index.js +27 -1
  130. package/src/components/Users/ProfessionalListing/index.js +9 -4
  131. package/src/components/Users/UserActiveStateFilter/index.js +16 -3
  132. package/src/components/Users/UserDetails/index.js +27 -1
  133. package/src/components/Users/UsersListing/index.js +9 -4
  134. package/template/pages/BusinessProductsList/index.js +1 -1
@@ -10,8 +10,11 @@ import {
10
10
  WrapperMap,
11
11
  ErrorText,
12
12
  FormControl,
13
- Row
13
+ Row,
14
+ Header,
15
+ DeliveryZoneInnerContainer
14
16
  } from './styles'
17
+ import { CaretDownFill } from 'react-bootstrap-icons'
15
18
 
16
19
  export const DeliveryZone = (props) => {
17
20
  const {
@@ -31,6 +34,7 @@ export const DeliveryZone = (props) => {
31
34
  const [zoneData, setZoneData] = useState()
32
35
  const [alertState, setAlertState] = useState({ open: false, content: [] })
33
36
  const [isShowMap, setIsShowMap] = useState(false)
37
+ const [hasContent, setHasContent] = useState(false)
34
38
  // const kmlRef = useRef(null)
35
39
 
36
40
  const typeOptions = [
@@ -120,121 +124,128 @@ export const DeliveryZone = (props) => {
120
124
 
121
125
  return (
122
126
  <>
123
- <DeliveryZoneContainer autoComplete='off'>
124
- <h2>{t('LETS_CREATE_YOUR_FIRST_DELIVERY_ZONE', 'Let’s create your first Delivery Zone')}</h2>
125
- <Row>
126
- <FormControl>
127
- <label>{t('NAME', 'Name')}</label>
128
- <Input
129
- placeholder={t('NAME', 'Name')}
130
- name='name'
131
- value={zoneState?.name ?? ''}
132
- onChange={(e) => handleChangeZoneState(e)}
133
- />
134
- </FormControl>
135
- <FormControl>
136
- <label>{t('TYPE', 'Type')}</label>
137
- <TypeSelectWrapper>
138
- <Select
139
- defaultValue={parseInt(zoneState?.type || zoneType)}
140
- options={typeOptions}
141
- onChange={handleChangeType}
142
- />
143
- </TypeSelectWrapper>
144
- </FormControl>
145
- </Row>
146
- <Row>
147
- <FormControl>
148
- <label>{t('MINIMUN_PURCHASED', 'Minimum purchase')}</label>
149
- <Input
150
- placeholder='$0.00'
151
- name='minimum'
152
- value={zoneState?.minimum ?? ''}
153
- onChange={(e) => handleChangeZoneState(e)}
154
- />
155
- </FormControl>
156
- <FormControl>
157
- <label>{t('DELIVERY_FEE', 'Delivery fee')}</label>
158
- <Input
159
- placeholder='$0.00'
160
- name='price'
161
- value={zoneState?.price ?? ''}
162
- onChange={(e) => handleChangeZoneState(e)}
163
- />
164
- </FormControl>
165
- </Row>
166
- {zoneType === 5 &&
167
- <Row>
127
+ <DeliveryZoneContainer>
128
+ <Header onClick={() => setHasContent(prev => !prev)}>
129
+ <h2>{t('LETS_CREATE_YOUR_FIRST_DELIVERY_ZONE', 'Let’s create your first Delivery Zone')}</h2>
130
+ <CaretDownFill />
131
+ </Header>
132
+ {hasContent && (
133
+ <DeliveryZoneInnerContainer>
134
+ <Row>
135
+ <FormControl>
136
+ <label>{t('NAME', 'Name')}</label>
137
+ <Input
138
+ placeholder={t('NAME', 'Name')}
139
+ name='name'
140
+ value={zoneState?.name ?? ''}
141
+ onChange={(e) => handleChangeZoneState(e)}
142
+ />
143
+ </FormControl>
144
+ <FormControl>
145
+ <label>{t('TYPE', 'Type')}</label>
146
+ <TypeSelectWrapper>
147
+ <Select
148
+ defaultValue={parseInt(zoneState?.type || zoneType)}
149
+ options={typeOptions}
150
+ onChange={handleChangeType}
151
+ />
152
+ </TypeSelectWrapper>
153
+ </FormControl>
154
+ </Row>
155
+ <Row>
156
+ <FormControl>
157
+ <label>{t('MINIMUN_PURCHASED', 'Minimum purchase')}</label>
158
+ <Input
159
+ placeholder='$0.00'
160
+ name='minimum'
161
+ value={zoneState?.minimum ?? ''}
162
+ onChange={(e) => handleChangeZoneState(e)}
163
+ />
164
+ </FormControl>
165
+ <FormControl>
166
+ <label>{t('DELIVERY_FEE', 'Delivery fee')}</label>
167
+ <Input
168
+ placeholder='$0.00'
169
+ name='price'
170
+ value={zoneState?.price ?? ''}
171
+ onChange={(e) => handleChangeZoneState(e)}
172
+ />
173
+ </FormControl>
174
+ </Row>
175
+ {zoneType === 5 &&
176
+ <Row>
177
+ <FormControl>
178
+ <label>{t('DISTANCE_FROM_STORE', 'Distance from store')}</label>
179
+ <Input
180
+ placeholder={`1 - 99 ${configState?.configs?.distance_unit?.value}`}
181
+ name='distance'
182
+ maxLength={2}
183
+ value={zoneState?.data?.distance ?? ''}
184
+ onInput={(e) => {
185
+ e.target.value = e.target.value.match('^[1-9]{1,2}$')
186
+ }}
187
+ onChange={e => handleChangeZoneState(e, false, configState?.configs?.distance_unit?.value)}
188
+ />
189
+ </FormControl>
190
+ </Row>}
168
191
  <FormControl>
169
- <label>{t('DISTANCE_FROM_STORE', 'Distance from store')}</label>
192
+ <label>{t('BUSINESS_ADDRESS', 'Business address')}</label>
170
193
  <Input
171
- placeholder={`1 - 99 ${configState?.configs?.distance_unit?.value}`}
172
- name='distance'
173
- maxLength={2}
174
- value={zoneState?.data?.distance ?? ''}
175
- onInput={(e) => {
176
- e.target.value = e.target.value.match('^[1-9]{1,2}$')
177
- }}
178
- onChange={e => handleChangeZoneState(e, false, configState?.configs?.distance_unit?.value)}
194
+ name='address'
195
+ defaultValue={formState?.changes?.address}
196
+ disabled
179
197
  />
180
198
  </FormControl>
181
- </Row>}
182
- <FormControl>
183
- <label>{t('BUSINESS_ADDRESS', 'Business address')}</label>
184
- <Input
185
- name='address'
186
- defaultValue={formState?.changes?.address}
187
- disabled
188
- />
189
- </FormControl>
190
- {zoneType !== 4 && isShowMap && (
191
- configState?.configs?.google_maps_api_key?.value ? (
192
- <WrapperMap>
193
- {zoneType !== 5 &&
194
- <button
199
+ {zoneType !== 4 && isShowMap && (
200
+ configState?.configs?.google_maps_api_key?.value ? (
201
+ <WrapperMap>
202
+ {zoneType !== 5 &&
203
+ <button
204
+ type='button'
205
+ onClick={() => setClearState(true)}
206
+ >
207
+ {t('CLEAR', 'Clear')}
208
+ </button>}
209
+ <BusinessZoneGoogleMaps
210
+ distance={zoneState?.data?.distance}
211
+ disabled
212
+ apiKey={configState?.configs?.google_maps_api_key?.value}
213
+ mapControls={googleMapsControls}
214
+ clearState={clearState}
215
+ setClearState={setClearState}
216
+ type={zoneType}
217
+ data={zoneState?.data || zoneData}
218
+ handleData={handleZoneData}
219
+ fillStyle={fillStyle}
220
+ infoContentString={infoContentString}
221
+ greenFillStyle={greenFillStyle}
222
+ kmlData={kmlData}
223
+ />
224
+ </WrapperMap>
225
+ ) : (
226
+ <ErrorText>{t('REQUIRED_GOOGLE_MAP_API_KEY', 'Google Maps api key is required')}</ErrorText>
227
+ )
228
+ )}
229
+ {/* {(zoneType !== 5) && (
230
+ <KmlButtonWrapper>
231
+ <Button
232
+ color='primary'
233
+ borderRadius='8px'
195
234
  type='button'
196
- onClick={() => setClearState(true)}
235
+ onClick={() => kmlRef.current.click()}
197
236
  >
198
- {t('CLEAR', 'Clear')}
199
- </button>}
200
- <BusinessZoneGoogleMaps
201
- distance={zoneState?.data?.distance}
202
- disabled
203
- apiKey={configState?.configs?.google_maps_api_key?.value}
204
- mapControls={googleMapsControls}
205
- clearState={clearState}
206
- setClearState={setClearState}
207
- type={zoneType}
208
- data={zoneState?.data || zoneData}
209
- handleData={handleZoneData}
210
- fillStyle={fillStyle}
211
- infoContentString={infoContentString}
212
- greenFillStyle={greenFillStyle}
213
- kmlData={kmlData}
214
- />
215
- </WrapperMap>
216
- ) : (
217
- <ErrorText>{t('REQUIRED_GOOGLE_MAP_API_KEY', 'Google Maps api key is required')}</ErrorText>
218
- )
237
+ <ExamineClick
238
+ onFiles={files => handleUploadKmlFiles(files)}
239
+ childRef={e => { kmlRef.current = e }}
240
+ accept='.kml,.kmz'
241
+ >
242
+ <span>{t('UPLOAD_KML', 'Upload KML')}</span>
243
+ </ExamineClick>
244
+ </Button>
245
+ </KmlButtonWrapper>
246
+ )} */}
247
+ </DeliveryZoneInnerContainer>
219
248
  )}
220
- {/* {(zoneType !== 5) && (
221
- <KmlButtonWrapper>
222
- <Button
223
- color='primary'
224
- borderRadius='8px'
225
- type='button'
226
- onClick={() => kmlRef.current.click()}
227
- >
228
- <ExamineClick
229
- onFiles={files => handleUploadKmlFiles(files)}
230
- childRef={e => { kmlRef.current = e }}
231
- accept='.kml,.kmz'
232
- >
233
- <span>{t('UPLOAD_KML', 'Upload KML')}</span>
234
- </ExamineClick>
235
- </Button>
236
- </KmlButtonWrapper>
237
- )} */}
238
249
  </DeliveryZoneContainer>
239
250
  <Alert
240
251
  title={t('WEB_APPNAME', 'Ordering')}
@@ -1,15 +1,36 @@
1
1
  import styled, { css } from 'styled-components'
2
2
 
3
3
  export const DeliveryZoneContainer = styled.div`
4
+ background: ${props => props.theme.colors.white};
5
+ border-radius: 7.6px;
6
+ padding: 25px 0px;
7
+ margin-bottom: 35px;
8
+
9
+ @media (min-width: 450px) {
10
+ box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);
11
+ padding: 25px 35px;
12
+ }
13
+ `
14
+
15
+ export const DeliveryZoneInnerContainer = styled.div`
4
16
  display: flex;
5
17
  flex-direction: column;
6
18
  min-height: calc(100% - 130px);
19
+ width: 100%;
20
+ max-width: 558px;
21
+ margin-top: 23px;
22
+ `
7
23
 
24
+ export const Header = styled.div`
25
+ display: flex;
26
+ justify-content: space-between;
27
+ align-items: center;
28
+ cursor: pointer;
8
29
  h2 {
9
30
  font-weight: 600;
10
31
  font-size: 16px;
11
32
  line-height: 24px;
12
- margin-bottom: 23px;
33
+ margin: 0;
13
34
  }
14
35
  `
15
36
 
@@ -1,4 +1,4 @@
1
- import React from 'react'
1
+ import React, { useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import { CheckSquareFill, Square } from 'react-bootstrap-icons'
4
4
  import {
@@ -23,9 +23,15 @@ export const PaymentMethods = (props) => {
23
23
  handleChangePaymethodIds(updateIds)
24
24
  }
25
25
 
26
+ useEffect(() => {
27
+ if (!paymethodsList?.loading && paymethodsList?.paymethods?.length > 0) {
28
+ handleChangeIds(paymethodsList?.paymethods[0].id)
29
+ }
30
+ }, [paymethodsList])
31
+
26
32
  return (
27
33
  <Container>
28
- <h2>{t('PAYMENT_METHODS', 'Payment methods')}</h2>
34
+ <h2>{t('PAYMENT_METHODS', 'Payment methods')}<sup>*</sup></h2>
29
35
  <ContentWrapper>
30
36
  {!paymethodsList?.loading && paymethodsList?.paymethods.map((paymethod, idx) => (
31
37
  <PaymethodItem key={paymethod?.id} isBorderTop={idx === 0} onClick={() => handleChangeIds(paymethod.id)}>
@@ -7,6 +7,10 @@ export const Container = styled.div`
7
7
  line-height: 24px;
8
8
  margin-top: 0;
9
9
  margin-bottom: 25px;
10
+ sup {
11
+ color: ${props => props.theme.colors.danger};
12
+ font-size: 13px;
13
+ }
10
14
  }
11
15
  `
12
16
 
@@ -1,5 +1,5 @@
1
- import React from 'react'
2
- import { useLanguage } from 'ordering-components-admin-external'
1
+ import React, { useEffect } from 'react'
2
+ import { useLanguage, useSession } from 'ordering-components-admin-external'
3
3
  import { useTheme } from 'styled-components'
4
4
  import { Input } from '../../../../styles'
5
5
  import {
@@ -11,17 +11,22 @@ import {
11
11
  } from './styles'
12
12
 
13
13
  export const ReceiveOrders = (props) => {
14
- const { formState, handleChangeInput } = props
14
+ const { formState, handleChangeInput, changeFormState } = props
15
+ const [{ user }] = useSession()
15
16
 
16
17
  const [, t] = useLanguage()
17
18
  const theme = useTheme()
18
19
 
20
+ useEffect(() => {
21
+ if (user?.email) changeFormState({ email: user?.email })
22
+ }, [user])
23
+
19
24
  return (
20
25
  <ReceiveOrdersContainer>
21
26
  <h2>{t('RECEIVE_ORDERS', 'Receive orders')}</h2>
22
27
  <ContentWrapper>
23
28
  <FormControl>
24
- <label>{t('BY_EMAIL', 'By Email')}</label>
29
+ <label>{t('BY_EMAIL', 'By Email')}<sup>*</sup></label>
25
30
  <Input
26
31
  name='email'
27
32
  defaultValue={formState?.changes?.email ?? ''}
@@ -32,10 +37,10 @@ export const ReceiveOrders = (props) => {
32
37
  <DownloadWrapper>
33
38
  <label>{t('DOWNLOADS_APPS', 'Downloads apps')}</label>
34
39
  <DownloadIconWrapper>
35
- <a href='https://apps.apple.com/us/app/customer-app-2-0/id1607414555' target='_blank' rel='noopener noreferrer'>
40
+ <a href='https://apps.apple.com/us/app/store-app-2-0/id1608192050' target='_blank' rel='noopener noreferrer'>
36
41
  <img src={theme.images.general.appStore} alt='' />
37
42
  </a>
38
- <a href='https://play.google.com/store/apps/details?id=com.ordering.onlineorderingappv5&hl=en&gl=US' target='_blank' rel='noopener noreferrer'>
43
+ <a href='https://play.google.com/store/apps/details?id=com.ordering.storeappv5&hl=en&gl=US' target='_blank' rel='noopener noreferrer'>
39
44
  <img src={theme.images.general.googlePlay} alt='' />
40
45
  </a>
41
46
  </DownloadIconWrapper>
@@ -20,6 +20,10 @@ export const FormControl = styled.div`
20
20
  font-size: 14px;
21
21
  line-height: 24px;
22
22
  margin-bottom: 12px;
23
+ sup {
24
+ color: ${props => props.theme.colors.danger};
25
+ font-size: 13px;
26
+ }
23
27
  }
24
28
  input {
25
29
  width: 100%;
@@ -9,16 +9,18 @@ import { OrderTypePriceLevel } from './OrderTypePriceLevel'
9
9
  import { PaymentMethods } from './PaymentMethods'
10
10
  import { ReceiveOrders } from './ReceiveOrders'
11
11
  import { useInfoShare } from '../../../contexts/InfoShareContext'
12
- import { Button, IconButton } from '../../../styles'
12
+ import { Button, IconButton, Input } from '../../../styles'
13
13
  import { DeliveryZone } from './DeliveryZone'
14
14
  import { useHistory } from 'react-router-dom'
15
- import { Alert } from '../../Shared'
15
+ import { Alert, Modal } from '../../Shared'
16
16
  import {
17
17
  AddNewBusinessContainer,
18
18
  BoxLayout,
19
19
  ButtonWrapper,
20
20
  HeaderTitleContainer,
21
- MapWrapper
21
+ MapWrapper,
22
+ SlugEditWrapper,
23
+ SlugFormControl
22
24
  } from './styles'
23
25
 
24
26
  const BusinessAddUI = (props) => {
@@ -50,6 +52,7 @@ const BusinessAddUI = (props) => {
50
52
  const [{ configs }] = useConfig()
51
53
  const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
52
54
  const [alertState, setAlertState] = useState({ open: false, content: [] })
55
+ const [isSlugEdit, setIsSlugEdit] = useState(false)
53
56
 
54
57
  const handleSubmit = () => {
55
58
  if (paymethodIds?.length === 0) {
@@ -59,6 +62,17 @@ const BusinessAddUI = (props) => {
59
62
  })
60
63
  return
61
64
  }
65
+ if (!formState?.changes?.slug) {
66
+ setAlertState({
67
+ open: true,
68
+ content: t(
69
+ 'VALIDATION_ERROR_REQUIRED',
70
+ 'Slug is required'
71
+ ).replace('_attribute_', t('SLUG', 'Slug'))
72
+ })
73
+ return
74
+ }
75
+ isSlugEdit && setIsSlugEdit(false)
62
76
  handleAddBusiness()
63
77
  }
64
78
 
@@ -75,10 +89,8 @@ const BusinessAddUI = (props) => {
75
89
 
76
90
  useEffect(() => {
77
91
  if (!formState?.loading && formState?.result?.error) {
78
- setAlertState({
79
- open: true,
80
- content: formState?.result?.result
81
- })
92
+ if (formState?.result?.result?.length === 0 && formState?.result?.result[0].toLowerCase().includes(t('SLUG', 'Slug').toLowerCase())) setIsSlugEdit(true)
93
+ else setAlertState({ open: true, content: formState?.result?.result })
82
94
  }
83
95
  }, [formState?.result])
84
96
 
@@ -146,15 +158,13 @@ const BusinessAddUI = (props) => {
146
158
  />
147
159
  </BoxLayout>
148
160
  {orderStatus?.options?.type === 1 && (
149
- <BoxLayout>
150
- <DeliveryZone
151
- kmlData={kmlData}
152
- zoneState={zoneState}
153
- formState={formState}
154
- handleChangeZoneState={handleChangeZoneState}
155
- handleUploadKmlFiles={handleUploadKmlFiles}
156
- />
157
- </BoxLayout>
161
+ <DeliveryZone
162
+ kmlData={kmlData}
163
+ zoneState={zoneState}
164
+ formState={formState}
165
+ handleChangeZoneState={handleChangeZoneState}
166
+ handleUploadKmlFiles={handleUploadKmlFiles}
167
+ />
158
168
  )}
159
169
  <BoxLayout>
160
170
  <PaymentMethods
@@ -208,6 +218,27 @@ const BusinessAddUI = (props) => {
208
218
  onAccept={() => closeAlert()}
209
219
  closeOnBackdrop={false}
210
220
  />
221
+ <Modal
222
+ width='769px'
223
+ padding='30px'
224
+ title={t('WEB_APPNAME', 'Ordering')}
225
+ open={isSlugEdit}
226
+ onClose={() => setIsSlugEdit(false)}
227
+ >
228
+ <SlugEditWrapper>
229
+ <p>{formState?.result?.result}</p>
230
+ <SlugFormControl>
231
+ <label>{t('SLUG', 'Slug')}</label>
232
+ <Input
233
+ name='slug'
234
+ placeholder={t('SLUG', 'Slug')}
235
+ value={formState?.changes?.slug}
236
+ onChange={handleChangeInput}
237
+ />
238
+ </SlugFormControl>
239
+ <Button color='primary' borderRadius='8px' onClick={handleSubmit}>{t('ACCEPT', 'Accept')}</Button>
240
+ </SlugEditWrapper>
241
+ </Modal>
211
242
  </>
212
243
  )
213
244
  }
@@ -61,7 +61,7 @@ export const BoxLayout = styled.div`
61
61
 
62
62
  export const ButtonWrapper = styled.div`
63
63
  display: flex;
64
- justify-content: flex-end;
64
+ justify-content: center;
65
65
  flex-direction: column;
66
66
  padding-bottom: 30px;
67
67
  button {
@@ -93,3 +93,29 @@ export const MapWrapper = styled.div`
93
93
  overflow: hidden;
94
94
  display: none;
95
95
  `
96
+
97
+ export const SlugEditWrapper = styled.div`
98
+ p {
99
+ font-size: 16px;
100
+ margin-bottom: 20px;
101
+ }
102
+ button {
103
+ width: 100%;
104
+ height: 44px;
105
+ margin-top: 25px;
106
+ margin-left: auto;
107
+ }
108
+ `
109
+
110
+ export const SlugFormControl = styled.div`
111
+ label {
112
+ font-weight: 400;
113
+ font-size: 14px;
114
+ line-height: 24px;
115
+ margin-bottom: 12px;
116
+ }
117
+ input {
118
+ height: 44px;
119
+ width: 100%;
120
+ }
121
+ `
@@ -74,7 +74,7 @@ export const BusinessAddStore = () => {
74
74
  handleChangeAddress(e)
75
75
  }}
76
76
  autoComplete='new-password'
77
- types={['restaurant']}
77
+ types={['restaurant', 'bar', 'cafe', 'bakery', 'meal_delivery']}
78
78
  />
79
79
  <p>{t('START_TYPING_THEN_SELECT_AN_ADDRESS_FROM_THE_LIST', 'Start typing then select an address from the list')}</p>
80
80
  </FormControl>
@@ -1,4 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react'
2
+ import { useHistory, useLocation } from 'react-router-dom'
2
3
  import {
3
4
  useLanguage,
4
5
  useUtils,
@@ -47,6 +48,8 @@ const BusinessBrandListingUI = (props) => {
47
48
  setOpenDetail
48
49
  } = props
49
50
 
51
+ const history = useHistory()
52
+ const query = new URLSearchParams(useLocation().search)
50
53
  const [, t] = useLanguage()
51
54
  const theme = useTheme()
52
55
  const [{ optimizeImage }] = useUtils()
@@ -64,6 +67,7 @@ const BusinessBrandListingUI = (props) => {
64
67
  const handleCloseSidebar = () => {
65
68
  setOpenDetail(false)
66
69
  setSelectedBrand(null)
70
+ history.replace(`${location.pathname}`)
67
71
  }
68
72
 
69
73
  const handleOpenSideBar = (id) => {
@@ -84,10 +88,13 @@ const BusinessBrandListingUI = (props) => {
84
88
  })
85
89
  }
86
90
 
87
- const handleClickBrand = (e, brandId) => {
88
- const isInvalid = e.target.closest('.brand_enable_control')
91
+ const handleClickBrand = (e, brandId, isInitialRender) => {
92
+ const isInvalid = e?.target?.closest('.brand_enable_control')
89
93
  if (isInvalid) return
90
94
  handleOpenSideBar(brandId)
95
+ if (!isInitialRender) {
96
+ history.replace(`${location.pathname}?id=${brandId}`)
97
+ }
91
98
  }
92
99
 
93
100
  const expandSideBar = () => {
@@ -126,6 +133,32 @@ const BusinessBrandListingUI = (props) => {
126
133
  }
127
134
  }, [brandFormState?.result])
128
135
 
136
+ useEffect(() => {
137
+ if (!brandListState?.brands?.length) return
138
+ const id = query.get('id')
139
+ if (id) {
140
+ handleClickBrand(null, Number(id), true)
141
+ }
142
+ }, [brandListState?.brands?.length])
143
+
144
+ const handleTabClick = (tab, isInitialRender) => {
145
+ setSelectedType(tab)
146
+ if (!isInitialRender) {
147
+ const id = query.get('id')
148
+ history.replace(`${location.pathname}?id=${id}&tab=${tab}`)
149
+ }
150
+ }
151
+
152
+ useEffect(() => {
153
+ if (!selectedBrand) return
154
+ const tab = query.get('tab')
155
+ if (tab) {
156
+ handleTabClick(tab, true)
157
+ } else {
158
+ handleTabClick(selectedType)
159
+ }
160
+ }, [selectedBrand])
161
+
129
162
  return (
130
163
  <>
131
164
  <BrandListingContainer>
@@ -273,14 +306,14 @@ const BusinessBrandListingUI = (props) => {
273
306
  <TabContainer>
274
307
  <Tab
275
308
  active={selectedType === 'general'}
276
- onClick={() => setSelectedType('general')}
309
+ onClick={() => handleTabClick('general')}
277
310
  >
278
311
  {t('GENERAL', 'General')}
279
312
  </Tab>
280
313
  {selectedBrand && (
281
314
  <Tab
282
315
  active={selectedType === 'businesses'}
283
- onClick={() => setSelectedType('businesses')}
316
+ onClick={() => handleTabClick('businesses')}
284
317
  >
285
318
  {t('BUSINESSES', 'Businesses')}
286
319
  </Tab>