ordering-ui-admin-external 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/_bundles/main.css +2 -2
  2. package/_bundles/{ordering-ui-admin.509785f9d6ed069b4b5d.js → ordering-ui-admin.0bfe9a0aef33a990bc0a.js} +2 -2
  3. package/_bundles/{ordering-ui-admin.509785f9d6ed069b4b5d.js.LICENSE.txt → ordering-ui-admin.0bfe9a0aef33a990bc0a.js.LICENSE.txt} +10 -4
  4. package/_modules/components/BusinessIntelligence/Reports/index.js +27 -3
  5. package/_modules/components/BusinessIntelligence/Reports/styles.js +9 -2
  6. package/_modules/components/BusinessIntelligence/ReviewsListing/index.js +9 -1
  7. package/_modules/components/DisabledFeatureAlert/index.js +63 -0
  8. package/_modules/components/DisabledFeatureAlert/styles.js +42 -0
  9. package/_modules/components/Loyalty/RewardsPrograms/index.js +38 -12
  10. package/_modules/components/Loyalty/RewardsPrograms/styles.js +13 -6
  11. package/_modules/components/Marketing/CampaignHeader/index.js +5 -2
  12. package/_modules/components/Marketing/CampaignHeader/styles.js +7 -4
  13. package/_modules/components/Marketing/CampaignList/index.js +8 -4
  14. package/_modules/components/Marketing/CampaignList/styles.js +30 -22
  15. package/_modules/components/Marketing/CampaignListing/index.js +29 -3
  16. package/_modules/components/Marketing/EnterprisePromotionListing/index.js +46 -22
  17. package/_modules/components/Marketing/EnterprisePromotionListing/styles.js +1 -1
  18. package/_modules/components/OrderingProducts/OrderingProductDetails/index.js +24 -428
  19. package/_modules/components/OrderingProducts/OrderingProductDetails/styles.js +35 -114
  20. package/_modules/components/OrderingProducts/OrderingProductGeneralDetails/index.js +480 -0
  21. package/_modules/components/OrderingProducts/OrderingProductGeneralDetails/styles.js +127 -0
  22. package/_modules/components/OrderingProducts/OrderingProductsListing/index.js +3 -1
  23. package/_modules/components/OrderingProducts/OrderingProductsListing/styles.js +23 -3
  24. package/_modules/components/OrderingProducts/SiteTheme/ThemeComponent.js +119 -0
  25. package/_modules/components/OrderingProducts/SiteTheme/ThemeImage.js +267 -0
  26. package/_modules/components/OrderingProducts/SiteTheme/ThemeOption.js +135 -0
  27. package/_modules/components/OrderingProducts/SiteTheme/index.js +266 -0
  28. package/_modules/components/OrderingProducts/SiteTheme/styles.js +114 -0
  29. package/_modules/components/Orders/CountryFilter/index.js +114 -0
  30. package/_modules/components/Orders/CountryFilter/styles.js +34 -0
  31. package/_modules/components/Orders/CurrencyFilter/index.js +114 -0
  32. package/_modules/components/Orders/CurrencyFilter/styles.js +34 -0
  33. package/_modules/components/Orders/DeliveriesLocation/index.js +22 -12
  34. package/_modules/components/Orders/DriversLocation/index.js +13 -7
  35. package/_modules/components/Orders/OrdersFilterGroup/index.js +13 -1
  36. package/_modules/components/Orders/OrdersListing/index.js +8 -2
  37. package/_modules/components/Orders/OrdersTable/index.js +296 -174
  38. package/_modules/components/Orders/OrdersTable/styles.js +30 -4
  39. package/_modules/components/Orders/index.js +9 -1
  40. package/_modules/components/Settings/SettingItemUI/index.js +3 -1
  41. package/_modules/components/Settings/SettingItemUI/styles.js +18 -11
  42. package/_modules/components/Settings/Settings/index.js +1 -11
  43. package/_modules/components/Settings/SettingsDetail/index.js +40 -3
  44. package/_modules/components/Settings/SettingsDetail/styles.js +27 -8
  45. package/_modules/components/Settings/SettingsList/index.js +43 -6
  46. package/_modules/components/Shared/ColorPicker/styles.js +3 -1
  47. package/_modules/components/Shared/ColumnAllowSettingPopover/index.js +4 -2
  48. package/_modules/components/Shared/SearchBar/index.js +4 -2
  49. package/_modules/components/SidebarMenu/index.js +25 -14
  50. package/_modules/components/SidebarMenu/styles.js +19 -9
  51. package/_modules/components/Stores/BusinessMenu/index.js +36 -5
  52. package/_modules/components/Stores/BusinessMenu/styles.js +27 -16
  53. package/_modules/components/Stores/BusinessMenuOptions/styles.js +9 -4
  54. package/_modules/components/Stores/BusinessPaymentMethods/index.js +53 -16
  55. package/_modules/components/Stores/BusinessProductList/index.js +7 -10
  56. package/_modules/components/Stores/BusinessProductsCategories/index.js +2 -2
  57. package/_modules/components/Stores/BusinessProductsListing/index.js +44 -21
  58. package/_modules/components/Stores/BusinessProductsListing/styles.js +20 -16
  59. package/_modules/components/Stores/BusinessesListing/index.js +4 -1
  60. package/_modules/components/Stores/BusinessesListingHeader/index.js +20 -3
  61. package/_modules/components/Stores/BusinessesListingHeader/styles.js +6 -2
  62. package/_modules/components/Stores/ImportersList/index.js +5 -2
  63. package/_modules/components/Stores/ImportersList/styles.js +18 -15
  64. package/_modules/components/Stores/ImportersListing/index.js +31 -4
  65. package/_modules/components/Stores/PaymentOption/index.js +12 -7
  66. package/_modules/components/Stores/PaymentOption/styles.js +9 -4
  67. package/_modules/components/Stores/PaymentOptionMethods/index.js +9 -4
  68. package/_modules/components/Stores/PaymentOptionMethods/styles.js +10 -5
  69. package/_modules/components/Stores/PaymentOptionPaypal/index.js +9 -4
  70. package/_modules/components/Stores/PaymentOptionSquare/index.js +10 -5
  71. package/_modules/components/Stores/PaymentOptionStripeDirect/index.js +10 -5
  72. package/_modules/components/Stores/PaymentOptionStripeDirect/styles.js +10 -5
  73. package/_modules/components/Stores/PaymethodOptionPaypalExpress/index.js +9 -4
  74. package/_modules/components/Stores/PaymethodOptionStripeConnect/index.js +9 -4
  75. package/_modules/components/Stores/PaymethodOptionStripeRedirect/index.js +9 -4
  76. package/_modules/components/Users/UsersList/index.js +8 -2
  77. package/_modules/components/Users/UsersList/styles.js +15 -12
  78. package/package.json +2 -2
  79. package/src/components/BusinessIntelligence/Reports/index.js +18 -4
  80. package/src/components/BusinessIntelligence/Reports/styles.js +11 -0
  81. package/src/components/BusinessIntelligence/ReviewsListing/index.js +12 -0
  82. package/src/components/DisabledFeatureAlert/index.js +37 -0
  83. package/src/components/DisabledFeatureAlert/styles.js +32 -0
  84. package/src/components/Loyalty/RewardsPrograms/index.js +18 -5
  85. package/src/components/Loyalty/RewardsPrograms/styles.js +10 -0
  86. package/src/components/Marketing/CampaignHeader/index.js +3 -2
  87. package/src/components/Marketing/CampaignHeader/styles.js +8 -0
  88. package/src/components/Marketing/CampaignList/index.js +5 -3
  89. package/src/components/Marketing/CampaignList/styles.js +16 -0
  90. package/src/components/Marketing/CampaignListing/index.js +18 -2
  91. package/src/components/Marketing/EnterprisePromotionListing/index.js +17 -4
  92. package/src/components/Marketing/EnterprisePromotionListing/styles.js +5 -1
  93. package/src/components/OrderingProducts/OrderingProductDetails/index.js +34 -497
  94. package/src/components/OrderingProducts/OrderingProductDetails/styles.js +38 -288
  95. package/src/components/OrderingProducts/OrderingProductGeneralDetails/index.js +514 -0
  96. package/src/components/OrderingProducts/OrderingProductGeneralDetails/styles.js +279 -0
  97. package/src/components/OrderingProducts/OrderingProductsListing/index.js +14 -2
  98. package/src/components/OrderingProducts/OrderingProductsListing/styles.js +62 -0
  99. package/src/components/OrderingProducts/SiteTheme/ThemeComponent.js +104 -0
  100. package/src/components/OrderingProducts/SiteTheme/ThemeImage.js +151 -0
  101. package/src/components/OrderingProducts/SiteTheme/ThemeOption.js +118 -0
  102. package/src/components/OrderingProducts/SiteTheme/index.js +221 -0
  103. package/src/components/OrderingProducts/SiteTheme/styles.js +160 -0
  104. package/src/components/Orders/CountryFilter/index.js +68 -0
  105. package/src/components/Orders/CountryFilter/styles.js +29 -0
  106. package/src/components/Orders/CurrencyFilter/index.js +68 -0
  107. package/src/components/Orders/CurrencyFilter/styles.js +29 -0
  108. package/src/components/Orders/DeliveriesLocation/index.js +60 -8
  109. package/src/components/Orders/DriversLocation/index.js +32 -4
  110. package/src/components/Orders/OrdersFilterGroup/index.js +15 -1
  111. package/src/components/Orders/OrdersListing/index.js +8 -1
  112. package/src/components/Orders/OrdersTable/index.js +297 -252
  113. package/src/components/Orders/OrdersTable/styles.js +33 -0
  114. package/src/components/Orders/index.js +3 -1
  115. package/src/components/Settings/SettingItemUI/index.js +2 -1
  116. package/src/components/Settings/SettingItemUI/styles.js +5 -0
  117. package/src/components/Settings/Settings/index.js +0 -11
  118. package/src/components/Settings/SettingsDetail/index.js +23 -4
  119. package/src/components/Settings/SettingsDetail/styles.js +9 -2
  120. package/src/components/Settings/SettingsList/index.js +30 -3
  121. package/src/components/Shared/ColorPicker/styles.js +1 -0
  122. package/src/components/Shared/ColumnAllowSettingPopover/index.js +2 -2
  123. package/src/components/Shared/SearchBar/index.js +3 -2
  124. package/src/components/SidebarMenu/index.js +22 -7
  125. package/src/components/SidebarMenu/styles.js +13 -0
  126. package/src/components/Stores/BusinessMenu/index.js +21 -3
  127. package/src/components/Stores/BusinessMenu/styles.js +19 -0
  128. package/src/components/Stores/BusinessMenuOptions/styles.js +6 -0
  129. package/src/components/Stores/BusinessPaymentMethods/index.js +62 -32
  130. package/src/components/Stores/BusinessProductList/index.js +2 -1
  131. package/src/components/Stores/BusinessProductsCategories/index.js +2 -2
  132. package/src/components/Stores/BusinessProductsListing/index.js +18 -4
  133. package/src/components/Stores/BusinessProductsListing/styles.js +40 -10
  134. package/src/components/Stores/BusinessesListing/index.js +3 -0
  135. package/src/components/Stores/BusinessesListingHeader/index.js +15 -3
  136. package/src/components/Stores/BusinessesListingHeader/styles.js +38 -0
  137. package/src/components/Stores/ImportersList/index.js +3 -2
  138. package/src/components/Stores/ImportersList/styles.js +8 -1
  139. package/src/components/Stores/ImportersListing/index.js +25 -1
  140. package/src/components/Stores/PaymentOption/index.js +9 -5
  141. package/src/components/Stores/PaymentOption/styles.js +8 -0
  142. package/src/components/Stores/PaymentOptionMethods/index.js +8 -3
  143. package/src/components/Stores/PaymentOptionMethods/styles.js +8 -0
  144. package/src/components/Stores/PaymentOptionPaypal/index.js +8 -3
  145. package/src/components/Stores/PaymentOptionSquare/index.js +183 -176
  146. package/src/components/Stores/PaymentOptionStripeDirect/index.js +8 -3
  147. package/src/components/Stores/PaymentOptionStripeDirect/styles.js +8 -0
  148. package/src/components/Stores/PaymethodOptionPaypalExpress/index.js +8 -3
  149. package/src/components/Stores/PaymethodOptionStripeConnect/index.js +8 -3
  150. package/src/components/Stores/PaymethodOptionStripeRedirect/index.js +8 -3
  151. package/src/components/Users/UsersList/index.js +10 -1
  152. package/src/components/Users/UsersList/styles.js +9 -0
  153. package/template/app.js +8 -8
