From c372530ed189eb36d786bfb5a42d785a7dd8a4e8 Mon Sep 17 00:00:00 2001 From: André Oliveira <37463445+SpecialAro@users.noreply.github.com> Date: Tue, 5 Jul 2022 11:04:19 +0100 Subject: Add Server Information to About Dialog and to Global Messages (#425) Add Server Information to About Dialog and to Global Messages --- src/api/apiBase.ts | 8 ++++---- src/components/auth/AuthLayout.js | 8 +++++++- src/components/auth/Welcome.js | 6 ++++-- src/i18n/globalMessages.ts | 2 +- src/i18n/locales/en-US.json | 6 +++--- src/lib/Menu.js | 3 ++- 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 { let nameServer; switch (serverType) { case LIVE_FRANZ_API: - nameServer = 'Franz Server'; + nameServer = 'Franz'; break; case LIVE_FERDIUM_API: - nameServer = 'Ferdium Server'; + nameServer = 'Ferdium'; break; case noServer: - nameServer = 'no Server'; + nameServer = 'No'; break; default: - nameServer = 'a Custom Server'; + nameServer = 'Custom'; } 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'; import { GITHUB_FERDIUM_URL } from '../../config'; import Icon from '../ui/icon'; +import { serverName } from '../../api/apiBase'; + class AuthLayout extends Component { static propTypes = { children: oneOrManyChildElements.isRequired, @@ -53,6 +55,10 @@ class AuthLayout extends Component { const { intl } = this.props; + let serverNameParse = serverName(); + serverNameParse = + serverNameParse === 'Custom' ? 'your Custom Server' : serverNameParse; + return ( <> {isWindows && !isFullScreen && ( @@ -85,7 +91,7 @@ class AuthLayout extends Component { onClick={retryHealthCheck} > - {intl.formatMessage(globalMessages.APIUnhealthy)} + {intl.formatMessage(globalMessages.APIUnhealthy, { serverNameParse })} )}
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({ }, changeServerMessage: { id: 'login.changeServerMessage', - defaultMessage: 'You are using {serverNameParse}, do you want to switch?' + defaultMessage: 'You are using {serverNameParse} Server, do you want to switch?' }, changeServer: { id: 'login.changeServer', @@ -53,7 +53,9 @@ class Welcome extends Component { recipes = shuffleArray(recipes); recipes.length = 8 * 2; - const serverNameParse = serverName(); + let serverNameParse = serverName(); + serverNameParse = + serverNameParse === 'Custom' ? 'a Custom' : serverNameParse; return (
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'; export default defineMessages({ APIUnhealthy: { id: 'global.api.unhealthy', - defaultMessage: "Can't connect to Ferdium online services", + defaultMessage: "Can't connect to {serverNameParse} online services", }, notConnectedToTheInternet: { 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 @@ "feature.quickSwitch.info": "Select a service with TAB, ↑ and ↓. Open a service with ENTER.", "feature.quickSwitch.search": "Search...", "feature.quickSwitch.title": "QuickSwitch", - "global.api.unhealthy": "Can't connect to Ferdium online services", + "global.api.unhealthy": "Can't connect to {serverNameParse} online services", "global.cancel": "Cancel", "global.edit": "Edit", "global.no": "No", @@ -65,7 +65,7 @@ "locked.touchIdPrompt": "unlock via Touch ID", "locked.unlockWithPassword": "Unlock with Password", "login.changeServer": "Change here!", - "login.changeServerMessage": "You are using {serverNameParse}, do you want to switch?", + "login.changeServerMessage": "You are using {serverNameParse} Server, do you want to switch?", "login.customServerQuestion": "Using a custom Ferdium server?", "login.customServerSuggestion": "Try importing your Franz account", "login.email.label": "Email address", @@ -475,4 +475,4 @@ "workspaceDrawer.workspaceFeatureInfo": "

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.

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.

", "workspaceDrawer.workspacesSettingsTooltip": "Edit workspaces settings", "workspaces.switchingIndicator.switchingTo": "Switching to" -} \ No newline at end of file +} 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'; import { todoActions } from '../features/todos/actions'; import workspaceActions from '../features/workspaces/actions'; import { workspaceStore } from '../features/workspaces/index'; -import apiBase, { serverBase } from '../api/apiBase'; +import apiBase, { serverBase, serverName } from '../api/apiBase'; import { openExternalUrl } from '../helpers/url-helpers'; import globalMessages from '../i18n/globalMessages'; @@ -870,6 +870,7 @@ class FranzMenu { const aboutAppDetails = [ `Version: ${ferdiumVersion}`, + `Server: ${serverName()} Server`, `Electron: ${electronVersion}`, `Chrome: ${chromeVersion}`, `Node.js: ${nodeVersion}`, -- cgit v1.2.3-54-g00ecf