ordering-ui-admin-external 1.3.1 → 1.3.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 (79) hide show
  1. package/_bundles/{ordering-ui-admin.0bfe9a0aef33a990bc0a.js → ordering-ui-admin.7b1ded1d480e937548f3.js} +2 -2
  2. package/_bundles/{ordering-ui-admin.0bfe9a0aef33a990bc0a.js.LICENSE.txt → ordering-ui-admin.7b1ded1d480e937548f3.js.LICENSE.txt} +0 -0
  3. package/_modules/components/BusinessIntelligence/Reports/index.js +3 -27
  4. package/_modules/components/BusinessIntelligence/Reports/styles.js +2 -9
  5. package/_modules/components/Loyalty/RewardsPrograms/index.js +12 -38
  6. package/_modules/components/Loyalty/RewardsPrograms/styles.js +6 -13
  7. package/_modules/components/Marketing/CampaignHeader/index.js +2 -5
  8. package/_modules/components/Marketing/CampaignHeader/styles.js +4 -7
  9. package/_modules/components/Marketing/CampaignList/index.js +4 -8
  10. package/_modules/components/Marketing/CampaignList/styles.js +22 -30
  11. package/_modules/components/Marketing/CampaignListing/index.js +3 -29
  12. package/_modules/components/OrderingProducts/OrderingProductDetails/index.js +4 -2
  13. package/_modules/components/Orders/CurrencyFilter/index.js +24 -47
  14. package/_modules/components/Orders/OrderBill/index.js +40 -11
  15. package/_modules/components/Orders/OrderDetails/index.js +2 -1
  16. package/_modules/components/Orders/OrdersTable/index.js +5 -2
  17. package/_modules/components/Orders/ProductItemAccordion/index.js +10 -5
  18. package/_modules/components/Settings/PluginList/index.js +31 -1
  19. package/_modules/components/Settings/SettingsDetail/index.js +3 -40
  20. package/_modules/components/Settings/SettingsDetail/styles.js +13 -26
  21. package/_modules/components/Settings/SettingsList/index.js +6 -43
  22. package/_modules/components/SidebarMenu/index.js +17 -20
  23. package/_modules/components/Stores/BusinessMenu/index.js +5 -36
  24. package/_modules/components/Stores/BusinessMenu/styles.js +19 -27
  25. package/_modules/components/Stores/BusinessPaymentMethods/index.js +16 -53
  26. package/_modules/components/Stores/BusinessProductAddForm/index.js +4 -2
  27. package/_modules/components/Stores/BusinessesListingHeader/index.js +7 -1
  28. package/_modules/components/Stores/ImportersList/index.js +2 -5
  29. package/_modules/components/Stores/ImportersList/styles.js +15 -18
  30. package/_modules/components/Stores/ImportersListing/index.js +4 -31
  31. package/_modules/components/Stores/PaymentOption/index.js +7 -12
  32. package/_modules/components/Stores/PaymentOptionMethods/index.js +4 -9
  33. package/_modules/components/Stores/PaymentOptionPaypal/index.js +4 -9
  34. package/_modules/components/Stores/PaymentOptionSquare/index.js +4 -9
  35. package/_modules/components/Stores/PaymentOptionStripeDirect/index.js +5 -10
  36. package/_modules/components/Stores/PaymentOptionStripeDirect/styles.js +5 -10
  37. package/_modules/components/Stores/PaymethodOptionPaypalExpress/index.js +4 -9
  38. package/_modules/components/Stores/PaymethodOptionStripeConnect/index.js +4 -9
  39. package/_modules/components/Stores/PaymethodOptionStripeRedirect/index.js +4 -9
  40. package/_modules/config/constants.js +412 -2
  41. package/package.json +1 -1
  42. package/src/components/BusinessIntelligence/Reports/index.js +4 -18
  43. package/src/components/BusinessIntelligence/Reports/styles.js +0 -11
  44. package/src/components/Loyalty/RewardsPrograms/index.js +5 -18
  45. package/src/components/Loyalty/RewardsPrograms/styles.js +0 -10
  46. package/src/components/Marketing/CampaignHeader/index.js +2 -3
  47. package/src/components/Marketing/CampaignHeader/styles.js +0 -8
  48. package/src/components/Marketing/CampaignList/index.js +3 -5
  49. package/src/components/Marketing/CampaignList/styles.js +0 -16
  50. package/src/components/Marketing/CampaignListing/index.js +2 -18
  51. package/src/components/OrderingProducts/OrderingProductDetails/index.js +1 -1
  52. package/src/components/Orders/CurrencyFilter/index.js +22 -41
  53. package/src/components/Orders/OrderBill/index.js +15 -15
  54. package/src/components/Orders/OrderDetails/index.js +1 -0
  55. package/src/components/Orders/OrdersTable/index.js +2 -2
  56. package/src/components/Orders/ProductItemAccordion/index.js +4 -3
  57. package/src/components/Settings/PluginList/index.js +2 -2
  58. package/src/components/Settings/SettingsDetail/index.js +2 -23
  59. package/src/components/Settings/SettingsDetail/styles.js +13 -8
  60. package/src/components/Settings/SettingsList/index.js +1 -24
  61. package/src/components/SidebarMenu/index.js +17 -17
  62. package/src/components/Stores/BusinessMenu/index.js +3 -21
  63. package/src/components/Stores/BusinessMenu/styles.js +0 -15
  64. package/src/components/Stores/BusinessPaymentMethods/index.js +32 -62
  65. package/src/components/Stores/BusinessProductAddForm/index.js +1 -1
  66. package/src/components/Stores/BusinessesListingHeader/index.js +2 -2
  67. package/src/components/Stores/ImportersList/index.js +2 -3
  68. package/src/components/Stores/ImportersList/styles.js +1 -9
  69. package/src/components/Stores/ImportersListing/index.js +0 -19
  70. package/src/components/Stores/PaymentOption/index.js +4 -9
  71. package/src/components/Stores/PaymentOptionMethods/index.js +3 -8
  72. package/src/components/Stores/PaymentOptionPaypal/index.js +3 -8
  73. package/src/components/Stores/PaymentOptionSquare/index.js +3 -8
  74. package/src/components/Stores/PaymentOptionStripeDirect/index.js +3 -8
  75. package/src/components/Stores/PaymentOptionStripeDirect/styles.js +0 -8
  76. package/src/components/Stores/PaymethodOptionPaypalExpress/index.js +3 -8
  77. package/src/components/Stores/PaymethodOptionStripeConnect/index.js +3 -8
  78. package/src/components/Stores/PaymethodOptionStripeRedirect/index.js +3 -8
  79. package/src/config/constants.js +547 -0
