ordering-ui-admin-external 1.23.5 → 1.24.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 (96) hide show
  1. package/_bundles/{ordering-ui-admin.a1255b2c1a2d4b87080d.js → ordering-ui-admin.0c354f3e7da49f56465b.js} +2 -2
  2. package/_modules/components/CartRecovery/RecoveryActionAdd/index.js +325 -0
  3. package/_modules/components/CartRecovery/RecoveryGeneral/index.js +41 -17
  4. package/_modules/components/Delivery/DriversCompaniesList/styles.js +1 -1
  5. package/_modules/components/Delivery/DriversCompaniesListing/index.js +20 -2
  6. package/_modules/components/Delivery/DriversCompaniesListing/styles.js +2 -2
  7. package/_modules/components/Delivery/DriversCompanyAddForm/GeneralForm/index.js +122 -0
  8. package/_modules/components/Delivery/DriversCompanyAddForm/GeneralForm/styles.js +21 -0
  9. package/_modules/components/Delivery/DriversCompanyAddForm/ScheduleForm/index.js +27 -0
  10. package/_modules/components/Delivery/DriversCompanyAddForm/ScheduleForm/styles.js +14 -0
  11. package/_modules/components/Delivery/DriversCompanyAddForm/WebhooksForm/index.js +60 -0
  12. package/_modules/components/Delivery/DriversCompanyAddForm/WebhooksForm/styles.js +16 -0
  13. package/_modules/components/Delivery/DriversCompanyAddForm/index.js +114 -0
  14. package/_modules/components/Delivery/DriversCompanyAddForm/styles.js +18 -0
  15. package/_modules/components/MyProducts/AdvancedSettings/index.js +66 -82
  16. package/_modules/components/MyProducts/AdvancedSettings/styles.js +40 -44
  17. package/_modules/components/MyProducts/OrderingWebsite/SelectBusiness.js +59 -0
  18. package/_modules/components/MyProducts/OrderingWebsite/SelectFranchise.js +59 -0
  19. package/_modules/components/MyProducts/OrderingWebsite/index.js +21 -29
  20. package/_modules/components/MyProducts/OrderingWebsite/styles.js +1 -1
  21. package/_modules/components/MyProducts/UploadAudio/index.js +170 -0
  22. package/_modules/components/MyProducts/UploadAudio/styles.js +30 -0
  23. package/_modules/components/MyProducts/index.js +8 -1
  24. package/_modules/components/Orders/DeliveriesLocation/index.js +1 -0
  25. package/_modules/components/Orders/OrderBill/index.js +4 -3
  26. package/_modules/components/Orders/OrderContactInformation/index.js +14 -12
  27. package/_modules/components/Orders/OrderDetails/index.js +6 -131
  28. package/_modules/components/Orders/OrdersTable/index.js +2 -2
  29. package/_modules/components/Settings/NotificationSetting/index.js +1 -1
  30. package/_modules/components/Settings/SettingsList/index.js +1 -1
  31. package/_modules/components/Settings/SettingsList/styles.js +2 -2
  32. package/_modules/components/SidebarMenu/index.js +22 -22
  33. package/_modules/components/Stores/BusinessDetails/index.js +2 -1
  34. package/_modules/components/Stores/BusinessDeviceDetail/index.js +66 -16
  35. package/_modules/components/Stores/BusinessDeviceDetail/styles.js +7 -5
  36. package/_modules/components/Stores/BusinessSalesChannel/index.js +13 -4
  37. package/_modules/components/Stores/BusinessSalesFacebook/FacebookProfile.js +2 -2
  38. package/_modules/components/Stores/BusinessSalesFacebook/index.js +2 -2
  39. package/_modules/components/Stores/BusinessSalesGoogle/index.js +2 -2
  40. package/_modules/components/Stores/BusinessSalesInstagram/AdvancedInstagram.js +3 -2
  41. package/_modules/components/Stores/BusinessSalesInstagram/GeneralInstagram.js +2 -2
  42. package/_modules/components/Stores/BusinessSalesInstagram/index.js +3 -5
  43. package/_modules/components/Users/CustomersListing/index.js +5 -3
  44. package/_modules/utils/index.js +203 -2
  45. package/index-template.js +1 -1
  46. package/index.html +1 -0
  47. package/package.json +2 -2
  48. package/public/push/onesignal/OneSignalSDKUpdaterWorker.js +1 -0
  49. package/public/push/onesignal/OneSignalSDKWorker.js +1 -0
  50. package/src/components/CartRecovery/RecoveryActionAdd/index.js +355 -0
  51. package/src/components/CartRecovery/RecoveryGeneral/index.js +23 -4
  52. package/src/components/Delivery/DriversCompaniesList/styles.js +1 -1
  53. package/src/components/Delivery/DriversCompaniesListing/index.js +29 -12
  54. package/src/components/Delivery/DriversCompaniesListing/styles.js +1 -1
  55. package/src/components/Delivery/DriversCompanyAddForm/GeneralForm/index.js +120 -0
  56. package/src/components/Delivery/DriversCompanyAddForm/GeneralForm/styles.js +32 -0
  57. package/src/components/Delivery/DriversCompanyAddForm/ScheduleForm/index.js +29 -0
  58. package/src/components/Delivery/DriversCompanyAddForm/ScheduleForm/styles.js +11 -0
  59. package/src/components/Delivery/DriversCompanyAddForm/WebhooksForm/index.js +69 -0
  60. package/src/components/Delivery/DriversCompanyAddForm/WebhooksForm/styles.js +24 -0
  61. package/src/components/Delivery/DriversCompanyAddForm/index.js +121 -0
  62. package/src/components/Delivery/DriversCompanyAddForm/styles.js +39 -0
  63. package/src/components/MyProducts/AdvancedSettings/index.js +35 -36
  64. package/src/components/MyProducts/AdvancedSettings/styles.js +3 -11
  65. package/src/components/MyProducts/OrderingWebsite/SelectBusiness.js +47 -0
  66. package/src/components/MyProducts/OrderingWebsite/SelectFranchise.js +47 -0
  67. package/src/components/MyProducts/OrderingWebsite/index.js +20 -30
  68. package/src/components/MyProducts/OrderingWebsite/styles.js +0 -4
  69. package/src/components/MyProducts/UploadAudio/index.js +168 -0
  70. package/src/components/MyProducts/UploadAudio/styles.js +120 -0
  71. package/src/components/MyProducts/index.js +3 -1
  72. package/src/components/Orders/DeliveriesLocation/index.js +1 -0
  73. package/src/components/Orders/OrderBill/index.js +9 -6
  74. package/src/components/Orders/OrderContactInformation/index.js +5 -1
  75. package/src/components/Orders/OrderDetails/index.js +7 -35
  76. package/src/components/Orders/OrdersTable/index.js +3 -1
  77. package/src/components/Settings/NotificationSetting/index.js +2 -0
  78. package/src/components/Settings/SettingsList/index.js +53 -53
  79. package/src/components/Settings/SettingsList/styles.js +2 -1
  80. package/src/components/Settings/SettingsSelectUI/index.js +1 -1
  81. package/src/components/SidebarMenu/index.js +1 -0
  82. package/src/components/Stores/BusinessDetails/index.js +1 -0
  83. package/src/components/Stores/BusinessDeviceDetail/index.js +46 -7
  84. package/src/components/Stores/BusinessDeviceDetail/styles.js +11 -0
  85. package/src/components/Stores/BusinessSalesChannel/index.js +12 -6
  86. package/src/components/Stores/BusinessSalesFacebook/FacebookProfile.js +2 -2
  87. package/src/components/Stores/BusinessSalesFacebook/index.js +3 -3
  88. package/src/components/Stores/BusinessSalesGoogle/index.js +3 -3
  89. package/src/components/Stores/BusinessSalesInstagram/AdvancedInstagram.js +2 -2
  90. package/src/components/Stores/BusinessSalesInstagram/GeneralInstagram.js +2 -2
  91. package/src/components/Stores/BusinessSalesInstagram/index.js +3 -3
  92. package/src/components/Users/CustomersListing/index.js +2 -3
  93. package/src/utils/index.js +53 -0
  94. package/template/app.js +76 -3
  95. package/template/config.json +1 -0
  96. /package/_bundles/{ordering-ui-admin.a1255b2c1a2d4b87080d.js.LICENSE.txt → ordering-ui-admin.0c354f3e7da49f56465b.js.LICENSE.txt} +0 -0
