aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar André Oliveira <37463445+SpecialAro@users.noreply.github.com>2022-07-05 11:04:19 +0100
committerLibravatar GitHub <noreply@github.com>2022-07-05 11:04:19 +0100
commitc372530ed189eb36d786bfb5a42d785a7dd8a4e8 (patch)
treebcc056023f70037fa87ef88b4441c24f3d6ed110
parent6.0.0-nightly.89 [skip ci] (diff)
downloadferdium-app-c372530ed189eb36d786bfb5a42d785a7dd8a4e8.tar.gz
ferdium-app-c372530ed189eb36d786bfb5a42d785a7dd8a4e8.tar.zst
ferdium-app-c372530ed189eb36d786bfb5a42d785a7dd8a4e8.zip
Add Server Information to About Dialog and to Global Messages (#425)
Add Server Information to About Dialog and to Global Messages
-rw-r--r--src/api/apiBase.ts8
-rw-r--r--src/components/auth/AuthLayout.js8
-rw-r--r--src/components/auth/Welcome.js6
-rw-r--r--src/i18n/globalMessages.ts2
-rw-r--r--src/i18n/locales/en-US.json6
-rw-r--r--src/lib/Menu.js3
6 files changed, 21 insertions, 12 deletions
diff --git a/src/api/apiBase.ts b/src/api/apiBase.ts
index c6e3c0ed8..918213542 100644
--- a/src/api/apiBase.ts
+++ b/src/api/apiBase.ts
@@ -61,16 +61,16 @@ export function serverName(): string {
61 let nameServer; 61 let nameServer;
62 switch (serverType) { 62 switch (serverType) {
63 case LIVE_FRANZ_API: 63 case LIVE_FRANZ_API:
64 nameServer = 'Franz Server'; 64 nameServer = 'Franz';
65 break; 65 break;
66 case LIVE_FERDIUM_API: 66 case LIVE_FERDIUM_API:
67 nameServer = 'Ferdium Server'; 67 nameServer = 'Ferdium';
68 break; 68 break;
69 case noServer: 69 case noServer:
70 nameServer = 'no Server'; 70 nameServer = 'No';
71 break; 71 break;
72 default: 72 default:
73 nameServer = 'a Custom Server'; 73 nameServer = 'Custom';
74 } 74 }
75 75
76 return nameServer; 76 return nameServer;
diff --git a/src/components/auth/AuthLayout.js b/src/components/auth/AuthLayout.js
index 77b91fa1c..41bda2f67 100644
--- a/src/components/auth/AuthLayout.js
+++ b/src/components/auth/AuthLayout.js
@@ -21,6 +21,8 @@ import AppUpdateInfoBar from '../AppUpdateInfoBar';
21import { GITHUB_FERDIUM_URL } from '../../config'; 21import { GITHUB_FERDIUM_URL } from '../../config';
22import Icon from '../ui/icon'; 22import Icon from '../ui/icon';
23 23
24import { serverName } from '../../api/apiBase';
25
24class AuthLayout extends Component { 26class AuthLayout extends Component {
25 static propTypes = { 27 static propTypes = {
26 children: oneOrManyChildElements.isRequired, 28 children: oneOrManyChildElements.isRequired,
@@ -53,6 +55,10 @@ class AuthLayout extends Component {
53 55
54 const { intl } = this.props; 56 const { intl } = this.props;
55 57
58 let serverNameParse = serverName();
59 serverNameParse =
60 serverNameParse === 'Custom' ? 'your Custom Server' : serverNameParse;
61
56 return ( 62 return (
57 <> 63 <>
58 {isWindows && !isFullScreen && ( 64 {isWindows && !isFullScreen && (
@@ -85,7 +91,7 @@ class AuthLayout extends Component {
85 onClick={retryHealthCheck} 91 onClick={retryHealthCheck}
86 > 92 >
87 <Icon icon={mdiFlash} /> 93 <Icon icon={mdiFlash} />
88 {intl.formatMessage(globalMessages.APIUnhealthy)} 94 {intl.formatMessage(globalMessages.APIUnhealthy, { serverNameParse })}
89 </InfoBar> 95 </InfoBar>
90 )} 96 )}
91 <div className="auth__layout"> 97 <div className="auth__layout">
diff --git a/src/components/auth/Welcome.js b/src/components/auth/Welcome.js
index 830501ac3..c9d592a88 100644
--- a/src/components/auth/Welcome.js
+++ b/src/components/auth/Welcome.js
@@ -21,7 +21,7 @@ const messages = defineMessages({
21 }, 21 },
22 changeServerMessage: { 22 changeServerMessage: {
23 id: 'login.changeServerMessage', 23 id: 'login.changeServerMessage',
24 defaultMessage: 'You are using {serverNameParse}, do you want to switch?' 24 defaultMessage: 'You are using {serverNameParse} Server, do you want to switch?'
25 }, 25 },
26 changeServer: { 26 changeServer: {
27 id: 'login.changeServer', 27 id: 'login.changeServer',
@@ -53,7 +53,9 @@ class Welcome extends Component {
53 recipes = shuffleArray(recipes); 53 recipes = shuffleArray(recipes);
54 recipes.length = 8 * 2; 54 recipes.length = 8 * 2;
55 55
56 const serverNameParse = serverName(); 56 let serverNameParse = serverName();
57 serverNameParse =
58 serverNameParse === 'Custom' ? 'a Custom' : serverNameParse;
57 59
58 return ( 60 return (
59 <div className="welcome"> 61 <div className="welcome">
diff --git a/src/i18n/globalMessages.ts b/src/i18n/globalMessages.ts
index 0afe04a40..690bad1de 100644
--- a/src/i18n/globalMessages.ts
+++ b/src/i18n/globalMessages.ts
@@ -3,7 +3,7 @@ import { defineMessages } from 'react-intl';
3export default defineMessages({ 3export default defineMessages({
4 APIUnhealthy: { 4 APIUnhealthy: {
5 id: 'global.api.unhealthy', 5 id: 'global.api.unhealthy',
6 defaultMessage: "Can't connect to Ferdium online services", 6 defaultMessage: "Can't connect to {serverNameParse} online services",
7 }, 7 },
8 notConnectedToTheInternet: { 8 notConnectedToTheInternet: {
9 id: 'global.notConnectedToTheInternet', 9 id: 'global.notConnectedToTheInternet',
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json
index 1690a6067..1b57ba920 100644
--- a/src/i18n/locales/en-US.json
+++ b/src/i18n/locales/en-US.json
@@ -20,7 +20,7 @@
20 "feature.quickSwitch.info": "Select a service with TAB, ↑ and ↓. Open a service with ENTER.", 20 "feature.quickSwitch.info": "Select a service with TAB, ↑ and ↓. Open a service with ENTER.",
21 "feature.quickSwitch.search": "Search...", 21 "feature.quickSwitch.search": "Search...",
22 "feature.quickSwitch.title": "QuickSwitch", 22 "feature.quickSwitch.title": "QuickSwitch",
23 "global.api.unhealthy": "Can't connect to Ferdium online services", 23 "global.api.unhealthy": "Can't connect to {serverNameParse} online services",
24 "global.cancel": "Cancel", 24 "global.cancel": "Cancel",
25 "global.edit": "Edit", 25 "global.edit": "Edit",
26 "global.no": "No", 26 "global.no": "No",
@@ -65,7 +65,7 @@
65 "locked.touchIdPrompt": "unlock via Touch ID", 65 "locked.touchIdPrompt": "unlock via Touch ID",
66 "locked.unlockWithPassword": "Unlock with Password", 66 "locked.unlockWithPassword": "Unlock with Password",
67 "login.changeServer": "Change here!", 67 "login.changeServer": "Change here!",
68 "login.changeServerMessage": "You are using {serverNameParse}, do you want to switch?", 68 "login.changeServerMessage": "You are using {serverNameParse} Server, do you want to switch?",
69 "login.customServerQuestion": "Using a custom Ferdium server?", 69 "login.customServerQuestion": "Using a custom Ferdium server?",
70 "login.customServerSuggestion": "Try importing your Franz account", 70 "login.customServerSuggestion": "Try importing your Franz account",
71 "login.email.label": "Email address", 71 "login.email.label": "Email address",
@@ -475,4 +475,4 @@
475 "workspaceDrawer.workspaceFeatureInfo": "<p>Ferdium Workspaces let you focus on what’s important right now. Set up different sets of services and easily switch between them at any time.</p><p>You decide which services you need when and where, so we can help you stay on top of your game - or easily switch off from work whenever you want.</p>", 475 "workspaceDrawer.workspaceFeatureInfo": "<p>Ferdium Workspaces let you focus on what’s important right now. Set up different sets of services and easily switch between them at any time.</p><p>You decide which services you need when and where, so we can help you stay on top of your game - or easily switch off from work whenever you want.</p>",
476 "workspaceDrawer.workspacesSettingsTooltip": "Edit workspaces settings", 476 "workspaceDrawer.workspacesSettingsTooltip": "Edit workspaces settings",
477 "workspaces.switchingIndicator.switchingTo": "Switching to" 477 "workspaces.switchingIndicator.switchingTo": "Switching to"
478} \ No newline at end of file 478}
diff --git a/src/lib/Menu.js b/src/lib/Menu.js
index 9e063e24c..0272f39c3 100644
--- a/src/lib/Menu.js
+++ b/src/lib/Menu.js
@@ -37,7 +37,7 @@ import { ferdiumVersion } from '../environment-remote';
37import { todoActions } from '../features/todos/actions'; 37import { todoActions } from '../features/todos/actions';
38import workspaceActions from '../features/workspaces/actions'; 38import workspaceActions from '../features/workspaces/actions';
39import { workspaceStore } from '../features/workspaces/index'; 39import { workspaceStore } from '../features/workspaces/index';
40import apiBase, { serverBase } from '../api/apiBase'; 40import apiBase, { serverBase, serverName } from '../api/apiBase';
41import { openExternalUrl } from '../helpers/url-helpers'; 41import { openExternalUrl } from '../helpers/url-helpers';
42import globalMessages from '../i18n/globalMessages'; 42import globalMessages from '../i18n/globalMessages';
43 43
@@ -870,6 +870,7 @@ class FranzMenu {
870 870
871 const aboutAppDetails = [ 871 const aboutAppDetails = [
872 `Version: ${ferdiumVersion}`, 872 `Version: ${ferdiumVersion}`,
873 `Server: ${serverName()} Server`,
873 `Electron: ${electronVersion}`, 874 `Electron: ${electronVersion}`,
874 `Chrome: ${chromeVersion}`, 875 `Chrome: ${chromeVersion}`,
875 `Node.js: ${nodeVersion}`, 876 `Node.js: ${nodeVersion}`,