@@ -25,14 +25,6 @@ export const Container = styled.div`
25
25
  max-height: calc(100vh - 345px);
26
26
  `}
27
27
  }
28
-
29
- ${({ isDisabledFeature }) => isDisabledFeature && css`
30
- opacity: 0.5;
31
- cursor: not-allowed;
32
- > table {
33
- pointer-events: none;
34
- }
35
- `}
36
28
  `
37
29
 
38
30
  export const Table = styled.table`
@@ -208,12 +200,4 @@ export const AddNewPageButton = styled.div`
208
200
  &:hover {
209
201
  color: ${props => props.theme.colors.primary};
210
202
  }
211
-
212
- ${({ isDisabledFeature }) => isDisabledFeature && css`
213
- opacity: 0.5;
214
- cursor: not-allowed;
215
- &:hover {
216
- color: ${props => props.theme.colors.lightGray};
217
- }
218
- `}
219
203
  `
@@ -1,10 +1,9 @@
1
- import React, { useState, useEffect } from 'react'
1
+ import React, { useState } from 'react'
2
2
  import { SideBar } from '../../Shared'
3
3
  import { CampaignDetail } from '../CampaignDetail'
4
4
  import { CampaignHeader } from '../CampaignHeader'
5
5
  import { CampaignList } from '../CampaignList'
6
- import { useConfig, useSession, CampaignListing as CampaignListingController } from 'ordering-components-admin-external'
7
- import { DisabledFeatureAlert } from '../../DisabledFeatureAlert'
6
+ import { CampaignListing as CampaignListingController } from 'ordering-components-admin-external'
8
7
  import {
9
8
  CampaignListingContainer
10
9
  } from './styles'