@@ -8,7 +8,7 @@ import {
8
8
  CopyInputWrapper
9
9
  } from './styles'
10
10
 
11
- export const FacebookProfile = ({ businessSlug }) => {
11
+ export const FacebookProfile = ({ storeUrl }) => {
12
12
  const [, t] = useLanguage()
13
13
  const theme = useTheme()
14
14
 
@@ -20,7 +20,7 @@ export const FacebookProfile = ({ businessSlug }) => {
20
20
  <p>{t('BUSINESS_FACEBOOK_PROFILE_STEP1_DESC', 'Copy this link below. It’s your unique Ordering link for facebook.')}</p>
21
21
  <CopyInputWrapper>
22
22
  <Input
23
- defaultValue='https://yourbusinessname.com/store/storename'
23
+ defaultValue={storeUrl || 'https://yourbusinessname.com/store/storename'}
24
24
  disabled
25
25
  />
26
26
  </CopyInputWrapper>
@@ -4,7 +4,7 @@ import { useWindowSize } from '../../../hooks/useWindowSize'
4
4
  import {
5
5
  Container,
6
6
  Header,
7
- LeftHeader,
7
+ LeftHeader
8
8
  // Tabs,
9
9
  // Tab
10
10
  } from './styles'
@@ -14,7 +14,7 @@ import { FacebookProfile } from './FacebookProfile'
14
14
  import { FacebookPost } from './FacebookPost'
15
15
 
16
16
  export const BusinessSalesFacebook = (props) => {
17
- const { onClose, socialItem, businessSlug } = props
17
+ const { onClose, socialItem, storeUrl } = props
18
18
 
19
19
  const { width } = useWindowSize()
20
20
  // const [, t] = useLanguage()
@@ -74,7 +74,7 @@ export const BusinessSalesFacebook = (props) => {
74
74
  </Tab>
75
75
  ))}
76
76
  </Tabs> */}
77
- {selectedTab === 'profile' && <FacebookProfile businessSlug={businessSlug} />}
77
+ {selectedTab === 'profile' && <FacebookProfile storeUrl={storeUrl} />}
78
78
  {selectedTab === 'post' && <FacebookPost />}
79
79
  </Container>
80
80
  )
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import { useWindowSize } from '../../../hooks/useWindowSize'
4
4
  import { IconButton, Input } from '../../../styles'
