ordering-ui-admin-external 1.5.1 → 1.6.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 (156) hide show
  1. package/_bundles/{ordering-ui-admin.743f7975ef6f607887b2.js → ordering-ui-admin.47d189a0568d6b5734d5.js} +2 -2
  2. package/_bundles/{ordering-ui-admin.743f7975ef6f607887b2.js.LICENSE.txt → ordering-ui-admin.47d189a0568d6b5734d5.js.LICENSE.txt} +1 -1
  3. package/_modules/components/Delivery/UserFormDetails/index.js +10 -3
  4. package/_modules/components/Login/LoginForm/index.js +4 -3
  5. package/_modules/components/Login/ResetPassword/index.js +251 -0
  6. package/_modules/components/Login/ResetPassword/styles.js +64 -0
  7. package/_modules/components/Login/index.js +8 -1
  8. package/_modules/components/Marketing/CampaignDetailContent/index.js +41 -5
  9. package/_modules/components/Marketing/CampaignDetailGeneral/index.js +2 -2
  10. package/_modules/components/Marketing/CampaignEmail/index.js +155 -12
  11. package/_modules/components/Marketing/CampaignEmail/styles.js +18 -4
  12. package/_modules/components/Marketing/CampaignHeader/index.js +11 -1
  13. package/_modules/components/Marketing/CampaignHeader/styles.js +25 -6
  14. package/_modules/components/Marketing/CampaignList/index.js +41 -25
  15. package/_modules/components/Marketing/CampaignNotification/index.js +14 -1
  16. package/_modules/components/Marketing/CampaignNotification/styles.js +7 -3
  17. package/_modules/components/Marketing/CampaignSMS/index.js +14 -1
  18. package/_modules/components/Marketing/CampaignSMS/styles.js +7 -3
  19. package/_modules/components/Marketing/CampaignWebHook/index.js +13 -1
  20. package/_modules/components/Marketing/CampaignWebHook/styles.js +7 -3
  21. package/_modules/components/MyProducts/BoxLayout/index.js +20 -0
  22. package/_modules/components/MyProducts/BoxLayout/styles.js +22 -0
  23. package/_modules/components/MyProducts/CustomerApp/index.js +48 -0
  24. package/_modules/components/MyProducts/CustomerApp/styles.js +25 -0
  25. package/_modules/components/MyProducts/DriverApp/index.js +69 -0
  26. package/_modules/components/MyProducts/DriverApp/styles.js +29 -0
  27. package/_modules/components/MyProducts/OrderingWebsite/index.js +40 -0
  28. package/_modules/components/MyProducts/OrderingWebsite/styles.js +29 -0
  29. package/_modules/components/MyProducts/StoreApp/index.js +69 -0
  30. package/_modules/components/MyProducts/StoreApp/styles.js +29 -0
  31. package/_modules/components/MyProducts/index.js +33 -0
  32. package/_modules/components/Orders/OrdersTable/index.js +8 -9
  33. package/_modules/components/Profile/ProfilePage/index.js +70 -0
  34. package/_modules/components/Profile/ProfilePage/styles.js +22 -0
  35. package/_modules/components/Profile/index.js +12 -0
  36. package/_modules/components/Settings/InsertLink/index.js +3 -2
  37. package/_modules/components/Shared/ColumnAllowSettingPopover/index.js +4 -3
  38. package/_modules/components/SidebarMenu/index.js +65 -29
  39. package/_modules/components/SidebarMenu/styles.js +3 -1
  40. package/_modules/components/Stores/BusinessLocation/index.js +1 -1
  41. package/_modules/components/Stores/BusinessProductsListing/index.js +7 -0
  42. package/_modules/components/Stores/BusinessWebhooks/index.js +2 -2
  43. package/_modules/components/Stores/PaymentOption/index.js +23 -4
  44. package/_modules/components/Stores/PaymentOptionMethods/index.js +23 -4
  45. package/_modules/components/Stores/PaymentOptionPaypal/index.js +23 -4
  46. package/_modules/components/Stores/PaymentOptionStripeDirect/index.js +23 -4
  47. package/_modules/components/Stores/PaymethodOptionPaypalExpress/index.js +23 -4
  48. package/_modules/components/Stores/PaymethodOptionStripeConnect/index.js +23 -4
  49. package/_modules/components/Stores/PaymethodOptionStripeRedirect/index.js +23 -4
  50. package/_modules/components/Users/CustomerDetails/index.js +8 -10
  51. package/_modules/components/Users/CustomersListing/index.js +4 -2
  52. package/_modules/components/Users/OccupationSelector/index.js +48 -0
  53. package/_modules/components/Users/OccupationSelector/styles.js +16 -0
  54. package/_modules/components/Users/OccupationsFilter/index.js +49 -0
  55. package/_modules/components/Users/OccupationsFilter/styles.js +22 -0
  56. package/_modules/components/Users/ProfessionalDetail/index.js +47 -8
  57. package/_modules/components/Users/ProfessionalDetail/styles.js +10 -5
  58. package/_modules/components/Users/ProfessionalList/index.js +43 -6
  59. package/_modules/components/Users/ProfessionalList/styles.js +5 -3
  60. package/_modules/components/Users/ProfessionalListing/index.js +14 -3
  61. package/_modules/components/Users/ProfessionalSchedule/styles.js +1 -1
  62. package/_modules/components/Users/UserDetails/index.js +11 -13
  63. package/_modules/components/Users/UserFormDetails/index.js +8 -1
  64. package/_modules/components/Users/UserTypeSelector/index.js +7 -0
  65. package/_modules/components/Users/UsersList/index.js +40 -5
  66. package/_modules/components/Users/UsersList/styles.js +7 -5
  67. package/_modules/components/Users/UsersListing/index.js +4 -2
  68. package/_modules/contexts/ThemeContext/index.js +1 -1
  69. package/_modules/index.js +38 -0
  70. package/index-template.js +22 -4
  71. package/package.json +2 -2
  72. package/src/components/Delivery/UserFormDetails/index.js +8 -10
  73. package/src/components/Login/LoginForm/index.js +23 -20
  74. package/src/components/Login/ResetPassword/index.js +283 -0
  75. package/src/components/Login/ResetPassword/styles.js +215 -0
  76. package/src/components/Login/index.js +3 -1
  77. package/src/components/Marketing/CampaignDetail/index.js +0 -1
  78. package/src/components/Marketing/CampaignDetailContent/index.js +54 -24
  79. package/src/components/Marketing/CampaignDetailGeneral/index.js +1 -1
  80. package/src/components/Marketing/CampaignEmail/index.js +152 -15
  81. package/src/components/Marketing/CampaignEmail/styles.js +64 -3
  82. package/src/components/Marketing/CampaignHeader/index.js +19 -3
  83. package/src/components/Marketing/CampaignHeader/styles.js +77 -0
  84. package/src/components/Marketing/CampaignList/index.js +75 -65
  85. package/src/components/Marketing/CampaignNotification/index.js +11 -3
  86. package/src/components/Marketing/CampaignNotification/styles.js +13 -0
  87. package/src/components/Marketing/CampaignSMS/index.js +11 -2
  88. package/src/components/Marketing/CampaignSMS/styles.js +13 -0
  89. package/src/components/Marketing/CampaignWebHook/index.js +11 -2
  90. package/src/components/Marketing/CampaignWebHook/styles.js +13 -0
  91. package/src/components/MyProducts/BoxLayout/index.js +25 -0
  92. package/src/components/MyProducts/BoxLayout/styles.js +78 -0
  93. package/src/components/MyProducts/CustomerApp/index.js +52 -0
  94. package/src/components/MyProducts/CustomerApp/styles.js +59 -0
  95. package/src/components/MyProducts/DriverApp/index.js +83 -0
  96. package/src/components/MyProducts/DriverApp/styles.js +104 -0
  97. package/src/components/MyProducts/OrderingWebsite/index.js +41 -0
  98. package/src/components/MyProducts/OrderingWebsite/styles.js +104 -0
  99. package/src/components/MyProducts/StoreApp/index.js +83 -0
  100. package/src/components/MyProducts/StoreApp/styles.js +104 -0
  101. package/src/components/MyProducts/index.js +11 -0
  102. package/src/components/OrderingProducts/OrderingProductDetails/index.js +1 -1
  103. package/src/components/Orders/OrdersTable/index.js +3 -6
  104. package/src/components/Profile/ProfilePage/index.js +81 -0
  105. package/src/components/Profile/ProfilePage/styles.js +64 -0
  106. package/src/components/Profile/index.js +5 -0
  107. package/src/components/Settings/InsertLink/index.js +6 -2
  108. package/src/components/Shared/ColumnAllowSettingPopover/index.js +11 -7
  109. package/src/components/SidebarMenu/index.js +103 -41
  110. package/src/components/SidebarMenu/styles.js +7 -0
  111. package/src/components/Stores/BusinessLocation/index.js +1 -1
  112. package/src/components/Stores/BusinessProductsListing/index.js +8 -0
  113. package/src/components/Stores/BusinessWebhooks/index.js +2 -2
  114. package/src/components/Stores/PaymentOption/index.js +12 -2
  115. package/src/components/Stores/PaymentOptionMethods/index.js +12 -2
  116. package/src/components/Stores/PaymentOptionPaypal/index.js +12 -2
  117. package/src/components/Stores/PaymentOptionStripeDirect/index.js +12 -2
  118. package/src/components/Stores/PaymethodOptionPaypalExpress/index.js +12 -2
  119. package/src/components/Stores/PaymethodOptionStripeConnect/index.js +12 -2
  120. package/src/components/Stores/PaymethodOptionStripeRedirect/index.js +12 -2
  121. package/src/components/Users/CustomerDetails/index.js +1 -1
  122. package/src/components/Users/CustomersListing/index.js +3 -1
  123. package/src/components/Users/OccupationSelector/index.js +37 -0
  124. package/src/components/Users/OccupationSelector/styles.js +18 -0
  125. package/src/components/Users/OccupationsFilter/index.js +50 -0
  126. package/src/components/Users/OccupationsFilter/styles.js +32 -0
  127. package/src/components/Users/ProfessionalDetail/index.js +42 -7
  128. package/src/components/Users/ProfessionalDetail/styles.js +16 -2
  129. package/src/components/Users/ProfessionalList/index.js +41 -3
  130. package/src/components/Users/ProfessionalList/styles.js +5 -0
  131. package/src/components/Users/ProfessionalListing/index.js +14 -1
  132. package/src/components/Users/ProfessionalSchedule/styles.js +1 -0
  133. package/src/components/Users/UserDetails/index.js +1 -1
  134. package/src/components/Users/UserFormDetails/index.js +11 -2
  135. package/src/components/Users/UserTypeSelector/index.js +6 -0
  136. package/src/components/Users/UsersList/index.js +44 -8
  137. package/src/components/Users/UsersList/styles.js +7 -2
  138. package/src/components/Users/UsersListing/index.js +4 -2
  139. package/src/contexts/ThemeContext/index.js +4 -0
  140. package/src/index.js +17 -1
  141. package/template/app.js +55 -3
  142. package/template/assets/images/myProducts/customer-app.png +0 -0
  143. package/template/assets/images/myProducts/driver-app.png +0 -0
  144. package/template/assets/images/myProducts/ordering-website.png +0 -0
  145. package/template/assets/images/myProducts/store-app.png +0 -0
  146. package/template/components/ListenPageChanges/index.js +7 -1
  147. package/template/config.json +2 -1
  148. package/template/helmetdata.json +49 -0
  149. package/template/pages/CustomerApp/index.js +12 -0
  150. package/template/pages/DriverApp/index.js +12 -0
  151. package/template/pages/Login/index.js +7 -1
  152. package/template/pages/OrderingWebsite/index.js +12 -0
  153. package/template/pages/Professionals/index.js +2 -1
  154. package/template/pages/Profile/index.js +12 -0
  155. package/template/pages/ResetPassword/index.js +42 -0
  156. package/template/pages/StoreApp/index.js +12 -0