@@ -9,6 +9,7 @@ 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'
12
13
 
13
14
  import {
14
15
  Container,
@@ -31,7 +32,8 @@ export const PaymentOption = (props) => {
31
32
  actionState,
32
33
  handleSaveClick,
33
34
  businessPaymethod,
34
- handleDeletePaymethod
35
+ handleDeletePaymethod,
36
+ isDisabledFeature
35
37
  } = props
36
38
 
37
39
  const theme = useTheme()
@@ -151,7 +153,8 @@ export const PaymentOption = (props) => {
151
153
  sitesState?.sites.map(site => (
152
154
  <TabOption
153
155
  key={site.id}
154
- onClick={() => setPaymethodInfo({ key: 'sites', value: site.id })}
156
+ onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'sites', value: site.id })}
157
+ isDisabledFeature={isDisabledFeature}
155
158
  >
156
159
  {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
157
160
  <RiCheckboxFill className='fill' />
@@ -167,7 +170,8 @@ export const PaymentOption = (props) => {
167
170
  orderTypes.map(type => (
168
171
  <TabOption
169
172
  key={type.value}
170
- onClick={() => setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
173
+ onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
174
+ isDisabledFeature={isDisabledFeature}
171
175
  >
172
176
  {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
173
177
  <RiCheckboxFill className='fill' />
@@ -182,13 +186,13 @@ export const PaymentOption = (props) => {
182
186
  <Button
183
187
  borderRadius='5px'
184
188
  color='primary'
185
- disabled={actionState.loading || Object.keys(changesState).length === 0}
189
+ disabled={isDisabledFeature || actionState.loading || Object.keys(changesState).length === 0}
186
190
  onClick={() => handleSaveClick(businessPaymethod.id)}
187
191
  >
188
192
  {actionState.loading ? t('LOADING', 'Loading') : t('SAVE', 'Save')}
189
193
  </Button>
190
194
  </Container>
191
-
195
+ {isDisabledFeature && (<DisabledFeatureAlert />)}
192
196
  <Confirm
193
197
  width='700px'
194
198
  title={t('WEB_APPNAME', 'Ordering')}
@@ -114,6 +114,14 @@ export const TabOption = styled.div`
114
114
  color: ${props => props.theme.colors.primary};
115
115
  }
116
116
  }
117
+
118
+ ${({ isDisabledFeature }) => isDisabledFeature && css`
119
+ cursor: not-allowed;
120
+ opacity: 0.4;
121
+ &:hover {
122
+ background-color: ${props => props.theme.colors.white};
123
+ }
124
+ `}
117
125
  `
118
126
 
119
127
  export const TabOptionName = styled.span`
@@ -8,6 +8,7 @@ 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'
11
12
 
12
13
  import {
13
14
  Container,
@@ -37,7 +38,8 @@ export const PaymentOptionMethods = (props) => {
37
38
  businessPaymethod,
38
39
  handleDeletePaymethod,
39
40
  id,
40
- title
41
+ title,
42
+ isDisabledFeature
41
43
  } = props
42
44
 
43
45
  const theme = useTheme()
@@ -223,7 +225,8 @@ export const PaymentOptionMethods = (props) => {
223
225
  sitesState?.sites.map(site => (
224
226
  <TabOption
225
227
  key={site.id}
226
- onClick={() => setPaymethodInfo({ key: 'sites', value: site.id })}
228
+ isDisabledFeature={isDisabledFeature}
229
+ onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'sites', value: site.id })}
227
230
  >
228
231
  {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
229
232
  <RiCheckboxFill className='fill' />
@@ -239,7 +242,8 @@ export const PaymentOptionMethods = (props) => {
239
242
  orderTypes.map(type => (
240
243
  <TabOption
241
244
  key={type.value}
242
- onClick={() => setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
245
+ isDisabledFeature={isDisabledFeature}
246
+ onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
243
247
  >
244
248
  {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
245
249
  <RiCheckboxFill className='fill' />
@@ -260,6 +264,7 @@ export const PaymentOptionMethods = (props) => {
260
264
  {actionState.loading ? t('LOADING', 'Loading') : t('SAVE', 'Save')}
261
265
  </Button>
262
266
  </Container>
267
+ {(isDisabledFeature && (paymentTabs === 1 || paymentTabs === 2)) && (<DisabledFeatureAlert />)}
263
268
  <Confirm
264
269
  width='700px'
265
270
  title={t('WEB_APPNAME', 'Ordering')}
@@ -89,6 +89,14 @@ export const TabOption = styled.div`
89
89
  color: ${props => props.theme.colors.primary};
90
90
  }
91
91
  }
92
+
93
+ ${({ isDisabledFeature }) => isDisabledFeature && css`
94
+ cursor: not-allowed;
95
+ opacity: 0.4;
96
+ &:hover {
97
+ background-color: ${props => props.theme.colors.white};
98
+ }
99
+ `}
92
100
  `
93
101
 
94
102
  export const TabOptionName = styled.span`
@@ -8,6 +8,7 @@ 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'
11
12
 
12
13
  import {
13
14
  Container,
@@ -35,7 +36,8 @@ export const PaymentOptionPaypal = (props) => {
35
36
  handleSaveClick,
36
37
  businessPaymethod,
37
38
  handleChangeBusinessPaymentState,
38
- handleDeletePaymethod
39
+ handleDeletePaymethod,
40
+ isDisabledFeature
39
41
  } = props
40
42
 
41
43
  const theme = useTheme()
@@ -223,7 +225,8 @@ export const PaymentOptionPaypal = (props) => {
223
225
  sitesState?.sites.map(site => (
224
226
  <TabOption
225
227
  key={site.id}
226
- onClick={() => setPaymethodInfo({ key: 'sites', value: site.id })}
228
+ isDisabledFeature={isDisabledFeature}
229
+ onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'sites', value: site.id })}
227
230
  >
228
231
  {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
229
232
  <RiCheckboxFill className='fill' />
@@ -239,7 +242,8 @@ export const PaymentOptionPaypal = (props) => {
239
242
  orderTypes.map(type => (
240
243
  <TabOption
241
244
  key={type.value}
242
- onClick={() => setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
245
+ isDisabledFeature={isDisabledFeature}
246
+ onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
243
247
  >
244
248
  {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
245
249
  <RiCheckboxFill className='fill' />
@@ -260,6 +264,7 @@ export const PaymentOptionPaypal = (props) => {
260
264
  {actionState.loading ? t('LOADING', 'Loading') : t('SAVE', 'Save')}
261
265
  </Button>
262
266
  </Container>
267
+ {(isDisabledFeature && (paymentTabs === 1 || paymentTabs === 2)) && (<DisabledFeatureAlert />)}
263
268
  <Confirm
264
269
  width='700px'
265
270
  title={t('WEB_APPNAME', 'Ordering')}
@@ -11,6 +11,7 @@ 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'
14
15
 
15
16
  import {
16
17
  Container,
@@ -40,7 +41,8 @@ const PaymentOptionSquareUI = (props) => {
40
41
  handleSavePaymethod,
41
42
  handleChangeDataInput,
42
43
  handleChangeSanboxDataInput,
43
- handleChangeSandbox
44
+ handleChangeSandbox,
45
+ isDisabledFeature
44
46
  } = props
45
47
 
46
48
  const theme = useTheme()
@@ -110,190 +112,195 @@ const PaymentOptionSquareUI = (props) => {
110
112
  }, [actionState?.error])
111
113
 
112
114
  return (
113
- <Container id='payment_method_square'>
114
- <Header>
115
- <h1>{businessPaymethod?.paymethod?.name}</h1>
116
- <ActionSelectorWrapper>
117
- <DropdownButton
118
- menuAlign={theme?.rtl ? 'left' : 'right'}
119
- title={<ThreeDots />}
120
- id={theme?.rtl ? 'dropdown-menu-align-left' : 'dropdown-menu-align-right'}
121
- >
122
- <Dropdown.Item
123
- onClick={() => onClickDeletePaymethod()}
115
+ <>
116
+ <Container id='payment_method_square'>
117
+ <Header>
118
+ <h1>{businessPaymethod?.paymethod?.name}</h1>
119
+ <ActionSelectorWrapper>
120
+ <DropdownButton
121
+ menuAlign={theme?.rtl ? 'left' : 'right'}
122
+ title={<ThreeDots />}
123
+ id={theme?.rtl ? 'dropdown-menu-align-left' : 'dropdown-menu-align-right'}
124
124
  >
125
- {t('DELETE', 'Delete')}
126
- </Dropdown.Item>
127
- </DropdownButton>
128
- </ActionSelectorWrapper>
129
- <CloseButton>
130
- <IconButton
131
- color='black'
132
- onClick={() => onClose()}
133
- >
134
- <XLg />
135
- </IconButton>
136
- </CloseButton>
137
- </Header>
125
+ <Dropdown.Item
126
+ onClick={() => onClickDeletePaymethod()}
127
+ >
128
+ {t('DELETE', 'Delete')}
129
+ </Dropdown.Item>
130
+ </DropdownButton>
131
+ </ActionSelectorWrapper>
132
+ <CloseButton>
133
+ <IconButton
134
+ color='black'
135
+ onClick={() => onClose()}
136
+ >
137
+ <XLg />
138
+ </IconButton>
139
+ </CloseButton>
140
+ </Header>
138
141
 
139
- <TabsContainer>
140
- <Tab
141
- active={paymentTabs === 0}
142
- onClick={() => setPaymentTabs(0)}
143
- >
144
- {t('GENERAL', 'General')}
145
- </Tab>
146
- {sitesState?.sites?.length > 0 && (
142
+ <TabsContainer>
147
143
  <Tab
148
- active={paymentTabs === 1}
149
- onClick={() => setPaymentTabs(1)}
144
+ active={paymentTabs === 0}
145
+ onClick={() => setPaymentTabs(0)}
150
146
  >
151
- {t('CHANNELS', 'Channels')}
147
+ {t('GENERAL', 'General')}
152
148
  </Tab>
149
+ {sitesState?.sites?.length > 0 && (
150
+ <Tab
151
+ active={paymentTabs === 1}
152
+ onClick={() => setPaymentTabs(1)}
153
+ >
154
+ {t('CHANNELS', 'Channels')}
155
+ </Tab>
156
+ )}
157
+ <Tab
158
+ active={paymentTabs === 2}
159
+ onClick={() => setPaymentTabs(2)}
160
+ >
161
+ {t('ORDER_TYPE', 'Order type')}
162
+ </Tab>
163
+ </TabsContainer>
164
+ {paymentTabs === 0 && (
165
+ <SquareInfoContainer>
166
+ <SquareButtonWrapper>
167
+ <Button
168
+ borderRadius='8px'
169
+ color='primary'
170
+ onClick={handleConnectSquare}
171
+ >
172
+ <SiSquare />
173
+ {t('CONNECT_WITH_SQUARE', 'Connect with Square')}
174
+ </Button>
175
+ </SquareButtonWrapper>
176
+ <FormContainer>
177
+ <SandboxWrapper>
178
+ <Checkbox
179
+ defaultChecked={squareData?.sandbox ?? businessPaymethod?.sandbox ?? false}
180
+ onChange={e => handleChangeSandbox(e.target.checked)}
181
+ />
182
+ <span>{t('SANDBOX', 'Sandbox')}</span>
183
+ </SandboxWrapper>
184
+ <FormController>
185
+ <label>{t('APPLICATION_ID', 'Application Id')}</label>
186
+ <Input
187
+ name='application_id'
188
+ disabled={actionState?.loading}
189
+ value={squareData?.data?.application_id ?? businessPaymethod?.data?.application_id ?? ''}
190
+ onChange={handleChangeDataInput}
191
+ />
192
+ </FormController>
193
+ <FormController>
194
+ <label>{t('LOCATION_ID', 'Location Id')}</label>
195
+ <Input
196
+ name='location_id'
197
+ disabled={actionState?.loading}
198
+ value={squareData?.data?.location_id ?? businessPaymethod?.data?.location_id ?? ''}
199
+ onChange={handleChangeDataInput}
200
+ />
201
+ </FormController>
202
+ <FormController>
203
+ <label>{t('CLIENT_SECRET', 'Client secret')}</label>
204
+ <Input
205
+ name='client_secret'
206
+ disabled={actionState?.loading}
207
+ value={squareData?.data?.client_secret ?? businessPaymethod?.data?.client_secret ?? ''}
208
+ onChange={handleChangeDataInput}
209
+ />
210
+ </FormController>
211
+ <FormController>
212
+ <label>{t('APPLICATION_ID', 'Application Id')} ({t('SANDBOX', 'Sandbox')})</label>
213
+ <Input
214
+ name='application_id'
215
+ disabled={actionState?.loading}
216
+ value={squareData?.data_sandbox?.application_id ?? businessPaymethod?.data_sandbox?.application_id ?? ''}
217
+ onChange={handleChangeSanboxDataInput}
218
+ />
219
+ </FormController>
220
+ <FormController>
221
+ <label>{t('LOCATION_ID', 'Location Id')} ({t('SANDBOX', 'Sandbox')})</label>
222
+ <Input
223
+ name='location_id'
224
+ disabled={actionState?.loading}
225
+ value={squareData?.data_sandbox?.location_id ?? businessPaymethod?.data_sandbox?.location_id ?? ''}
226
+ onChange={handleChangeSanboxDataInput}
227
+ />
228
+ </FormController>
229
+ <FormController>
230
+ <label>{t('CLIENT_SECRET', 'Client secret')} ({t('SANDBOX', 'Sandbox')})</label>
231
+ <Input
232
+ name='client_secret'
233
+ disabled={actionState?.loading}
234
+ value={squareData?.data_sandbox?.client_secret ?? businessPaymethod?.data_sandbox?.client_secret ?? ''}
235
+ onChange={handleChangeSanboxDataInput}
236
+ />
237
+ </FormController>
238
+ <Button
239
+ borderRadius='8px'
240
+ color='primary'
241
+ onClick={() => handleSavePaymethod(businessPaymethod?.id)}
242
+ >
243
+ {t('SAVE', 'Save')}
244
+ </Button>
245
+ </FormContainer>
246
+ </SquareInfoContainer>
153
247
  )}
154
- <Tab
155
- active={paymentTabs === 2}
156
- onClick={() => setPaymentTabs(2)}
157
- >
158
- {t('ORDER_TYPE', 'Order type')}
159
- </Tab>
160
- </TabsContainer>
161
- {paymentTabs === 0 && (
162
- <SquareInfoContainer>
163
- <SquareButtonWrapper>
164
- <Button
165
- borderRadius='8px'
166
- color='primary'
167
- onClick={handleConnectSquare}
248
+ {paymentTabs === 1 && sitesState?.sites?.length > 0 && (
249
+ sitesState?.sites.map(site => (
250
+ <TabOption
251
+ key={site.id}
252
+ isDisabledFeature={isDisabledFeature}
253
+ onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'sites', value: site.id })}
168
254
  >
169
- <SiSquare />
170
- {t('CONNECT_WITH_SQUARE', 'Connect with Square')}
171
- </Button>
172
- </SquareButtonWrapper>
173
- <FormContainer>
174
- <SandboxWrapper>
175
- <Checkbox
176
- defaultChecked={squareData?.sandbox ?? businessPaymethod?.sandbox ?? false}
177
- onChange={e => handleChangeSandbox(e.target.checked)}
178
- />
179
- <span>{t('SANDBOX', 'Sandbox')}</span>
180
- </SandboxWrapper>
181
- <FormController>
182
- <label>{t('APPLICATION_ID', 'Application Id')}</label>
183
- <Input
184
- name='application_id'
185
- disabled={actionState?.loading}
186
- value={squareData?.data?.application_id ?? businessPaymethod?.data?.application_id ?? ''}
187
- onChange={handleChangeDataInput}
188
- />
189
- </FormController>
190
- <FormController>
191
- <label>{t('LOCATION_ID', 'Location Id')}</label>
192
- <Input
193
- name='location_id'
194
- disabled={actionState?.loading}
195
- value={squareData?.data?.location_id ?? businessPaymethod?.data?.location_id ?? ''}
196
- onChange={handleChangeDataInput}
197
- />
198
- </FormController>
199
- <FormController>
200
- <label>{t('CLIENT_SECRET', 'Client secret')}</label>
201
- <Input
202
- name='client_secret'
203
- disabled={actionState?.loading}
204
- value={squareData?.data?.client_secret ?? businessPaymethod?.data?.client_secret ?? ''}
205
- onChange={handleChangeDataInput}
206
- />
207
- </FormController>
208
- <FormController>
209
- <label>{t('APPLICATION_ID', 'Application Id')} ({t('SANDBOX', 'Sandbox')})</label>
210
- <Input
211
- name='application_id'
212
- disabled={actionState?.loading}
213
- value={squareData?.data_sandbox?.application_id ?? businessPaymethod?.data_sandbox?.application_id ?? ''}
214
- onChange={handleChangeSanboxDataInput}
215
- />
216
- </FormController>
217
- <FormController>
218
- <label>{t('LOCATION_ID', 'Location Id')} ({t('SANDBOX', 'Sandbox')})</label>
219
- <Input
220
- name='location_id'
221
- disabled={actionState?.loading}
222
- value={squareData?.data_sandbox?.location_id ?? businessPaymethod?.data_sandbox?.location_id ?? ''}
223
- onChange={handleChangeSanboxDataInput}
224
- />
225
- </FormController>
226
- <FormController>
227
- <label>{t('CLIENT_SECRET', 'Client secret')} ({t('SANDBOX', 'Sandbox')})</label>
228
- <Input
229
- name='client_secret'
230
- disabled={actionState?.loading}
231
- value={squareData?.data_sandbox?.client_secret ?? businessPaymethod?.data_sandbox?.client_secret ?? ''}
232
- onChange={handleChangeSanboxDataInput}
233
- />
234
- </FormController>
235
- <Button
236
- borderRadius='8px'
237
- color='primary'
238
- onClick={() => handleSavePaymethod(businessPaymethod?.id)}
255
+ {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
256
+ <RiCheckboxFill className='fill' />
257
+ ) : (
258
+ <RiCheckboxBlankLine />
259
+ )}
260
+ <TabOptionName>{site.name}</TabOptionName>
261
+ </TabOption>
262
+ ))
263
+ )}
264
+ {paymentTabs === 2 && (
265
+ orderTypes.map(type => (
266
+ <TabOption
267
+ key={type.value}
268
+ isDisabledFeature={isDisabledFeature}
269
+ onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
239
270
  >
240
- {t('SAVE', 'Save')}
241
- </Button>
242
- </FormContainer>
243
- </SquareInfoContainer>
244
- )}
245
- {paymentTabs === 1 && sitesState?.sites?.length > 0 && (
246
- sitesState?.sites.map(site => (
247
- <TabOption
248
- key={site.id}
249
- onClick={() => setPaymethodInfo({ key: 'sites', value: site.id })}
250
- >
251
- {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
252
- <RiCheckboxFill className='fill' />
253
- ) : (
254
- <RiCheckboxBlankLine />
255
- )}
256
- <TabOptionName>{site.name}</TabOptionName>
257
- </TabOption>
258
- ))
259
- )}
260
- {paymentTabs === 2 && (
261
- orderTypes.map(type => (
262
- <TabOption
263
- key={type.value}
264
- onClick={() => setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
265
- >
266
- {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
267
- <RiCheckboxFill className='fill' />
268
- ) : (
269
- <RiCheckboxBlankLine />
270
- )}
271
- <TabOptionName>{type.text}</TabOptionName>
272
- </TabOption>
273
- ))
274
- )}
271
+ {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
272
+ <RiCheckboxFill className='fill' />
273
+ ) : (
274
+ <RiCheckboxBlankLine />
275
+ )}
276
+ <TabOptionName>{type.text}</TabOptionName>
277
+ </TabOption>
278
+ ))
279
+ )}
275
280
 
276
- <Confirm
277
- width='700px'
278
- title={t('WEB_APPNAME', 'Ordering')}
279
- content={confirm.content}
280
- acceptText={t('ACCEPT', 'Accept')}
281
- open={confirm.open}
282
- onClose={() => setConfirm({ ...confirm, open: false })}
283
- onCancel={() => setConfirm({ ...confirm, open: false })}
284
- onAccept={confirm.handleOnAccept}
285
- closeOnBackdrop={false}
286
- />
287
- <Alert
288
- title={t('WEB_APPNAME', 'Ordering')}
289
- content={alertState.content}
290
- acceptText={t('ACCEPT', 'Accept')}
291
- open={alertState.open}
292
- onClose={() => setAlertState({ open: false, content: [] })}
293
- onAccept={() => setAlertState({ open: false, content: [] })}
294
- closeOnBackdrop={false}
295
- />
296
- </Container>
281
+ <Confirm
282
+ width='700px'
283
+ title={t('WEB_APPNAME', 'Ordering')}
284
+ content={confirm.content}
285
+ acceptText={t('ACCEPT', 'Accept')}
286
+ open={confirm.open}
287
+ onClose={() => setConfirm({ ...confirm, open: false })}
288
+ onCancel={() => setConfirm({ ...confirm, open: false })}
289
+ onAccept={confirm.handleOnAccept}
290
+ closeOnBackdrop={false}
291
+ />
292
+ <Alert
293
+ title={t('WEB_APPNAME', 'Ordering')}
294
+ content={alertState.content}
295
+ acceptText={t('ACCEPT', 'Accept')}
296
+ open={alertState.open}
297
+ onClose={() => setAlertState({ open: false, content: [] })}
298
+ onAccept={() => setAlertState({ open: false, content: [] })}
299
+ closeOnBackdrop={false}
300
+ />
301
+ </Container>
302
+ {(isDisabledFeature && (paymentTabs === 1 || paymentTabs === 2)) && (<DisabledFeatureAlert />)}
303
+ </>
297
304
  )
298
305
  }
299
306
 
@@ -8,6 +8,7 @@ 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'
11
12
 
12
13
  import {
13
14
  Container,
@@ -35,7 +36,8 @@ export const PaymentOptionStripeDirect = (props) => {
35
36
  handleChangeInput,
36
37
  handleSaveClick,
37
38
  businessPaymethod,
38
- handleDeletePaymethod
39
+ handleDeletePaymethod,
40
+ isDisabledFeature
39
41
  } = props
40
42
 
41
43
  const theme = useTheme()
@@ -221,7 +223,8 @@ export const PaymentOptionStripeDirect = (props) => {
221
223
  sitesState?.sites.map(site => (
222
224
  <TabOption
223
225
  key={site.id}
224
- onClick={() => setPaymethodInfo({ key: 'sites', value: site.id })}
226
+ onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'sites', value: site.id })}
227
+ isDisabledFeature={isDisabledFeature}
225
228
  >
226
229
  {(changesState?.sites ?? businessPaymethod?.sites?.map(s => s.id))?.includes(site.id) ? (
227
230
  <RiCheckboxFill className='fill' />
@@ -237,7 +240,8 @@ export const PaymentOptionStripeDirect = (props) => {
237
240
  orderTypes.map(type => (
238
241
  <TabOption
239
242
  key={type.value}
240
- onClick={() => setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
243
+ isDisabledFeature={isDisabledFeature}
244
+ onClick={() => !isDisabledFeature && setPaymethodInfo({ key: 'allowed_order_types', value: type.value })}
241
245
  >
242
246
  {(changesState?.allowed_order_types ?? businessPaymethod?.allowed_order_types)?.includes(type.value) ? (
243
247
  <RiCheckboxFill className='fill' />
@@ -258,6 +262,7 @@ export const PaymentOptionStripeDirect = (props) => {
258
262
  {actionState.loading ? t('LOADING', 'Loading') : t('SAVE', 'Save')}
259
263
  </Button>
260
264
  </Container>
265
+ {(isDisabledFeature && (paymentTabs === 1 || paymentTabs === 2)) && (<DisabledFeatureAlert />)}
261
266
  <Confirm
262
267
  width='700px'
263
268
  title={t('WEB_APPNAME', 'Ordering')}
@@ -89,6 +89,14 @@ export const TabOption = styled.div`
89
89
  color: ${props => props.theme.colors.primary};
90
90
  }
91
91
  }
92
+
93
+ ${({ isDisabledFeature }) => isDisabledFeature && css`
94
+ cursor: not-allowed;
95
+ opacity: 0.4;
96
+ &:hover {
97
+ background-color: ${props => props.theme.colors.white};
98
+ }
99
+ `}
92
100
  `
93
101
 
94
102
  export const TabOptionName = styled.span`