5
- import { XLg, Files } from 'react-bootstrap-icons'
5
+ import { XLg } from 'react-bootstrap-icons'
6
6
  import { useTheme } from 'styled-components'
7
7
  import {
8
8
  Container,
@@ -14,7 +14,7 @@ import {
14
14
  } from './styles'
15
15
 
16
16
  export const BusinessSalesGoogle = (props) => {
17
- const { onClose, socialItem, businessSlug } = props
17
+ const { onClose, socialItem, storeUrl } = props
18
18
 
19
19
  const { width } = useWindowSize()
20
20
  const [, t] = useLanguage()
@@ -77,7 +77,7 @@ export const BusinessSalesGoogle = (props) => {
77
77
  <p>{t('BUSINESS_GOOGLE_STEP3_DESC', 'Scroll down and find Order ahead links and Menu link fields. Paste the link below.')}</p>
78
78
  <CopyInputWrapper isBottom>
79
79
  <Input
80
- defaultValue='https://yourbusinessname.com/store/storename'
80
+ defaultValue={storeUrl || 'https://yourbusinessname.com/store/storename'}
81
81
  disabled
82
82
  />
83
83
  </CopyInputWrapper>
@@ -9,7 +9,7 @@ import {
9
9
  ImageWrapper
10
10
  } from './styles'
11
11
 
12
- export const AdvancedInstagram = (props) => {
12
+ export const AdvancedInstagram = ({ storeUrl }) => {
13
13
  const [, t] = useLanguage()
14
14
  const theme = useTheme()
15
15
 
@@ -40,7 +40,7 @@ export const AdvancedInstagram = (props) => {
40
40
  />
41
41
  <CopyInputWrapper isBottom>
42
42
  <Input
43
- defaultValue='https://yourbusinessname.com/store/storename'
43
+ defaultValue={storeUrl || 'https://yourbusinessname.com/store/storename'}
44
44
  disabled
45
45
  />
46
46
  </CopyInputWrapper>
@@ -8,7 +8,7 @@ import {
8
8
  CopyInputWrapper
9
9
  } from './styles'
10
10
 
11
- export const GeneralInstagram = ({ businessSlug }) => {
11
+ export const GeneralInstagram = ({ storeUrl }) => {
12
12
  const [, t] = useLanguage()
13
13
  const theme = useTheme()
14
14
 
@@ -37,7 +37,7 @@ export const GeneralInstagram = ({ businessSlug }) => {
37
37
  <p>{t('BUSINESS_INSTAGRAM_GENERAL_STEP5_DESC', 'Just add this link to the website field:')}</p>
38
38
  <CopyInputWrapper isBottom>
39
39
  <Input
40
- defaultValue='https://yourbusinessname.com/store/storename'
40
+ defaultValue={storeUrl || 'https://yourbusinessname.com/store/storename'}
41
41
  disabled
42
42
  />
43
43
  </CopyInputWrapper>
@@ -14,7 +14,7 @@ import {
14
14
  } from './styles'
15
15
 
16
16
  export const BusinessSalesInstagram = (props) => {
17
- const { onClose, socialItem, businessSlug } = props
17
+ const { onClose, socialItem, storeUrl } = props
18
18
 
19
19
  const { width } = useWindowSize()
20
20
  const [, t] = useLanguage()
@@ -74,8 +74,8 @@ export const BusinessSalesInstagram = (props) => {
74
74
  </Tab>
75
75
  ))}
76
76
  </Tabs>
77
- {selectedTab === 'general' && <GeneralInstagram businessSlug={businessSlug} />}
78
- {selectedTab === 'advanced' && <AdvancedInstagram businessSlug={businessSlug} />}
77
+ {selectedTab === 'general' && <GeneralInstagram storeUrl={storeUrl} />}
78
+ {selectedTab === 'advanced' && <AdvancedInstagram />}
79
79
  </Container>
80
80
  )
81
81
  }
@@ -129,16 +129,15 @@ const CustomersListingUI = (props) => {
129
129
  <VerifiedStatusFilterContainer>
130
130
  <Button
131
131
  color={(orderFilterValue === '' || orderFilterValue === null) ? 'primary' : 'secundaryDark'}
132
- onClick={() => handleChangeOrderFilterValue('')}
132
+ onClick={() => handleChangeOrderFilterValue(null)}
133
133
  >
134
134
  {t('ALL', 'All')}
135
- {(orderFilterValue === '' || orderFilterValue === null) && <CloseIcon />}
136
135
  </Button>
137
136
  {orderList.map((item, i) => (
138
137
  <Button
139
138
  key={i}
140
139
  color={orderFilterValue === item.value ? 'primary' : 'secundaryDark'}
141
- onClick={() => handleChangeOrderFilterValue(item.value)}
140
+ onClick={() => handleChangeOrderFilterValue(prev => prev === item.value ? null : item.value)}
142
141
  >
143
142
  {item.name}
144
143
  {orderFilterValue === item.value && <CloseIcon />}
@@ -389,6 +389,59 @@ export const reviewCommentList = (type) => {
389
389
  return reviews[type]
390
390
  }
391
391
 
392
+ export const getOrderStatus = (status) => {
393
+ const orderStatus = [
394
+ { key: 0, value: 'Pending Order', slug: 'PENDING_ORDER', percentage: 10 },
395
+ { key: 1, value: 'Completed by admin', slug: 'COMPLETED_BY_ADMIN', percentage: 100 },
396
+ { key: 2, value: 'Reject by admin', slug: 'REJECT_BY_ADMIN', percentage: 0 },
397
+ { key: 3, value: 'Driver arrived by business', slug: 'DRIVER_IN_BUSINESS', percentage: 60 },
398
+ { key: 4, value: 'Preparation Completed', slug: 'PREPARATION_COMPLETED', percentage: 20 },
399
+ { key: 5, value: 'Reject by business', slug: 'REJECT_BY_BUSINESS', percentage: 0 },
400
+ { key: 6, value: 'Reject by driver', slug: 'REJECT_BY_DRIVER', percentage: 0 },
401
+ { key: 7, value: 'Accepted by business', slug: 'ACCEPTED_BY_BUSINESS', percentage: 15 },
402
+ { key: 8, value: 'Accepted by driver', slug: 'ACCEPTED_BY_DRIVER', percentage: 40 },
403
+ { key: 9, value: 'Pick up completed by driver', slug: 'PICK_UP_COMPLETED_BY_DRIVER', percentage: 70 },
404
+ { key: 10, value: 'Pick up Failed by driver', slug: 'PICK_UP_FAILED_BY_DRIVER', percentage: 0 },
405
+ { key: 11, value: 'Delivery completed by driver', slug: 'DELIVERY_COMPLETED_BY_DRIVER', percentage: 100 },
406
+ { key: 12, value: 'Delivery Failed by driver', slug: 'DELIVERY_FAILED_BY_DRIVER', percentage: 0 },
407
+ { key: 13, value: 'Preorder', slug: 'PREORDER', percentage: 0 },
408
+ { key: 14, value: 'Order not ready', slug: 'ORDER_NOT_READY', percentage: 15 },
409
+ { key: 15, value: 'Pickup completed by customer', slug: 'PICKUP_COMPLETED_BY_CUSTOMER', percentage: 100 },
410
+ { key: 16, value: 'Canceled by customer', slug: 'CANCELED_BY_CUSTOMER', percentage: 0 },
411
+ { key: 17, value: 'Not picked by customer', slug: 'NOT_PICKED_BY_CUSTOMER', percentage: 0 },
412
+ { key: 18, value: 'Driver almost arrived to business', slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS', percentage: 50 },
413
+ { key: 19, value: 'Driver almost arrived to customer', slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', percentage: 90 },
414
+ { key: 20, value: 'Customer almost arrived to business', slug: 'CUSTOMER_ALMOST_ARRIVED_TO_BUSINESS', percentage: 90 },
415
+ { key: 21, value: 'Customer arrived to business', slug: 'CUSTOMER_ARRIVED_TO_BUSINESS', percentage: 90 },
416
+ { key: 22, value: 'Looking for driver', slug: 'ORDER_LOOKING_FOR_DRIVER', percentage: 30 },
417
+ { key: 23, value: 'Driver on way', slug: 'ORDER_DRIVER_ON_WAY', percentage: 80 }
418
+ ]
419
+
420
+ const objectStatus = orderStatus.find((o) => o.key === status)
421
+ return objectStatus && objectStatus
422
+ }
423
+
424
+ export const getOrderStatuPickUp = (status) => {
425
+ const orderStatus = [
426
+ { key: 0, value: 'Pending Order', slug: 'PENDING_ORDER', percentage: 10 },
427
+ { key: 1, value: 'Completed by admin', slug: 'COMPLETED_BY_ADMIN', percentage: 100 },
428
+ { key: 2, value: 'Reject by admin', slug: 'REJECT_BY_ADMIN', percentage: 0 },
429
+ { key: 4, value: 'Preparation Completed', slug: 'PREPARATION_COMPLETED', percentage: 50 },
430
+ { key: 5, value: 'Reject by business', slug: 'REJECT_BY_BUSINESS', percentage: 0 },
431
+ { key: 7, value: 'Accepted by business', slug: 'ACCEPTED_BY_BUSINESS', percentage: 30 },
432
+ { key: 13, value: 'Preorder', slug: 'PREORDER', percentage: 0 },
433
+ { key: 14, value: 'Order not ready', slug: 'ORDER_NOT_READY', percentage: 30 },
434
+ { key: 15, value: 'Pickup completed by customer', slug: 'PICKUP_COMPLETED_BY_CUSTOMER', percentage: 100 },
435
+ { key: 16, value: 'Canceled by customer', slug: 'CANCELED_BY_CUSTOMER', percentage: 0 },
436
+ { key: 17, value: 'Not picked by customer', slug: 'NOT_PICKED_BY_CUSTOMER', percentage: 0 },
437
+ { key: 20, value: 'Customer almost arrived to business', slug: 'CUSTOMER_ALMOST_ARRIVED_TO_BUSINESS', percentage: 70 },
438
+ { key: 21, value: 'Customer arrived to business', slug: 'CUSTOMER_ARRIVED_TO_BUSINESS', percentage: 90 },
439
+ ]
440
+
441
+ const objectStatus = orderStatus.find((o) => o.key === status)
442
+ return objectStatus && objectStatus
443
+ }
444
+
392
445
  /**
393
446
  * function to manage order reject comment list
394
447
  * @param {string} param0 type of orders to return
package/template/app.js CHANGED
@@ -5,9 +5,18 @@ import {
5
5
  Route,
6
6
  Link,
7
7
  Redirect,
8
- useLocation
8
+ useLocation,
9
+ useHistory
9
10
  } from 'react-router-dom'
10
- import { useSession, useOrder, useLanguage, useConfig, GoogleTagManager, CannyIdentification } from 'ordering-components-admin-external'
11
+ import {
12
+ useSession,
13
+ useOrder,
14
+ useLanguage,
15
+ useConfig,
16
+ GoogleTagManager,
17
+ CannyIdentification,
18
+ useEvent
19
+ } from 'ordering-components-admin-external'
11
20
  import { NotNetworkConnectivity } from '../src/components/NotNetworkConnectivity'
12
21
  import { useOnlineStatus } from '../src/hooks/useOnlineStatus'
13
22
  import { useWindowSize } from '../src/hooks/useWindowSize'
@@ -77,10 +86,15 @@ import { OrderingWidgets } from './pages/OrderingWidgets'
77
86
  import { BusinessDevicesList } from './pages/BusinessDevicesList'
78
87
 
79
88
  export const App = () => {
89
+ const history = useHistory()
90
+ const [events] = useEvent()
80
91
  const [{ auth, loading, user }] = useSession()
81
92
  const [orderStatus] = useOrder()
82
- const [{ configs }] = useConfig()
93
+ const [{ configs, loading: configLoading }] = useConfig()
83
94
  const [loaded, setLoaded] = useState(false)
95
+ const [oneSignalState, setOneSignalState] = useState({
96
+ notification_app: settings.notification_app
97
+ })
84
98
  const [, t] = useLanguage()
85
99
  const onlineStatus = useOnlineStatus()
86
100
  const { height } = useWindowSize()
@@ -115,6 +129,64 @@ export const App = () => {
115
129
  }
116
130
  }, [height])
117
131
 
132
+ const oneSignalSetup = () => {
133
+ if (!configs?.onesignal_dashboardweb_id?.value) {
134
+ setOneSignalState({
135
+ notification_app: settings.notification_app
136
+ })
137
+ return
138
+ }
139
+ const OneSignal = window.OneSignal || []
140
+ const initConfig = {
141
+ appId: configs?.onesignal_dashboardweb_id?.value,
142
+ // allowLocalhostAsSecureOrigin: true,
143
+ notificationClickHandlerAction: 'navigate'
144
+ }
145
+
146
+ OneSignal.push(function () {
147
+ OneSignal.SERVICE_WORKER_PARAM = { scope: '/push/onesignal/' }
148
+ OneSignal.SERVICE_WORKER_PATH = 'push/onesignal/OneSignalSDKWorker.js'
149
+ OneSignal.SERVICE_WORKER_UPDATER_PATH = 'push/onesignal/OneSignalSDKWorker.js'
150
+ OneSignal.init(initConfig)
151
+
152
+ const onNotificationClicked = function (data) {
153
+ if (data?.data?.order_uuid) {
154
+ history.push(`/orders?id=${data?.data?.order_uuid}`)
155
+ }
156
+ }
157
+ const handler = function (data) {
158
+ onNotificationClicked(data)
159
+ OneSignal.addListenerForNotificationOpened(handler)
160
+ }
161
+ OneSignal.addListenerForNotificationOpened(handler)
162
+
163
+ OneSignal.on('subscriptionChange', function (isSubscribed) {
164
+ if (isSubscribed) {
165
+ OneSignal.getUserId((userId) => {
166
+ const data = {
167
+ ...oneSignalState,
168
+ notification_token: userId
169
+ }
170
+ setOneSignalState(data)
171
+ })
172
+ }
173
+ })
174
+
175
+ OneSignal.getUserId((userId) => {
176
+ const data = {
177
+ ...oneSignalState,
178
+ notification_token: userId
179
+ }
180
+ setOneSignalState(data)
181
+ })
182
+ })
183
+ }
184
+
185
+ useEffect(() => {
186
+ if (configLoading) return
187
+ oneSignalSetup()
188
+ }, [configLoading, events])
189
+
118
190
  return (
119
191
  <>
120
192
  <ListenPageChanges />
@@ -160,6 +232,7 @@ export const App = () => {
160
232
  <Login
161
233
  useLoginByEmail
162
234
  elementLinkToForgotPassword={<Link to='/password/forgot'>{t('RESET_PASSWORD', 'Reset password')}</Link>}
235
+ notificationState={oneSignalState}
163
236
  />
164
237
  )
165
238
  : (
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "app_id": "ordering-admin-react",
3
+ "notification_app": "dashboardweb",
3
4
  "app_name": "Ordering Admin",
4
5
  "billing_url": "https://billing-dashboard.tryordering.com",
5
6
  "api": {