@@ -0,0 +1,81 @@
1
+ import React from 'react'
2
+ import {
3
+ UserDetails as UserDetailsController,
4
+ useLanguage,
5
+ useSession
6
+ } from 'ordering-components-admin-external'
7
+ import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
8
+ import { List as MenuIcon } from 'react-bootstrap-icons'
9
+ import { IconButton, Button } from '../../../styles'
10
+ import { useInfoShare } from '../../../contexts/InfoShareContext'
11
+
12
+ import {
13
+ Container,
14
+ HeaderContainer,
15
+ UserInfoContainer,
16
+ UserImage,
17
+ UserInfoWrapper,
18
+ ButtonsGroup
19
+ } from './styles'
20
+
21
+ const ProfilePageUI = (props) => {
22
+ const {
23
+ handleGoogleAccountLink
24
+ } = props
25
+
26
+ const [, t] = useLanguage()
27
+ const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
28
+ const [{ user }] = useSession()
29
+
30
+ return (
31
+ <Container>
32
+ <HeaderContainer>
33
+ {isCollapse && (
34
+ <IconButton
35
+ color='black'
36
+ onClick={() => handleMenuCollapse(false)}
37
+ >
38
+ <MenuIcon />
39
+ </IconButton>
40
+ )}
41
+ <h1>{t('PROFILE', '')}</h1>
42
+ </HeaderContainer>
43
+ <UserInfoContainer>
44
+ <UserImage>
45
+ {user?.photo ? (
46
+ <img src={user?.photo} loading='lazy' alt='' />
47
+ ) : (
48
+ <FaUserAlt />
49
+ )}
50
+ </UserImage>
51
+ <UserInfoWrapper>
52
+ <p className='name'>{user?.name} {user?.lastname}</p>
53
+ <p className='email'>{user?.email}</p>
54
+ {user?.cellphone && <p className='phone'>{user?.cellphone}</p>}
55
+ <ButtonsGroup>
56
+ {user?.level === 8 && (
57
+ <Button
58
+ color='primary'
59
+ borderRadius='8px'
60
+ outline
61
+ onClick={() => handleGoogleAccountLink()}
62
+ >
63
+ {t('GOOGLE_ACCOUNT', 'Google account')}
64
+ </Button>
65
+ )}
66
+ </ButtonsGroup>
67
+ </UserInfoWrapper>
68
+ </UserInfoContainer>
69
+ </Container>
70
+ )
71
+ }
72
+
73
+ export const ProfilePage = (props) => {
74
+ const [{ user }] = useSession()
75
+ const profileProps = {
76
+ ...props,
77
+ userId: user?.id,
78
+ UIComponent: ProfilePageUI
79
+ }
80
+ return <UserDetailsController {...profileProps} />
81
+ }
@@ -0,0 +1,64 @@
1
+ import styled from 'styled-components'
2
+
3
+ export const Container = 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;
10
+ `
11
+ export const HeaderContainer = styled.div`
12
+ display: flex;
13
+ align-items: center;
14
+ h1 {
15
+ font-size: 20px;
16
+ font-weight: 700;
17
+ margin: 0;
18
+ }
19
+ `
20
+ export const UserInfoContainer = styled.div`
21
+ padding-top: 30px;
22
+ display: flex;
23
+ `
24
+ export const UserImage = styled.div`
25
+ border-radius: 8px;
26
+ box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
27
+ width: 216px;
28
+ height: 216px;
29
+ img {
30
+ width: 100%;
31
+ height: 100%;
32
+ object-fit: contain;
33
+ border-radius: 8px;
34
+ }
35
+ `
36
+ export const UserInfoWrapper = styled.div`
37
+ margin: 0 26px;
38
+ p {
39
+ &.name {
40
+ font-size: 20px;
41
+ font-weight: 600;
42
+ margin: 0;
43
+ }
44
+ &.email {
45
+ font-size: 14px;
46
+ line-height: 24px;
47
+ margin: 12px 0;
48
+ }
49
+ &.phone {
50
+ font-size: 14px;
51
+ line-height: 24px;
52
+ margin: 0;
53
+ }
54
+ }
55
+ `
56
+ export const ButtonsGroup = styled.div`
57
+ display: flex;
58
+ align-items: center;
59
+ margin-top: 26px;
60
+
61
+ button {
62
+ height: 44px;
63
+ }
64
+ `
@@ -0,0 +1,5 @@
1
+ import { ProfilePage } from './ProfilePage'
2
+
3
+ export {
4
+ ProfilePage
5
+ }
@@ -12,7 +12,8 @@ export const InsertLink = (props) => {
12
12
  const {
13
13
  editorContext,
14
14
  onClose,
15
- handleRestoreEditor
15
+ handleRestoreEditor,
16
+ isLinkButton
16
17
  } = props
17
18
  const [, t] = useLanguage()
18
19
  const [changesState, setChangesState] = useState({})
@@ -27,12 +28,15 @@ export const InsertLink = (props) => {
27
28
  const handleInsertClick = () => {
28
29
  handleRestoreEditor()
29
30
  editorContext.invoke('editor.createLink', {
30
- text: changesState?.text || '',
31
+ text: isLinkButton
32
+ ? `<button style='font-size: 9px;color: white;padding: 6px 11px; cursor: pointer; border-radius: 4px; background: #2C7BE5; border: none;'>${changesState?.text || 'button'}</button>`
33
+ : (changesState?.text || ''),
31
34
  url: changesState?.url || '',
32
35
  isNewWindow: changesState?.isNewWindow ?? true
33
36
  })
34
37
  onClose()
35
38
  }
39
+
36
40
  return (
37
41
  <InsertLinkContainer>
38
42
  <h1>{t('INSERT_LINK', 'Insert link')}</h1>
@@ -18,7 +18,8 @@ export const ColumnAllowSettingPopover = (props) => {
18
18
  optionsDefault,
19
19
  allowColumns,
20
20
  handleChangeAllowColumns,
21
- title
21
+ title,
22
+ isOrder
22
23
  } = props
23
24
 
24
25
  const [open, setOpen] = useState(false)
@@ -92,14 +93,17 @@ export const ColumnAllowSettingPopover = (props) => {
92
93
  {optionsDefault.map(option => (
93
94
  <AllowItem
94
95
  key={option.value}
95
- isChecked={allowColumns?.[option.value]?.visable}
96
+ isChecked={isOrder ? allowColumns?.[option.value]?.visable : allowColumns[option.value]}
96
97
  onClick={() => handleChangeAllowColumns(option.value)}
97
98
  >
98
- {allowColumns?.[option.value]?.visable ? (
99
- <RiCheckboxFill />
100
- ) : (
101
- <RiCheckboxBlankLine />
102
- )}
99
+ {(isOrder
100
+ ? allowColumns?.[option.value]?.visable
101
+ : allowColumns[option.value])
102
+ ? (
103
+ <RiCheckboxFill />
104
+ ) : (
105
+ <RiCheckboxBlankLine />
106
+ )}
103
107
  <span>
104
108
  {option.content}
105
109
  </span>
@@ -17,7 +17,9 @@ import {
17
17
  Award,
18
18
  BoxArrowUpRight,
19
19
  Cart3,
20
- CloudDownload
20
+ Cash,
21
+ CloudDownload,
22
+ BagCheck
21
23
  } from 'react-bootstrap-icons'
22
24
  import { useTheme } from 'styled-components'
23
25
  import { useEvent, useLanguage, useSession, useConfig } from 'ordering-components-admin-external'
@@ -108,6 +110,33 @@ export const SidebarMenu = (props) => {
108
110
  }
109
111
  ]
110
112
 
113
+ const myProductMenus = [
114
+ {
115
+ id: 1,
116
+ title: t('ORDERING_WEBSITE', 'Ordering website'),
117
+ pageName: 'ordering_website',
118
+ url: '/my-products/ordering-website'
119
+ },
120
+ {
121
+ id: 2,
122
+ title: t('CUSTOMER_APP', 'Customer app'),
123
+ pageName: 'customer_app',
124
+ url: '/my-products/customer-app'
125
+ },
126
+ {
127
+ id: 3,
128
+ title: t('STORE_APP', 'Store app'),
129
+ pageName: 'store_app',
130
+ url: '/my-products/store-app'
131
+ },
132
+ {
133
+ id: 4,
134
+ title: t('DRIVER_APP', 'Driver app'),
135
+ pageName: 'driver_app',
136
+ url: '/my-products/driver-app'
137
+ }
138
+ ]
139
+
111
140
  const storesSubMenus = [
112
141
  {
113
142
  id: 1,
@@ -337,7 +366,7 @@ export const SidebarMenu = (props) => {
337
366
  <SidebarContent className='d-flex flex-column justify-content-between p-1 pt-0'>
338
367
  <div className='d-flex flex-column'>
339
368
  <Accordion>
340
- {sessionState?.user?.level !== 5 && (
369
+ {sessionState?.user?.level !== 5 && sessionState?.user?.level !== 8 && (
341
370
  <MenuContainer>
342
371
  <ContextAwareToggle
343
372
  eventKey='0'
@@ -353,38 +382,41 @@ export const SidebarMenu = (props) => {
353
382
  </MenuContainer>
354
383
  )}
355
384
 
356
- <MenuContainer>
357
- <ContextAwareToggle
358
- eventKey='1'
359
- active={
360
- location.pathname === '/orders' ||
361
- location.pathname === '/deliveries' ||
362
- location.pathname === '/drivers' ||
363
- location.pathname === '/appointments'
364
- }
365
- >
366
- <ListCheck />
367
- <span>{t('ORDERS', 'Orders')}</span>
368
- </ContextAwareToggle>
369
- <Accordion.Collapse eventKey='1'>
370
- <MenuContent>
371
- {ordersSubMenus.map(item => (
372
- !(sessionState?.user?.level === 2 && item.pageName === 'drivers') &&
373
- !(sessionState?.user?.level === 5 && item.pageName === 'appointments') && (
374
- <SubMenu
375
- key={item.id}
376
- active={location.pathname.includes(item.pageName)}
377
- onClick={() => handleGoToPage({ page: item.pageName })}
378
- >
379
- {item.title}
380
- </SubMenu>
381
- )
382
- ))}
383
- </MenuContent>
384
- </Accordion.Collapse>
385
- </MenuContainer>
385
+ {sessionState?.user?.level !== 8 && (
386
+ <MenuContainer>
387
+ <ContextAwareToggle
388
+ eventKey='1'
389
+ active={
390
+ location.pathname === '/orders' ||
391
+ location.pathname === '/deliveries' ||
392
+ location.pathname === '/drivers' ||
393
+ location.pathname === '/appointments' ||
394
+ location.pathname === '/gift-cards'
395
+ }
396
+ >
397
+ <ListCheck />
398
+ <span>{t('ORDERS', 'Orders')}</span>
399
+ </ContextAwareToggle>
400
+ <Accordion.Collapse eventKey='1'>
401
+ <MenuContent>
402
+ {ordersSubMenus.map(item => (
403
+ !(sessionState?.user?.level === 2 && item.pageName === 'drivers') &&
404
+ !(sessionState?.user?.level === 5 && item.pageName === 'appointments') && (
405
+ <SubMenu
406
+ key={item.id}
407
+ active={location.pathname.includes(item.url)}
408
+ onClick={() => handleGoToPage({ page: item.pageName })}
409
+ >
410
+ {item.title}
411
+ </SubMenu>
412
+ )
413
+ ))}
414
+ </MenuContent>
415
+ </Accordion.Collapse>
416
+ </MenuContainer>
417
+ )}
386
418
 
387
- {sessionState?.user?.level !== 5 && (
419
+ {(sessionState?.user?.level !== 5 && sessionState?.user?.level !== 8) && (
388
420
  <MenuContainer>
389
421
  <ContextAwareToggle
390
422
  eventKey='2'
@@ -398,7 +430,7 @@ export const SidebarMenu = (props) => {
398
430
  </MenuContainer>
399
431
  )}
400
432
 
401
- {sessionState?.user?.level !== 5 && (
433
+ {(sessionState?.user?.level !== 5 && sessionState?.user?.level !== 8) && (
402
434
  <MenuContainer>
403
435
  <ContextAwareToggle
404
436
  eventKey='3'
@@ -457,7 +489,7 @@ export const SidebarMenu = (props) => {
457
489
  </MenuContainer>
458
490
  )}
459
491
 
460
- {sessionState?.user?.level !== 5 && (
492
+ {(sessionState?.user?.level !== 5 && sessionState?.user?.level !== 8) && (
461
493
  <MenuContainer>
462
494
  <ContextAwareToggle
463
495
  eventKey='5'
@@ -525,7 +557,7 @@ export const SidebarMenu = (props) => {
525
557
  </MenuContainer>
526
558
  )}
527
559
 
528
- {sessionState?.user?.level !== 5 && sessionState?.user?.level !== 2 && (
560
+ {sessionState?.user?.level === 0 && (
529
561
  <MenuContainer>
530
562
  <ContextAwareToggle
531
563
  eventKey='8'
@@ -553,7 +585,7 @@ export const SidebarMenu = (props) => {
553
585
  </MenuContainer>
554
586
  )}
555
587
 
556
- {sessionState?.user?.level !== 5 && sessionState?.user?.level !== 2 && (
588
+ {sessionState?.user?.level === 0 && (
557
589
  <MenuContainer>
558
590
  <ContextAwareToggle
559
591
  eventKey='9'
@@ -582,7 +614,7 @@ export const SidebarMenu = (props) => {
582
614
  </MenuContainer>
583
615
  )}
584
616
 
585
- {sessionState?.user?.level !== 5 && sessionState?.user?.level !== 2 && (
617
+ {sessionState?.user?.level === 0 && (
586
618
  <MenuContainer>
587
619
  <ContextAwareToggle
588
620
  eventKey='10'
@@ -609,6 +641,36 @@ export const SidebarMenu = (props) => {
609
641
  </Accordion.Collapse>
610
642
  </MenuContainer>
611
643
  )}
644
+ {sessionState?.user?.level === 0 && (
645
+ <MenuContainer>
646
+ <span>{t('SALES_CHANNELS_AND_PRODUCTS', 'Sales channels and products')}</span>
647
+ <ContextAwareToggle
648
+ eventKey='12'
649
+ active={
650
+ location.pathname === '/my-products/ordering-website' ||
651
+ location.pathname === '/my-products/customer-app' ||
652
+ location.pathname === '/my-products/store-app' ||
653
+ location.pathname === '/my-products/driver-app'
654
+ }
655
+ >
656
+ <BagCheck />
657
+ <span>{t('MY_PRODUCTS', 'My products')}</span>
658
+ </ContextAwareToggle>
659
+ <Accordion.Collapse eventKey='12'>
660
+ <MenuContent>
661
+ {myProductMenus.map(item => (
662
+ <SubMenu
663
+ key={item.id}
664
+ active={location.pathname.includes(item.url)}
665
+ onClick={() => handleGoToPage({ page: item.pageName })}
666
+ >
667
+ {item.title}
668
+ </SubMenu>
669
+ ))}
670
+ </MenuContent>
671
+ </Accordion.Collapse>
672
+ </MenuContainer>
673
+ )}
612
674
  </Accordion>
613
675
  </div>
614
676
  <div className='d-flex flex-column mt-4'>
@@ -649,7 +711,7 @@ export const SidebarMenu = (props) => {
649
711
  </MenuContainer>
650
712
  </Accordion>
651
713
  )}
652
- {sessionState?.user?.level !== 5 && sessionState?.user?.level !== 2 && (
714
+ {sessionState?.user?.level === 0 && (
653
715
  <Button
654
716
  className='d-flex align-items-center'
655
717
  variant={location.pathname === '/ordering-products' && 'primary'}
@@ -715,9 +777,9 @@ export const SidebarMenu = (props) => {
715
777
  className='d-flex flex-column px-1'
716
778
  >
717
779
  <Button
718
- className='d-flex align-items-center'
719
- onClick={() => handleGoToPage({ page: 'profile' })}
780
+ className='d-000flex align-items-center'
720
781
  variant={location.pathname === '/profile' && 'primary'}
782
+ onClick={() => handleGoToPage({ page: 'profile' })}
721
783
  >
722
784
  {sessionState?.user?.photo ? (
723
785
  <Image src={sessionState?.user?.photo} width='30px' height='30px' roundedCircle />
@@ -156,6 +156,13 @@ export const UserInfo = styled.div`
156
156
  `
157
157
  export const MenuContainer = styled.div`
