@@ -15,6 +15,8 @@ import Toggle from '../../ui/Toggle';
1515import Button from '../../ui/Button' ;
1616import ImageUpload from '../../ui/ImageUpload' ;
1717
18+ import PremiumFeatureContainer from '../../ui/PremiumFeatureContainer' ;
19+
1820const messages = defineMessages ( {
1921 saveService : {
2022 id : 'settings.service.form.saveButton' ,
@@ -92,6 +94,14 @@ const messages = defineMessages({
9294 id : 'settings.service.form.iconUpload' ,
9395 defaultMessage : '!!!Drop your image, or click here' ,
9496 } ,
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+ } ,
95105} ) ;
96106
97107export default @observer class EditServiceForm extends Component {
@@ -106,13 +116,14 @@ export default @observer class EditServiceForm extends Component {
106116 return null ;
107117 } ,
108118 user : PropTypes . instanceOf ( User ) . isRequired ,
109- userCanManageServices : PropTypes . bool . isRequired ,
110119 action : PropTypes . string . isRequired ,
111120 form : PropTypes . instanceOf ( Form ) . isRequired ,
112121 onSubmit : PropTypes . func . isRequired ,
113122 onDelete : PropTypes . func . isRequired ,
114123 isSaving : PropTypes . bool . isRequired ,
115124 isDeleting : PropTypes . bool . isRequired ,
125+ isProxyFeatureEnabled : PropTypes . bool . isRequired ,
126+ isProxyFeaturePremiumFeature : PropTypes . bool . isRequired ,
116127 } ;
117128
118129 static defaultProps = {
@@ -169,11 +180,12 @@ export default @observer class EditServiceForm extends Component {
169180 service,
170181 action,
171182 user,
172- userCanManageServices,
173183 form,
174184 isSaving,
175185 isDeleting,
176186 onDelete,
187+ isProxyFeatureEnabled,
188+ isProxyFeaturePremiumFeature,
177189 } = this . props ;
178190 const { intl } = this . context ;
179191
@@ -318,6 +330,33 @@ export default @observer class EditServiceForm extends Component {
318330 />
319331 </ div >
320332 </ 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+
321360 { recipe . message && (
322361 < p className = "settings__message" >
323362 < span className = "mdi mdi-information" />
@@ -328,7 +367,7 @@ export default @observer class EditServiceForm extends Component {
328367 </ div >
329368 < div className = "settings__controls" >
330369 { /* Delete Button */ }
331- { action === 'edit' && userCanManageServices && deleteButton }
370+ { action === 'edit' && deleteButton }
332371
333372 { /* Save Button */ }
334373 { isSaving || isValidatingCustomUrl ? (
0 commit comments