aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-06-05 16:28:45 +0530
committerLibravatar GitHub <noreply@github.com>2021-06-05 12:58:45 +0200
commitaa6689e6158efde28b68948cd8b67d55080158d2 (patch)
tree6e687fb7b5e2eb37c0027ba31d968b04632f5771 /src/components
parentReused commonly defined method for 'apiBase' (diff)
downloadferdium-app-aa6689e6158efde28b68948cd8b67d55080158d2.tar.gz
ferdium-app-aa6689e6158efde28b68948cd8b67d55080158d2.tar.zst
ferdium-app-aa6689e6158efde28b68948cd8b67d55080158d2.zip
Removed hardcoded strings and reused constants defined in config.js (#1499)
Diffstat (limited to 'src/components')
-rw-r--r--src/components/auth/AuthLayout.js3
-rw-r--r--src/components/auth/ChangeServer.js5
-rw-r--r--src/components/auth/Login.js7
-rw-r--r--src/components/auth/Signup.js8
-rw-r--r--src/components/services/content/ConnectionLostBanner.js4
-rw-r--r--src/components/settings/account/AccountDashboard.js4
-rw-r--r--src/components/settings/navigation/SettingsNavigation.js6
-rw-r--r--src/components/settings/settings/EditSettingsForm.js5
-rw-r--r--src/components/settings/team/TeamDashboard.js3
9 files changed, 24 insertions, 21 deletions
diff --git a/src/components/auth/AuthLayout.js b/src/components/auth/AuthLayout.js
index 4783fc6a0..6fa3adf92 100644
--- a/src/components/auth/AuthLayout.js
+++ b/src/components/auth/AuthLayout.js
@@ -12,6 +12,7 @@ import globalMessages from '../../i18n/globalMessages';
12 12
13import { isWindows } from '../../environment'; 13import { isWindows } from '../../environment';
14import AppUpdateInfoBar from '../AppUpdateInfoBar'; 14import AppUpdateInfoBar from '../AppUpdateInfoBar';
15import { GITHUB_FERDI_URL } from '../../config';
15 16
16export default @observer class AuthLayout extends Component { 17export default @observer class AuthLayout extends Component {
17 static propTypes = { 18 static propTypes = {
@@ -94,7 +95,7 @@ export default @observer class AuthLayout extends Component {
94 })} 95 })}
95 </div> 96 </div>
96 {/* </div> */} 97 {/* </div> */}
97 <Link to="https://github.com/getferdi/ferdi" className="auth__adlk" target="_blank"> 98 <Link to={`${GITHUB_FERDI_URL}/ferdi`} className="auth__adlk" target="_blank">
98 <img src="./assets/images/adlk.svg" alt="" /> 99 <img src="./assets/images/adlk.svg" alt="" />
99 </Link> 100 </Link>
100 </div> 101 </div>
diff --git a/src/components/auth/ChangeServer.js b/src/components/auth/ChangeServer.js
index 68c2303a4..0dedd825a 100644
--- a/src/components/auth/ChangeServer.js
+++ b/src/components/auth/ChangeServer.js
@@ -8,6 +8,7 @@ import Select from '../ui/Select';
8import Button from '../ui/Button'; 8import Button from '../ui/Button';
9import Infobox from '../ui/Infobox'; 9import Infobox from '../ui/Infobox';
10import { url, required } from '../../helpers/validation-helpers'; 10import { url, required } from '../../helpers/validation-helpers';
11import { LIVE_FERDI_API, LIVE_FRANZ_API } from '../../config';
11 12
12const messages = defineMessages({ 13const messages = defineMessages({
13 headline: { 14 headline: {
@@ -47,9 +48,9 @@ export default @observer class ChangeServer extends Component {
47 intl: intlShape, 48 intl: intlShape,
48 }; 49 };
49 50
50 ferdiServer='https://api.getferdi.com'; 51 ferdiServer=LIVE_FERDI_API;
51 52
52 franzServer='https://api.franzinfra.com'; 53 franzServer=LIVE_FRANZ_API;
53 54
54 defaultServers=[this.franzServer, this.ferdiServer]; 55 defaultServers=[this.franzServer, this.ferdiServer];
55 56
diff --git a/src/components/auth/Login.js b/src/components/auth/Login.js
index 23fdfcac7..52b09eab6 100644
--- a/src/components/auth/Login.js
+++ b/src/components/auth/Login.js
@@ -4,7 +4,8 @@ import PropTypes from 'prop-types';
4import { observer, inject } from 'mobx-react'; 4import { observer, inject } from 'mobx-react';
5import { defineMessages, intlShape } from 'react-intl'; 5import { defineMessages, intlShape } from 'react-intl';
6 6
7import { isDevMode, useLiveAPI } from '../../environment'; 7import { LIVE_FRANZ_API } from '../../config';
8import { API_VERSION, isDevMode, useLiveAPI } from '../../environment';
8import Form from '../../lib/Form'; 9import Form from '../../lib/Form';
9import { required, email } from '../../helpers/validation-helpers'; 10import { required, email } from '../../helpers/validation-helpers';
10import serverlessLogin from '../../helpers/serverless-helpers'; 11import serverlessLogin from '../../helpers/serverless-helpers';
@@ -164,12 +165,12 @@ export default @inject('actions') @observer class Login extends Component {
164 {error.code === 'invalid-credentials' && ( 165 {error.code === 'invalid-credentials' && (
165 <> 166 <>
166 <p className="error-message center">{intl.formatMessage(messages.invalidCredentials)}</p> 167 <p className="error-message center">{intl.formatMessage(messages.invalidCredentials)}</p>
167 { window.ferdi.stores.settings.all.app.server !== 'https://api.franzinfra.com' && ( 168 { window.ferdi.stores.settings.all.app.server !== LIVE_FRANZ_API && (
168 <p className="error-message center"> 169 <p className="error-message center">
169 {intl.formatMessage(messages.customServerQuestion)} 170 {intl.formatMessage(messages.customServerQuestion)}
170 {' '} 171 {' '}
171 <Link 172 <Link
172 to={`${window.ferdi.stores.settings.all.app.server.replace('v1', '')}/import`} 173 to={`${window.ferdi.stores.settings.all.app.server.replace(API_VERSION, '')}/import`}
173 target="_blank" 174 target="_blank"
174 style={{ cursor: 'pointer', textDecoration: 'underline' }} 175 style={{ cursor: 'pointer', textDecoration: 'underline' }}
175 > 176 >
diff --git a/src/components/auth/Signup.js b/src/components/auth/Signup.js
index 6a7db5cde..140867ea1 100644
--- a/src/components/auth/Signup.js
+++ b/src/components/auth/Signup.js
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
4import { observer, inject } from 'mobx-react'; 4import { observer, inject } from 'mobx-react';
5import { defineMessages, intlShape } from 'react-intl'; 5import { defineMessages, intlShape } from 'react-intl';
6 6
7import { isDevMode, useLiveAPI } from '../../environment'; 7import { isDevMode, termsBase, useLiveAPI } from '../../environment';
8import Form from '../../lib/Form'; 8import Form from '../../lib/Form';
9import { required, email, minLength } from '../../helpers/validation-helpers'; 9import { required, email, minLength } from '../../helpers/validation-helpers';
10import serverlessLogin from '../../helpers/serverless-helpers'; 10import serverlessLogin from '../../helpers/serverless-helpers';
@@ -135,8 +135,6 @@ export default @inject('actions') @observer class Signup extends Component {
135 isSubmitting, loginRoute, error, changeServerRoute, 135 isSubmitting, loginRoute, error, changeServerRoute,
136 } = this.props; 136 } = this.props;
137 137
138 const termsBase = window.ferdi.stores.settings.all.app.server !== 'https://api.franzinfra.com' ? window.ferdi.stores.settings.all.app.server : 'https://meetfranz.com';
139
140 return ( 138 return (
141 <div className="auth__scroll-container"> 139 <div className="auth__scroll-container">
142 <div className="auth__container auth__container--signup"> 140 <div className="auth__container auth__container--signup">
@@ -183,7 +181,7 @@ export default @inject('actions') @observer class Signup extends Component {
183 {intl.formatMessage(messages.legalInfo)} 181 {intl.formatMessage(messages.legalInfo)}
184 <br /> 182 <br />
185 <Link 183 <Link
186 to={`${termsBase}/terms`} 184 to={`${termsBase()}/terms`}
187 target="_blank" 185 target="_blank"
188 className="link" 186 className="link"
189 > 187 >
@@ -191,7 +189,7 @@ export default @inject('actions') @observer class Signup extends Component {
191 </Link> 189 </Link>
192 &nbsp;&amp;&nbsp; 190 &nbsp;&amp;&nbsp;
193 <Link 191 <Link
194 to={`${termsBase}/privacy`} 192 to={`${termsBase()}/privacy`}
195 target="_blank" 193 target="_blank"
196 className="link" 194 className="link"
197 > 195 >
diff --git a/src/components/services/content/ConnectionLostBanner.js b/src/components/services/content/ConnectionLostBanner.js
index 36ab2b351..e54a88faa 100644
--- a/src/components/services/content/ConnectionLostBanner.js
+++ b/src/components/services/content/ConnectionLostBanner.js
@@ -8,7 +8,7 @@ import { intlShape, defineMessages } from 'react-intl';
8import { 8import {
9 mdiAlert, 9 mdiAlert,
10} from '@mdi/js'; 10} from '@mdi/js';
11import { LIVE_API_WEBSITE } from '../../../config'; 11import { LIVE_API_FERDI_WEBSITE } from '../../../config';
12// import { Button } from '@meetfranz/forms'; 12// import { Button } from '@meetfranz/forms';
13 13
14const messages = defineMessages({ 14const messages = defineMessages({
@@ -98,7 +98,7 @@ class ConnectionLostBanner extends Component {
98 {intl.formatMessage(messages.text, { name })} 98 {intl.formatMessage(messages.text, { name })}
99 <br /> 99 <br />
100 <a 100 <a
101 href={`${LIVE_API_WEBSITE}/support#what-does-franz-lost-the-connection-to-service-mean`} 101 href={`${LIVE_API_FERDI_WEBSITE}/support#what-does-franz-lost-the-connection-to-service-mean`}
102 className={classes.link} 102 className={classes.link}
103 > 103 >
104 {intl.formatMessage(messages.moreInformation)} 104 {intl.formatMessage(messages.moreInformation)}
diff --git a/src/components/settings/account/AccountDashboard.js b/src/components/settings/account/AccountDashboard.js
index 809bfda6e..68d88e218 100644
--- a/src/components/settings/account/AccountDashboard.js
+++ b/src/components/settings/account/AccountDashboard.js
@@ -11,7 +11,7 @@ import Button from '../../ui/Button';
11import Infobox from '../../ui/Infobox'; 11import Infobox from '../../ui/Infobox';
12import SubscriptionForm from '../../../containers/subscription/SubscriptionFormScreen'; 12import SubscriptionForm from '../../../containers/subscription/SubscriptionFormScreen';
13import { i18nPlanName } from '../../../helpers/plan-helpers'; 13import { i18nPlanName } from '../../../helpers/plan-helpers';
14import { LOCAL_SERVER } from '../../../config'; 14import { LOCAL_SERVER, LIVE_FRANZ_API } from '../../../config';
15 15
16const messages = defineMessages({ 16const messages = defineMessages({
17 headline: { 17 headline: {
@@ -154,7 +154,7 @@ class AccountDashboard extends Component {
154 } 154 }
155 155
156 const isUsingWithoutAccount = server === LOCAL_SERVER; 156 const isUsingWithoutAccount = server === LOCAL_SERVER;
157 const isUsingFranzServer = server === 'https://api.franzinfra.com'; 157 const isUsingFranzServer = server === LIVE_FRANZ_API;
158 158
159 return ( 159 return (
160 <div className="settings__main"> 160 <div className="settings__main">
diff --git a/src/components/settings/navigation/SettingsNavigation.js b/src/components/settings/navigation/SettingsNavigation.js
index f7786f4e8..616c8c587 100644
--- a/src/components/settings/navigation/SettingsNavigation.js
+++ b/src/components/settings/navigation/SettingsNavigation.js
@@ -5,7 +5,7 @@ import { inject, observer } from 'mobx-react';
5import { ProBadge } from '@meetfranz/ui'; 5import { ProBadge } from '@meetfranz/ui';
6import { RouterStore } from 'mobx-react-router'; 6import { RouterStore } from 'mobx-react-router';
7 7
8import { LOCAL_SERVER, LIVE_API } from '../../../config'; 8import { LOCAL_SERVER, LIVE_FERDI_API, LIVE_FRANZ_API } from '../../../config';
9import Link from '../../ui/Link'; 9import Link from '../../ui/Link';
10import { workspaceStore } from '../../../features/workspaces'; 10import { workspaceStore } from '../../../features/workspaces';
11import UIStore from '../../../stores/UIStore'; 11import UIStore from '../../../stores/UIStore';
@@ -82,7 +82,7 @@ export default @inject('stores', 'actions') @observer class SettingsNavigation e
82 this.props.actions.settings.update({ 82 this.props.actions.settings.update({
83 type: 'app', 83 type: 'app',
84 data: { 84 data: {
85 server: LIVE_API, 85 server: LIVE_FERDI_API,
86 }, 86 },
87 }); 87 });
88 } 88 }
@@ -105,7 +105,7 @@ export default @inject('stores', 'actions') @observer class SettingsNavigation e
105 const { intl } = this.context; 105 const { intl } = this.context;
106 const isLoggedIn = Boolean(localStorage.getItem('authToken')); 106 const isLoggedIn = Boolean(localStorage.getItem('authToken'));
107 const isUsingWithoutAccount = stores.settings.app.server === LOCAL_SERVER; 107 const isUsingWithoutAccount = stores.settings.app.server === LOCAL_SERVER;
108 const isUsingFranzServer = stores.settings.app.server === 'https://api.franzinfra.com'; 108 const isUsingFranzServer = stores.settings.app.server === LIVE_FRANZ_API;
109 109
110 return ( 110 return (
111 <div className="settings-navigation"> 111 <div className="settings-navigation">
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js
index 0c0366335..08e5efa2a 100644
--- a/src/components/settings/settings/EditSettingsForm.js
+++ b/src/components/settings/settings/EditSettingsForm.js
@@ -16,6 +16,7 @@ import Input from '../../ui/Input';
16import { 16import {
17 DEFAULT_APP_SETTINGS, 17 DEFAULT_APP_SETTINGS,
18 FRANZ_TRANSLATION, 18 FRANZ_TRANSLATION,
19 GITHUB_FRANZ_URL,
19} from '../../../config'; 20} from '../../../config';
20import { isMac, isWindows } from '../../../environment'; 21import { isMac, isWindows } from '../../../environment';
21 22
@@ -677,13 +678,13 @@ export default @observer class EditSettingsForm extends Component {
677 678
678 Ferdi is based on 679 Ferdi is based on
679 {' '} 680 {' '}
680 <a href="https://github.com/meetfranz/franz" target="_blank">Franz</a> 681 <a href={`${GITHUB_FRANZ_URL}/franz`} target="_blank">Franz</a>
681 682
682 683
683 , a project published 684 , a project published
684 under the 685 under the
685 {' '} 686 {' '}
686 <a href="https://github.com/meetfranz/franz/blob/master/LICENSE" target="_blank">Apache-2.0 License</a> 687 <a href={`${GITHUB_FRANZ_URL}/franz/blob/master/LICENSE`} target="_blank">Apache-2.0 License</a>
687 </span> 688 </span>
688 <br /> 689 <br />
689 <span className="mdi mdi-information" /> 690 <span className="mdi mdi-information" />
diff --git a/src/components/settings/team/TeamDashboard.js b/src/components/settings/team/TeamDashboard.js
index 72358d485..f26f4cc0c 100644
--- a/src/components/settings/team/TeamDashboard.js
+++ b/src/components/settings/team/TeamDashboard.js
@@ -12,6 +12,7 @@ import Button from '../../ui/Button';
12import Infobox from '../../ui/Infobox'; 12import Infobox from '../../ui/Infobox';
13import globalMessages from '../../../i18n/globalMessages'; 13import globalMessages from '../../../i18n/globalMessages';
14import UpgradeButton from '../../ui/UpgradeButton'; 14import UpgradeButton from '../../ui/UpgradeButton';
15import { LIVE_FRANZ_API } from '../../../config';
15 16
16const messages = defineMessages({ 17const messages = defineMessages({
17 headline: { 18 headline: {
@@ -125,7 +126,7 @@ export default @injectSheet(styles) @observer class TeamDashboard extends Compon
125 } = this.props; 126 } = this.props;
126 const { intl } = this.context; 127 const { intl } = this.context;
127 128
128 if (server === 'https://api.franzinfra.com') { 129 if (server === LIVE_FRANZ_API) {
129 return ( 130 return (
130 <div className="settings__main"> 131 <div className="settings__main">
131 <div className="settings__header"> 132 <div className="settings__header">