@@ -15,6 +15,8 @@ import Toggle from '../../ui/Toggle';
15
15
import Button from '../../ui/Button' ;
16
16
import ImageUpload from '../../ui/ImageUpload' ;
17
17
18
+ import PremiumFeatureContainer from '../../ui/PremiumFeatureContainer' ;
19
+
18
20
const messages = defineMessages ( {
19
21
saveService : {
20
22
id : 'settings.service.form.saveButton' ,
@@ -92,6 +94,14 @@ const messages = defineMessages({
92
94
id : 'settings.service.form.iconUpload' ,
93
95
defaultMessage : '!!!Drop your image, or click here' ,
94
96
} ,
97
+ headlineProxy : {
98
+ id : 'settings.service.form.proxy.headline' ,
99
+ defaultMessage : '!!!Proxy Settings' ,
100
+ } ,
101
+ proxyInfo : {
102
+ id : 'settings.service.form.proxy.info' ,
103
+ defaultMessage : '!!!Proxy settings will not be synchronized with the Franz servers.' ,
104
+ } ,
95
105
} ) ;
96
106
97
107
export default @observer class EditServiceForm extends Component {
@@ -106,13 +116,14 @@ export default @observer class EditServiceForm extends Component {
106
116
return null ;
107
117
} ,
108
118
user : PropTypes . instanceOf ( User ) . isRequired ,
109
- userCanManageServices : PropTypes . bool . isRequired ,
110
119
action : PropTypes . string . isRequired ,
111
120
form : PropTypes . instanceOf ( Form ) . isRequired ,
112
121
onSubmit : PropTypes . func . isRequired ,
113
122
onDelete : PropTypes . func . isRequired ,
114
123
isSaving : PropTypes . bool . isRequired ,
115
124
isDeleting : PropTypes . bool . isRequired ,
125
+ isProxyFeatureEnabled : PropTypes . bool . isRequired ,
126
+ isProxyFeaturePremiumFeature : PropTypes . bool . isRequired ,
116
127
} ;
117
128
118
129
static defaultProps = {
@@ -169,11 +180,12 @@ export default @observer class EditServiceForm extends Component {
169
180
service,
170
181
action,
171
182
user,
172
- userCanManageServices,
173
183
form,
174
184
isSaving,
175
185
isDeleting,
176
186
onDelete,
187
+ isProxyFeatureEnabled,
188
+ isProxyFeaturePremiumFeature,
177
189
} = this . props ;
178
190
const { intl } = this . context ;
179
191
@@ -318,6 +330,33 @@ export default @observer class EditServiceForm extends Component {
318
330
/>
319
331
</ div >
320
332
</ div >
333
+
334
+ { isProxyFeatureEnabled && (
335
+ < PremiumFeatureContainer condition = { isProxyFeaturePremiumFeature } >
336
+ < div className = "settings__settings-group" >
337
+ < h3 >
338
+ { intl . formatMessage ( messages . headlineProxy ) }
339
+ < span className = "badge badge--success" > beta</ span >
340
+ </ h3 >
341
+ < Toggle field = { form . $ ( 'proxy.isEnabled' ) } />
342
+ { form . $ ( 'proxy.isEnabled' ) . value && (
343
+ < div >
344
+ < Input field = { form . $ ( 'proxy.host' ) } />
345
+ < Input field = { form . $ ( 'proxy.user' ) } />
346
+ < Input
347
+ field = { form . $ ( 'proxy.password' ) }
348
+ showPasswordToggle
349
+ />
350
+ < p >
351
+ < span className = "mdi mdi-information" />
352
+ { intl . formatMessage ( messages . proxyInfo ) }
353
+ </ p >
354
+ </ div >
355
+ ) }
356
+ </ div >
357
+ </ PremiumFeatureContainer >
358
+ ) }
359
+
321
360
{ recipe . message && (
322
361
< p className = "settings__message" >
323
362
< span className = "mdi mdi-information" />
@@ -328,7 +367,7 @@ export default @observer class EditServiceForm extends Component {
328
367
</ div >
329
368
< div className = "settings__controls" >
330
369
{ /* Delete Button */ }
331
- { action === 'edit' && userCanManageServices && deleteButton }
370
+ { action === 'edit' && deleteButton }
332
371
333
372
{ /* Save Button */ }
334
373
{ isSaving || isValidatingCustomUrl ? (
0 commit comments