@@ -12,10 +11,6 @@ import {
12
11
  export const CampaignListingUI = (props) => {
13
12
  const [isOpenDetail, setIsOpenDetail] = useState(false)
14
13
  const [selectedCampaign, setSelectedCampaign] = useState(null)
15
- const [{ configs }] = useConfig()
16
- const [{ user }] = useSession()
17
- const featureName = 'Marketing_dashboard'
18
- const [isDisabledFeature, setIsDisabledFeature] = useState(false)
19
14
 
20
15
  const handleOpenDetail = (action) => {
21
16
  setSelectedCampaign(action)
@@ -27,30 +22,19 @@ export const CampaignListingUI = (props) => {
27
22
  setSelectedCampaign(null)
28
23
  }
29
24
 
30
- useEffect(() => {
31
- if (configs && Object.keys(configs).length > 0 && user) {
32
- if (!Object.keys(configs).includes(featureName) && user?.level === 0) {
33
- setIsDisabledFeature(false)
34
- }
35
- }
36
- }, [configs])
37
-
38
25
  return (
39
26
  <>
40
27
  <CampaignListingContainer>
41
28
  <CampaignHeader
42
29
  {...props}
43
30
  handleOpenDetail={handleOpenDetail}
44
- isDisabledFeature={isDisabledFeature}
45
31
  />
46
32
  <CampaignList
47
33
  {...props}
48
34
  handleOpenDetail={handleOpenDetail}
49
35
  selectedCampaign={selectedCampaign}
50
- isDisabledFeature={isDisabledFeature}
51
36
  />
52
37
  </CampaignListingContainer>
53
- {isDisabledFeature && (<DisabledFeatureAlert />)}
54
38
  {isOpenDetail && (
55
39
  <SideBar
56
40
  sidebarId='campaignDetail'
@@ -27,7 +27,7 @@ const OrderingProductDetailsUI = (props) => {
27
27
 
28
28
  const tabs = [
29
29
  { key: 'general', content: t('GENERAL', 'General') },
30
- // { key: 'theme', content: t('THEME', 'Theme') }
30
+ { key: 'theme', content: t('THEME', 'Theme') }
31
31
  ]
32
32
 
33
33
  const moreOptions = [
@@ -1,12 +1,11 @@
1
1
  import React, { useEffect, useState } from 'react'
2
- import { useLanguage, CountryList as CountryListControler } from 'ordering-components-admin-external'
2
+ import { useLanguage } from 'ordering-components-admin-external'
3
3
  import { MultiSelect } from '../../../styles/MultiSelect'
4
- import { PlaceholderTitle, Option, SkeletonWrapper } from './styles'
5
- import Skeleton from 'react-loading-skeleton'
4
+ import { PlaceholderTitle, Option } from './styles'
5
+ import { currencyList } from '../../../config/constants'
6
6
 
7
- const CurrencyFilterUI = (props) => {
7
+ export const CurrencyFilter = (props) => {
8
8
  const {
9
- countriesState,
10
9
  filterValues,
11
10
  handleChangeCurrency
12
11
  } = props
@@ -23,46 +22,28 @@ const CurrencyFilterUI = (props) => {
23
22
 
24
23
  useEffect(() => {
25
24
  const _countryList = []
26
- if (!countriesState.loading) {
27
- const _groupsOption = countriesState.countries.map((country) => {
28
- return {
29
- value: country.code,
30
- content: (
31
- <Option>{country.code}</Option>
32
- )
33
- }
34
- })
35
-
36
- for (const option of _groupsOption) {
37
- _countryList.push(option)
25
+ const _groupsOption = currencyList.map((country) => {
26
+ return {
27
+ value: country.value,
28
+ content: (
29
+ <Option>{country.text}</Option>
30
+ )
38
31
  }
32
+ })
33
+
34
+ for (const option of _groupsOption) {
35
+ _countryList.push(option)
39
36
  }
40
37
  setCountryTypes(_countryList)
41
- }, [countriesState])
38
+ }, [currencyList])
42
39
 
43
40
  return (
44
- <>
45
- {!countriesState.loading ? (
46
- <MultiSelect
47
- placeholder={placeholder}
48
- defaultValue={filterValues.currency}
49
- options={countryTypes}
50
- onChange={(code) => handleChangeCurrency(code)}
51
- optionInnerMaxHeight='200px'
52
- />
53
- ) : (
54
- <SkeletonWrapper>
55
- <Skeleton style={{ height: '57px' }} />
56
- </SkeletonWrapper>
57
- )}
58
- </>
41
+ <MultiSelect
42
+ placeholder={placeholder}
43
+ defaultValue={filterValues.currency}
44
+ options={countryTypes}
45
+ onChange={(code) => handleChangeCurrency(code)}
46
+ optionInnerMaxHeight='200px'
47
+ />
59
48
  )
60
49
  }
61
-
62
- export const CurrencyFilter = (props) => {
63
- const countryFilterProps = {
64
- ...props,
65
- UIComponent: CurrencyFilterUI
66
- }
67
- return <CountryListControler {...countryFilterProps} />
68
- }
@@ -86,7 +86,7 @@ export const OrderBill = (props) => {
86
86
  <tr>
87
87
  <td>{t('SUBTOTAL', 'Subtotal')}</td>
88
88
  <td>
89
- {parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()))}
89
+ {parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()), { currency: order?.currency })}
90
90
  </td>
91
91
  </tr>
92
92
  {(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
@@ -99,7 +99,7 @@ export const OrderBill = (props) => {
99
99
  ) : (
100
100
  <td>{t('DISCOUNT', 'Discount')}</td>
101
101
  )}
102
- <td>- {parsePrice(order?.summary?.discount ?? order?.discount)}</td>
102
+ <td>- {parsePrice(order?.summary?.discount ?? order?.discount, { currency: order?.currency })}</td>
103
103
  </tr>
104
104
  )}
105
105
  {
@@ -112,7 +112,7 @@ export const OrderBill = (props) => {
112
112
  )}
113
113
  </td>
114
114
  <td>
115
- - {parsePrice(offer?.summary?.discount)}
115
+ - {parsePrice(offer?.summary?.discount, { currency: order?.currency })}
116
116
  </td>
117
117
  </tr>
118
118
  ))
@@ -121,9 +121,9 @@ export const OrderBill = (props) => {
121
121
  <tr>
122
122
  <td>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</td>
123
123
  {order?.tax_type === 1 ? (
124
- <td>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0))}</td>
124
+ <td>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0), { currency: order?.currency })}</td>
125
125
  ) : (
126
- <td>{parsePrice(order?.summary?.subtotal_with_discount ?? 0)}</td>
126
+ <td>{parsePrice(order?.summary?.subtotal_with_discount ?? 0, { currency: order?.currency })}</td>
127
127
  )}
