diff options
author | Vijay A <avijayr@protonmail.com> | 2021-07-17 20:32:22 +0530 |
---|---|---|
committer | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-07-20 16:02:15 +0000 |
commit | 45373f655f68fdd0b320cde175b6108454ad4731 (patch) | |
tree | c1ccb0c73639d754b68a36a1977b74471fe4b566 /src/components/settings/services | |
parent | New Crowdin updates (#1668) (diff) | |
download | ferdium-app-45373f655f68fdd0b320cde175b6108454ad4731.tar.gz ferdium-app-45373f655f68fdd0b320cde175b6108454ad4731.tar.zst ferdium-app-45373f655f68fdd0b320cde175b6108454ad4731.zip |
Removed Franz paid plans features:
- serviceLimit
- planSelection
- trialStatusBar
and other Franz features that were for different tiers of subscription.
Diffstat (limited to 'src/components/settings/services')
-rw-r--r-- | src/components/settings/services/EditServiceForm.js | 124 | ||||
-rw-r--r-- | src/components/settings/services/ServicesDashboard.js | 2 |
2 files changed, 41 insertions, 85 deletions
diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index 513c75eed..0f7c29de5 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js | |||
@@ -6,7 +6,6 @@ import { defineMessages, intlShape } from 'react-intl'; | |||
6 | import normalizeUrl from 'normalize-url'; | 6 | import normalizeUrl from 'normalize-url'; |
7 | 7 | ||
8 | import Form from '../../../lib/Form'; | 8 | import Form from '../../../lib/Form'; |
9 | import User from '../../../models/User'; | ||
10 | import Recipe from '../../../models/Recipe'; | 9 | import Recipe from '../../../models/Recipe'; |
11 | import Service from '../../../models/Service'; | 10 | import Service from '../../../models/Service'; |
12 | import Tabs, { TabItem } from '../../ui/Tabs'; | 11 | import Tabs, { TabItem } from '../../ui/Tabs'; |
@@ -17,9 +16,6 @@ import Button from '../../ui/Button'; | |||
17 | import ImageUpload from '../../ui/ImageUpload'; | 16 | import ImageUpload from '../../ui/ImageUpload'; |
18 | import Select from '../../ui/Select'; | 17 | import Select from '../../ui/Select'; |
19 | 18 | ||
20 | import PremiumFeatureContainer from '../../ui/PremiumFeatureContainer'; | ||
21 | import LimitReachedInfobox from '../../../features/serviceLimit/components/LimitReachedInfobox'; | ||
22 | import { serviceLimitStore } from '../../../features/serviceLimit'; | ||
23 | import { isMac } from '../../../environment'; | 19 | import { isMac } from '../../../environment'; |
24 | import globalMessages from '../../../i18n/globalMessages'; | 20 | import globalMessages from '../../../i18n/globalMessages'; |
25 | 21 | ||
@@ -80,14 +76,6 @@ const messages = defineMessages({ | |||
80 | id: 'settings.service.form.customUrlValidationError', | 76 | id: 'settings.service.form.customUrlValidationError', |
81 | defaultMessage: '!!!Could not validate custom {name} server.', | 77 | defaultMessage: '!!!Could not validate custom {name} server.', |
82 | }, | 78 | }, |
83 | customUrlPremiumInfo: { | ||
84 | id: 'settings.service.form.customUrlPremiumInfo', | ||
85 | defaultMessage: '!!!To add self hosted services, you need a Ferdi Premium Supporter Account.', | ||
86 | }, | ||
87 | customUrlUpgradeAccount: { | ||
88 | id: 'settings.service.form.customUrlUpgradeAccount', | ||
89 | defaultMessage: '!!!Upgrade your account', | ||
90 | }, | ||
91 | indirectMessageInfo: { | 79 | indirectMessageInfo: { |
92 | id: 'settings.service.form.indirectMessageInfo', | 80 | id: 'settings.service.form.indirectMessageInfo', |
93 | defaultMessage: '!!!You will be notified about all new messages in a channel, not just @username, @channel, @here, ...', | 81 | defaultMessage: '!!!You will be notified about all new messages in a channel, not just @username, @channel, @here, ...', |
@@ -149,7 +137,6 @@ export default @observer class EditServiceForm extends Component { | |||
149 | 137 | ||
150 | return null; | 138 | return null; |
151 | }, | 139 | }, |
152 | user: PropTypes.instanceOf(User).isRequired, | ||
153 | action: PropTypes.string.isRequired, | 140 | action: PropTypes.string.isRequired, |
154 | form: PropTypes.instanceOf(Form).isRequired, | 141 | form: PropTypes.instanceOf(Form).isRequired, |
155 | onSubmit: PropTypes.func.isRequired, | 142 | onSubmit: PropTypes.func.isRequired, |
@@ -158,8 +145,6 @@ export default @observer class EditServiceForm extends Component { | |||
158 | isSaving: PropTypes.bool.isRequired, | 145 | isSaving: PropTypes.bool.isRequired, |
159 | isDeleting: PropTypes.bool.isRequired, | 146 | isDeleting: PropTypes.bool.isRequired, |
160 | isProxyFeatureEnabled: PropTypes.bool.isRequired, | 147 | isProxyFeatureEnabled: PropTypes.bool.isRequired, |
161 | isServiceProxyIncludedInCurrentPlan: PropTypes.bool.isRequired, | ||
162 | isSpellcheckerIncludedInCurrentPlan: PropTypes.bool.isRequired, | ||
163 | isHibernationFeatureActive: PropTypes.bool.isRequired, | 148 | isHibernationFeatureActive: PropTypes.bool.isRequired, |
164 | }; | 149 | }; |
165 | 150 | ||
@@ -217,15 +202,12 @@ export default @observer class EditServiceForm extends Component { | |||
217 | recipe, | 202 | recipe, |
218 | service, | 203 | service, |
219 | action, | 204 | action, |
220 | user, | ||
221 | form, | 205 | form, |
222 | isSaving, | 206 | isSaving, |
223 | isDeleting, | 207 | isDeleting, |
224 | onDelete, | 208 | onDelete, |
225 | openRecipeFile, | 209 | openRecipeFile, |
226 | isProxyFeatureEnabled, | 210 | isProxyFeatureEnabled, |
227 | isServiceProxyIncludedInCurrentPlan, | ||
228 | isSpellcheckerIncludedInCurrentPlan, | ||
229 | isHibernationFeatureActive, | 211 | isHibernationFeatureActive, |
230 | } = this.props; | 212 | } = this.props; |
231 | const { intl } = this.context; | 213 | const { intl } = this.context; |
@@ -285,7 +267,6 @@ export default @observer class EditServiceForm extends Component { | |||
285 | )} | 267 | )} |
286 | </span> | 268 | </span> |
287 | </div> | 269 | </div> |
288 | <LimitReachedInfobox /> | ||
289 | <div className="settings__body"> | 270 | <div className="settings__body"> |
290 | <form onSubmit={e => this.submit(e)} id="form"> | 271 | <form onSubmit={e => this.submit(e)} id="form"> |
291 | <div className="service-name"> | 272 | <div className="service-name"> |
@@ -311,24 +292,11 @@ export default @observer class EditServiceForm extends Component { | |||
311 | )} | 292 | )} |
312 | {recipe.hasCustomUrl && ( | 293 | {recipe.hasCustomUrl && ( |
313 | <TabItem title={intl.formatMessage(messages.tabOnPremise)}> | 294 | <TabItem title={intl.formatMessage(messages.tabOnPremise)}> |
314 | {user.isPremium || recipe.author.find(a => a.email === user.email) ? ( | 295 | <Input field={form.$('customUrl')} /> |
315 | <> | 296 | {form.error === 'url-validation-error' && ( |
316 | <Input field={form.$('customUrl')} /> | 297 | <p className="franz-form__error"> |
317 | {form.error === 'url-validation-error' && ( | 298 | {intl.formatMessage(messages.customUrlValidationError, { name: recipe.name })} |
318 | <p className="franz-form__error"> | 299 | </p> |
319 | {intl.formatMessage(messages.customUrlValidationError, { name: recipe.name })} | ||
320 | </p> | ||
321 | )} | ||
322 | </> | ||
323 | ) : ( | ||
324 | <div className="center premium-info"> | ||
325 | <p>{intl.formatMessage(messages.customUrlPremiumInfo)}</p> | ||
326 | <p> | ||
327 | <Link to="/settings/user" className="button"> | ||
328 | {intl.formatMessage(messages.customUrlUpgradeAccount)} | ||
329 | </Link> | ||
330 | </p> | ||
331 | </div> | ||
332 | )} | 300 | )} |
333 | </TabItem> | 301 | </TabItem> |
334 | )} | 302 | )} |
@@ -403,56 +371,46 @@ export default @observer class EditServiceForm extends Component { | |||
403 | </div> | 371 | </div> |
404 | 372 | ||
405 | {!isMac && ( | 373 | {!isMac && ( |
406 | <PremiumFeatureContainer | 374 | <div className="settings__settings-group"> |
407 | condition={!isSpellcheckerIncludedInCurrentPlan} | 375 | <Select field={form.$('spellcheckerLanguage')} /> |
408 | gaEventInfo={{ category: 'User', event: 'upgrade', label: 'spellchecker' }} | 376 | </div> |
409 | > | ||
410 | <div className="settings__settings-group"> | ||
411 | <Select field={form.$('spellcheckerLanguage')} /> | ||
412 | </div> | ||
413 | </PremiumFeatureContainer> | ||
414 | )} | 377 | )} |
415 | 378 | ||
416 | {isProxyFeatureEnabled && ( | 379 | {isProxyFeatureEnabled && ( |
417 | <PremiumFeatureContainer | 380 | <div className="settings__settings-group"> |
418 | condition={!isServiceProxyIncludedInCurrentPlan} | 381 | <h3> |
419 | gaEventInfo={{ category: 'User', event: 'upgrade', label: 'proxy' }} | 382 | {intl.formatMessage(messages.headlineProxy)} |
420 | > | 383 | <span className="badge badge--success">beta</span> |
421 | <div className="settings__settings-group"> | 384 | </h3> |
422 | <h3> | 385 | <Toggle field={form.$('proxy.isEnabled')} /> |
423 | {intl.formatMessage(messages.headlineProxy)} | 386 | {form.$('proxy.isEnabled').value && ( |
424 | <span className="badge badge--success">beta</span> | 387 | <> |
425 | </h3> | 388 | <div className="grid"> |
426 | <Toggle field={form.$('proxy.isEnabled')} /> | 389 | <div className="grid__row"> |
427 | {form.$('proxy.isEnabled').value && ( | 390 | <Input field={form.$('proxy.host')} className="proxyHost" /> |
428 | <> | 391 | <Input field={form.$('proxy.port')} /> |
429 | <div className="grid"> | ||
430 | <div className="grid__row"> | ||
431 | <Input field={form.$('proxy.host')} className="proxyHost" /> | ||
432 | <Input field={form.$('proxy.port')} /> | ||
433 | </div> | ||
434 | </div> | 392 | </div> |
435 | <div className="grid"> | 393 | </div> |
436 | <div className="grid__row"> | 394 | <div className="grid"> |
437 | <Input field={form.$('proxy.user')} /> | 395 | <div className="grid__row"> |
438 | <Input | 396 | <Input field={form.$('proxy.user')} /> |
439 | field={form.$('proxy.password')} | 397 | <Input |
440 | showPasswordToggle | 398 | field={form.$('proxy.password')} |
441 | /> | 399 | showPasswordToggle |
442 | </div> | 400 | /> |
443 | </div> | 401 | </div> |
444 | <p> | 402 | </div> |
445 | <span className="mdi mdi-information" /> | 403 | <p> |
446 | {intl.formatMessage(messages.proxyRestartInfo)} | 404 | <span className="mdi mdi-information" /> |
447 | </p> | 405 | {intl.formatMessage(messages.proxyRestartInfo)} |
448 | <p> | 406 | </p> |
449 | <span className="mdi mdi-information" /> | 407 | <p> |
450 | {intl.formatMessage(messages.proxyInfo)} | 408 | <span className="mdi mdi-information" /> |
451 | </p> | 409 | {intl.formatMessage(messages.proxyInfo)} |
452 | </> | 410 | </p> |
453 | )} | 411 | </> |
454 | </div> | 412 | )} |
455 | </PremiumFeatureContainer> | 413 | </div> |
456 | )} | 414 | )} |
457 | 415 | ||
458 | <div className="user-agent"> | 416 | <div className="user-agent"> |
@@ -512,7 +470,7 @@ export default @observer class EditServiceForm extends Component { | |||
512 | type="submit" | 470 | type="submit" |
513 | label={intl.formatMessage(messages.saveService)} | 471 | label={intl.formatMessage(messages.saveService)} |
514 | htmlForm="form" | 472 | htmlForm="form" |
515 | disabled={action !== 'edit' && ((form.isPristine && requiresUserInput) || serviceLimitStore.userHasReachedServiceLimit)} | 473 | disabled={action !== 'edit' && (form.isPristine && requiresUserInput)} |
516 | /> | 474 | /> |
517 | )} | 475 | )} |
518 | </div> | 476 | </div> |
diff --git a/src/components/settings/services/ServicesDashboard.js b/src/components/settings/services/ServicesDashboard.js index a0f05fd20..a05af5da0 100644 --- a/src/components/settings/services/ServicesDashboard.js +++ b/src/components/settings/services/ServicesDashboard.js | |||
@@ -10,7 +10,6 @@ import Loader from '../../ui/Loader'; | |||
10 | import FAB from '../../ui/FAB'; | 10 | import FAB from '../../ui/FAB'; |
11 | import ServiceItem from './ServiceItem'; | 11 | import ServiceItem from './ServiceItem'; |
12 | import Appear from '../../ui/effects/Appear'; | 12 | import Appear from '../../ui/effects/Appear'; |
13 | import LimitReachedInfobox from '../../../features/serviceLimit/components/LimitReachedInfobox'; | ||
14 | 13 | ||
15 | const messages = defineMessages({ | 14 | const messages = defineMessages({ |
16 | headline: { | 15 | headline: { |
@@ -93,7 +92,6 @@ export default @observer class ServicesDashboard extends Component { | |||
93 | <div className="settings__header"> | 92 | <div className="settings__header"> |
94 | <h1>{intl.formatMessage(messages.headline)}</h1> | 93 | <h1>{intl.formatMessage(messages.headline)}</h1> |
95 | </div> | 94 | </div> |
96 | <LimitReachedInfobox /> | ||
97 | <div className="settings__body"> | 95 | <div className="settings__body"> |
98 | {(services.length !== 0 || searchNeedle) && !isLoading && ( | 96 | {(services.length !== 0 || searchNeedle) && !isLoading && ( |
99 | <SearchInput | 97 | <SearchInput |