ordering-ui-admin-external 1.6.2 → 1.6.3

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 (175) hide show
  1. package/_bundles/main.css +134 -129
  2. package/_bundles/{ordering-ui-admin.488bdda58ba73188d3b5.js → ordering-ui-admin.3ebe4d4f772eaeb4f851.js} +2 -2
  3. package/_bundles/{ordering-ui-admin.488bdda58ba73188d3b5.js.LICENSE.txt → ordering-ui-admin.3ebe4d4f772eaeb4f851.js.LICENSE.txt} +4 -4
  4. package/_modules/components/BusinessIntelligence/Reports/index.js +1 -1
  5. package/_modules/components/CartRecovery/OpenCartsFilterGroup/index.js +1 -1
  6. package/_modules/components/CartRecovery/RecoveryActionHeader/index.js +1 -1
  7. package/_modules/components/Delivery/AddressForm/index.js +1 -1
  8. package/_modules/components/Delivery/DriversCompaniesListing/index.js +1 -1
  9. package/_modules/components/Delivery/DriversGroupLogs/index.js +2 -2
  10. package/_modules/components/Delivery/DriversGroupsListing/index.js +1 -1
  11. package/_modules/components/Home/HomePage/index.js +29 -6
  12. package/_modules/components/Home/HomePage/styles.js +27 -5
  13. package/_modules/components/LanguageSelector/index.js +1 -1
  14. package/_modules/components/Login/LoginForm/index.js +119 -20
  15. package/_modules/components/Login/LoginForm/styles.js +60 -30
  16. package/_modules/components/Loyalty/RewardsPrograms/index.js +1 -1
  17. package/_modules/components/Marketing/CampaignSignUpOption/index.js +1 -1
  18. package/_modules/components/Marketing/EnterprisePromotionListing/index.js +1 -1
  19. package/_modules/components/Messages/MessagesListing/styles.js +1 -1
  20. package/_modules/components/MyProducts/AppLayout/index.js +75 -0
  21. package/_modules/components/MyProducts/AppLayout/styles.js +41 -0
  22. package/_modules/components/MyProducts/CallCenterApp/index.js +42 -0
  23. package/_modules/components/MyProducts/ContentForm/index.js +236 -0
  24. package/_modules/components/MyProducts/ContentForm/styles.js +32 -0
  25. package/_modules/components/MyProducts/CustomerApp/index.js +18 -25
  26. package/_modules/components/MyProducts/DriverApp/index.js +18 -45
  27. package/_modules/components/MyProducts/KioskApp/index.js +42 -0
  28. package/_modules/components/MyProducts/OrderingWebsite/index.js +351 -3
  29. package/_modules/components/MyProducts/OrderingWebsite/styles.js +54 -3
  30. package/_modules/components/MyProducts/PosApp/index.js +42 -0
  31. package/_modules/components/MyProducts/StoreApp/index.js +18 -45
  32. package/_modules/components/MyProducts/index.js +22 -1
  33. package/_modules/components/OrderingProducts/OrderingProductDetails/index.js +6 -8
  34. package/_modules/components/OrderingProducts/SiteTheme/index.js +13 -4
  35. package/_modules/components/Orders/DeliveriesManager/index.js +6 -0
  36. package/_modules/components/Orders/DriversManager/index.js +7 -1
  37. package/_modules/components/Orders/GoogleMapsApiKeySettingButton/index.js +110 -0
  38. package/_modules/components/{MyProducts/CustomerApp/styles.js → Orders/GoogleMapsApiKeySettingButton/style.js} +9 -13
  39. package/_modules/components/Orders/Messages/styles.js +3 -3
  40. package/_modules/components/Orders/OrderContactInformation/index.js +7 -7
  41. package/_modules/components/Orders/OrdersContentHeader/index.js +4 -2
  42. package/_modules/components/Orders/OrdersManager/index.js +3 -2
  43. package/_modules/components/Profile/ProfilePage/index.js +2 -1
  44. package/_modules/components/Profile/ProfilePage/styles.js +2 -2
  45. package/_modules/components/Profile/Sessions/index.js +209 -0
  46. package/_modules/components/Profile/Sessions/styles.js +46 -0
  47. package/_modules/components/Profile/index.js +8 -1
  48. package/_modules/components/Settings/EmailSetting/index.js +2 -29
  49. package/_modules/components/Settings/PageForm/index.js +6 -1
  50. package/_modules/components/Settings/Settings/index.js +0 -62
  51. package/_modules/components/Shared/CitySelector/index.js +9 -1
  52. package/_modules/components/Shared/Modal/index.js +5 -3
  53. package/_modules/components/Shared/Modal/styles.js +25 -23
  54. package/_modules/components/SidebarMenu/index.js +132 -76
  55. package/_modules/components/SidebarMenu/styles.js +4 -2
  56. package/_modules/components/Stores/AddBusinessForm/index.js +22 -8
  57. package/_modules/components/Stores/BusinessBrandGENDetail/index.js +6 -1
  58. package/_modules/components/Stores/BusinessProductList/styles.js +1 -1
  59. package/_modules/components/Stores/BusinessProductsCategories/styles.js +1 -1
  60. package/_modules/components/Stores/BusinessProductsCategoyInfo/index.js +6 -1
  61. package/_modules/components/Stores/BusinessProductsListing/index.js +35 -8
  62. package/_modules/components/Stores/BusinessProductsListing/styles.js +6 -4
  63. package/_modules/components/Stores/BusinessSelectHeader/index.js +17 -9
  64. package/_modules/components/Stores/BusinessSelectHeader/styles.js +1 -1
  65. package/_modules/components/Stores/BusinessSummary/index.js +21 -8
  66. package/_modules/components/Stores/BusinessSummary/styles.js +5 -3
  67. package/_modules/components/Stores/BusinessSync/index.js +6 -2
  68. package/_modules/components/Stores/BusinessSyncItsaCheckmate/index.js +52 -0
  69. package/_modules/components/Stores/BusinessSyncItsaCheckmate/styles.js +31 -0
  70. package/_modules/components/Support/index.js +1 -1
  71. package/_modules/hooks/useCountdownTimer.js +40 -0
  72. package/_modules/index.js +18 -0
  73. package/_modules/utils/index.js +65 -4
  74. package/index-template.js +49 -8
  75. package/package.json +3 -2
  76. package/src/components/BusinessIntelligence/Reports/index.js +1 -1
  77. package/src/components/CartRecovery/OpenCartsFilterGroup/index.js +1 -1
  78. package/src/components/CartRecovery/RecoveryActionHeader/index.js +1 -1
  79. package/src/components/Delivery/AddressForm/index.js +1 -1
  80. package/src/components/Delivery/DriversCompaniesListing/index.js +1 -1
  81. package/src/components/Delivery/DriversGroupLogs/index.js +1 -1
  82. package/src/components/Delivery/DriversGroupsListing/index.js +1 -1
  83. package/src/components/Home/HomePage/index.js +62 -6
  84. package/src/components/Home/HomePage/styles.js +48 -1
  85. package/src/components/LanguageSelector/index.js +1 -1
  86. package/src/components/Login/LoginForm/index.js +211 -94
  87. package/src/components/Login/LoginForm/styles.js +74 -8
  88. package/src/components/Loyalty/RewardsPrograms/index.js +1 -1
  89. package/src/components/Marketing/CampaignSignUpOption/index.js +1 -1
  90. package/src/components/Marketing/EnterprisePromotionListing/index.js +1 -1
  91. package/src/components/Messages/MessagesListing/styles.js +3 -5
  92. package/src/components/MyProducts/AppLayout/index.js +97 -0
  93. package/src/components/MyProducts/AppLayout/styles.js +145 -0
  94. package/src/components/MyProducts/CallCenterApp/index.js +29 -0
  95. package/src/components/MyProducts/ContentForm/index.js +230 -0
  96. package/src/components/MyProducts/ContentForm/styles.js +67 -0
  97. package/src/components/MyProducts/CustomerApp/index.js +17 -41
  98. package/src/components/MyProducts/DriverApp/index.js +16 -70
  99. package/src/components/MyProducts/KioskApp/index.js +29 -0
  100. package/src/components/MyProducts/OrderingWebsite/index.js +452 -25
  101. package/src/components/MyProducts/OrderingWebsite/styles.js +244 -0
  102. package/src/components/MyProducts/PosApp/index.js +29 -0
  103. package/src/components/MyProducts/StoreApp/index.js +16 -70
  104. package/src/components/MyProducts/index.js +7 -1
  105. package/src/components/OrderingProducts/OrderingProductDetails/index.js +4 -4
  106. package/src/components/OrderingProducts/SiteTheme/index.js +8 -0
  107. package/src/components/Orders/DeliveriesManager/index.js +5 -1
  108. package/src/components/Orders/DriversManager/index.js +7 -1
  109. package/src/components/Orders/GoogleMapsApiKeySettingButton/index.js +94 -0
  110. package/src/components/Orders/GoogleMapsApiKeySettingButton/style.js +38 -0
  111. package/src/components/Orders/Messages/styles.js +6 -0
  112. package/src/components/Orders/OrderContactInformation/index.js +1 -1
  113. package/src/components/Orders/OrdersContentHeader/index.js +6 -1
  114. package/src/components/Orders/OrdersManager/index.js +2 -1
  115. package/src/components/Profile/ProfilePage/index.js +2 -0
  116. package/src/components/Profile/ProfilePage/styles.js +2 -1
  117. package/src/components/Profile/Sessions/index.js +209 -0
  118. package/src/components/Profile/Sessions/styles.js +132 -0
  119. package/src/components/Profile/index.js +3 -1
  120. package/src/components/Settings/EmailSetting/index.js +0 -32
  121. package/src/components/Settings/PageForm/index.js +3 -0
  122. package/src/components/Settings/Settings/index.js +0 -65
  123. package/src/components/Shared/CitySelector/index.js +8 -0
  124. package/src/components/Shared/Modal/index.js +32 -26
  125. package/src/components/Shared/Modal/styles.js +11 -3
  126. package/src/components/SidebarMenu/index.js +92 -70
  127. package/src/components/SidebarMenu/styles.js +8 -1
  128. package/src/components/Stores/AddBusinessForm/index.js +10 -8
  129. package/src/components/Stores/BusinessBrandGENDetail/index.js +3 -0
  130. package/src/components/Stores/BusinessProductList/styles.js +1 -1
  131. package/src/components/Stores/BusinessProductsCategories/styles.js +1 -1
  132. package/src/components/Stores/BusinessProductsCategoyInfo/index.js +3 -0
  133. package/src/components/Stores/BusinessProductsListing/index.js +35 -1
  134. package/src/components/Stores/BusinessProductsListing/styles.js +9 -1
  135. package/src/components/Stores/BusinessSelectHeader/index.js +14 -2
  136. package/src/components/Stores/BusinessSelectHeader/styles.js +5 -0
  137. package/src/components/Stores/BusinessSummary/index.js +27 -10
  138. package/src/components/Stores/BusinessSummary/styles.js +7 -0
  139. package/src/components/Stores/BusinessSync/index.js +7 -2
  140. package/src/components/Stores/BusinessSyncItsaCheckmate/index.js +63 -0
  141. package/src/components/Stores/BusinessSyncItsaCheckmate/styles.js +88 -0
  142. package/src/components/Support/index.js +1 -1
  143. package/src/hooks/useCountdownTimer.js +26 -0
  144. package/src/index.js +7 -1
  145. package/src/utils/index.js +61 -0
  146. package/template/app.js +14 -12
  147. package/template/assets/images/ItsaCheckmateLogo.png +0 -0
  148. package/template/assets/images/door-dash.png +0 -0
  149. package/template/assets/images/myProducts/driver-app-brand.png +0 -0
  150. package/template/assets/images/myProducts/driver-app-free.png +0 -0
  151. package/template/assets/images/myProducts/multi-store-customer-app.png +0 -0
  152. package/template/assets/images/myProducts/my-callcenter-app-brand.png +0 -0
  153. package/template/assets/images/myProducts/my-callcenter-app-live.png +0 -0
  154. package/template/assets/images/myProducts/my-kiosk-app-brand.png +0 -0
  155. package/template/assets/images/myProducts/my-kiosk-app-live.png +0 -0
  156. package/template/assets/images/myProducts/my-pos-app-brand.png +0 -0
  157. package/template/assets/images/myProducts/my-pos-app-live.png +0 -0
  158. package/template/assets/images/myProducts/single-store-customer-app.png +0 -0
  159. package/template/assets/images/myProducts/store-app-brand.png +0 -0
  160. package/template/assets/images/myProducts/store-app-free.png +0 -0
  161. package/template/assets/images/projectStatuses/project-active.png +0 -0
  162. package/template/assets/images/projectStatuses/project-past-due-payment.png +0 -0
  163. package/template/components/AutologinParams/index.js +79 -0
  164. package/template/components/ListenPageChanges/index.js +3 -2
  165. package/template/config.json +1 -0
  166. package/template/helmetdata.json +21 -0
  167. package/template/pages/CallCenterApp/index.js +12 -0
  168. package/template/pages/KioskApp/index.js +12 -0
  169. package/template/pages/PosApp/index.js +12 -0
  170. package/template/theme.json +3 -0
  171. package/_modules/components/MyProducts/DriverApp/styles.js +0 -29
  172. package/_modules/components/MyProducts/StoreApp/styles.js +0 -29
  173. package/src/components/MyProducts/CustomerApp/styles.js +0 -59
  174. package/src/components/MyProducts/DriverApp/styles.js +0 -104
  175. package/src/components/MyProducts/StoreApp/styles.js +0 -104
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from 'react'
2
2
  import Skeleton from 'react-loading-skeleton'
