aboutsummaryrefslogtreecommitdiffstats
path: root/src/containers/settings
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-09-08 20:47:39 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-09-08 20:55:44 +0530
commit2772cb2e3e75f16b3dc96a2441518ed0772e3ba1 (patch)
tree98f5ec36534927581b1b0688837f407774d5f76a /src/containers/settings
parentrefactor: expose some more methods for session handling on the main repo (#1887) (diff)
downloadferdium-app-2772cb2e3e75f16b3dc96a2441518ed0772e3ba1.tar.gz
ferdium-app-2772cb2e3e75f16b3dc96a2441518ed0772e3ba1.tar.zst
ferdium-app-2772cb2e3e75f16b3dc96a2441518ed0772e3ba1.zip
chore: proxy feature is always turned on: remove 'enabled' flag
Diffstat (limited to 'src/containers/settings')
-rw-r--r--src/containers/settings/EditServiceScreen.js77
1 files changed, 36 insertions, 41 deletions
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js
index c880e97ae..3a66a27e6 100644
--- a/src/containers/settings/EditServiceScreen.js
+++ b/src/containers/settings/EditServiceScreen.js
@@ -18,8 +18,6 @@ import ErrorBoundary from '../../components/util/ErrorBoundary';
18import { required, url, oneRequired } from '../../helpers/validation-helpers'; 18import { required, url, oneRequired } from '../../helpers/validation-helpers';
19import { getSelectOptions } from '../../helpers/i18n-helpers'; 19import { getSelectOptions } from '../../helpers/i18n-helpers';
20 20
21import { config as proxyFeature } from '../../features/serviceProxy';
22
23import { SPELLCHECKER_LOCALES } from '../../i18n/languages'; 21import { SPELLCHECKER_LOCALES } from '../../i18n/languages';
24 22
25import globalMessages from '../../i18n/globalMessages'; 23import globalMessages from '../../i18n/globalMessages';
@@ -131,7 +129,7 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex
131 } 129 }
132 } 130 }
133 131
134 prepareForm(recipe, service, proxy) { 132 prepareForm(recipe, service) {
135 const { 133 const {
136 intl, 134 intl,
137 } = this.context; 135 } = this.context;
@@ -275,44 +273,42 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex
275 }); 273 });
276 } 274 }
277 275
278 if (proxy.isEnabled) { 276 const serviceProxyConfig = stores.settings.proxy[service.id] || {};
279 const serviceProxyConfig = stores.settings.proxy[service.id] || {}; 277
280 278 Object.assign(config.fields, {
281 Object.assign(config.fields, { 279 proxy: {
282 proxy: { 280 name: 'proxy',
283 name: 'proxy', 281 label: 'proxy',
284 label: 'proxy', 282 fields: {
285 fields: { 283 isEnabled: {
286 isEnabled: { 284 label: intl.formatMessage(messages.enableProxy),
287 label: intl.formatMessage(messages.enableProxy), 285 value: serviceProxyConfig.isEnabled,
288 value: serviceProxyConfig.isEnabled, 286 default: false,
289 default: false, 287 },
290 }, 288 host: {
291 host: { 289 label: intl.formatMessage(messages.proxyHost),
292 label: intl.formatMessage(messages.proxyHost), 290 value: serviceProxyConfig.host,
293 value: serviceProxyConfig.host, 291 default: '',
294 default: '', 292 },
295 }, 293 port: {
296 port: { 294 label: intl.formatMessage(messages.proxyPort),
297 label: intl.formatMessage(messages.proxyPort), 295 value: serviceProxyConfig.port,
298 value: serviceProxyConfig.port, 296 default: '',
299 default: '', 297 },
300 }, 298 user: {
301 user: { 299 label: intl.formatMessage(messages.proxyUser),
302 label: intl.formatMessage(messages.proxyUser), 300 value: serviceProxyConfig.user,
303 value: serviceProxyConfig.user, 301 default: '',
304 default: '', 302 },
305 }, 303 password: {
306 password: { 304 label: intl.formatMessage(messages.proxyPassword),
307 label: intl.formatMessage(messages.proxyPassword), 305 value: serviceProxyConfig.password,
308 value: serviceProxyConfig.password, 306 default: '',
309 default: '', 307 type: 'password',
310 type: 'password',
311 },
312 }, 308 },
313 }, 309 },
314 }); 310 },
315 } 311 });
316 312
317 return new Form(config); 313 return new Form(config);
318 } 314 }
@@ -381,7 +377,7 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex
381 ); 377 );
382 } 378 }
383 379
384 const form = this.prepareForm(recipe, service, proxyFeature); 380 const form = this.prepareForm(recipe, service);
385 381
386 return ( 382 return (
387 <ErrorBoundary> 383 <ErrorBoundary>
@@ -397,7 +393,6 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex
397 onSubmit={(d) => this.onSubmit(d)} 393 onSubmit={(d) => this.onSubmit(d)}
398 onDelete={() => this.deleteService()} 394 onDelete={() => this.deleteService()}
399 openRecipeFile={(file) => this.openRecipeFile(file)} 395 openRecipeFile={(file) => this.openRecipeFile(file)}
400 isProxyFeatureEnabled={proxyFeature.isEnabled}
401 /> 396 />
402 </ErrorBoundary> 397 </ErrorBoundary>
403 ); 398 );