158
158
  margin: 5px 0;
159
+ > span {
160
+ font-weight: 500;
161
+ font-size: 10px;
162
+ line-height: 15px;
163
+ padding: 0px 13px;
164
+ color: ${props => props.theme.colors.lightGray};
165
+ }
159
166
  > button {
160
167
  width: 100%;
161
168
  text-align: initial;
@@ -138,7 +138,7 @@ export const BusinessLocation = (props) => {
138
138
  ? formState?.result?.result?.address
139
139
  : formState?.changes?.address ?? business?.address ?? ''
140
140
  }
141
- autoComplete='new-field'
141
+ autoComplete='new-password'
142
142
  countryCode={configs?.country_autocomplete?.value || '*'}
143
143
  />
144
144
  </WrapperGoogleAutoCompleteInput>
@@ -190,6 +190,14 @@ const BusinessProductsListingUI = (props) => {
190
190
  setBatchImageFormOpen(true)
191
191
  }
192
192
 
193
+ useEffect(() => {
194
+ if (slug && !isInitialRender) {
195
+ setOpenSidebar(null)
196
+ setSelectedProduct(null)
197
+ handleUpdateInitialRender(false)
198
+ }
199
+ }, [slug, isInitialRender])
200
+
193
201
  useEffect(() => {
194
202
  if (!slug) {
195
203
  setSelectedBusiness(null)
@@ -96,8 +96,8 @@ const BusinessWebhooksUI = (props) => {
96
96
  <WebhooksContainer>
97
97
  <Title>{t('WEBHOOKS', 'WEbhooks')}</Title>
98
98
  {
99
- business?.webhooks?.length > 0 && business?.webhooks.map((webhook, i) => (
100
- <WebhookAddContainer key={i}>
99
+ business?.webhooks?.length > 0 && business?.webhooks.map(webhook => (
100
+ <WebhookAddContainer key={webhook.id}>
101
101
  <HookSelectWrapper inActive>
102
102
  <Select
103
103
  defaultValue={webhook?.hook}
@@ -40,6 +40,7 @@ export const PaymentOption = (props) => {
40
40
  const [isMenuOpen, setIsMenuOpen] = useState(false)
41
41
  const [paymentTabs, setPaymentTabs] = useState(sitesState?.sites?.length > 0 ? 0 : 1)
42
42
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
43
+ const [localState, setLocalState] = useState({allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites})
43
44
 
44
45
  const setPaymethodInfo = (values) => {
45
46
  const data = {}
@@ -102,6 +103,15 @@ export const PaymentOption = (props) => {
102
103
  })
103
104
  }, [businessPaymethod?.id, businessPaymethod?.sandbox, businessPaymethod?.allowed_order_types])
104
105
 
106
+ useEffect(() => {
107
+ if (changesState?.allowed_order_types) {
108
+ setLocalState({allowed_order_types: changesState?.allowed_order_types})
109
+ }
110
+ if (changesState?.sites) {
111
+ setLocalState({sites: changesState?.sites})
112
+ }
113
+ }, [changesState?.allowed_order_types, changesState?.sites])
114
+
105
115
  return (
106
116
  <>
107
117
  <Container id='payment_method_option'>
@@ -153,7 +163,7 @@ export const PaymentOption = (props) => {
153
163
  key={site.id}
154
164
  onClick={() => setPaymethodInfo({ key: 'sites', value: site.id })}
155
165
  >
156
- {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
166
+ {(localState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
157
167
  <RiCheckboxFill className='fill' />
158
168
  ) : (
159
169
  <RiCheckboxBlankLine />
@@ -169,7 +179,7 @@ export const PaymentOption = (props) => {
169
179
  key={type.value}
170
180
  onClick={() => setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
171
181
  >
172
- {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
182
+ {(localState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
173
183
  <RiCheckboxFill className='fill' />
174
184
  ) : (
175
185
  <RiCheckboxBlankLine />
@@ -46,6 +46,7 @@ export const PaymentOptionMethods = (props) => {
46
46
  const [isMenuOpen, setIsMenuOpen] = useState(false)
47
47
  const [paymentTabs, setPaymentTabs] = useState(0)
48
48
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
49
+ const [localState, setLocalState] = useState({allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites})
49
50
 
50
51
  const setPaymethodInfo = (values) => {
51
52
  const data = {}
@@ -109,6 +110,15 @@ export const PaymentOptionMethods = (props) => {
109
110
  cleanChangesState(initState)
110
111
  }, [])
111
112
 
113
+ useEffect(() => {
114
+ if (changesState?.allowed_order_types) {
115
+ setLocalState({allowed_order_types: changesState?.allowed_order_types})
116
+ }
117
+ if (changesState?.sites) {
118
+ setLocalState({sites: changesState?.sites})
119
+ }
120
+ }, [changesState?.sites, changesState?.allowed_order_types])
121
+
112
122
  return (
113
123
  <>
114
124
  <Container id={id}>
@@ -225,7 +235,7 @@ export const PaymentOptionMethods = (props) => {
225
235
  key={site.id}
226
236
  onClick={() => setPaymethodInfo({ key: 'sites', value: site.id })}
227
237
  >
228
- {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
238
+ {(localState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
229
239
  <RiCheckboxFill className='fill' />
230
240
  ) : (
231
241
  <RiCheckboxBlankLine />
@@ -241,7 +251,7 @@ export const PaymentOptionMethods = (props) => {
241
251
  key={type.value}
242
252
  onClick={() => setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
243
253
  >
244
- {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
254
+ {(localState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
245
255
  <RiCheckboxFill className='fill' />
246
256
  ) : (
247
257
  <RiCheckboxBlankLine />
@@ -44,6 +44,7 @@ export const PaymentOptionPaypal = (props) => {
44
44
  const [isMenuOpen, setIsMenuOpen] = useState(false)
45
45
  const [paymentTabs, setPaymentTabs] = useState(0)
46
46
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
47
+ const [localState, setLocalState] = useState({allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites})
47
48
 
48
49
  const actionSidebar = (value) => {
49
50
  if (!value) {
@@ -109,6 +110,15 @@ export const PaymentOptionPaypal = (props) => {
109
110
  cleanChangesState(initState)
110
111
  }, [])
111
112
 
113
+ useEffect(() => {
114
+ if (changesState?.allowed_order_types) {
115
+ setLocalState({allowed_order_types: changesState?.allowed_order_types})
116
+ }
117
+ if (changesState?.sites) {
118
+ setLocalState({sites: changesState?.sites})
119
+ }
120
+ }, [changesState?.sites, changesState?.allowed_order_types])
121
+
112
122
  return (
113
123
  <>
114
124
  <Container id='paypal'>
@@ -225,7 +235,7 @@ export const PaymentOptionPaypal = (props) => {
225
235
  key={site.id}
226
236
  onClick={() => setPaymethodInfo({ key: 'sites', value: site.id })}
227
237
  >
228
- {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
238
+ {(localState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
229
239
  <RiCheckboxFill className='fill' />
230
240
  ) : (
231
241
  <RiCheckboxBlankLine />
@@ -241,7 +251,7 @@ export const PaymentOptionPaypal = (props) => {
241
251
  key={type.value}
242
252
  onClick={() => setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
243
253
  >
244
- {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
254
+ {(localState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
245
255
  <RiCheckboxFill className='fill' />
246
256
  ) : (
247
257
  <RiCheckboxBlankLine />
@@ -44,6 +44,7 @@ export const PaymentOptionStripeDirect = (props) => {
44
44
  const [isMenuOpen, setIsMenuOpen] = useState(false)
45
45
  const [paymentTabs, setPaymentTabs] = useState(0)
46
46
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
47
+ const [localState, setLocalState] = useState({allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites})
47
48
 
48
49
  const setPaymethodInfo = (values) => {
49
50
  const data = {}
@@ -107,6 +108,15 @@ export const PaymentOptionStripeDirect = (props) => {
107
108
  cleanChangesState(initState)
108
109
  }, [])
109
110
 
111
+ useEffect(() => {
112
+ if (changesState?.allowed_order_types) {
113
+ setLocalState({allowed_order_types: changesState?.allowed_order_types})
114
+ }
115
+ if (changesState?.sites) {
116
+ setLocalState({sites: changesState?.sites})
117
+ }
118
+ }, [changesState?.sites, changesState?.allowed_order_types])
119
+
110
120
  return (
111
121
  <>
112
122
  <Container id='stripe_direct'>
@@ -223,7 +233,7 @@ export const PaymentOptionStripeDirect = (props) => {
223
233
  key={site.id}
224
234
  onClick={() => setPaymethodInfo({ key: 'sites', value: site.id })}
225
235
  >
226
- {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
236
+ {(localState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
227
237
  <RiCheckboxFill className='fill' />
228
238
  ) : (
229
239
  <RiCheckboxBlankLine />
@@ -239,7 +249,7 @@ export const PaymentOptionStripeDirect = (props) => {
239
249
  key={type.value}
240
250
  onClick={() => setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
241
251
  >
242
- {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
252
+ {(localState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
243
253
  <RiCheckboxFill className='fill' />
244
254
  ) : (
245
255
  <RiCheckboxBlankLine />