3
- import { useLanguage, useUtils, useEvent } from 'ordering-components-admin-external'
3
+ import { useLanguage, useUtils, useEvent, useApi } from 'ordering-components-admin-external'
4
4
  import BsChevronRight from '@meronex/icons/bs/BsChevronRight'
5
5
  import { useTheme } from 'styled-components'
6
6
  import { Dropdown, DropdownButton } from 'react-bootstrap'
@@ -22,7 +22,8 @@ import {
22
22
  BusinessConfigsContainer,
23
23
  BusinessConfigItem,
24
24
  ActionSelectorWrapper,
25
- BusinessPreviewHeader
25
+ BusinessPreviewHeader,
26
+ ButtonWrapper
26
27
  } from './styles'
27
28
 
28
29
  export const BusinessSummary = (props) => {
@@ -40,6 +41,7 @@ export const BusinessSummary = (props) => {
40
41
  const [{ optimizeImage }] = useUtils()
41
42
  const [events] = useEvent()
42
43
  const theme = useTheme()
44
+ const [ordering] = useApi()
43
45
  const [isBusinessPreview, setIsBusinessPreview] = useState(false)
44
46
  const [selectedView, setSelectedView] = useState('desktop')
45
47
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
@@ -48,6 +50,10 @@ export const BusinessSummary = (props) => {
48
50
  events.emit('go_to_page', { page: 'store', params: { store: businessState?.business?.slug } })
49
51
  }
50
52
 
53
+ const handleOpenSite = () => {
54
+ window.open(`https://${ordering.project}.tryordering.com/store/${businessState?.business?.slug}`, '_blank')
55
+ }
56
+
51
57
  const itemsExcluded = ['publishing']
52
58
 
53
59
  const businessConfigs = [
@@ -208,14 +214,25 @@ export const BusinessSummary = (props) => {
208
214
  )}
209
215
 
210
216
  <BusinessDetailsContent>
211
- <Button
212
- color='lightPrimary'
213
- borderRadius='8px'
214
- onClick={handleOpenCategory}
215
- disabled={businessState?.loading}
216
- >
217
- {t('CATEGORIES_AND_PRODUCTS', 'Categories & products')}
218
- </Button>
217
+ <ButtonWrapper>
218
+ <Button
219
+ color='lightPrimary'
220
+ borderRadius='8px'
221
+ onClick={handleOpenCategory}
222
+ disabled={businessState?.loading}
223
+ >
224
+ {t('CATEGORIES_AND_PRODUCTS', 'Categories & products')}
225
+ </Button>
226
+ <Button
227
+ color='primary'
228
+ outline
229
+ borderRadius='8px'
230
+ onClick={handleOpenSite}
231
+ disabled={businessState?.loading}
232
+ >
233
+ {t('STORE_WEBSITE', 'Store website')}
234
+ </Button>
235
+ </ButtonWrapper>
219
236
  <BusinessDescription>
220
237
  {businessState?.loading ? (
221
238
  <Skeleton width={300} />
@@ -243,3 +243,10 @@ export const BusinessPreviewHeader = styled.div`
243
243
  }
244
244
  }
245
245
  `
246
+
247
+ export const ButtonWrapper = styled.div`
248
+ display: flex;
249
+ > button:first-child {
250
+ margin-right: 15px;
251
+ }
252
+ `
@@ -1,6 +1,7 @@
1
1
  import React, { useState } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import { BusinessSyncBasic } from '../BusinessSyncBasic'
4
+ import { BusinessSyncItsaCheckmate } from '../BusinessSyncItsaCheckmate'
4
5
  import { BusinessSyncStore } from '../BusinessSyncStore'
5
6
 
6
7
  import {
@@ -17,7 +18,8 @@ export const BusinessSync = (props) => {
17
18
  const [selectedOption, setSelectedOption] = useState('deliverect')
18
19
 
19
20
  const syncOptions = [
20
- { key: 'deliverect', name: t('DELIVERECT', 'Deliverect') }
21
+ { key: 'deliverect', name: t('DELIVERECT', 'Deliverect') },
22
+ { key: 'itsacheckmate', name: t('ITSACHECKMATE', 'ItsaCheckmate') }
21
23
  ]
22
24
 
23
25
  const handleChangeOption = (key) => {
@@ -28,7 +30,7 @@ export const BusinessSync = (props) => {
28
30
  return (
29
31
  <Container>
30
32
  <Header>
31
- <h2>{t('SYNC_WITH_DELIVERECT', 'Sync with deliverect')}</h2>
33
+ <h2>{t('SYNC_WITH', 'Sync with')}</h2>
32
34
  </Header>
33
35
  <Tabs>
34
36
  {syncOptions.map(option => (
@@ -44,6 +46,9 @@ export const BusinessSync = (props) => {
44
46
  {selectedOption === 'deliverect' && (
45
47
  <BusinessSyncBasic />
46
48
  )}
49
+ {selectedOption === 'itsacheckmate' && (
50
+ <BusinessSyncItsaCheckmate />
51
+ )}
47
52
  {selectedOption === 'synced_store' && (
48
53
  <BusinessSyncStore
49
54
  handleParentSidebarMove={handleParentSidebarMove}
@@ -0,0 +1,63 @@
1
+ import React from 'react'
2
+ import { useLanguage } from 'ordering-components-admin-external'
3
+ import { useTheme } from 'styled-components'
4
+ import { Check2Circle } from 'react-bootstrap-icons'
5
+ import {
6
+ Container,
7
+ LogoWrapper,
8
+ Description,
9
+ GetStarted,
10
+ YoutubeVideoWrapper,
11
+ YoutubeVideoInner
12
+ } from './styles'
13
+ import { Button } from '../../../styles'
14
+
15
+ export const BusinessSyncItsaCheckmate = () => {
16
+ const theme = useTheme()
17
+ const [, t] = useLanguage()
18
+
19
+ return (
20
+ <Container>
21
+ <LogoWrapper>
22
+ <img src={theme.images.general.ItsaCheckmateLogo} alt='' />
23
+ </LogoWrapper>
24
+ <Description>
25
+ <div
26
+ className='sub-header'
27
+ dangerouslySetInnerHTML={{ __html: t('ITSACHECKMATE_SUB_HEADER', 'Take control of all your <strong>Ordering Platform Menus</strong> in one place!') }}
28
+ />
29
+ <div className='menu-item'>
30
+ <Check2Circle />
31
+ <p>{t('ITSACHECKMATE_MENU_1', '86 items & modifiers')}</p>
32
+ </div>
33
+ <div className='menu-item'>
34
+ <Check2Circle />
35
+ <p>{t('ITSACHECKMATE_MENU_2', 'Turn on or off ordering platforms')}</p>
36
+ </div>
37
+ <div className='menu-item'>
38
+ <Check2Circle />
39
+ <p>{t('ITSACHECKMATE_MENU_3', 'Manage delivery hours')}</p>
40
+ </div>
41
+ <div className='menu-item'>
42
+ <Check2Circle />
43
+ <p>{t('ITSACHECKMATE_MENU_4', 'Add, edit, or delete items ')}</p>
44
+ </div>
45
+ </Description>
46
+ <GetStarted>
47
+ <h2>{t('GET_STARTED_RIGHT_HERE', 'Get started right here')}</h2>
48
+ <p>{t('FILL_UP_THIS_FORM_TO_REQUEST_INFORMATION', 'Fill up this form to request more information')}</p>
49
+ <a href='https://share.hsforms.com/1vuXwaFtfTTeZf362zJgqSg3neff' target='_blank' rel='noopener noreferrer'>
50
+ <Button color='primary'>{t('SEND_FORM', 'Send Form')}</Button>
51
+ </a>
52
+ </GetStarted>
53
+ <YoutubeVideoWrapper>
54
+ <YoutubeVideoInner>
55
+ <iframe
56
+ title='youtube'
57
+ src='https://www.youtube.com/embed/_caZDl4ZFp0?feature=oembed'
58
+ />
59
+ </YoutubeVideoInner>
60
+ </YoutubeVideoWrapper>
61
+ </Container>
62
+ )
63
+ }
@@ -0,0 +1,88 @@
1
+ import styled, { css } from 'styled-components'
2
+
3
+ export const Container = styled.div``
4
+
5
+ export const LogoWrapper = styled.div`
6
+ width: 216px;
7
+ height: 216px;
8
+ box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
9
+ border-radius: 7.6px;
10
+ margin: 0 auto;
11
+ display: flex;
12
+ align-items: center;
13
+
14
+ > img {
15
+ width: 100%;
16
+ }
17
+ `
18
+
19
+ export const Description = styled.div`
20
+ margin-top: 36px;
21
+ margin-bottom: 50px;
22
+ div.sub-header {
23
+ font-size: 14px;
24
+ margin-bottom: 10px;
25
+ }
26
+ div.menu-item {
27
+ display: flex;
28
+ align-items: center;
29
+ svg {
30
+ ${props => props.theme?.rtl ? css`
31
+ margin-left: 8px;
32
+ ` : css`
33
+ margin-right: 8px;
34
+ `}
35
+ }
36
+ > p {
37
+ font-weight: 400;
38
+ font-size: 14px;
39
+ line-height: 24px;
40
+ margin: 0px;
41
+ }
42
+ }
43
+ `
44
+
45
+ export const GetStarted = styled.div`
46
+ h2 {
47
+ font-weight: 500;
48
+ font-size: 14px;
49
+ line-height: 24px;
50
+ margin-top: 0px;
51
+ margin-bottom: 10px;
52
+ }
53
+ p {
54
+ font-weight: 400;
55
+ font-size: 14px;
56
+ line-height: 24px;
57
+ margin-top: 0px;
58
+ margin-bottom: 8px;
59
+ color: ${props => props.theme.colors.lightGray};
60
+ }
61
+ button {
62
+ border-radius: 8px;
63
+ height: 44px;
64
+ }
65
+ `
66
+
67
+ export const YoutubeVideoWrapper = styled.div`
68
+ margin-top: 50px;
69
+ padding-bottom: 30px;
70
+ `
71
+
72
+ export const YoutubeVideoInner = styled.div`
73
+ position: relative;
74
+ width: 100%;
75
+ padding-bottom: 56.25%;
76
+ box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
77
+ border-radius: 7.6px;
78
+ background-color: ${props => props.theme.colors.secundaryDarkContrast};
79
+
80
+ iframe {
81
+ position: absolute;
82
+ top: 0;
83
+ left: 0;
84
+ width: 100%;
85
+ height: 100%;
86
+ border: 0;
87
+ }
88
+ `
@@ -59,7 +59,7 @@ export const Support = (props) => {
59
59
  <Button
60
60
  borderRadius='7.6px'
61
61
  color='primary'
62
- onClick={() => handleGoToLink('https://www.ordering.co/ordering-support')}
62
+ onClick={() => handleGoToLink('https://support.ordering.co')}
63
63
  outline
64
64
  >
65
65
  {t('TECH_SUPPORT', 'Tech Support')}
@@ -0,0 +1,26 @@
1
+ import { useEffect, useState } from 'react'
2
+
3
+ /**
4
+ * Hook for countdown seconds
5
+ * @param {int} initialCount
6
+ * @param {boolean} start
7
+ */
8
+ export function useCountdownTimer (initialCount, start) {
9
+ const [count, setCount] = useState(initialCount)
10
+
11
+ useEffect(() => {
12
+ if (start) {
13
+ const secondsLeft = setInterval(() => {
14
+ setCount(c => c - (c === 0 ? 0 : 1))
15
+ }, 1000)
16
+ return () => clearInterval(secondsLeft)
17
+ }
18
+ }, [start])
19
+
20
+ return [
21
+ count,
22
+ setCount,
23
+ /** reset */
24
+ () => { setCount(initialCount) }
25
+ ]
26
+ }
package/src/index.js CHANGED
@@ -341,7 +341,10 @@ import {
341
341
  OrderingWebsite,
342
342
  CustomerApp,
343
343
  StoreApp,
344
- DriverApp
344
+ DriverApp,
345
+ PosApp,
346
+ CallCenterApp,
347
+ KioskApp
345
348
  } from './components/MyProducts'
346
349
  import { OpenCartListing, RecoveryActionListing } from './components/CartRecovery'
347
350
  import { FreeProductsList, PurchasedProductsList } from './components/Downloads'
@@ -741,6 +744,9 @@ export {
741
744
  CustomerApp,
742
745
  StoreApp,
743
746
  DriverApp,
747
+ PosApp,
748
+ CallCenterApp,
749
+ KioskApp,
744
750
 
745
751
  Layout,
746
752
  SidebarMenu,
@@ -243,6 +243,16 @@ export const shape = {
243
243
  capsuleShape: 'capsule_shape'
244
244
  }
245
245
 
246
+ /**
247
+ * Function to check URL
248
+ * @param {string} url URL of page
249
+ * @param {string} fallback default URL
250
+ */
251
+ export const checkPreSiteUrl = (url, fallback) => {
252
+ if (!url) return fallback
253
+ return url[0] === '/' ? url : `/${url}`
254
+ }
255
+
246
256
  /**
247
257
  * default value for bitton
248
258
  */
@@ -252,6 +262,25 @@ export const ribbonValues = {
252
262
  shape: 'rectangle',
253
263
  enabled: false
254
264
  }
265
+ /**
266
+ * Format seconds to hh:mm:ss
267
+ * @param {number} seconds
268
+ */
269
+ export const formatSeconds = (seconds) => {
270
+ // Hours, minutes and seconds
271
+ const hrs = Math.floor(seconds / 3600)
272
+ const mins = Math.floor((seconds % 3600) / 60)
273
+ const secs = Math.floor(seconds % 60)
274
+
275
+ // Output like '1:01' or '4:03:59' or '123:03:59'
276
+ let ret = ''
277
+ if (hrs > 0) {
278
+ ret += '' + hrs + ':' + (mins < 10 ? '0' : '')
279
+ }
280
+ ret += '' + mins + ':' + (secs < 10 ? '0' : '')
281
+ ret += '' + secs
282
+ return ret
283
+ }
255
284
 
256
285
  /**
257
286
  * Function to check URL
@@ -387,3 +416,35 @@ export const orderRejectCommentList = (status) => {
387
416
  }
388
417
 
389
418
  export const widgetURL = 'https://orderingweb.ordering.co/'
419
+
420
+ export const getCurrentDiffDays = (time) => {
421
+ const current = moment().utc()
422
+ const compared = moment(time)
423
+ return compared.diff(current, 'days')
424
+ }
425
+
426
+ export const firstLetterCapital = (text) => {
427
+ return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase()
428
+ }
429
+
430
+ export const stringToSlug = str => {
431
+ str = str.replace(/^\s+|\s+$/g, '') // trim
432
+ str = str?.toLowerCase()
433
+
434
+ // remove accents, swap ñ for n, etc
435
+ const from = 'åàáãäâèéëêìíïîòóöôùúüûñç·/_,:;'
436
+ const to = 'aaaaaaeeeeiiiioooouuuunc------'
437
+
438
+ for (let i = 0, l = from.length; i < l; i++) {
439
+ str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i))
440
+ }
441
+
442
+ str = str
443
+ .replace(/[^a-z0-9 -]/g, '') // remove invalid chars
444
+ .replace(/\s+/g, '_') // collapse whitespace and replace by -
445
+ .replace(/-+/g, '_') // collapse dashes
446
+ .replace(/^-+/, '') // trim - from start of text
447
+ .replace(/-+$/, '') // trim - from end of text
448
+
449
+ return str
450
+ }
package/template/app.js CHANGED
@@ -54,6 +54,9 @@ import { OrderingWebsite } from './pages/OrderingWebsite'
54
54
  import { CustomerApp } from './pages/CustomerApp'
55
55
  import { StoreApp } from './pages/StoreApp'
56
56
  import { DriverApp } from './pages/DriverApp'
57
+ import { PosApp } from './pages/PosApp'
58
+ import { CallCenterApp } from './pages/CallCenterApp'
59
+ import { KioskApp } from './pages/KioskApp'
57
60
 
58
61
  import { ScrollToTop } from './components/ScrollToTop'
59
62
  import { ListenPageChanges } from './components/ListenPageChanges'
@@ -63,12 +66,11 @@ import { RewardsPrograms } from './pages/RewardsPrograms'
63
66
  import { OpenCarts } from './pages/OpenCarts'
64
67
  import { RecoveryActionListing } from './pages/RecoveryActionListing'
65
68
  import { CampaignListing } from './pages/CampaignListing'
66
- import { FreeProductsList } from './pages/FreeProductsList'
67
- import { PurchasedProductsList } from './pages/PurchasedProductsList'
68
69
  import { Professionals } from './pages/Professionals'
69
70
  import { QueryLogin } from '../src/components/Login'
70
71
  import { PluginSettings } from './pages/PluginSettings'
71
72
  import { Profile } from './pages/Profile'
73
+ import settings from './config.json'
72
74
 
73
75
  export const App = () => {
74
76
  const [{ auth, loading, user }] = useSession()
@@ -129,7 +131,7 @@ export const App = () => {
129
131
  )}
130
132
  <Layout>
131
133
  {auth && (
132
- <SidebarMenu />
134
+ <SidebarMenu billingUrl={settings?.billing_url} />
133
135
  )}
134
136
  {onlineStatus && (
135
137
  <ScrollToTop>
@@ -293,18 +295,24 @@ export const App = () => {
293
295
  <ProtectedRoute path='/my-products/ordering-website' allowedLevels={[0]}>
294
296
  <OrderingWebsite />
295
297
  </ProtectedRoute>
296
-
297
298
  <ProtectedRoute path='/my-products/customer-app' allowedLevels={[0]}>
298
299
  <CustomerApp />
299
300
  </ProtectedRoute>
300
-
301
301
  <ProtectedRoute path='/my-products/store-app' allowedLevels={[0]}>
302
302
  <StoreApp />
303
303
  </ProtectedRoute>
304
-
305
304
  <ProtectedRoute path='/my-products/driver-app' allowedLevels={[0]}>
306
305
  <DriverApp />
307
306
  </ProtectedRoute>
307
+ <ProtectedRoute path='/my-products/pos-app' allowedLevels={[0]}>
308
+ <PosApp />
309
+ </ProtectedRoute>
310
+ <ProtectedRoute path='/my-products/call-center-app' allowedLevels={[0]}>
311
+ <CallCenterApp />
312
+ </ProtectedRoute>
313
+ <ProtectedRoute path='/my-products/kiosk-app' allowedLevels={[0]}>
314
+ <KioskApp />
315
+ </ProtectedRoute>
308
316
 
309
317
  <ProtectedRoute path='/settings/basic' allowedLevels={[0]}>
310
318
  <BasicSettings />
@@ -332,12 +340,6 @@ export const App = () => {
332
340
  <Support />
333
341
  </ProtectedRoute>
334
342
 
335
- <ProtectedRoute path='/downloads/free-products' allowedLevels={[0]}>
336
- <FreeProductsList />
337
- </ProtectedRoute>
338
- <ProtectedRoute path='/downloads/purchased-products' allowedLevels={[0]}>
339
- <PurchasedProductsList />
340
- </ProtectedRoute>
341
343
  <ProtectedRoute path='/ordering-products' allowedLevels={[0]}>
342
344
  <OrderingProducts />
343
345
  </ProtectedRoute>
@@ -0,0 +1,79 @@
1
+ import React, { cloneElement, useEffect, useState } from 'react'
2
+
3
+ import { SpinnerLoader } from '../../../src/components/Shared'
4
+ import settings from '../../config.json'
5
+ import theme from '../../theme.json'
6
+
7
+ export const AutologinParams = (props) => {
8
+ const [userState, setUserState] = useState({ loading: true, result: null, error: null })
9
+
10
+ const allowedLevels = [0, 2, 5]
11
+ const search = window.location.search
12
+
13
+ let queryProject
14
+ let queryToken
15
+
16
+ if (search) {
17
+ const query = new URLSearchParams(search)
18
+ queryProject = query.get('project')
19
+ queryToken = query.get('token')
20
+ }
21
+
22
+ const setUser = async () => {
23
+ if (!queryProject || !queryToken) {
24
+ setUserState({ ...userState, loading: false })
25
+ return
26
+ }
27
+ window.localStorage.removeItem('token')
28
+ window.localStorage.removeItem('user')
29
+ window.localStorage.removeItem('project')
30
+ try {
31
+ setUserState({ ...userState, loading: true })
32
+ const requestOptions = {
33
+ method: 'GET',
34
+ headers: {
35
+ 'Content-Type': 'application/json',
36
+ Authorization: `Bearer ${queryToken}`
37
+ }
38
+ }
39
+ const response = await fetch(`${settings.api.url}/${settings.api.version}/${settings.api.language}/${queryProject}/users/me`, requestOptions)
40
+ const { error, result } = await response.json()
41
+ if (!error && allowedLevels.includes(result.level)) {
42
+ window.localStorage.setItem('token', queryToken)
43
+ window.localStorage.setItem('user', JSON.stringify(result))
44
+ window.localStorage.setItem('project', queryProject)
45
+ }
46
+ setUserState({
47
+ ...userState,
48
+ loading: false,
49
+ error: result
50
+ })
51
+ } catch (e) {
52
+ setUserState({
53
+ ...userState,
54
+ loading: false,
55
+ error: e?.message
56
+ })
57
+ }
58
+ }
59
+
60
+ useEffect(() => {
61
+ setUser()
62
+ }, [])
63
+
64
+ return (
65
+ userState.loading
66
+ ? <SpinnerLoader content={theme?.defaultLanguages?.LOADING_DELICIOUS_FOOD} />
67
+ : cloneElement(props.children, {
68
+ settings: {
69
+ ...settings,
70
+ ...props.configFile,
71
+ project: settings?.use_project_domain
72
+ ? '_'
73
+ : queryProject ?? window.localStorage.getItem('project') !== null
74
+ ? window.localStorage.getItem('project')
75
+ : props.configFile?.project ?? null
76
+ }
77
+ })
78
+ )
79
+ }
@@ -42,6 +42,9 @@ export const ListenPageChanges = ({ children }) => {
42
42
  customer_app: '/my-products/customer-app',
43
43
  store_app: '/my-products/store-app',
44
44
  driver_app: '/my-products/driver-app',
45
+ pos_app: '/my-products/pos-app',
46
+ call_center_app: '/my-products/call-center-app',
47
+ kiosk_app: '/my-products/kiosk-app',
45
48
  delivery_drivers: '/delivery/drivers-list',
46
49
  drivers_managers: '/delivery/drivers-managers',
47
50
  drivers_companies: '/delivery/drivers-companies',
@@ -51,8 +54,6 @@ export const ListenPageChanges = ({ children }) => {
51
54
  ordering_products: '/ordering-products',
52
55
  support: '/support',
53
56
  rewards_programs: '/loyalty/rewards-programs',
54
- free_products: '/downloads/free-products',
55
- purchased_products: '/downloads/purchased-products',
56
57
  reset_password: '/password/reset',
57
58
  profile: '/profile'
58
59
  }
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "app_id": "ordering-admin-react",
3
3
  "app_name": "Ordering Admin",
4
+ "billing_url": "https://billing-dashboard.tryordering.com",
4
5
  "api": {
5
6
  "url": "https://apiv4.ordering.co",
6
7
  "language": "en",
@@ -265,6 +265,27 @@
265
265
  "robots": "index, follow",
266
266
  "canonicalUrl": ""
267
267
  },
268
+ "pos_app": {
269
+ "title": "POS App",
270
+ "description": "a dummy description about this page",
271
+ "keywords": "test, dummy, data",
272
+ "robots": "index, follow",
273
+ "canonicalUrl": ""
274
+ },
275
+ "call_center_app": {
276
+ "title": "Call Center App",
277
+ "description": "a dummy description about this page",
278
+ "keywords": "test, dummy, data",
279
+ "robots": "index, follow",
280
+ "canonicalUrl": ""
281
+ },
282
+ "kiosk_app": {
283
+ "title": "Kiosk App",
284
+ "description": "a dummy description about this page",
285
+ "keywords": "test, dummy, data",
286
+ "robots": "index, follow",
287
+ "canonicalUrl": ""
288
+ },
268
289
  "support": {
269
290
  "title": "Support",
270
291
  "description": "a dummy description about this page",
@@ -0,0 +1,12 @@
1
+ import React from 'react'
2
+ import { HelmetTags } from '../../components/HelmetTags'
3
+ import { CallCenterApp as CallCenterAppController } from '../../../src/components/MyProducts'
4
+
5
+ export const CallCenterApp = (props) => {
6
+ return (
7
+ <>
8
+ <HelmetTags page='call_center_app' />
9
+ <CallCenterAppController {...props} />
10
+ </>
11
+ )
12
+ }