128
128
  </tr>
129
129
  )}
@@ -134,7 +134,7 @@ export const OrderBill = (props) => {
134
134
  {t('TAX', 'Tax')}
135
135
  <span>{`(${verifyDecimals(order?.tax, parseNumber)}%)`}</span>
136
136
  </td>
137
- <td>{parsePrice(order?.summary?.tax ?? 0)}</td>
137
+ <td>{parsePrice(order?.summary?.tax ?? 0, { currency: order?.currency })}</td>
138
138
  </tr>
139
139
  )
140
140
  }
@@ -145,7 +145,7 @@ export const OrderBill = (props) => {
145
145
  {t('SERVICE_FEE', 'Service fee')}
146
146
  <span>{`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}</span>
147
147
  </td>
148
- <td>{parsePrice(order?.summary?.service_fee ?? 0)}</td>
148
+ <td>{parsePrice(order?.summary?.service_fee ?? 0, { currency: order?.currency })}</td>
149
149
  </tr>
150
150
  )
151
151
  }
@@ -156,7 +156,7 @@ export const OrderBill = (props) => {
156
156
  {tax?.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
157
157
  <span>{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}</span>
158
158
  </td>
159
- <td>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</td>
159
+ <td>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: order?.currency })}</td>
160
160
  </tr>
161
161
  ))
162
162
  }
@@ -167,7 +167,7 @@ export const OrderBill = (props) => {
167
167
  {fee?.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
168
168
  ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%)
169
169
  </td>
170
- <td>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0)}</td>
170
+ <td>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0, { currency: order?.currency })}</td>
171
171
  </tr>
172
172
  ))
173
173
  }
@@ -181,7 +181,7 @@ export const OrderBill = (props) => {
181
181
  )}
182
182
  </td>
183
183
  <td>
184
- - {parsePrice(offer?.summary?.discount)}
184
+ - {parsePrice(offer?.summary?.discount, { currency: order?.currency })}
185
185
  </td>
186
186
  </tr>
187
187
  ))
@@ -189,7 +189,7 @@ export const OrderBill = (props) => {
189
189
  {order?.summary?.delivery_price > 0 && (
190
190
  <tr>
191
191
  <td>{t('DELIVERY_FEE', 'Delivery Fee')}</td>
192
- <td>{parsePrice(order?.summary?.delivery_price)}</td>
192
+ <td>{parsePrice(order?.summary?.delivery_price, { currency: order?.currency })}</td>
193
193
  </tr>
194
194
  )}
195
195
  {
@@ -202,7 +202,7 @@ export const OrderBill = (props) => {
202
202
  )}
203
203
  </td>
204
204
  <td>
205
- - {parsePrice(offer?.summary?.discount)}
205
+ - {parsePrice(offer?.summary?.discount, { currency: order?.currency })}
206
206
  </td>
207
207
  </tr>
208
208
  ))
@@ -218,7 +218,7 @@ export const OrderBill = (props) => {
218
218
  <span>{`(${verifyDecimals(order?.driver_tip, parseNumber)}%)`}</span>
219
219
  )}
220
220
  </td>
221
- <td>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip)}</td>
221
+ <td>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: order?.currency })}</td>
222
222
  </tr>
223
223
  )}
224
224
  </tbody>
@@ -227,7 +227,7 @@ export const OrderBill = (props) => {
227
227
  <tbody>
228
228
  <tr>
229
229
  <td>{t('TOTAL', 'Total')}</td>
230
- <td>{parsePrice(order?.summary?.total || order?.total, { currencyPosition: 'left' })}</td>
230
+ <td>{parsePrice(order?.summary?.total || order?.total, { currencyPosition: 'left', currency: order?.currency })}</td>
231
231
  </tr>
232
232
  </tbody>
233
233
  </table>
@@ -246,7 +246,7 @@ export const OrderBill = (props) => {
246
246
  ? walletName[event?.wallet_event?.wallet?.type]?.name
247
247
  : event?.paymethod?.name}
248
248
  </td>
249
- <td>-{parsePrice(event?.amount)}</td>
249
+ <td>-{parsePrice(event?.amount, { currency: order?.currency })}</td>
250
250
  </tr>
251
251
  ))}
252
252
  </tbody>
@@ -388,6 +388,7 @@ const OrderDetailsUI = (props) => {
388
388
  <ProductItemAccordion
389
389
  key={product.id}
390
390
  product={product}
391
+ currency={order?.currency}
391
392
  />
392
393
  ))}
393
394
  </OrderProducts>
@@ -58,7 +58,7 @@ export const OrdersTable = (props) => {
58
58
  } = props
59
59
  const [, t] = useLanguage()
60
60
  const theme = useTheme()
61
- const [{ parseDate, optimizeImage, getTimeAgo }] = useUtils()
61
+ const [{ parseDate, optimizeImage, getTimeAgo, parsePrice }] = useUtils()
62
62
  const [isAllChecked, setIsAllChecked] = useState(false)
63
63
  const [, setCurrentTime] = useState()
64
64
  const [dragOverd, setDragOverd] = useState('')
@@ -667,7 +667,7 @@ export const OrdersTable = (props) => {
667
667
  <td className='orderPrice' key={`total${i}-${index}`}>
668
668
  <div className='info'>
669
669
  {allowColumns?.total?.visable && (
670
- <p className='bold'>{order?.summary?.total} {order?.currency}</p>
670
+ <p className='bold'>{parsePrice(order?.summary?.total, { currency: order?.currency })}</p>
671
671
  )}
672
672
  {!(order?.status === 1 || order?.status === 11 || order?.status === 2 || order?.status === 5 || order?.status === 6 || order?.status === 10 || order.status === 12) && (
673
673
  <p>
@@ -34,7 +34,8 @@ export const ProductItemAccordion = (props) => {
34
34
  getProductMax,
35
35
  offsetDisabled,
36
36
  onDeleteProduct,
37
- onEditProduct
37
+ onEditProduct,
38
+ currency
38
39
  } = props
39
40
  const [, t] = useLanguage()
40
41
  const [orderState] = useOrder()
@@ -151,7 +152,7 @@ export const ProductItemAccordion = (props) => {
151
152
  <h3>{product.name}</h3>
152
153
  {windowSize.width <= 410 && (
153
154
  <span>
154
- <p>{parsePrice(getProductPrice(product), { currencyPosition: 'left' })}</p>
155
+ <p>{parsePrice(getProductPrice(product), { currencyPosition: 'left', ...(currency && { currency }) })}</p>
155
156
  {isCartProduct && (
156
157
  <div>
157
158
  {onEditProduct && (
@@ -175,7 +176,7 @@ export const ProductItemAccordion = (props) => {
175
176
  <ProductPriceSection>
176
177
  <ProductPrice>
177
178
  <span>
178
- {parsePrice(getProductPrice(product), { currencyPosition: 'left' })}
179
+ {parsePrice(getProductPrice(product), { currencyPosition: 'left', ...(currency && { currency }) })}
179
180
  </span>
180
181
  {(productInfo().ingredients?.length > 0 || productInfo().options?.length > 0 || product.comment) && (
181
182
  <p>
@@ -234,7 +234,7 @@ const PluginListUI = (props) => {
234
234
  )}
235
235
  </PLuginsSeparator>
236
236
 
237
- {/* {!pluginListState.loading && pluginListState.sysPlugins?.length > 0 && (
237
+ {!pluginListState.loading && pluginListState.sysPlugins?.length > 0 && (
238
238
  <PLuginsSeparator h='50%'>
239
239
  <Header mb={0}>
240
240
  <h1 style={{ marginTop: 20 }}>{t('SYSTEM_PLUGINS', 'System Plugins')}</h1>
@@ -282,7 +282,7 @@ const PluginListUI = (props) => {
282
282
  )}
283
283
  </PagesBottomContainer>
284
284
  </PLuginsSeparator>
285
- )} */}
285
+ )}
286
286
  </PluginListContainer>
287
287
  <Alert
288
288
  title={t('WEB_APPNAME', 'Ordering')}
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
2
2
  import { XLg, LifePreserver } from 'react-bootstrap-icons'
3
3
  import Skeleton from 'react-loading-skeleton'
4
4
  import { useWindowSize } from '../../../hooks/useWindowSize'
5
- import { useLanguage, useConfig, useSession } from 'ordering-components-admin-external'
5
+ import { useLanguage } from 'ordering-components-admin-external'
6
6
  import { IconButton } from '../../../styles'
7
7
  import { Modal, NotFoundSource } from '../../Shared'
8
8
  import MdcPlayCircle from '@meronex/icons/mdc/MdcPlayCircle'
@@ -10,7 +10,6 @@ import BsArrowRight from '@meronex/icons/bs/BsArrowRight'
10
10
  import { EmailSetting } from '../EmailSetting'
11
11
  import { NotificationSetting } from '../NotificationSetting'
12
12
  import { SettingsList } from '../SettingsList'
13
- import { DisabledFeatureAlert } from '../../DisabledFeatureAlert'
14
13
  import {
15
14
  Container,
16
15
  DescriptionContent,
@@ -43,9 +42,6 @@ export const SettingsDetail = (props) => {
43
42
  const [isMenuOpen, setIsMenuOpen] = useState(false)
44
43
  const [extraInfoOpen, setExtraInfoOpen] = useState(false)
45
44
  const [extraSubCatOpen, setExtraSubCatOpen] = useState(false)
46
- const [isDisabledFeature, setIsDisabledFeature] = useState(false)
47
- const [{ configs }] = useConfig()
48
- const [{ user }] = useSession()
49
45
  const actionSidebar = (value) => {
50
46
  setIsMenuOpen(value)
51
47
 
@@ -132,22 +128,6 @@ export const SettingsDetail = (props) => {
132
128
  return () => document.removeEventListener('keydown', onCloseSidebar)
133
129
  }, [open])
134
130
 
135
- useEffect(() => {
136
- if (configs && Object.keys(configs).length > 0 && user && category) {
137
- const featureList = { wallet: 'cash_wallet' }
138
-
139
- if (Object.keys(featureList).every(feature => feature !== category?.key)) {
140
- setIsDisabledFeature(false)
141
- return
142
- }
143
- if (!Object.keys(configs).includes(featureList[category?.key]) && user?.level === 0) {
144
- setIsDisabledFeature(true)
145
- return
146
- }
147
- setIsDisabledFeature(false)
148
- }
149
- }, [configs, category])
150
-
151
131
  return (
152
132
  <Container
153
133
  id='catDescription'
@@ -197,14 +177,13 @@ export const SettingsDetail = (props) => {
197
177
  </video>
198
178
  </VideoContainer>
199
179
  )}
200
- <AllSetting onClick={() => !isDisabledFeature && handleExtraOpen(false)} isDisabledFeature={isDisabledFeature}>
180
+ <AllSetting onClick={() => handleExtraOpen(false)}>
201
181
  <span>{t('SETTINGS', 'All settings')}</span>
202
182
  <BsArrowRight />
203
183
  </AllSetting>
204
184
  </Content>
205
185
  )}
206
186
  </DescriptionContent>
207
- {isDisabledFeature && (<DisabledFeatureAlert />)}
208
187
  {extraInfoOpen && category.support_url && (
209
188
  <>
210
189
  {width >= 1000 ? (
@@ -141,21 +141,26 @@ export const AllSetting = styled.div`
141
141
  user-select: none;
142
142
  cursor: pointer;
143
143
  margin-top: 36px;
144
- ${({ isDisabledFeature }) => css`
145
- cursor: ${props => isDisabledFeature ? 'not-allowed' : 'pointer'};
146
- `}
144
+ cursor: pointer;
147
145
  span {
148
146
  font-weight: 600;
149
147
  font-size: 14px;
150
- ${({ isDisabledFeature }) => css`
151
- color: ${props => isDisabledFeature ? props.theme.colors?.disabled : '#03459E'};
152
- `}
148
+ color: ${props => props.theme.colors.primary};
153
149
  }
154
150
  svg {
155
- ${({ isDisabledFeature }) => css`
156
- color: ${props => isDisabledFeature ? props.theme.colors?.disabled : '#03459E'};
151
+ color: ${props => props.theme.colors.primary};
152
+ margin-left: 5px;
153
+ transition: 0.2s linear;
154
+ ${props => props.theme.rtl && css`
155
+ margin-right: 5px;
156
+ margin-left: 0px;
157
157
  `}
158
158
  }
159
+ &:hover {
160
+ svg {
161
+ transform: translateX(3px);
162
+ }
163
+ }
159
164
  `
160
165
 
161
166
  export const MoreInfo = styled.span`
@@ -1,12 +1,11 @@
1
1
  import React, { useEffect, useState } from 'react'
2
- import { useLanguage, useConfig, useSession, SettingsList as SettingsListController } from 'ordering-components-admin-external'
2
+ import { useLanguage, SettingsList as SettingsListController } from 'ordering-components-admin-external'
3
3
  import Skeleton from 'react-loading-skeleton'
4
4
  import { Alert, NotFoundSource } from '../../Shared'
5
5
  import { Button } from '../../../styles'
6
6
  import { SettingsSelectUI } from '../SettingsSelectUI'
7
7
  import { SettingsCountryFilter } from '../SettingsCountryFilter'
8
8
  import { SettingsImage } from '../SettingsImage'
9
- import { DisabledFeatureAlert } from '../../DisabledFeatureAlert'
10
9
  import {
11
10
  SettingsListContainer,
12
11
  GeneralContainer,
@@ -26,7 +25,6 @@ export const SettingsListUI = (props) => {
26
25
  const {
27
26
  settingsState,
28
27
  configs,
29
- category,
30
28
  formState,
31
29
  onCloseSettingsList,
32
30
  handleCheckBoxChange,
@@ -36,11 +34,7 @@ export const SettingsListUI = (props) => {
36
34
  } = props
37
35
 
38
36
  const [, t] = useLanguage()
39
- const [configState] = useConfig()
40
- const [isDisabledFeature, setIsDisabledFeature] = useState(false)
41
37
  const [alertState, setAlertState] = useState({ open: false, content: [] })
42
- const [{ user }] = useSession()
43
- const featureName = 'advanced_logistics'
44
38
  const closeAlert = () => {
45
39
  setAlertState({
46
40
  open: false,
@@ -103,21 +97,6 @@ export const SettingsListUI = (props) => {
103
97
  }
104
98
  }, [settingsState?.result])
105
99
 
106
- useEffect(() => {
107
- if (category?.key === 'autoassign' && !configState?.loading &&
108
- Object.keys(configState?.configs).length > 0 && !formState?.loading &&
109
- formState?.finalResult.length > 0 && user) {
110
- const autoassignType = formState?.changes?.find(change => change?.key === 'autoassign_type')?.value ||
111
- formState?.finalResult?.find(re => re?.key === 'autoassign_type')?.value
112
- if (!Object.keys(configState?.configs).includes(featureName) &&
113
- user?.level === 0 && autoassignType === 'enterprise') {
114
- setIsDisabledFeature(true)
115
- return
116
- }
117
- setIsDisabledFeature(false)
118
- }
119
- }, [configState, formState])
120
-
121
100
  return (
122
101
  <>
123
102
  <SettingsListContainer>
@@ -280,14 +259,12 @@ export const SettingsListUI = (props) => {
280
259
  )
281
260
  }
282
261
  </SettingsListContainer>
283
- {isDisabledFeature && (<DisabledFeatureAlert />)}
284
262
  {
285
263
  settingsState?.changes?.length > 0 && (
286
264
  <SubmitBtnWrapper>
287
265
  <Button
288
266
  color='primary'
289
267
  onClick={handleSubmit}
290
- disabled={isDisabledFeature}
291
268
  >
292
269
  {t('SAVE', 'Save')}
293
270
  </Button>
@@ -64,12 +64,12 @@ export const SidebarMenu = (props) => {
64
64
  id: 3,
65
65
  title: t('DRIVERS_DASHBOARD', 'Drivers Dashboard'),
66
66
  pageName: 'drivers'
67
+ },
68
+ {
69
+ id: 4,
70
+ title: t('APPOINTMENTS', 'Appointments'),
71
+ pageName: 'appointments'
67
72
  }
68
- // {
69
- // id: 4,
70
- // title: t('APPOINTMENTS', 'Appointments'),
71
- // pageName: 'appointments'
72
- // }
73
73
  ]
74
74
 
75
75
  const loyaltySubMenus = [
@@ -141,13 +141,13 @@ export const SidebarMenu = (props) => {
141
141
  title: t('MANAGERS', 'Managers'),
142
142
  pageName: 'managers',
143
143
  url: '/users/managers'
144
+ },
145
+ {
146
+ id: 3,
147
+ title: t('PROFESSIONALS', 'Professionals'),
148
+ pageName: 'professionals',
149
+ url: '/users/professionals'
144
150
  }
145
- // {
146
- // id: 3,
147
- // title: t('PROFESSIONALS', 'Professionals'),
148
- // pageName: 'professionals',
149
- // url: '/users/professionals'
150
- // }
151
151
  ]
152
152
 
153
153
  const settingsSubMenus = [
@@ -272,13 +272,13 @@ export const SidebarMenu = (props) => {
272
272
  title: t('PROMOTIONS_ENTERPRISE', 'Promotions enterprise'),
273
273
  pageName: 'enterprise_promotions',
274
274
  url: '/marketing/promotions-enterprise'
275
+ },
276
+ {
277
+ id: 2,
278
+ title: t('CAMPAIGN', 'Campaign'),
279
+ pageName: 'campaign',
280
+ url: '/marketing/campaign'
275
281
  }
276
- // {
277
- // id: 2,
278
- // title: t('CAMPAIGN', 'Campaign'),
279
- // pageName: 'campaign',
280
- // url: '/marketing/campaign'
281
- // }
282
282
  ]
283
283
 
284
284
  const downloadsSubMenus = [