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
@@ -1,11 +1,10 @@
1
1
  import React, { useEffect, useState } from 'react'
2
- import { useLanguage, useConfig, useSession, BusinessMenu as BusinessMenuController } from 'ordering-components-admin-external'
2
+ import { useLanguage, BusinessMenu as BusinessMenuController } from 'ordering-components-admin-external'
3
3
  import { BusinessMenuOptions } from '../BusinessMenuOptions'
4
4
  import { Confirm, Modal, SearchBar } from '../../Shared'
5
5
  import { useWindowSize } from '../../../hooks/useWindowSize'
6
6
  import { Button, Checkbox } from '../../../styles'
7
7
  import { ChevronRight } from 'react-bootstrap-icons'
8
- import { DisabledFeatureAlert } from '../../DisabledFeatureAlert'
9
8
 
10
9
  import {
11
10
  MainContainer,
@@ -33,8 +32,6 @@ const BusinessMenuUI = (props) => {
33
32
  sitesState
34
33
  } = props
35
34
  const [, t] = useLanguage()
36
- const [{ configs }] = useConfig()
37
- const [{ user }] = useSession()
38
35
  const { width } = useWindowSize()
39
36
 
40
37
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
@@ -43,8 +40,6 @@ const BusinessMenuUI = (props) => {
43
40
  const [isOpenSharedProduct, setIsOpenSharedProduct] = useState(false)
44
41
  const [searchValue, setSearchValue] = useState('')
45
42
  const [menuList, setMenuList] = useState([])
46
- const [isDisabledFeature, setIsDisabledFeature] = useState(false)
47
- const featureName = 'shared_menus'
48
43
 
49
44
  const handleOpenOptions = (name, menu) => {
50
45
  setCurrentMenu(menu)
@@ -71,16 +66,6 @@ const BusinessMenuUI = (props) => {
71
66
  setMenuList(filteredMenus)
72
67
  }, [JSON.stringify(businessMenusState.menus), JSON.stringify(businessMenusState.menusShared), searchValue, isSelectedSharedMenus])
73
68
 
74
- useEffect(() => {
75
- if (configs && Object.keys(configs).length > 0 && user) {
76
- if (!Object.keys(configs).includes(featureName) && user?.level === 0 && isSelectedSharedMenus) {
77
- setIsDisabledFeature(true)
78
- return
79
- }
80
- setIsDisabledFeature(false)
81
- }
82
- }, [configs, isSelectedSharedMenus])
83
-
84
69
  return (
85
70
  <MainContainer>
86
71
  <MenuContainer isHide={isOpenSharedProduct}>
@@ -90,7 +75,6 @@ const BusinessMenuUI = (props) => {
90
75
  borderRadius='8px'
91
76
  color='lightPrimary'
92
77
  onClick={() => handleOpenOptions('option', {})}
93
- disabled={isDisabledFeature}
94
78
  >
95
79
  {t('ADD_MENU', 'Add menu')}
96
80
  </Button>
@@ -116,7 +100,7 @@ const BusinessMenuUI = (props) => {
116
100
  {t('SHARED_MENUS', 'Shared menus')}
117
101
  </Tab>
118
102
  </TabsContainer>
119
- <SearchBarWrapper isDisabledFeature={isDisabledFeature}>
103
+ <SearchBarWrapper>
120
104
  <SearchBar
121
105
  isCustomLayout
122
106
  lazyLoad
@@ -145,8 +129,7 @@ const BusinessMenuUI = (props) => {
145
129
  key={menu.id}
146
130
  isBorderTop={index === 0}
147
131
  active={menu.id === currentMenu?.id}
148
- onClick={(e) => !isDisabledFeature && handleOpenEdit(e, menu)}
149
- isDisabledFeature={isDisabledFeature}
132
+ onClick={(e) => handleOpenEdit(e, menu)}
150
133
  >
151
134
  <CheckboxWrapper
152
135
  className='business_checkbox_control'
@@ -168,7 +151,6 @@ const BusinessMenuUI = (props) => {
168
151
  </AddMenuButton>
169
152
  )}
170
153
  </MenuContainer>
171
- {isDisabledFeature && (<DisabledFeatureAlert />)}
172
154
  {width >= 1000 ? (
173
155
  <>
174
156
  {showOption === 'option' && (
@@ -73,14 +73,6 @@ export const MeunItem = styled.div`
73
73
  margin: 0 3px;
74
74
  font-size: 13px;
75
75
  }
76
-
77
- ${({ isDisabledFeature }) => isDisabledFeature && css`
78
- cursor: not-allowed;
79
- opacity: 0.4;
80
- &:hover {
81
- background-color: ${props => props.theme.colors.white};
82
- }
83
- `}
84
76
  `
85
77
 
86
78
  export const MenuName = styled.span`
@@ -140,13 +132,6 @@ export const Tab = styled.div`
140
132
 
141
133
  export const SearchBarWrapper = styled.div`
142
134
  margin-bottom: 15px;
143
- ${({ isDisabledFeature }) => isDisabledFeature && css`
144
- cursor: not-allowed;
145
- > div {
146
- pointer-events: none;
147
- opacity: 0.4;
148
- }
149
- `}
150
135
  `
151
136
  export const SelectButtonGroup = styled.div`
152
137
  display: flex;
@@ -3,7 +3,6 @@ import Skeleton from 'react-loading-skeleton'
3
3
  import {
4
4
  useLanguage,
5
5
  useConfig,
6
- useSession,
7
6
  BusinessPaymethods as BusinessPaymentMethodsController
8
7
  } from 'ordering-components-admin-external'
9
8
  import RiCheckboxBlankLine from '@meronex/icons/ri/RiCheckboxBlankLine'
@@ -67,7 +66,6 @@ const BusinessPaymentMethodsUI = (props) => {
67
66
 
68
67
  const [, t] = useLanguage()
69
68
  const [{ configs }] = useConfig()
70
- const [{ user }] = useSession()
71
69
  const { width } = useWindowSize()
72
70
  const [isEdit, setIsEdit] = useState(false)
73
71
  const [selectedBusinessPaymethod, setSelectedBusinessPaymethod] = useState(null)
@@ -75,8 +73,6 @@ const BusinessPaymentMethodsUI = (props) => {
75
73
  const [searchValue, setSearchValue] = useState('')
76
74
  const [alertState, setAlertState] = useState({ open: false, content: [] })
77
75
  const [isOpenWalletDetails, setIsOpenWalletDetails] = useState(false)
78
- const featureName = 'payments_advanced'
79
- const [isDisabledFeature, setIsDisabledFeature] = useState(false)
80
76
  const isWalletCashEnabled = configs?.wallet_enabled?.value === '1'
81
77
 
82
78
  const orderTypes = [
@@ -157,16 +153,6 @@ const BusinessPaymentMethodsUI = (props) => {
157
153
  setSelectedBusinessPaymethod(updatedPaymethod)
158
154
  }, [businessPaymethodsState?.paymethods, selectedBusinessPaymethod])
159
155
 
160
- useEffect(() => {
161
- if (configs && Object.keys(configs).length > 0 && user) {
162
- if (!Object.keys(configs).includes(featureName) && user?.level === 0) {
163
- setIsDisabledFeature(true)
164
- return
165
- }
166
- setIsDisabledFeature(false)
167
- }
168
- }, [configs])
169
-
170
156
  return (
171
157
  <MainContainer>
172
158
  <PaymentMethodsContainer isOpenWalletDetails={isOpenWalletDetails}>
@@ -267,23 +253,22 @@ const BusinessPaymentMethodsUI = (props) => {
267
253
  'square',
268
254
  ...methodsPay
269
255
  ].includes(selectedPaymethodGateway) && (
270
- <PaymentOption
271
- sitesState={sitesState}
272
- open={isEdit}
273
- onClose={() => handleCloseEdit()}
274
- businessPaymethod={selectedBusinessPaymethod}
275
- changesState={changesState}
276
- orderTypes={orderTypes}
277
- handleChangeBusinessPaymentState={handleChangeBusinessPaymentState}
278
- cleanChangesState={cleanChangesState}
279
- actionState={actionState}
280
- handleChangeSandbox={handleChangeSandbox}
281
- handleChangeInput={handleChangeInput}
282
- handleSaveClick={handleSaveClick}
283
- handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
284
- isDisabledFeature={isDisabledFeature}
285
- />
286
- )}
256
+ <PaymentOption
257
+ sitesState={sitesState}
258
+ open={isEdit}
259
+ onClose={() => handleCloseEdit()}
260
+ businessPaymethod={selectedBusinessPaymethod}
261
+ changesState={changesState}
262
+ orderTypes={orderTypes}
263
+ handleChangeBusinessPaymentState={handleChangeBusinessPaymentState}
264
+ cleanChangesState={cleanChangesState}
265
+ actionState={actionState}
266
+ handleChangeSandbox={handleChangeSandbox}
267
+ handleChangeInput={handleChangeInput}
268
+ handleSaveClick={handleSaveClick}
269
+ handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
270
+ />
271
+ )}
287
272
  {selectedPaymethodGateway === 'apple_pay' && (
288
273
  <PaymentOptionMethods
289
274
  sitesState={sitesState}
@@ -301,7 +286,6 @@ const BusinessPaymentMethodsUI = (props) => {
301
286
  handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
302
287
  id={selectedPaymethodGateway}
303
288
  title='Apple pay'
304
- isDisabledFeature={isDisabledFeature}
305
289
  />
306
290
  )}
307
291
  {selectedPaymethodGateway === 'google_pay' && (
@@ -321,7 +305,6 @@ const BusinessPaymentMethodsUI = (props) => {
321
305
  handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
322
306
  id={selectedPaymethodGateway}
323
307
  title='Google pay'
324
- isDisabledFeature={isDisabledFeature}
325
308
  />
326
309
  )}
327
310
  {selectedPaymethodGateway === 'stripe_direct' && (
@@ -339,7 +322,6 @@ const BusinessPaymentMethodsUI = (props) => {
339
322
  handleChangeInput={handleChangeInput}
340
323
  handleSaveClick={handleSaveClick}
341
324
  handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
342
- isDisabledFeature={isDisabledFeature}
343
325
  />
344
326
  )}
345
327
  {selectedPaymethodGateway === 'paypal' && (
@@ -357,7 +339,6 @@ const BusinessPaymentMethodsUI = (props) => {
357
339
  handleChangeInput={handleChangeInput}
358
340
  handleSaveClick={handleSaveClick}
359
341
  handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
360
- isDisabledFeature={isDisabledFeature}
361
342
  />
362
343
  )}
363
344
  {selectedPaymethodGateway === 'paypal_express' && (
@@ -375,7 +356,6 @@ const BusinessPaymentMethodsUI = (props) => {
375
356
  handleChangeInput={handleChangeInput}
376
357
  handleSaveClick={handleSaveClick}
377
358
  handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
378
- isDisabledFeature={isDisabledFeature}
379
359
  />
380
360
  )}
381
361
  {selectedPaymethodGateway === 'stripe_redirect' && (
@@ -393,7 +373,6 @@ const BusinessPaymentMethodsUI = (props) => {
393
373
  handleChangeInput={handleChangeInput}
394
374
  handleSaveClick={handleSaveClick}
395
375
  handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
396
- isDisabledFeature={isDisabledFeature}
397
376
  />
398
377
  )}
399
378
  {selectedPaymethodGateway === 'stripe_connect' && (
@@ -411,7 +390,6 @@ const BusinessPaymentMethodsUI = (props) => {
411
390
  handleChangeStripeInput={handleChangeStripeInput}
412
391
  handleStripeSave={handleStripeSave}
413
392
  handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
414
- isDisabledFeature={isDisabledFeature}
415
393
  />
416
394
  )}
417
395
  {selectedPaymethodGateway === 'square' && (
@@ -427,7 +405,6 @@ const BusinessPaymentMethodsUI = (props) => {
427
405
  handleChangeBusinessPaymentState={handleChangeBusinessPaymentState}
428
406
  businessPaymethods={businessPaymethodsState?.paymethods}
429
407
  handleSuccessPaymethodUpdate={handleSuccessPaymethodUpdate}
430
- isDisabledFeature={isDisabledFeature}
431
408
  />
432
409
  )}
433
410
  </>
@@ -448,23 +425,22 @@ const BusinessPaymentMethodsUI = (props) => {
448
425
  'stripe_redirect',
449
426
  'stripe_connect'
450
427
  ].includes(selectedPaymethodGateway) && (
451
- <PaymentOption
452
- sitesState={sitesState}
453
- open={isEdit}
454
- onClose={() => handleCloseEdit()}
455
- businessPaymethod={selectedBusinessPaymethod}
456
- changesState={changesState}
457
- orderTypes={orderTypes}
458
- handleChangeBusinessPaymentState={handleChangeBusinessPaymentState}
459
- cleanChangesState={cleanChangesState}
460
- actionState={actionState}
461
- handleChangeSandbox={handleChangeSandbox}
462
- handleChangeInput={handleChangeInput}
463
- handleSaveClick={handleSaveClick}
464
- handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
465
- isDisabledFeature={isDisabledFeature}
466
- />
467
- )}
428
+ <PaymentOption
429
+ sitesState={sitesState}
430
+ open={isEdit}
431
+ onClose={() => handleCloseEdit()}
432
+ businessPaymethod={selectedBusinessPaymethod}
433
+ changesState={changesState}
434
+ orderTypes={orderTypes}
435
+ handleChangeBusinessPaymentState={handleChangeBusinessPaymentState}
436
+ cleanChangesState={cleanChangesState}
437
+ actionState={actionState}
438
+ handleChangeSandbox={handleChangeSandbox}
439
+ handleChangeInput={handleChangeInput}
440
+ handleSaveClick={handleSaveClick}
441
+ handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
442
+ />
443
+ )}
468
444
  {selectedPaymethodGateway === 'stripe_direct' && (
469
445
  <PaymentOptionStripeDirect
470
446
  sitesState={sitesState}
@@ -480,7 +456,6 @@ const BusinessPaymentMethodsUI = (props) => {
480
456
  handleChangeInput={handleChangeInput}
481
457
  handleSaveClick={handleSaveClick}
482
458
  handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
483
- isDisabledFeature={isDisabledFeature}
484
459
  />
485
460
  )}
486
461
  {selectedPaymethodGateway === 'paypal' && (
@@ -498,7 +473,6 @@ const BusinessPaymentMethodsUI = (props) => {
498
473
  handleChangeInput={handleChangeInput}
499
474
  handleSaveClick={handleSaveClick}
500
475
  handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
501
- isDisabledFeature={isDisabledFeature}
502
476
  />
503
477
  )}
504
478
  {selectedPaymethodGateway === 'paypal_express' && (
@@ -516,7 +490,6 @@ const BusinessPaymentMethodsUI = (props) => {
516
490
  handleChangeInput={handleChangeInput}
517
491
  handleSaveClick={handleSaveClick}
518
492
  handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
519
- isDisabledFeature={isDisabledFeature}
520
493
  />
521
494
  )}
522
495
  {selectedPaymethodGateway === 'stripe_redirect' && (
@@ -534,7 +507,6 @@ const BusinessPaymentMethodsUI = (props) => {
534
507
  handleChangeInput={handleChangeInput}
535
508
  handleSaveClick={handleSaveClick}
536
509
  handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
537
- isDisabledFeature={isDisabledFeature}
538
510
  />
539
511
  )}
540
512
  {selectedPaymethodGateway === 'stripe_connect' && (
@@ -553,7 +525,6 @@ const BusinessPaymentMethodsUI = (props) => {
553
525
  handleChangeStripeInput={handleChangeStripeInput}
554
526
  handleStripeSave={handleStripeSave}
555
527
  handleDeletePaymethod={handleDeleteBusinessPaymethodOption}
556
- isDisabledFeature={isDisabledFeature}
557
528
  />
558
529
  )}
559
530
  {selectedPaymethodGateway === 'square' && (
@@ -569,7 +540,6 @@ const BusinessPaymentMethodsUI = (props) => {
569
540
  handleChangeBusinessPaymentState={handleChangeBusinessPaymentState}
570
541
  businessPaymethods={businessPaymethodsState?.paymethods}
571
542
  handleSuccessPaymethodUpdate={handleSuccessPaymethodUpdate}
572
- isDisabledFeature={isDisabledFeature}
573
543
  />
574
544
  )}
575
545
  </Modal>
@@ -52,7 +52,7 @@ const BusinessProductAddFormUI = (props) => {
52
52
 
53
53
  const typeList = [
54
54
  { value: 'item', content: <Option>{t('ITEM', 'Item')}</Option> },
55
- // { value: 'service', content: <Option>{t('SERVICE', 'Service')}</Option> }
55
+ { value: 'service', content: <Option>{t('SERVICE', 'Service')}</Option> }
56
56
  ]
57
57
 
58
58
  const durationList = [
@@ -73,13 +73,13 @@ export const BusinessesListingHeader = (props) => {
73
73
  >
74
74
  {t('ADD_NEW_STORE', 'Add new store')}
75
75
  </Button>
76
- {/* <Button
76
+ <Button
77
77
  color='lightPrimary'
78
78
  borderRadius='8px'
79
79
  onClick={() => handleOpenSync()}
80
80
  >
81
81
  {t('SYNC', 'Sync')}
82
- </Button> */}
82
+ </Button>
83
83
  <SearchBar
84
84
  isCustomLayout
85
85
  lazyLoad
@@ -27,8 +27,7 @@ export const ImportersList = (props) => {
27
27
  handleDeleteImporter,
28
28
  selectedImporter,
29
29
  setSelectedImporter,
30
- handleEditImporter,
31
- isDisabledFeature
30
+ handleEditImporter
32
31
  } = props
33
32
  const [, t] = useLanguage()
34
33
  const theme = useTheme()
@@ -47,7 +46,7 @@ export const ImportersList = (props) => {
47
46
  }
48
47
 
49
48
  return (
50
- <ImportListContainer isDisabledFeature={isDisabledFeature}>
49
+ <ImportListContainer>
51
50
  <ImportersTableWrapper>
52
51
  <ImpotersTable>
53
52
  <thead>
@@ -1,15 +1,7 @@
1
1
  import styled, { css } from 'styled-components'
2
2
  import { darken } from 'polished'
3
3
 
4
- export const ImportListContainer = styled.div`
5
- ${({ isDisabledFeature }) => isDisabledFeature && css`
6
- cursor: not-allowed;
7
- opacity: 0.5;
8
- > div {
9
- pointer-events: none;
10
- }
11
- `}
12
- `
4
+ export const ImportListContainer = styled.div``
13
5
  export const ImportersTableWrapper = styled.div`
14
6
  `
15
7
 
@@ -1,8 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
  import {
3
3
  useLanguage,
4
- useConfig,
5
- useSession,
6
4
  ImporterListing as ImportersListingController
7
5
  } from 'ordering-components-admin-external'
8
6
 
@@ -13,7 +11,6 @@ import { ImporterForm } from '../ImporterForm'
13
11
  import { ImporterJobForm } from '../ImporterJobForm'
14
12
  import { ImporterHelpContent } from '../ImporterHelpContent'
15
13
  import { SideBar, Modal } from '../../Shared'
16
- import { DisabledFeatureAlert } from '../../DisabledFeatureAlert'
17
14
 
18
15
  import {
19
16
  ImportersListingContainer,
@@ -33,9 +30,6 @@ export const ImportersListingUI = (props) => {
33
30
  handleSuccessUpdateImporter
34
31
  } = props
35
32
  const [, t] = useLanguage()
36
- const [{ configs }] = useConfig()
37
- const [{ user }] = useSession()
38
- const featureName = 'massive_importer'
39
33
  const [openNewImporter, setOpenNewImporter] = useState(false)
40
34
  const [openImporterHelp, setOpenImporterHelp] = useState(false)
41
35
  const [openImportCsv, setOpenImportCsv] = useState(false)
@@ -43,7 +37,6 @@ export const ImportersListingUI = (props) => {
43
37
  const [selectedImporterJob, setSelectedImporterJob] = useState({})
44
38
  const [importJobFormMoveDistance, setImportJobFormMoveDistance] = useState(0)
45
39
  const [openMappingDetails, setOpenMappingDetails] = useState(false)
46
- const [isDisabledFeature, setIsDisabledFeature] = useState(false)
47
40
 
48
41
  const addNewImporter = () => {
49
42
  setSelectedImporter({})
@@ -70,14 +63,6 @@ export const ImportersListingUI = (props) => {
70
63
  setExtraOpen && setExtraOpen(openNewImporter)
71
64
  }, [openNewImporter])
72
65
 
73
- useEffect(() => {
74
- if (configs && Object.keys(configs).length > 0 && user) {
75
- if (!Object.keys(configs).includes(featureName) && user?.level === 0) {
76
- setIsDisabledFeature(true)
77
- }
78
- }
79
- }, [configs])
80
-
81
66
  return (
82
67
  <>
83
68
  <ImportersListingContainer>
@@ -87,7 +72,6 @@ export const ImportersListingUI = (props) => {
87
72
  <IconButton
88
73
  color='primary'
89
74
  onClick={() => setOpenImporterHelp(true)}
90
- disabled={isDisabledFeature}
91
75
  >
92
76
  <InfoCircle />
93
77
  </IconButton>
@@ -97,7 +81,6 @@ export const ImportersListingUI = (props) => {
97
81
  color='lightPrimary'
98
82
  borderRadius='5px'
99
83
  onClick={() => addNewImporter()}
100
- disabled={isDisabledFeature}
101
84
  >
102
85
  {t('ADD_IMPORTER', 'Add importer')}
103
86
  </Button>
@@ -112,9 +95,7 @@ export const ImportersListingUI = (props) => {
112
95
  selectedImporter={selectedImporter}
113
96
  setSelectedImporter={setSelectedImporter}
114
97
  handleEditImporter={handleEditImporter}
115
- isDisabledFeature={isDisabledFeature}
116
98
  />
117
- {isDisabledFeature && (<DisabledFeatureAlert />)}
118
99
  {openNewImporter && (
119
100
  <SideBar
120
101
  isBorderShow={!openMappingDetails}
@@ -9,7 +9,6 @@ import { useTheme } from 'styled-components'
9
9
  import { ThreeDots, XLg } from 'react-bootstrap-icons'
10
10
  import { Dropdown, DropdownButton } from 'react-bootstrap'
11
11
  import { Confirm } from '../../Shared'
12
- import { DisabledFeatureAlert } from '../../DisabledFeatureAlert'
13
12
 
14
13
  import {
15
14
  Container,
@@ -32,8 +31,7 @@ export const PaymentOption = (props) => {
32
31
  actionState,
33
32
  handleSaveClick,
34
33
  businessPaymethod,
35
- handleDeletePaymethod,
36
- isDisabledFeature
34
+ handleDeletePaymethod
37
35
  } = props
38
36
 
39
37
  const theme = useTheme()
@@ -153,8 +151,7 @@ export const PaymentOption = (props) => {
153
151
  sitesState?.sites.map(site => (
154
152
  <TabOption
155
153
  key={site.id}
156
- onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'sites', value: site.id })}
157
- isDisabledFeature={isDisabledFeature}
154
+ onClick={() => setPaymethodInfo({ key: 'sites', value: site.id })}
158
155
  >
159
156
  {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
160
157
  <RiCheckboxFill className='fill' />
@@ -170,8 +167,7 @@ export const PaymentOption = (props) => {
170
167
  orderTypes.map(type => (
171
168
  <TabOption
172
169
  key={type.value}
173
- onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
174
- isDisabledFeature={isDisabledFeature}
170
+ onClick={() => setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
175
171
  >
176
172
  {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
177
173
  <RiCheckboxFill className='fill' />
@@ -186,13 +182,12 @@ export const PaymentOption = (props) => {
186
182
  <Button
187
183
  borderRadius='5px'
188
184
  color='primary'
189
- disabled={isDisabledFeature || actionState.loading || Object.keys(changesState).length === 0}
185
+ disabled={actionState.loading || Object.keys(changesState).length === 0}
190
186
  onClick={() => handleSaveClick(businessPaymethod.id)}
191
187
  >
192
188
  {actionState.loading ? t('LOADING', 'Loading') : t('SAVE', 'Save')}
193
189
  </Button>
194
190
  </Container>
195
- {isDisabledFeature && (<DisabledFeatureAlert />)}
196
191
  <Confirm
197
192
  width='700px'
198
193
  title={t('WEB_APPNAME', 'Ordering')}
@@ -8,7 +8,6 @@ import { useTheme } from 'styled-components'
8
8
  import { ThreeDots, XLg } from 'react-bootstrap-icons'
9
9
  import { Dropdown, DropdownButton } from 'react-bootstrap'
10
10
  import { Confirm } from '../../Shared'
11
- import { DisabledFeatureAlert } from '../../DisabledFeatureAlert'
12
11
 
13
12
  import {
14
13
  Container,
@@ -38,8 +37,7 @@ export const PaymentOptionMethods = (props) => {
38
37
  businessPaymethod,
39
38
  handleDeletePaymethod,
40
39
  id,
41
- title,
42
- isDisabledFeature
40
+ title
43
41
  } = props
44
42
 
45
43
  const theme = useTheme()
@@ -225,8 +223,7 @@ export const PaymentOptionMethods = (props) => {
225
223
  sitesState?.sites.map(site => (
226
224
  <TabOption
227
225
  key={site.id}
228
- isDisabledFeature={isDisabledFeature}
229
- onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'sites', value: site.id })}
226
+ onClick={() => setPaymethodInfo({ key: 'sites', value: site.id })}
230
227
  >
231
228
  {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
232
229
  <RiCheckboxFill className='fill' />
@@ -242,8 +239,7 @@ export const PaymentOptionMethods = (props) => {
242
239
  orderTypes.map(type => (
243
240
  <TabOption
244
241
  key={type.value}
245
- isDisabledFeature={isDisabledFeature}
246
- onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
242
+ onClick={() => setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
247
243
  >
248
244
  {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
249
245
  <RiCheckboxFill className='fill' />
@@ -264,7 +260,6 @@ export const PaymentOptionMethods = (props) => {
264
260
  {actionState.loading ? t('LOADING', 'Loading') : t('SAVE', 'Save')}
265
261
  </Button>
266
262
  </Container>
267
- {(isDisabledFeature && (paymentTabs === 1 || paymentTabs === 2)) && (<DisabledFeatureAlert />)}
268
263
  <Confirm
269
264
  width='700px'
270
265
  title={t('WEB_APPNAME', 'Ordering')}
@@ -8,7 +8,6 @@ import { useTheme } from 'styled-components'
8
8
  import { ThreeDots, XLg } from 'react-bootstrap-icons'
9
9
  import { Dropdown, DropdownButton } from 'react-bootstrap'
10
10
  import { Confirm } from '../../Shared'
11
- import { DisabledFeatureAlert } from '../../DisabledFeatureAlert'
12
11
 
13
12
  import {
14
13
  Container,
@@ -36,8 +35,7 @@ export const PaymentOptionPaypal = (props) => {
36
35
  handleSaveClick,
37
36
  businessPaymethod,
38
37
  handleChangeBusinessPaymentState,
39
- handleDeletePaymethod,
40
- isDisabledFeature
38
+ handleDeletePaymethod
41
39
  } = props
42
40
 
43
41
  const theme = useTheme()
@@ -225,8 +223,7 @@ export const PaymentOptionPaypal = (props) => {
225
223
  sitesState?.sites.map(site => (
226
224
  <TabOption
227
225
  key={site.id}
228
- isDisabledFeature={isDisabledFeature}
229
- onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'sites', value: site.id })}
226
+ onClick={() => setPaymethodInfo({ key: 'sites', value: site.id })}
230
227
  >
231
228
  {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
232
229
  <RiCheckboxFill className='fill' />
@@ -242,8 +239,7 @@ export const PaymentOptionPaypal = (props) => {
242
239
  orderTypes.map(type => (
243
240
  <TabOption
244
241
  key={type.value}
245
- isDisabledFeature={isDisabledFeature}
246
- onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
242
+ onClick={() => setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
247
243
  >
248
244
  {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
249
245
  <RiCheckboxFill className='fill' />
@@ -264,7 +260,6 @@ export const PaymentOptionPaypal = (props) => {
264
260
  {actionState.loading ? t('LOADING', 'Loading') : t('SAVE', 'Save')}
265
261
  </Button>
266
262
  </Container>
267
- {(isDisabledFeature && (paymentTabs === 1 || paymentTabs === 2)) && (<DisabledFeatureAlert />)}
268
263
  <Confirm
269
264
  width='700px'
270
265
  title={t('WEB_APPNAME', 'Ordering')}
@@ -11,7 +11,6 @@ import { TabOption, TabOptionName } from '../PaymentOptionStripeDirect/styles'
11
11
  import RiCheckboxBlankLine from '@meronex/icons/ri/RiCheckboxBlankLine'
12
12
  import RiCheckboxFill from '@meronex/icons/ri/RiCheckboxFill'
13
13
  import SiSquare from '@meronex/icons/si/SiSquare'
14
- import { DisabledFeatureAlert } from '../../DisabledFeatureAlert'
15
14
 
16
15
  import {
17
16
  Container,
@@ -41,8 +40,7 @@ const PaymentOptionSquareUI = (props) => {
41
40
  handleSavePaymethod,
42
41
  handleChangeDataInput,
43
42
  handleChangeSanboxDataInput,
44
- handleChangeSandbox,
45
- isDisabledFeature
43
+ handleChangeSandbox
46
44
  } = props
47
45
 
48
46
  const theme = useTheme()
@@ -249,8 +247,7 @@ const PaymentOptionSquareUI = (props) => {
249
247
  sitesState?.sites.map(site => (
250
248
  <TabOption
251
249
  key={site.id}
252
- isDisabledFeature={isDisabledFeature}
253
- onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'sites', value: site.id })}
250
+ onClick={() => setPaymethodInfo({ key: 'sites', value: site.id })}
254
251
  >
255
252
  {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
256
253
  <RiCheckboxFill className='fill' />
@@ -265,8 +262,7 @@ const PaymentOptionSquareUI = (props) => {
265
262
  orderTypes.map(type => (
266
263
  <TabOption
267
264
  key={type.value}
268
- isDisabledFeature={isDisabledFeature}
269
- onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
265
+ onClick={() => setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
270
266
  >
271
267
  {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
272
268
  <RiCheckboxFill className='fill' />
@@ -299,7 +295,6 @@ const PaymentOptionSquareUI = (props) => {
299
295
  closeOnBackdrop={false}
300
296
  />
301
297
  </Container>
302
- {(isDisabledFeature && (paymentTabs === 1 || paymentTabs === 2)) && (<DisabledFeatureAlert />)}
303
298
  </>
304
299
  )
305
300
  }