From f39cbe7d803245702885b308ab1cee4551aea9a1 Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Sat, 4 Sep 2021 17:03:53 +0200 Subject: chore: remove what's new functionality (#1864) --- src/actions/index.js | 2 - src/components/AppUpdateInfoBar.js | 24 +- src/components/auth/AuthLayout.js | 7 - src/components/layout/AppLayout.js | 4 - src/config.ts | 28 +- src/containers/auth/AuthLayoutContainer.js | 23 +- src/containers/layout/AppLayoutContainer.js | 48 ++- src/features/announcements/actions.js | 10 - src/features/announcements/api.js | 35 -- .../announcements/components/AnnouncementScreen.js | 300 ------------- src/features/announcements/constants.js | 5 - src/features/announcements/index.js | 29 -- src/features/announcements/store.js | 148 ------- src/features/todos/store.js | 79 ++-- .../workspaces/components/WorkspacesDashboard.js | 14 +- src/i18n/locales/defaultMessages.json | 331 +++++++-------- src/i18n/locales/en-US.json | 4 +- .../messages/src/components/AppUpdateInfoBar.json | 12 +- .../components/AnnouncementScreen.json | 15 - src/i18n/messages/src/lib/Menu.json | 301 +++++++------ .../app/Controllers/Http/StaticController.js | 15 +- src/internal-server/start/routes.js | 17 +- src/lib/Menu.js | 472 ++++++++++++--------- src/routes.js | 31 +- src/stores/AppStore.js | 53 ++- src/stores/FeaturesStore.js | 24 +- src/stores/index.ts | 4 +- 27 files changed, 760 insertions(+), 1275 deletions(-) delete mode 100644 src/features/announcements/actions.js delete mode 100644 src/features/announcements/api.js delete mode 100644 src/features/announcements/components/AnnouncementScreen.js delete mode 100644 src/features/announcements/constants.js delete mode 100644 src/features/announcements/index.js delete mode 100644 src/features/announcements/store.js delete mode 100644 src/i18n/messages/src/features/announcements/components/AnnouncementScreen.json (limited to 'src') diff --git a/src/actions/index.js b/src/actions/index.js index ed8283d6c..aecdac675 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -10,7 +10,6 @@ import user from './user'; import news from './news'; import settings from './settings'; import requests from './requests'; -import announcements from '../features/announcements/actions'; import workspaces from '../features/workspaces/actions'; import todos from '../features/todos/actions'; @@ -28,7 +27,6 @@ const actions = { export default Object.assign( defineActions(actions, PropTypes.checkPropTypes), - { announcements }, { workspaces }, { todos }, ); diff --git a/src/components/AppUpdateInfoBar.js b/src/components/AppUpdateInfoBar.js index f51fe029b..30804262a 100644 --- a/src/components/AppUpdateInfoBar.js +++ b/src/components/AppUpdateInfoBar.js @@ -2,8 +2,9 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { defineMessages, intlShape } from 'react-intl'; -import { announcementActions } from '../features/announcements/actions'; import InfoBar from './ui/InfoBar'; +import { GITHUB_FERDI_URL } from '../config'; +import { openExternalUrl } from '../helpers/url-helpers'; const messages = defineMessages({ updateAvailable: { @@ -23,25 +24,16 @@ const messages = defineMessages({ class AppUpdateInfoBar extends Component { static propTypes = { onInstallUpdate: PropTypes.func.isRequired, - nextAppReleaseVersion: PropTypes.string, onHide: PropTypes.func.isRequired, }; - static defaultProps = { - nextAppReleaseVersion: null, - }; - static contextTypes = { intl: intlShape, }; render() { const { intl } = this.context; - const { - onInstallUpdate, - nextAppReleaseVersion, - onHide, - } = this.props; + const { onInstallUpdate, onHide } = this.props; return ( - {intl.formatMessage(messages.updateAvailable)} - {' '} + {intl.formatMessage(messages.updateAvailable)}{' '} diff --git a/src/components/auth/AuthLayout.js b/src/components/auth/AuthLayout.js index c0e6b982b..8235932c2 100644 --- a/src/components/auth/AuthLayout.js +++ b/src/components/auth/AuthLayout.js @@ -28,7 +28,6 @@ class AuthLayout extends Component { retryHealthCheck: PropTypes.func.isRequired, isHealthCheckLoading: PropTypes.bool.isRequired, isFullScreen: PropTypes.bool.isRequired, - nextAppReleaseVersion: PropTypes.string, installAppUpdate: PropTypes.func.isRequired, appUpdateIsDownloaded: PropTypes.bool.isRequired, }; @@ -37,10 +36,6 @@ class AuthLayout extends Component { shouldShowAppUpdateInfoBar: true, }; - static defaultProps = { - nextAppReleaseVersion: null, - }; - static contextTypes = { intl: intlShape, }; @@ -54,7 +49,6 @@ class AuthLayout extends Component { retryHealthCheck, isHealthCheckLoading, isFullScreen, - nextAppReleaseVersion, installAppUpdate, appUpdateIsDownloaded, } = this.props; @@ -77,7 +71,6 @@ class AuthLayout extends Component { )} {appUpdateIsDownloaded && this.state.shouldShowAppUpdateInfoBar && ( { this.setState({ shouldShowAppUpdateInfoBar: false }); diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index 00d7a759b..e6e5d40fe 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js @@ -76,7 +76,6 @@ class AppLayout extends Component { news: MobxPropTypes.arrayOrObservableArray.isRequired, showServicesUpdatedInfoBar: PropTypes.bool.isRequired, appUpdateIsDownloaded: PropTypes.bool.isRequired, - nextAppReleaseVersion: PropTypes.string, authRequestFailed: PropTypes.bool.isRequired, removeNewsItem: PropTypes.func.isRequired, reloadServicesAfterUpdate: PropTypes.func.isRequired, @@ -93,7 +92,6 @@ class AppLayout extends Component { static defaultProps = { children: [], - nextAppReleaseVersion: null, }; static contextTypes = { @@ -111,7 +109,6 @@ class AppLayout extends Component { news, showServicesUpdatedInfoBar, appUpdateIsDownloaded, - nextAppReleaseVersion, authRequestFailed, removeNewsItem, reloadServicesAfterUpdate, @@ -195,7 +192,6 @@ class AppLayout extends Component { )} {appUpdateIsDownloaded && this.state.shouldShowAppUpdateInfoBar && ( { this.setState({ shouldShowAppUpdateInfoBar: false }); diff --git a/src/config.ts b/src/config.ts index 835d130da..7bb2525a5 100644 --- a/src/config.ts +++ b/src/config.ts @@ -27,7 +27,8 @@ export const STATS_API = 'https://stats.franzinfra.com'; export const LOCAL_TODOS_FRONTEND_URL = 'http://localhost:4000'; export const PRODUCTION_TODOS_FRONTEND_URL = 'https://app.franztodos.com'; -export const DEVELOPMENT_TODOS_FRONTEND_URL = 'https://development--franz-todos.netlify.com'; +export const DEVELOPMENT_TODOS_FRONTEND_URL = + 'https://development--franz-todos.netlify.com'; export const CDN_URL = 'https://cdn.franzinfra.com'; @@ -69,8 +70,10 @@ export const SEARCH_ENGINE_NAMES = { }; export const SEARCH_ENGINE_URLS = { - [SEARCH_ENGINE_GOOGLE]: ({ searchTerm }) => `https://www.google.com/search?q=${searchTerm}`, - [SEARCH_ENGINE_DDG]: ({ searchTerm }) => `https://duckduckgo.com/?q=${searchTerm}`, + [SEARCH_ENGINE_GOOGLE]: ({ searchTerm }) => + `https://www.google.com/search?q=${searchTerm}`, + [SEARCH_ENGINE_DDG]: ({ searchTerm }) => + `https://duckduckgo.com/?q=${searchTerm}`, }; export const CUSTOM_TODO_SERVICE = 'isUsingCustomTodoService'; @@ -83,7 +86,8 @@ const TODO_HABITICA_URL = 'https://habitica.com/login'; const TODO_NOZBE_URL = 'https://app.nozbe.com/#login'; const TODO_RTM_URL = 'https://www.rememberthemilk.com/login/'; const TODO_ANYDO_URL = 'https://desktop.any.do/'; -const TODO_GOOGLETASKS_URL = 'https://tasks.google.com/embed/?origin=https%3A%2F%2Fcalendar.google.com&fullWidth=1'; +const TODO_GOOGLETASKS_URL = + 'https://tasks.google.com/embed/?origin=https%3A%2F%2Fcalendar.google.com&fullWidth=1'; export const TODO_SERVICE_RECIPE_IDS = { [TODO_TODOIST_URL]: 'todoist', @@ -108,7 +112,8 @@ export const TODO_APPS = { }; export const DEFAULT_TODO_SERVICE = TODO_FRANZ_TODOS_URL; -export const DEFAULT_TODO_RECIPE_ID = TODO_SERVICE_RECIPE_IDS[DEFAULT_TODO_SERVICE]; +export const DEFAULT_TODO_RECIPE_ID = + TODO_SERVICE_RECIPE_IDS[DEFAULT_TODO_SERVICE]; export const DEFAULT_TODO_SERVICE_NAME = TODO_APPS[DEFAULT_TODO_SERVICE]; export const SIDEBAR_WIDTH = { @@ -135,7 +140,6 @@ export const iconSizeBias = 20; export const DEFAULT_FEATURES_CONFIG = { isServiceProxyEnabled: true, - isAnnouncementsEnabled: true, isWorkspaceEnabled: true, isTodosEnabled: true, isSettingsWSEnabled: false, @@ -158,20 +162,12 @@ export const GITHUB_ORG_NAME = 'getferdi'; export const GITHUB_FERDI_REPO_NAME = 'ferdi'; export const GITHUB_NIGHTLIES_REPO_NAME = 'nightlies'; -export const FILE_SYSTEM_SETTINGS_TYPES = [ - 'app', - 'proxy', -]; +export const FILE_SYSTEM_SETTINGS_TYPES = ['app', 'proxy']; export const LOCAL_SERVER = 'You are using Ferdi without a server'; export const SERVER_NOT_LOADED = 'Ferdi::SERVER_NOT_LOADED'; -export const ALLOWED_PROTOCOLS = [ - 'https:', - 'http:', - 'ftp:', - 'ferdi:', -]; +export const ALLOWED_PROTOCOLS = ['https:', 'http:', 'ftp:', 'ferdi:']; export const DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED = false; diff --git a/src/containers/auth/AuthLayoutContainer.js b/src/containers/auth/AuthLayoutContainer.js index f99a8a73f..a0d50ab54 100644 --- a/src/containers/auth/AuthLayoutContainer.js +++ b/src/containers/auth/AuthLayoutContainer.js @@ -14,7 +14,10 @@ import AppLoader from '../../components/ui/AppLoader'; import { oneOrManyChildElements } from '../../prop-types'; import FeaturesStore from '../../stores/FeaturesStore'; -export default @inject('stores', 'actions') @observer class AuthLayoutContainer extends Component { +export default +@inject('stores', 'actions') +@observer +class AuthLayoutContainer extends Component { static propTypes = { children: oneOrManyChildElements.isRequired, location: PropTypes.shape({ @@ -23,15 +26,12 @@ export default @inject('stores', 'actions') @observer class AuthLayoutContainer }; render() { - const { - stores, actions, children, location, - } = this.props; - const { - app, features, globalError, user, - } = stores; + const { stores, actions, children, location } = this.props; + const { app, features, globalError, user } = stores; - const isLoadingBaseFeatures = features.defaultFeaturesRequest.isExecuting - && !features.defaultFeaturesRequest.wasExecuted; + const isLoadingBaseFeatures = + features.defaultFeaturesRequest.isExecuting && + !features.defaultFeaturesRequest.wasExecuted; if (isLoadingBaseFeatures) { return ( @@ -61,8 +61,9 @@ export default @inject('stores', 'actions') @observer class AuthLayoutContainer isHealthCheckLoading={app.healthCheckRequest.isExecuting} isFullScreen={app.isFullScreen} installAppUpdate={actions.app.installUpdate} - nextAppReleaseVersion={app.nextAppReleaseVersion} - appUpdateIsDownloaded={app.updateStatus === app.updateStatusTypes.DOWNLOADED} + appUpdateIsDownloaded={ + app.updateStatus === app.updateStatusTypes.DOWNLOADED + } > {children} diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 32b1f1cf7..83a25168b 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js @@ -25,7 +25,10 @@ import WorkspaceDrawer from '../../features/workspaces/components/WorkspaceDrawe import { workspaceStore } from '../../features/workspaces'; import WorkspacesStore from '../../features/workspaces/store'; -export default @inject('stores', 'actions') @observer class AppLayoutContainer extends Component { +export default +@inject('stores', 'actions') +@observer +class AppLayoutContainer extends Component { static defaultProps = { children: null, }; @@ -65,25 +68,25 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e const { retryRequiredRequests } = this.props.actions.requests; - const { - installUpdate, - toggleMuteApp, - } = this.props.actions.app; + const { installUpdate, toggleMuteApp } = this.props.actions.app; - const { - openSettings, - closeSettings, - } = this.props.actions.ui; + const { openSettings, closeSettings } = this.props.actions.ui; const { children } = this.props; - const isLoadingFeatures = features.featuresRequest.isExecuting - && !features.featuresRequest.wasExecuted; + const isLoadingFeatures = + features.featuresRequest.isExecuting && + !features.featuresRequest.wasExecuted; - const isLoadingServices = services.allServicesRequest.isExecuting - && services.allServicesRequest.isExecutingFirstTime; + const isLoadingServices = + services.allServicesRequest.isExecuting && + services.allServicesRequest.isExecutingFirstTime; - if (isLoadingFeatures || isLoadingServices || workspaces.isLoadingWorkspaces) { + if ( + isLoadingFeatures || + isLoadingServices || + workspaces.isLoadingWorkspaces + ) { return ( @@ -93,9 +96,11 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e const workspacesDrawer = ( ( - workspace ? workspaceStore.getWorkspaceServices(workspace).map((s) => s.name) : services.all.map((s) => s.name) - )} + getServicesForWorkspace={workspace => + (workspace + ? workspaceStore.getWorkspaceServices(workspace).map(s => s.name) + : services.all.map(s => s.name)) + } /> ); @@ -118,7 +123,9 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e toggleMuteApp={toggleMuteApp} toggleWorkspaceDrawer={workspaceActions.toggleWorkspaceDrawer} isWorkspaceDrawerOpen={workspaceStore.isWorkspaceDrawerOpen} - showMessageBadgeWhenMutedSetting={settings.all.app.showMessageBadgeWhenMuted} + showMessageBadgeWhenMutedSetting={ + settings.all.app.showMessageBadgeWhenMuted + } showMessageBadgesEvenWhenMuted={ui.showMessageBadgesEvenWhenMuted} isTodosServiceActive={services.isTodosServiceActive || false} /> @@ -145,8 +152,9 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e isFullScreen={app.isFullScreen} isOnline={app.isOnline} showServicesUpdatedInfoBar={ui.showServicesUpdatedInfoBar} - appUpdateIsDownloaded={app.updateStatus === app.updateStatusTypes.DOWNLOADED} - nextAppReleaseVersion={app.nextAppReleaseVersion} + appUpdateIsDownloaded={ + app.updateStatus === app.updateStatusTypes.DOWNLOADED + } authRequestFailed={app.authRequestFailed} sidebar={sidebar} workspacesDrawer={workspacesDrawer} diff --git a/src/features/announcements/actions.js b/src/features/announcements/actions.js deleted file mode 100644 index bab496314..000000000 --- a/src/features/announcements/actions.js +++ /dev/null @@ -1,10 +0,0 @@ -import PropTypes from 'prop-types'; -import { createActionsFromDefinitions } from '../../actions/lib/actions'; - -export const announcementActions = createActionsFromDefinitions({ - show: { - targetVersion: PropTypes.string, - }, -}, PropTypes.checkPropTypes); - -export default announcementActions; diff --git a/src/features/announcements/api.js b/src/features/announcements/api.js deleted file mode 100644 index 962f3e694..000000000 --- a/src/features/announcements/api.js +++ /dev/null @@ -1,35 +0,0 @@ -import Request from '../../stores/lib/Request'; -import apiBase from '../../api/apiBase'; -import { GITHUB_FERDI_REPO_NAME, GITHUB_NIGHTLIES_REPO_NAME, GITHUB_ORG_NAME } from '../../config'; -import { ferdiVersion } from '../../environment'; - -const debug = require('debug')('Ferdi:feature:announcements:api'); - -export const announcementsApi = { - async getCurrentVersion() { - debug('getting current version of electron app'); - return Promise.resolve(ferdiVersion); - }, - - async getChangelog(version) { - const ferdiRepoName = version.includes('nightly') ? GITHUB_NIGHTLIES_REPO_NAME : GITHUB_FERDI_REPO_NAME; - const url = `https://api.github.com/repos/${GITHUB_ORG_NAME}/${ferdiRepoName}/releases/tags/v${version}`; - debug(`fetching release changelog from Github url: ${url}`); - const request = await window.fetch(url, { method: 'GET' }); - if (!request.ok) return null; - const data = await request.json(); - return data.body; - }, - - async getAnnouncement(version) { - const url = `${apiBase()}/announcements/${version}`; - debug(`fetching release announcement from api url: ${url}`); - const response = await window.fetch(url, { method: 'GET' }); - if (!response.ok) return null; - return response.json(); - }, -}; - -export const getCurrentVersionRequest = new Request(announcementsApi, 'getCurrentVersion'); -export const getChangelogRequest = new Request(announcementsApi, 'getChangelog'); -export const getAnnouncementRequest = new Request(announcementsApi, 'getAnnouncement'); diff --git a/src/features/announcements/components/AnnouncementScreen.js b/src/features/announcements/components/AnnouncementScreen.js deleted file mode 100644 index 315843db3..000000000 --- a/src/features/announcements/components/AnnouncementScreen.js +++ /dev/null @@ -1,300 +0,0 @@ -import React, { Component } from 'react'; -import marked from 'marked'; -import PropTypes from 'prop-types'; -import { inject, observer } from 'mobx-react'; -import { defineMessages, intlShape } from 'react-intl'; -import injectSheet from 'react-jss'; -import { Button } from '@meetfranz/forms'; - -import { announcementsStore } from '../index'; -import UIStore from '../../../stores/UIStore'; -import AppStore from '../../../stores/AppStore'; - -const renderer = new marked.Renderer(); - -renderer.link = (href, title, text) => `${text}`; - -const markedOptions = { sanitize: true, renderer }; - -const messages = defineMessages({ - headline: { - id: 'feature.announcements.changelog.headline', - defaultMessage: '!!!Changes in Ferdi {version}', - }, -}); - -const smallScreen = '1000px'; - -const styles = (theme) => ({ - container: { - background: theme.colorBackground, - position: 'relative', - top: 0, - zIndex: 140, - width: '100%', - height: '100%', - overflowY: 'auto', - }, - headline: { - color: theme.colorHeadline, - margin: [25, 0, 40], - // 'max-width': 500, - 'text-align': 'center', - 'line-height': '1.3em', - }, - announcement: { - height: 'auto', - - [`@media(min-width: ${smallScreen})`]: { - display: 'flex', - flexDirection: 'column', - justifyContent: 'center', - height: '100vh', - }, - }, - main: { - display: 'flex', - flexDirection: 'column', - flexGrow: 1, - justifyContent: 'center', - - '& h1': { - margin: [40, 0, 15], - fontSize: 70, - color: theme.styleTypes.primary.accent, - textAlign: 'center', - - [`@media(min-width: ${smallScreen})`]: { - marginTop: 0, - }, - }, - '& h2': { - fontSize: 30, - fontWeight: 300, - color: theme.colorText, - textAlign: 'center', - marginBottom: 60, - }, - }, - mainBody: { - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - width: 'calc(100% - 80px)', - height: 'auto', - margin: '0 auto', - [`@media(min-width: ${smallScreen})`]: { - flexDirection: 'row', - justifyContent: 'center', - }, - }, - mainImage: { - minWidth: 250, - maxWidth: 400, - margin: '0 auto', - marginBottom: 40, - '& img': { - width: '100%', - }, - [`@media(min-width: ${smallScreen})`]: { - margin: 0, - }, - }, - mainText: { - height: 'auto', - maxWidth: 600, - textAlign: 'center', - '& p': { - lineHeight: '1.5em', - }, - [`@media(min-width: ${smallScreen})`]: { - textAlign: 'left', - }, - }, - mainCtaButton: { - textAlign: 'center', - marginTop: 40, - [`@media(min-width: ${smallScreen})`]: { - textAlign: 'left', - }, - }, - spotlight: { - height: 'auto', - background: theme.announcements.spotlight.background, - padding: [40, 0], - marginTop: 80, - [`@media(min-width: ${smallScreen})`]: { - marginTop: 0, - justifyContent: 'center', - alignItems: 'flex-start', - display: 'flex', - flexDirection: 'row', - }, - }, - spotlightTopicContainer: { - textAlign: 'center', - marginBottom: 20, - - [`@media(min-width: ${smallScreen})`]: { - marginBottom: 0, - minWidth: 250, - maxWidth: 330, - width: '100%', - textAlign: 'right', - marginRight: 60, - }, - }, - spotlightContentContainer: { - textAlign: 'center', - [`@media(min-width: ${smallScreen})`]: { - height: 'auto', - maxWidth: 600, - paddingRight: 40, - textAlign: 'left', - }, - '& p': { - lineHeight: '1.5em', - }, - }, - spotlightTopic: { - fontSize: 20, - marginBottom: 5, - letterSpacing: 0, - fontWeight: 100, - }, - spotlightSubject: { - fontSize: 20, - }, - changelog: { - padding: [0, 60], - maxWidth: 700, - margin: [100, 'auto'], - height: 'auto', - - '& h3': { - fontSize: '24px', - margin: '1.5em 0 1em 0', - }, - '& li': { - marginBottom: '1em', - lineHeight: '1.4em', - }, - '& div': { - height: 'auto', - }, - }, -}); - -@inject('stores', 'actions') @injectSheet(styles) @observer -class AnnouncementScreen extends Component { - static propTypes = { - classes: PropTypes.object.isRequired, - stores: PropTypes.shape({ - ui: PropTypes.instanceOf(UIStore).isRequired, - }).isRequired, - actions: PropTypes.shape({ - app: PropTypes.instanceOf(AppStore).isRequired, - }).isRequired, - }; - - static contextTypes = { - intl: intlShape, - }; - - render() { - const { classes, stores, actions } = this.props; - const { intl } = this.context; - const { changelog, announcement } = announcementsStore; - const themeImage = stores.ui.isDarkThemeActive ? 'dark' : 'light'; - return ( -
- {announcement && ( -
-
-

{announcement.main.headline}

-

{announcement.main.subHeadline}

-
-
- -
-
-
- {(announcement.main.cta.label || announcement.main.cta.href) && ( -
-
- )} -
-
-
- {announcement.spotlight && ( -
-
-

{announcement.spotlight.title}

-

{announcement.spotlight.subject}

-
-
-
-
-
-
-
- )} -
- )} - {changelog && ( -
-

- {intl.formatMessage(messages.headline, { - version: announcementsStore.targetVersion, - })} -

-
-
- )} -
- ); - } -} - -export default AnnouncementScreen; diff --git a/src/features/announcements/constants.js b/src/features/announcements/constants.js deleted file mode 100644 index 284226fdf..000000000 --- a/src/features/announcements/constants.js +++ /dev/null @@ -1,5 +0,0 @@ -export const ANNOUNCEMENTS_ROUTES = { - TARGET: '/announcements/:id', -}; - -export const GA_CATEGORY_ANNOUNCEMENTS = 'Announcements'; diff --git a/src/features/announcements/index.js b/src/features/announcements/index.js deleted file mode 100644 index 19930c5b1..000000000 --- a/src/features/announcements/index.js +++ /dev/null @@ -1,29 +0,0 @@ -import { reaction } from 'mobx'; -import { AnnouncementsStore } from './store'; - -const debug = require('debug')('Ferdi:feature:announcements'); - -export const GA_CATEGORY_ANNOUNCEMENTS = 'Announcements'; - -export const announcementsStore = new AnnouncementsStore(); - -export default function initAnnouncements(stores, actions) { - const { features } = stores; - - // Toggle announcement feature - reaction( - () => ( - features.features.isAnnouncementsEnabled - ), - (isEnabled) => { - if (isEnabled) { - debug('Initializing `announcements` feature'); - announcementsStore.start(stores, actions); - } else if (announcementsStore.isFeatureActive) { - debug('Disabling `announcements` feature'); - announcementsStore.stop(); - } - }, - { fireImmediately: true }, - ); -} diff --git a/src/features/announcements/store.js b/src/features/announcements/store.js deleted file mode 100644 index 794d20142..000000000 --- a/src/features/announcements/store.js +++ /dev/null @@ -1,148 +0,0 @@ -import { - action, - computed, - observable, -} from 'mobx'; -import semver from 'semver'; -import localStorage from 'mobx-localstorage'; - -import { FeatureStore } from '../utils/FeatureStore'; -import { ANNOUNCEMENTS_ROUTES } from './constants'; -import { getAnnouncementRequest, getChangelogRequest, getCurrentVersionRequest } from './api'; -import { announcementActions } from './actions'; -import { createActionBindings } from '../utils/ActionBinding'; -import { createReactions } from '../../stores/lib/Reaction'; -import { matchRoute } from '../../helpers/routing-helpers'; -import { DEFAULT_APP_SETTINGS } from '../../environment'; - -const LOCAL_STORAGE_KEY = 'announcements'; - -const debug = require('debug')('Ferdi:feature:announcements:store'); - -export class AnnouncementsStore extends FeatureStore { - @observable targetVersion = null; - - @observable isFeatureActive = false; - - @computed get changelog() { - return getChangelogRequest.result; - } - - @computed get announcement() { - if (!this.stores || !getAnnouncementRequest.result) return null; - const { locale } = this.stores.app; - const announcement = getAnnouncementRequest.result; - // User locale - if (announcement[locale]) return announcement[locale]; - // Default locale - if (announcement[DEFAULT_APP_SETTINGS.fallbackLocale]) return announcement[DEFAULT_APP_SETTINGS.fallbackLocale]; - // No locales specified - return announcement; - } - - @computed get areNewsAvailable() { - const isChangelogAvailable = getChangelogRequest.wasExecuted && !!this.changelog; - const isAnnouncementAvailable = getAnnouncementRequest.wasExecuted && !!this.announcement; - return isChangelogAvailable || isAnnouncementAvailable; - } - - @computed get settings() { - return localStorage.getItem(LOCAL_STORAGE_KEY) || {}; - } - - @computed get lastSeenAnnouncementVersion() { - return this.settings.lastSeenAnnouncementVersion || null; - } - - @computed get currentVersion() { - return getCurrentVersionRequest.result; - } - - @computed get isNewUser() { - return this.stores.settings.stats.appStarts <= 1; - } - - @computed get isAnnouncementShown() { - const { router } = this.stores; - return router.location.pathname.includes('/announcements'); - } - - async start(stores, actions) { - debug('AnnouncementsStore::start'); - this.stores = stores; - this.actions = actions; - getCurrentVersionRequest.execute(); - - this._registerActions(createActionBindings([ - [announcementActions.show, this._showAnnouncement], - ])); - - this._reactions = createReactions([ - this._showAnnouncementOnRouteMatch, - this._showAnnouncementToUsersWhoUpdatedApp, - this._fetchAnnouncements, - ]); - this._registerReactions(this._reactions); - this.isFeatureActive = true; - } - - stop() { - super.stop(); - debug('AnnouncementsStore::stop'); - this.isFeatureActive = false; - } - - // ======= HELPERS ======= // - - _updateSettings = (changes) => { - localStorage.setItem(LOCAL_STORAGE_KEY, { - ...this.settings, - ...changes, - }); - }; - - // ======= ACTIONS ======= // - - @action _showAnnouncement = ({ targetVersion } = {}) => { - const { router } = this.stores; - this.targetVersion = targetVersion || this.currentVersion; - this._updateSettings({ - lastSeenAnnouncementVersion: this.currentVersion, - }); - const targetRoute = `/announcements/${this.targetVersion}`; - if (router.location.pathname !== targetRoute) { - this.stores.router.push(targetRoute); - } - }; - - // ======= REACTIONS ======== - - _showAnnouncementToUsersWhoUpdatedApp = () => { - const { announcement, isNewUser } = this; - // Check if there is an announcement and don't show announcements to new users - if (!announcement || isNewUser) return; - - // Check if the user has already used current version (= has seen the announcement) - const { currentVersion, lastSeenAnnouncementVersion } = this; - if (semver.gt(currentVersion, lastSeenAnnouncementVersion || '0.0.0')) { - debug(`${currentVersion} > ${lastSeenAnnouncementVersion}: announcement is shown`); - this._showAnnouncement(); - } - }; - - _fetchAnnouncements = () => { - const targetVersion = this.targetVersion || this.currentVersion; - if (!targetVersion) return; - getChangelogRequest.reset().execute(targetVersion); - getAnnouncementRequest.reset().execute(targetVersion); - }; - - _showAnnouncementOnRouteMatch = () => { - const { router } = this.stores; - const match = matchRoute(ANNOUNCEMENTS_ROUTES.TARGET, router.location.pathname); - if (match) { - const targetVersion = match.id; - this._showAnnouncement({ targetVersion }); - } - } -} diff --git a/src/features/todos/store.js b/src/features/todos/store.js index f283c1e59..ec06c279d 100644 --- a/src/features/todos/store.js +++ b/src/features/todos/store.js @@ -1,9 +1,5 @@ import { ThemeType } from '@meetfranz/theme'; -import { - computed, - action, - observable, -} from 'mobx'; +import { computed, action, observable } from 'mobx'; import localStorage from 'mobx-localstorage'; import { todoActions } from './actions'; @@ -44,12 +40,13 @@ export default class TodoStore extends FeatureStore { } @computed get isTodosPanelForceHidden() { - const { isAnnouncementShown } = this.stores.announcements; - return !this.isFeatureEnabledByUser || isAnnouncementShown; + return !this.isFeatureEnabledByUser; } @computed get isTodosPanelVisible() { - if (this.settings.isTodosPanelVisible === undefined) return DEFAULT_TODOS_VISIBLE; + if (this.settings.isTodosPanelVisible === undefined) { + return DEFAULT_TODOS_VISIBLE; + } return this.settings.isTodosPanelVisible; } @@ -66,7 +63,10 @@ export default class TodoStore extends FeatureStore { } @computed get isUsingPredefinedTodoServer() { - return this.stores && this.stores.settings.app.predefinedTodoServer !== CUSTOM_TODO_SERVICE; + return ( + this.stores && + this.stores.settings.app.predefinedTodoServer !== CUSTOM_TODO_SERVICE + ); } @computed get todoUrl() { @@ -79,12 +79,17 @@ export default class TodoStore extends FeatureStore { } @computed get isTodoUrlValid() { - return !this.isUsingPredefinedTodoServer || isValidExternalURL(this.todoUrl); + return ( + !this.isUsingPredefinedTodoServer || isValidExternalURL(this.todoUrl) + ); } @computed get todoRecipeId() { - if (this.isFeatureEnabledByUser && this.isUsingPredefinedTodoServer - && this.todoUrl in TODO_SERVICE_RECIPE_IDS) { + if ( + this.isFeatureEnabledByUser && + this.isUsingPredefinedTodoServer && + this.todoUrl in TODO_SERVICE_RECIPE_IDS + ) { return TODO_SERVICE_RECIPE_IDS[this.todoUrl]; } return null; @@ -99,16 +104,21 @@ export default class TodoStore extends FeatureStore { // ACTIONS - this._registerActions(createActionBindings([ - [todoActions.resize, this._resize], - [todoActions.toggleTodosPanel, this._toggleTodosPanel], - [todoActions.setTodosWebview, this._setTodosWebview], - [todoActions.handleHostMessage, this._handleHostMessage], - [todoActions.handleClientMessage, this._handleClientMessage], - [todoActions.toggleTodosFeatureVisibility, this._toggleTodosFeatureVisibility], - [todoActions.openDevTools, this._openDevTools], - [todoActions.reload, this._reload], - ])); + this._registerActions( + createActionBindings([ + [todoActions.resize, this._resize], + [todoActions.toggleTodosPanel, this._toggleTodosPanel], + [todoActions.setTodosWebview, this._setTodosWebview], + [todoActions.handleHostMessage, this._handleHostMessage], + [todoActions.handleClientMessage, this._handleClientMessage], + [ + todoActions.toggleTodosFeatureVisibility, + this._toggleTodosFeatureVisibility, + ], + [todoActions.openDevTools, this._openDevTools], + [todoActions.reload, this._reload], + ]), + ); // REACTIONS @@ -133,7 +143,7 @@ export default class TodoStore extends FeatureStore { // ========== PRIVATE METHODS ========= // - _updateSettings = (changes) => { + _updateSettings = changes => { localStorage.setItem('todos', { ...this.settings, ...changes, @@ -162,7 +172,7 @@ export default class TodoStore extends FeatureStore { } }; - @action _handleHostMessage = (message) => { + @action _handleHostMessage = message => { debug('_handleHostMessage', message); if (message.action === 'todos:create') { this.webview.send(IPC.TODOS_HOST_CHANNEL, message); @@ -172,11 +182,18 @@ export default class TodoStore extends FeatureStore { @action _handleClientMessage = ({ channel, message = {} }) => { debug('_handleClientMessage', channel, message); switch (message.action) { - case 'todos:initialized': this._onTodosClientInitialized(); break; - case 'todos:goToService': this._goToService(message.data); break; + case 'todos:initialized': + this._onTodosClientInitialized(); + break; + case 'todos:goToService': + this._goToService(message.data); + break; default: debug('Other message received', channel, message); - console.log('this.stores.services.isTodosServiceAdded', this.stores.services.isTodosServiceAdded); + console.log( + 'this.stores.services.isTodosServiceAdded', + this.stores.services.isTodosServiceAdded, + ); if (this.stores.services.isTodosServiceAdded) { this.actions.service.handleIPCMessage({ serviceId: this.stores.services.isTodosServiceAdded.id, @@ -189,7 +206,7 @@ export default class TodoStore extends FeatureStore { _handleNewWindowEvent = ({ url }) => { this.actions.app.openExternalUrl({ url }); - } + }; @action _toggleTodosFeatureVisibility = () => { debug('_toggleTodosFeatureVisibility'); @@ -204,14 +221,14 @@ export default class TodoStore extends FeatureStore { const webview = document.querySelector('#todos-panel webview'); if (webview) webview.openDevTools(); - } + }; _reload = () => { debug('_reload'); const webview = document.querySelector('#todos-panel webview'); if (webview) webview.reload(); - } + }; // Todos client message handlers @@ -291,5 +308,5 @@ export default class TodoStore extends FeatureStore { }); } } - } + }; } diff --git a/src/features/workspaces/components/WorkspacesDashboard.js b/src/features/workspaces/components/WorkspacesDashboard.js index 8319d3bc6..5f34204f1 100644 --- a/src/features/workspaces/components/WorkspacesDashboard.js +++ b/src/features/workspaces/components/WorkspacesDashboard.js @@ -20,7 +20,7 @@ const messages = defineMessages({ }, noServicesAdded: { id: 'settings.workspaces.noWorkspacesAdded', - defaultMessage: '!!!You haven\'t created any workspaces yet.', + defaultMessage: "!!!You haven't created any workspaces yet.", }, workspacesRequestFailed: { id: 'settings.workspaces.workspacesRequestFailed', @@ -61,9 +61,6 @@ const styles = () => ({ appear: { height: 'auto', }, - announcementHeadline: { - marginBottom: 0, - }, teaserImage: { width: 250, margin: [-8, 0, 0, 20], @@ -71,7 +68,9 @@ const styles = () => ({ }, }); -@inject('stores') @injectSheet(styles) @observer +@inject('stores') +@injectSheet(styles) +@observer class WorkspacesDashboard extends Component { static propTypes = { classes: PropTypes.object.isRequired, @@ -108,7 +107,6 @@ class WorkspacesDashboard extends Component {

{intl.formatMessage(messages.headline)}

- {/* ===== Workspace updated info ===== */} {updateWorkspaceRequest.wasExecuted && updateWorkspaceRequest.result && ( @@ -175,11 +173,11 @@ class WorkspacesDashboard extends Component { {/* ===== Workspaces list ===== */} - {workspaces.map((workspace) => ( + {workspaces.map(workspace => ( onWorkspaceClick(w)} + onItemClick={w => onWorkspaceClick(w)} /> ))} diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 7aff45503..537aa7236 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json @@ -5,39 +5,39 @@ "defaultMessage": "!!!A new update for Ferdi is available.", "end": { "column": 3, - "line": 12 + "line": 13 }, "file": "src/components/AppUpdateInfoBar.js", "id": "infobar.updateAvailable", "start": { "column": 19, - "line": 9 + "line": 10 } }, { "defaultMessage": "!!!Changelog", "end": { "column": 3, - "line": 16 + "line": 17 }, "file": "src/components/AppUpdateInfoBar.js", "id": "infobar.buttonChangelog", "start": { "column": 13, - "line": 13 + "line": 14 } }, { "defaultMessage": "!!!Restart & install update", "end": { "column": 3, - "line": 20 + "line": 21 }, "file": "src/components/AppUpdateInfoBar.js", "id": "infobar.buttonInstallUpdate", "start": { "column": 23, - "line": 17 + "line": 18 } } ], @@ -4959,24 +4959,6 @@ ], "path": "src/containers/settings/EditUserScreen.json" }, - { - "descriptors": [ - { - "defaultMessage": "!!!Changes in Ferdi {version}", - "end": { - "column": 3, - "line": 23 - }, - "file": "src/features/announcements/components/AnnouncementScreen.js", - "id": "feature.announcements.changelog.headline", - "start": { - "column": 12, - "line": 20 - } - } - ], - "path": "src/features/announcements/components/AnnouncementScreen.json" - }, { "descriptors": [ { @@ -5898,949 +5880,936 @@ "defaultMessage": "!!!Edit", "end": { "column": 3, - "line": 22 + "line": 35 }, "file": "src/lib/Menu.js", "id": "menu.edit", "start": { "column": 8, - "line": 19 + "line": 32 } }, { "defaultMessage": "!!!Undo", "end": { "column": 3, - "line": 26 + "line": 39 }, "file": "src/lib/Menu.js", "id": "menu.edit.undo", "start": { "column": 8, - "line": 23 + "line": 36 } }, { "defaultMessage": "!!!Redo", "end": { "column": 3, - "line": 30 + "line": 43 }, "file": "src/lib/Menu.js", "id": "menu.edit.redo", "start": { "column": 8, - "line": 27 + "line": 40 } }, { "defaultMessage": "!!!Cut", "end": { "column": 3, - "line": 34 + "line": 47 }, "file": "src/lib/Menu.js", "id": "menu.edit.cut", "start": { "column": 7, - "line": 31 + "line": 44 } }, { "defaultMessage": "!!!Copy", "end": { "column": 3, - "line": 38 + "line": 51 }, "file": "src/lib/Menu.js", "id": "menu.edit.copy", "start": { "column": 8, - "line": 35 + "line": 48 } }, { "defaultMessage": "!!!Paste", "end": { "column": 3, - "line": 42 + "line": 55 }, "file": "src/lib/Menu.js", "id": "menu.edit.paste", "start": { "column": 9, - "line": 39 + "line": 52 } }, { "defaultMessage": "!!!Paste And Match Style", "end": { "column": 3, - "line": 46 + "line": 59 }, "file": "src/lib/Menu.js", "id": "menu.edit.pasteAndMatchStyle", "start": { "column": 22, - "line": 43 + "line": 56 } }, { "defaultMessage": "!!!Delete", "end": { "column": 3, - "line": 50 + "line": 63 }, "file": "src/lib/Menu.js", "id": "menu.edit.delete", "start": { "column": 10, - "line": 47 + "line": 60 } }, { "defaultMessage": "!!!Select All", "end": { "column": 3, - "line": 54 + "line": 67 }, "file": "src/lib/Menu.js", "id": "menu.edit.selectAll", "start": { "column": 13, - "line": 51 + "line": 64 } }, { "defaultMessage": "!!!Find in Page", "end": { "column": 3, - "line": 58 + "line": 71 }, "file": "src/lib/Menu.js", "id": "menu.edit.findInPage", "start": { "column": 14, - "line": 55 + "line": 68 } }, { "defaultMessage": "!!!Speech", "end": { "column": 3, - "line": 62 + "line": 75 }, "file": "src/lib/Menu.js", "id": "menu.edit.speech", "start": { "column": 10, - "line": 59 + "line": 72 } }, { "defaultMessage": "!!!Start Speaking", "end": { "column": 3, - "line": 66 + "line": 79 }, "file": "src/lib/Menu.js", "id": "menu.edit.startSpeaking", "start": { "column": 17, - "line": 63 + "line": 76 } }, { "defaultMessage": "!!!Stop Speaking", "end": { "column": 3, - "line": 70 + "line": 83 }, "file": "src/lib/Menu.js", "id": "menu.edit.stopSpeaking", "start": { "column": 16, - "line": 67 + "line": 80 } }, { "defaultMessage": "!!!Start Dictation", "end": { "column": 3, - "line": 74 + "line": 87 }, "file": "src/lib/Menu.js", "id": "menu.edit.startDictation", "start": { "column": 18, - "line": 71 + "line": 84 } }, { "defaultMessage": "!!!Emoji & Symbols", "end": { "column": 3, - "line": 78 + "line": 91 }, "file": "src/lib/Menu.js", "id": "menu.edit.emojiSymbols", "start": { "column": 16, - "line": 75 + "line": 88 } }, { "defaultMessage": "!!!Open Quick Switch", "end": { "column": 3, - "line": 82 + "line": 95 }, "file": "src/lib/Menu.js", "id": "menu.view.openQuickSwitch", "start": { "column": 19, - "line": 79 + "line": 92 } }, { "defaultMessage": "!!!Back", "end": { "column": 3, - "line": 86 + "line": 99 }, "file": "src/lib/Menu.js", "id": "menu.view.back", "start": { "column": 8, - "line": 83 + "line": 96 } }, { "defaultMessage": "!!!Forward", "end": { "column": 3, - "line": 90 + "line": 103 }, "file": "src/lib/Menu.js", "id": "menu.view.forward", "start": { "column": 11, - "line": 87 + "line": 100 } }, { "defaultMessage": "!!!Actual Size", "end": { "column": 3, - "line": 94 + "line": 107 }, "file": "src/lib/Menu.js", "id": "menu.view.resetZoom", "start": { "column": 13, - "line": 91 + "line": 104 } }, { "defaultMessage": "!!!Zoom In", "end": { "column": 3, - "line": 98 + "line": 111 }, "file": "src/lib/Menu.js", "id": "menu.view.zoomIn", "start": { "column": 10, - "line": 95 + "line": 108 } }, { "defaultMessage": "!!!Zoom Out", "end": { "column": 3, - "line": 102 + "line": 115 }, "file": "src/lib/Menu.js", "id": "menu.view.zoomOut", "start": { "column": 11, - "line": 99 + "line": 112 } }, { "defaultMessage": "!!!Toggle Full Screen", "end": { "column": 3, - "line": 106 + "line": 119 }, "file": "src/lib/Menu.js", "id": "menu.view.toggleFullScreen", "start": { "column": 20, - "line": 103 + "line": 116 } }, { "defaultMessage": "!!!Toggle Dark Mode", "end": { "column": 3, - "line": 110 + "line": 123 }, "file": "src/lib/Menu.js", "id": "menu.view.toggleDarkMode", "start": { "column": 18, - "line": 107 + "line": 120 } }, { "defaultMessage": "!!!Toggle Developer Tools", "end": { "column": 3, - "line": 114 + "line": 127 }, "file": "src/lib/Menu.js", "id": "menu.view.toggleDevTools", "start": { "column": 18, - "line": 111 + "line": 124 } }, { "defaultMessage": "!!!Toggle Todos Developer Tools", "end": { "column": 3, - "line": 118 + "line": 131 }, "file": "src/lib/Menu.js", "id": "menu.view.toggleTodosDevTools", "start": { "column": 23, - "line": 115 + "line": 128 } }, { "defaultMessage": "!!!Toggle Service Developer Tools", "end": { "column": 3, - "line": 122 + "line": 135 }, "file": "src/lib/Menu.js", "id": "menu.view.toggleServiceDevTools", "start": { "column": 25, - "line": 119 + "line": 132 } }, { "defaultMessage": "!!!Reload Service", "end": { "column": 3, - "line": 126 + "line": 139 }, "file": "src/lib/Menu.js", "id": "menu.view.reloadService", "start": { "column": 17, - "line": 123 + "line": 136 } }, { "defaultMessage": "!!!Reload Ferdi", "end": { "column": 3, - "line": 130 + "line": 143 }, "file": "src/lib/Menu.js", "id": "menu.view.reloadFerdi", "start": { "column": 15, - "line": 127 + "line": 140 } }, { "defaultMessage": "!!!Lock Ferdi", "end": { "column": 3, - "line": 134 + "line": 147 }, "file": "src/lib/Menu.js", "id": "menu.view.lockFerdi", "start": { "column": 13, - "line": 131 + "line": 144 } }, { "defaultMessage": "!!!Reload ToDos", "end": { "column": 3, - "line": 138 + "line": 151 }, "file": "src/lib/Menu.js", "id": "menu.view.reloadTodos", "start": { "column": 15, - "line": 135 + "line": 148 } }, { "defaultMessage": "!!!Minimize", "end": { "column": 3, - "line": 142 + "line": 155 }, "file": "src/lib/Menu.js", "id": "menu.window.minimize", "start": { "column": 12, - "line": 139 + "line": 152 } }, { "defaultMessage": "!!!Close", "end": { "column": 3, - "line": 146 + "line": 159 }, "file": "src/lib/Menu.js", "id": "menu.window.close", "start": { "column": 9, - "line": 143 + "line": 156 } }, { "defaultMessage": "!!!Learn More", "end": { "column": 3, - "line": 150 + "line": 163 }, "file": "src/lib/Menu.js", "id": "menu.help.learnMore", "start": { "column": 13, - "line": 147 + "line": 160 } }, { "defaultMessage": "!!!Changelog", "end": { "column": 3, - "line": 154 + "line": 167 }, "file": "src/lib/Menu.js", "id": "menu.help.changelog", "start": { "column": 13, - "line": 151 + "line": 164 } }, { "defaultMessage": "!!!Import/Export Configuration Data", "end": { "column": 3, - "line": 158 + "line": 171 }, "file": "src/lib/Menu.js", "id": "menu.help.importExportData", "start": { "column": 20, - "line": 155 + "line": 168 } }, { "defaultMessage": "!!!Support", "end": { "column": 3, - "line": 162 + "line": 175 }, "file": "src/lib/Menu.js", "id": "menu.help.support", "start": { "column": 11, - "line": 159 + "line": 172 } }, { "defaultMessage": "!!!Copy Debug Information", "end": { "column": 3, - "line": 166 + "line": 179 }, "file": "src/lib/Menu.js", "id": "menu.help.debugInfo", "start": { "column": 13, - "line": 163 + "line": 176 } }, { "defaultMessage": "!!!Publish Debug Information", "end": { "column": 3, - "line": 170 + "line": 183 }, "file": "src/lib/Menu.js", "id": "menu.help.publishDebugInfo", "start": { "column": 20, - "line": 167 + "line": 180 } }, { "defaultMessage": "!!!Ferdi Debug Information", "end": { "column": 3, - "line": 174 + "line": 187 }, "file": "src/lib/Menu.js", "id": "menu.help.debugInfoCopiedHeadline", "start": { "column": 27, - "line": 171 + "line": 184 } }, { "defaultMessage": "!!!Your Debug Information has been copied to your clipboard.", "end": { "column": 3, - "line": 178 + "line": 192 }, "file": "src/lib/Menu.js", "id": "menu.help.debugInfoCopiedBody", "start": { "column": 23, - "line": 175 + "line": 188 } }, { "defaultMessage": "!!!Unlock with Touch ID", "end": { "column": 3, - "line": 182 + "line": 196 }, "file": "src/lib/Menu.js", "id": "locked.touchId", "start": { "column": 11, - "line": 179 + "line": 193 } }, { "defaultMessage": "!!!unlock via Touch ID", "end": { "column": 3, - "line": 186 + "line": 200 }, "file": "src/lib/Menu.js", "id": "locked.touchIdPrompt", "start": { "column": 17, - "line": 183 + "line": 197 } }, { "defaultMessage": "!!!Terms of Service", "end": { "column": 3, - "line": 190 + "line": 204 }, "file": "src/lib/Menu.js", "id": "menu.help.tos", "start": { "column": 7, - "line": 187 + "line": 201 } }, { "defaultMessage": "!!!Privacy Statement", "end": { "column": 3, - "line": 194 + "line": 208 }, "file": "src/lib/Menu.js", "id": "menu.help.privacy", "start": { "column": 11, - "line": 191 + "line": 205 } }, { "defaultMessage": "!!!File", "end": { "column": 3, - "line": 198 + "line": 212 }, "file": "src/lib/Menu.js", "id": "menu.file", "start": { "column": 8, - "line": 195 + "line": 209 } }, { "defaultMessage": "!!!View", "end": { "column": 3, - "line": 202 + "line": 216 }, "file": "src/lib/Menu.js", "id": "menu.view", "start": { "column": 8, - "line": 199 + "line": 213 } }, { "defaultMessage": "!!!Services", "end": { "column": 3, - "line": 206 + "line": 220 }, "file": "src/lib/Menu.js", "id": "menu.services", "start": { "column": 12, - "line": 203 + "line": 217 } }, { "defaultMessage": "!!!Window", "end": { "column": 3, - "line": 210 + "line": 224 }, "file": "src/lib/Menu.js", "id": "menu.window", "start": { "column": 10, - "line": 207 + "line": 221 } }, { "defaultMessage": "!!!Help", "end": { "column": 3, - "line": 214 + "line": 228 }, "file": "src/lib/Menu.js", "id": "menu.help", "start": { "column": 8, - "line": 211 + "line": 225 } }, { "defaultMessage": "!!!About Ferdi", "end": { "column": 3, - "line": 218 + "line": 232 }, "file": "src/lib/Menu.js", "id": "menu.app.about", "start": { "column": 9, - "line": 215 - } - }, - { - "defaultMessage": "!!!What's new?", - "end": { - "column": 3, - "line": 222 - }, - "file": "src/lib/Menu.js", - "id": "menu.app.announcement", - "start": { - "column": 16, - "line": 219 + "line": 229 } }, { "defaultMessage": "!!!Settings", "end": { "column": 3, - "line": 226 + "line": 236 }, "file": "src/lib/Menu.js", "id": "menu.app.settings", "start": { "column": 12, - "line": 223 + "line": 233 } }, { "defaultMessage": "!!!Check for updates", "end": { "column": 3, - "line": 230 + "line": 240 }, "file": "src/lib/Menu.js", "id": "menu.app.checkForUpdates", "start": { "column": 19, - "line": 227 + "line": 237 } }, { "defaultMessage": "!!!Hide", "end": { "column": 3, - "line": 234 + "line": 244 }, "file": "src/lib/Menu.js", "id": "menu.app.hide", "start": { "column": 8, - "line": 231 + "line": 241 } }, { "defaultMessage": "!!!Hide Others", "end": { "column": 3, - "line": 238 + "line": 248 }, "file": "src/lib/Menu.js", "id": "menu.app.hideOthers", "start": { "column": 14, - "line": 235 + "line": 245 } }, { "defaultMessage": "!!!Unhide", "end": { "column": 3, - "line": 242 + "line": 252 }, "file": "src/lib/Menu.js", "id": "menu.app.unhide", "start": { "column": 10, - "line": 239 + "line": 249 } }, { "defaultMessage": "!!!Auto-hide menu bar", "end": { "column": 3, - "line": 246 + "line": 256 }, "file": "src/lib/Menu.js", "id": "menu.app.autohideMenuBar", "start": { "column": 19, - "line": 243 + "line": 253 } }, { "defaultMessage": "!!!Quit", "end": { "column": 3, - "line": 250 + "line": 260 }, "file": "src/lib/Menu.js", "id": "menu.app.quit", "start": { "column": 8, - "line": 247 + "line": 257 } }, { "defaultMessage": "!!!Add New Service...", "end": { "column": 3, - "line": 254 + "line": 264 }, "file": "src/lib/Menu.js", "id": "menu.services.addNewService", "start": { "column": 17, - "line": 251 + "line": 261 } }, { "defaultMessage": "!!!Add New Workspace...", "end": { "column": 3, - "line": 258 + "line": 268 }, "file": "src/lib/Menu.js", "id": "menu.workspaces.addNewWorkspace", "start": { "column": 19, - "line": 255 + "line": 265 } }, { "defaultMessage": "!!!Open workspace drawer", "end": { "column": 3, - "line": 262 + "line": 272 }, "file": "src/lib/Menu.js", "id": "menu.workspaces.openWorkspaceDrawer", "start": { "column": 23, - "line": 259 + "line": 269 } }, { "defaultMessage": "!!!Close workspace drawer", "end": { "column": 3, - "line": 266 + "line": 276 }, "file": "src/lib/Menu.js", "id": "menu.workspaces.closeWorkspaceDrawer", "start": { "column": 24, - "line": 263 + "line": 273 } }, { "defaultMessage": "!!!Activate next service...", "end": { "column": 3, - "line": 270 + "line": 280 }, "file": "src/lib/Menu.js", "id": "menu.services.setNextServiceActive", "start": { "column": 23, - "line": 267 + "line": 277 } }, { "defaultMessage": "!!!Activate previous service...", "end": { "column": 3, - "line": 274 + "line": 284 }, "file": "src/lib/Menu.js", "id": "menu.services.activatePreviousService", "start": { "column": 27, - "line": 271 + "line": 281 } }, { "defaultMessage": "!!!Disable notifications & audio", "end": { "column": 3, - "line": 278 + "line": 288 }, "file": "src/lib/Menu.js", "id": "sidebar.muteApp", "start": { "column": 11, - "line": 275 + "line": 285 } }, { "defaultMessage": "!!!Enable notifications & audio", "end": { "column": 3, - "line": 282 + "line": 292 }, "file": "src/lib/Menu.js", "id": "sidebar.unmuteApp", "start": { "column": 13, - "line": 279 + "line": 289 } }, { "defaultMessage": "!!!Workspaces", "end": { "column": 3, - "line": 286 + "line": 296 }, "file": "src/lib/Menu.js", "id": "menu.workspaces", "start": { "column": 14, - "line": 283 + "line": 293 } }, { "defaultMessage": "!!!Default", "end": { "column": 3, - "line": 290 + "line": 300 }, "file": "src/lib/Menu.js", "id": "menu.workspaces.defaultWorkspace", "start": { "column": 20, - "line": 287 + "line": 297 } }, { "defaultMessage": "!!!Todos", "end": { "column": 3, - "line": 294 + "line": 304 }, "file": "src/lib/Menu.js", "id": "menu.todos", "start": { "column": 9, - "line": 291 + "line": 301 } }, { "defaultMessage": "!!!Open Todos drawer", "end": { "column": 3, - "line": 298 + "line": 308 }, "file": "src/lib/Menu.js", "id": "menu.Todoss.openTodosDrawer", "start": { "column": 19, - "line": 295 + "line": 305 } }, { "defaultMessage": "!!!Close Todos drawer", "end": { "column": 3, - "line": 302 + "line": 312 }, "file": "src/lib/Menu.js", "id": "menu.Todoss.closeTodosDrawer", "start": { "column": 20, - "line": 299 + "line": 309 } }, { "defaultMessage": "!!!Enable Todos", "end": { "column": 3, - "line": 306 + "line": 316 }, "file": "src/lib/Menu.js", "id": "menu.todos.enableTodos", "start": { "column": 15, - "line": 303 + "line": 313 } }, { "defaultMessage": "!!!Home", "end": { "column": 3, - "line": 310 + "line": 320 }, "file": "src/lib/Menu.js", "id": "menu.services.goHome", "start": { "column": 17, - "line": 307 + "line": 317 } } ], diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index f7e3d662a..5c967bc82 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -10,7 +10,6 @@ "connectionLostBanner.cta": "Reload Service", "connectionLostBanner.informationLink": "What happened?", "connectionLostBanner.message": "Oh no! Ferdi lost the connection to {name}.", - "feature.announcements.changelog.headline": "Changes in Ferdi {version}", "feature.debugger.title": "Publish debugging information", "feature.nightlyBuilds.activate": "Activate", "feature.nightlyBuilds.cancel": "Cancel", @@ -76,7 +75,6 @@ "menu.Todoss.closeTodosDrawer": "Close Todos drawer", "menu.Todoss.openTodosDrawer": "Open Todos drawer", "menu.app.about": "About Ferdi", - "menu.app.announcement": "What's new?", "menu.app.autohideMenuBar": "Auto-hide menu bar", "menu.app.checkForUpdates": "Check for updates", "menu.app.hide": "Hide", @@ -461,4 +459,4 @@ "workspaceDrawer.workspaceFeatureInfo": "

Ferdi 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/i18n/messages/src/components/AppUpdateInfoBar.json b/src/i18n/messages/src/components/AppUpdateInfoBar.json index da801b548..b99eaff67 100644 --- a/src/i18n/messages/src/components/AppUpdateInfoBar.json +++ b/src/i18n/messages/src/components/AppUpdateInfoBar.json @@ -4,11 +4,11 @@ "defaultMessage": "!!!A new update for Ferdi is available.", "file": "src/components/AppUpdateInfoBar.js", "start": { - "line": 9, + "line": 10, "column": 19 }, "end": { - "line": 12, + "line": 13, "column": 3 } }, @@ -17,11 +17,11 @@ "defaultMessage": "!!!Changelog", "file": "src/components/AppUpdateInfoBar.js", "start": { - "line": 13, + "line": 14, "column": 13 }, "end": { - "line": 16, + "line": 17, "column": 3 } }, @@ -30,11 +30,11 @@ "defaultMessage": "!!!Restart & install update", "file": "src/components/AppUpdateInfoBar.js", "start": { - "line": 17, + "line": 18, "column": 23 }, "end": { - "line": 20, + "line": 21, "column": 3 } } diff --git a/src/i18n/messages/src/features/announcements/components/AnnouncementScreen.json b/src/i18n/messages/src/features/announcements/components/AnnouncementScreen.json deleted file mode 100644 index 6b94ff792..000000000 --- a/src/i18n/messages/src/features/announcements/components/AnnouncementScreen.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "id": "feature.announcements.changelog.headline", - "defaultMessage": "!!!Changes in Ferdi {version}", - "file": "src/features/announcements/components/AnnouncementScreen.js", - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 23, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/lib/Menu.json b/src/i18n/messages/src/lib/Menu.json index 373c3a64b..3799c9130 100644 --- a/src/i18n/messages/src/lib/Menu.json +++ b/src/i18n/messages/src/lib/Menu.json @@ -4,11 +4,11 @@ "defaultMessage": "!!!Edit", "file": "src/lib/Menu.js", "start": { - "line": 19, + "line": 32, "column": 8 }, "end": { - "line": 22, + "line": 35, "column": 3 } }, @@ -17,11 +17,11 @@ "defaultMessage": "!!!Undo", "file": "src/lib/Menu.js", "start": { - "line": 23, + "line": 36, "column": 8 }, "end": { - "line": 26, + "line": 39, "column": 3 } }, @@ -30,11 +30,11 @@ "defaultMessage": "!!!Redo", "file": "src/lib/Menu.js", "start": { - "line": 27, + "line": 40, "column": 8 }, "end": { - "line": 30, + "line": 43, "column": 3 } }, @@ -43,11 +43,11 @@ "defaultMessage": "!!!Cut", "file": "src/lib/Menu.js", "start": { - "line": 31, + "line": 44, "column": 7 }, "end": { - "line": 34, + "line": 47, "column": 3 } }, @@ -56,11 +56,11 @@ "defaultMessage": "!!!Copy", "file": "src/lib/Menu.js", "start": { - "line": 35, + "line": 48, "column": 8 }, "end": { - "line": 38, + "line": 51, "column": 3 } }, @@ -69,11 +69,11 @@ "defaultMessage": "!!!Paste", "file": "src/lib/Menu.js", "start": { - "line": 39, + "line": 52, "column": 9 }, "end": { - "line": 42, + "line": 55, "column": 3 } }, @@ -82,11 +82,11 @@ "defaultMessage": "!!!Paste And Match Style", "file": "src/lib/Menu.js", "start": { - "line": 43, + "line": 56, "column": 22 }, "end": { - "line": 46, + "line": 59, "column": 3 } }, @@ -95,11 +95,11 @@ "defaultMessage": "!!!Delete", "file": "src/lib/Menu.js", "start": { - "line": 47, + "line": 60, "column": 10 }, "end": { - "line": 50, + "line": 63, "column": 3 } }, @@ -108,11 +108,11 @@ "defaultMessage": "!!!Select All", "file": "src/lib/Menu.js", "start": { - "line": 51, + "line": 64, "column": 13 }, "end": { - "line": 54, + "line": 67, "column": 3 } }, @@ -121,11 +121,11 @@ "defaultMessage": "!!!Find in Page", "file": "src/lib/Menu.js", "start": { - "line": 55, + "line": 68, "column": 14 }, "end": { - "line": 58, + "line": 71, "column": 3 } }, @@ -134,11 +134,11 @@ "defaultMessage": "!!!Speech", "file": "src/lib/Menu.js", "start": { - "line": 59, + "line": 72, "column": 10 }, "end": { - "line": 62, + "line": 75, "column": 3 } }, @@ -147,11 +147,11 @@ "defaultMessage": "!!!Start Speaking", "file": "src/lib/Menu.js", "start": { - "line": 63, + "line": 76, "column": 17 }, "end": { - "line": 66, + "line": 79, "column": 3 } }, @@ -160,11 +160,11 @@ "defaultMessage": "!!!Stop Speaking", "file": "src/lib/Menu.js", "start": { - "line": 67, + "line": 80, "column": 16 }, "end": { - "line": 70, + "line": 83, "column": 3 } }, @@ -173,11 +173,11 @@ "defaultMessage": "!!!Start Dictation", "file": "src/lib/Menu.js", "start": { - "line": 71, + "line": 84, "column": 18 }, "end": { - "line": 74, + "line": 87, "column": 3 } }, @@ -186,11 +186,11 @@ "defaultMessage": "!!!Emoji & Symbols", "file": "src/lib/Menu.js", "start": { - "line": 75, + "line": 88, "column": 16 }, "end": { - "line": 78, + "line": 91, "column": 3 } }, @@ -199,11 +199,11 @@ "defaultMessage": "!!!Open Quick Switch", "file": "src/lib/Menu.js", "start": { - "line": 79, + "line": 92, "column": 19 }, "end": { - "line": 82, + "line": 95, "column": 3 } }, @@ -212,11 +212,11 @@ "defaultMessage": "!!!Back", "file": "src/lib/Menu.js", "start": { - "line": 83, + "line": 96, "column": 8 }, "end": { - "line": 86, + "line": 99, "column": 3 } }, @@ -225,11 +225,11 @@ "defaultMessage": "!!!Forward", "file": "src/lib/Menu.js", "start": { - "line": 87, + "line": 100, "column": 11 }, "end": { - "line": 90, + "line": 103, "column": 3 } }, @@ -238,11 +238,11 @@ "defaultMessage": "!!!Actual Size", "file": "src/lib/Menu.js", "start": { - "line": 91, + "line": 104, "column": 13 }, "end": { - "line": 94, + "line": 107, "column": 3 } }, @@ -251,11 +251,11 @@ "defaultMessage": "!!!Zoom In", "file": "src/lib/Menu.js", "start": { - "line": 95, + "line": 108, "column": 10 }, "end": { - "line": 98, + "line": 111, "column": 3 } }, @@ -264,11 +264,11 @@ "defaultMessage": "!!!Zoom Out", "file": "src/lib/Menu.js", "start": { - "line": 99, + "line": 112, "column": 11 }, "end": { - "line": 102, + "line": 115, "column": 3 } }, @@ -277,11 +277,11 @@ "defaultMessage": "!!!Toggle Full Screen", "file": "src/lib/Menu.js", "start": { - "line": 103, + "line": 116, "column": 20 }, "end": { - "line": 106, + "line": 119, "column": 3 } }, @@ -290,11 +290,11 @@ "defaultMessage": "!!!Toggle Dark Mode", "file": "src/lib/Menu.js", "start": { - "line": 107, + "line": 120, "column": 18 }, "end": { - "line": 110, + "line": 123, "column": 3 } }, @@ -303,11 +303,11 @@ "defaultMessage": "!!!Toggle Developer Tools", "file": "src/lib/Menu.js", "start": { - "line": 111, + "line": 124, "column": 18 }, "end": { - "line": 114, + "line": 127, "column": 3 } }, @@ -316,11 +316,11 @@ "defaultMessage": "!!!Toggle Todos Developer Tools", "file": "src/lib/Menu.js", "start": { - "line": 115, + "line": 128, "column": 23 }, "end": { - "line": 118, + "line": 131, "column": 3 } }, @@ -329,11 +329,11 @@ "defaultMessage": "!!!Toggle Service Developer Tools", "file": "src/lib/Menu.js", "start": { - "line": 119, + "line": 132, "column": 25 }, "end": { - "line": 122, + "line": 135, "column": 3 } }, @@ -342,11 +342,11 @@ "defaultMessage": "!!!Reload Service", "file": "src/lib/Menu.js", "start": { - "line": 123, + "line": 136, "column": 17 }, "end": { - "line": 126, + "line": 139, "column": 3 } }, @@ -355,11 +355,11 @@ "defaultMessage": "!!!Reload Ferdi", "file": "src/lib/Menu.js", "start": { - "line": 127, + "line": 140, "column": 15 }, "end": { - "line": 130, + "line": 143, "column": 3 } }, @@ -368,11 +368,11 @@ "defaultMessage": "!!!Lock Ferdi", "file": "src/lib/Menu.js", "start": { - "line": 131, + "line": 144, "column": 13 }, "end": { - "line": 134, + "line": 147, "column": 3 } }, @@ -381,11 +381,11 @@ "defaultMessage": "!!!Reload ToDos", "file": "src/lib/Menu.js", "start": { - "line": 135, + "line": 148, "column": 15 }, "end": { - "line": 138, + "line": 151, "column": 3 } }, @@ -394,11 +394,11 @@ "defaultMessage": "!!!Minimize", "file": "src/lib/Menu.js", "start": { - "line": 139, + "line": 152, "column": 12 }, "end": { - "line": 142, + "line": 155, "column": 3 } }, @@ -407,11 +407,11 @@ "defaultMessage": "!!!Close", "file": "src/lib/Menu.js", "start": { - "line": 143, + "line": 156, "column": 9 }, "end": { - "line": 146, + "line": 159, "column": 3 } }, @@ -420,11 +420,11 @@ "defaultMessage": "!!!Learn More", "file": "src/lib/Menu.js", "start": { - "line": 147, + "line": 160, "column": 13 }, "end": { - "line": 150, + "line": 163, "column": 3 } }, @@ -433,11 +433,11 @@ "defaultMessage": "!!!Changelog", "file": "src/lib/Menu.js", "start": { - "line": 151, + "line": 164, "column": 13 }, "end": { - "line": 154, + "line": 167, "column": 3 } }, @@ -446,11 +446,11 @@ "defaultMessage": "!!!Import/Export Configuration Data", "file": "src/lib/Menu.js", "start": { - "line": 155, + "line": 168, "column": 20 }, "end": { - "line": 158, + "line": 171, "column": 3 } }, @@ -459,11 +459,11 @@ "defaultMessage": "!!!Support", "file": "src/lib/Menu.js", "start": { - "line": 159, + "line": 172, "column": 11 }, "end": { - "line": 162, + "line": 175, "column": 3 } }, @@ -472,11 +472,11 @@ "defaultMessage": "!!!Copy Debug Information", "file": "src/lib/Menu.js", "start": { - "line": 163, + "line": 176, "column": 13 }, "end": { - "line": 166, + "line": 179, "column": 3 } }, @@ -485,11 +485,11 @@ "defaultMessage": "!!!Publish Debug Information", "file": "src/lib/Menu.js", "start": { - "line": 167, + "line": 180, "column": 20 }, "end": { - "line": 170, + "line": 183, "column": 3 } }, @@ -498,11 +498,11 @@ "defaultMessage": "!!!Ferdi Debug Information", "file": "src/lib/Menu.js", "start": { - "line": 171, + "line": 184, "column": 27 }, "end": { - "line": 174, + "line": 187, "column": 3 } }, @@ -511,11 +511,11 @@ "defaultMessage": "!!!Your Debug Information has been copied to your clipboard.", "file": "src/lib/Menu.js", "start": { - "line": 175, + "line": 188, "column": 23 }, "end": { - "line": 178, + "line": 192, "column": 3 } }, @@ -524,11 +524,11 @@ "defaultMessage": "!!!Unlock with Touch ID", "file": "src/lib/Menu.js", "start": { - "line": 179, + "line": 193, "column": 11 }, "end": { - "line": 182, + "line": 196, "column": 3 } }, @@ -537,11 +537,11 @@ "defaultMessage": "!!!unlock via Touch ID", "file": "src/lib/Menu.js", "start": { - "line": 183, + "line": 197, "column": 17 }, "end": { - "line": 186, + "line": 200, "column": 3 } }, @@ -550,11 +550,11 @@ "defaultMessage": "!!!Terms of Service", "file": "src/lib/Menu.js", "start": { - "line": 187, + "line": 201, "column": 7 }, "end": { - "line": 190, + "line": 204, "column": 3 } }, @@ -563,11 +563,11 @@ "defaultMessage": "!!!Privacy Statement", "file": "src/lib/Menu.js", "start": { - "line": 191, + "line": 205, "column": 11 }, "end": { - "line": 194, + "line": 208, "column": 3 } }, @@ -576,11 +576,11 @@ "defaultMessage": "!!!File", "file": "src/lib/Menu.js", "start": { - "line": 195, + "line": 209, "column": 8 }, "end": { - "line": 198, + "line": 212, "column": 3 } }, @@ -589,11 +589,11 @@ "defaultMessage": "!!!View", "file": "src/lib/Menu.js", "start": { - "line": 199, + "line": 213, "column": 8 }, "end": { - "line": 202, + "line": 216, "column": 3 } }, @@ -602,11 +602,11 @@ "defaultMessage": "!!!Services", "file": "src/lib/Menu.js", "start": { - "line": 203, + "line": 217, "column": 12 }, "end": { - "line": 206, + "line": 220, "column": 3 } }, @@ -615,11 +615,11 @@ "defaultMessage": "!!!Window", "file": "src/lib/Menu.js", "start": { - "line": 207, + "line": 221, "column": 10 }, "end": { - "line": 210, + "line": 224, "column": 3 } }, @@ -628,11 +628,11 @@ "defaultMessage": "!!!Help", "file": "src/lib/Menu.js", "start": { - "line": 211, + "line": 225, "column": 8 }, "end": { - "line": 214, + "line": 228, "column": 3 } }, @@ -641,24 +641,11 @@ "defaultMessage": "!!!About Ferdi", "file": "src/lib/Menu.js", "start": { - "line": 215, + "line": 229, "column": 9 }, "end": { - "line": 218, - "column": 3 - } - }, - { - "id": "menu.app.announcement", - "defaultMessage": "!!!What's new?", - "file": "src/lib/Menu.js", - "start": { - "line": 219, - "column": 16 - }, - "end": { - "line": 222, + "line": 232, "column": 3 } }, @@ -667,11 +654,11 @@ "defaultMessage": "!!!Settings", "file": "src/lib/Menu.js", "start": { - "line": 223, + "line": 233, "column": 12 }, "end": { - "line": 226, + "line": 236, "column": 3 } }, @@ -680,11 +667,11 @@ "defaultMessage": "!!!Check for updates", "file": "src/lib/Menu.js", "start": { - "line": 227, + "line": 237, "column": 19 }, "end": { - "line": 230, + "line": 240, "column": 3 } }, @@ -693,11 +680,11 @@ "defaultMessage": "!!!Hide", "file": "src/lib/Menu.js", "start": { - "line": 231, + "line": 241, "column": 8 }, "end": { - "line": 234, + "line": 244, "column": 3 } }, @@ -706,11 +693,11 @@ "defaultMessage": "!!!Hide Others", "file": "src/lib/Menu.js", "start": { - "line": 235, + "line": 245, "column": 14 }, "end": { - "line": 238, + "line": 248, "column": 3 } }, @@ -719,11 +706,11 @@ "defaultMessage": "!!!Unhide", "file": "src/lib/Menu.js", "start": { - "line": 239, + "line": 249, "column": 10 }, "end": { - "line": 242, + "line": 252, "column": 3 } }, @@ -732,11 +719,11 @@ "defaultMessage": "!!!Auto-hide menu bar", "file": "src/lib/Menu.js", "start": { - "line": 243, + "line": 253, "column": 19 }, "end": { - "line": 246, + "line": 256, "column": 3 } }, @@ -745,11 +732,11 @@ "defaultMessage": "!!!Quit", "file": "src/lib/Menu.js", "start": { - "line": 247, + "line": 257, "column": 8 }, "end": { - "line": 250, + "line": 260, "column": 3 } }, @@ -758,11 +745,11 @@ "defaultMessage": "!!!Add New Service...", "file": "src/lib/Menu.js", "start": { - "line": 251, + "line": 261, "column": 17 }, "end": { - "line": 254, + "line": 264, "column": 3 } }, @@ -771,11 +758,11 @@ "defaultMessage": "!!!Add New Workspace...", "file": "src/lib/Menu.js", "start": { - "line": 255, + "line": 265, "column": 19 }, "end": { - "line": 258, + "line": 268, "column": 3 } }, @@ -784,11 +771,11 @@ "defaultMessage": "!!!Open workspace drawer", "file": "src/lib/Menu.js", "start": { - "line": 259, + "line": 269, "column": 23 }, "end": { - "line": 262, + "line": 272, "column": 3 } }, @@ -797,11 +784,11 @@ "defaultMessage": "!!!Close workspace drawer", "file": "src/lib/Menu.js", "start": { - "line": 263, + "line": 273, "column": 24 }, "end": { - "line": 266, + "line": 276, "column": 3 } }, @@ -810,11 +797,11 @@ "defaultMessage": "!!!Activate next service...", "file": "src/lib/Menu.js", "start": { - "line": 267, + "line": 277, "column": 23 }, "end": { - "line": 270, + "line": 280, "column": 3 } }, @@ -823,11 +810,11 @@ "defaultMessage": "!!!Activate previous service...", "file": "src/lib/Menu.js", "start": { - "line": 271, + "line": 281, "column": 27 }, "end": { - "line": 274, + "line": 284, "column": 3 } }, @@ -836,11 +823,11 @@ "defaultMessage": "!!!Disable notifications & audio", "file": "src/lib/Menu.js", "start": { - "line": 275, + "line": 285, "column": 11 }, "end": { - "line": 278, + "line": 288, "column": 3 } }, @@ -849,11 +836,11 @@ "defaultMessage": "!!!Enable notifications & audio", "file": "src/lib/Menu.js", "start": { - "line": 279, + "line": 289, "column": 13 }, "end": { - "line": 282, + "line": 292, "column": 3 } }, @@ -862,11 +849,11 @@ "defaultMessage": "!!!Workspaces", "file": "src/lib/Menu.js", "start": { - "line": 283, + "line": 293, "column": 14 }, "end": { - "line": 286, + "line": 296, "column": 3 } }, @@ -875,11 +862,11 @@ "defaultMessage": "!!!Default", "file": "src/lib/Menu.js", "start": { - "line": 287, + "line": 297, "column": 20 }, "end": { - "line": 290, + "line": 300, "column": 3 } }, @@ -888,11 +875,11 @@ "defaultMessage": "!!!Todos", "file": "src/lib/Menu.js", "start": { - "line": 291, + "line": 301, "column": 9 }, "end": { - "line": 294, + "line": 304, "column": 3 } }, @@ -901,11 +888,11 @@ "defaultMessage": "!!!Open Todos drawer", "file": "src/lib/Menu.js", "start": { - "line": 295, + "line": 305, "column": 19 }, "end": { - "line": 298, + "line": 308, "column": 3 } }, @@ -914,11 +901,11 @@ "defaultMessage": "!!!Close Todos drawer", "file": "src/lib/Menu.js", "start": { - "line": 299, + "line": 309, "column": 20 }, "end": { - "line": 302, + "line": 312, "column": 3 } }, @@ -927,11 +914,11 @@ "defaultMessage": "!!!Enable Todos", "file": "src/lib/Menu.js", "start": { - "line": 303, + "line": 313, "column": 15 }, "end": { - "line": 306, + "line": 316, "column": 3 } }, @@ -940,11 +927,11 @@ "defaultMessage": "!!!Home", "file": "src/lib/Menu.js", "start": { - "line": 307, + "line": 317, "column": 17 }, "end": { - "line": 310, + "line": 320, "column": 3 } } diff --git a/src/internal-server/app/Controllers/Http/StaticController.js b/src/internal-server/app/Controllers/Http/StaticController.js index 28c5389a9..33e0e52d9 100644 --- a/src/internal-server/app/Controllers/Http/StaticController.js +++ b/src/internal-server/app/Controllers/Http/StaticController.js @@ -7,25 +7,14 @@ import { DEFAULT_FEATURES_CONFIG } from '../../../../config'; // TODO: This endpoint and associated code needs to be remoeved as cleanup class StaticController { // Enable all features - features({ - response, - }) { + features({ response }) { return response.send(DEFAULT_FEATURES_CONFIG); } // Return an empty array - emptyArray({ - response, - }) { + emptyArray({ response }) { return response.send([]); } - - // Show announcements - announcement({ - response, - }) { - return response.send({}); - } } export default StaticController; diff --git a/src/internal-server/start/routes.js b/src/internal-server/start/routes.js index b32b094ee..e75380ccd 100644 --- a/src/internal-server/start/routes.js +++ b/src/internal-server/start/routes.js @@ -25,12 +25,12 @@ const OnlyAllowFerdi = async ({ request, response }, next) => { }; // Health: Returning if all systems function correctly -Route.get('health', ({ - response, -}) => response.send({ - api: 'success', - db: 'success', -})).middleware(OnlyAllowFerdi); +Route.get('health', ({ response }) => + response.send({ + api: 'success', + db: 'success', + }), +).middleware(OnlyAllowFerdi); // API is grouped under '/v1/' route Route.group(() => { @@ -67,8 +67,9 @@ Route.group(() => { Route.get('features/:mode?', 'StaticController.features'); Route.get('services', 'StaticController.emptyArray'); Route.get('news', 'StaticController.emptyArray'); - Route.get('announcements/:version', 'StaticController.announcement'); -}).prefix(API_VERSION).middleware(OnlyAllowFerdi); +}) + .prefix(API_VERSION) + .middleware(OnlyAllowFerdi); Route.group(() => { Route.get('icon/:id', 'ServiceController.icon'); diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 5a99299c5..66447d551 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js @@ -2,12 +2,25 @@ import { clipboard } from 'electron'; import { app, Menu, dialog, systemPreferences } from '@electron/remote'; import { autorun, observable } from 'mobx'; import { defineMessages } from 'react-intl'; -import { CUSTOM_WEBSITE_RECIPE_ID, GITHUB_FERDI_URL, LIVE_API_FERDI_WEBSITE } from '../config'; import { - cmdOrCtrlShortcutKey, altKey, shiftKey, settingsShortcutKey, isLinux, isMac, aboutAppDetails, lockFerdiShortcutKey, todosToggleShortcutKey, workspaceToggleShortcutKey, addNewServiceShortcutKey, muteFerdiShortcutKey, + CUSTOM_WEBSITE_RECIPE_ID, + GITHUB_FERDI_URL, + LIVE_API_FERDI_WEBSITE, +} from '../config'; +import { + cmdOrCtrlShortcutKey, + altKey, + shiftKey, + settingsShortcutKey, + isLinux, + isMac, + aboutAppDetails, + lockFerdiShortcutKey, + todosToggleShortcutKey, + workspaceToggleShortcutKey, + addNewServiceShortcutKey, + muteFerdiShortcutKey, } from '../environment'; -import { announcementsStore } from '../features/announcements'; -import { announcementActions } from '../features/announcements/actions'; import { todosStore } from '../features/todos'; import { todoActions } from '../features/todos/actions'; import { workspaceActions } from '../features/workspaces/actions'; @@ -174,7 +187,8 @@ const menuItems = defineMessages({ }, debugInfoCopiedBody: { id: 'menu.help.debugInfoCopiedBody', - defaultMessage: '!!!Your Debug Information has been copied to your clipboard.', + defaultMessage: + '!!!Your Debug Information has been copied to your clipboard.', }, touchId: { id: 'locked.touchId', @@ -216,10 +230,6 @@ const menuItems = defineMessages({ id: 'menu.app.about', defaultMessage: '!!!About Ferdi', }, - announcement: { - id: 'menu.app.announcement', - defaultMessage: '!!!What\'s new?', - }, settings: { id: 'menu.app.settings', defaultMessage: '!!!Settings', @@ -513,44 +523,49 @@ const _titleBarTemplateFactory = (intl, locked) => [ submenu: [ { label: intl.formatMessage(menuItems.learnMore), - click() { openExternalUrl(LIVE_API_FERDI_WEBSITE, true); }, + click() { + openExternalUrl(LIVE_API_FERDI_WEBSITE, true); + }, }, { label: intl.formatMessage(menuItems.changelog), - click() { openExternalUrl(`${GITHUB_FERDI_URL}/ferdi/blob/develop/CHANGELOG.md`, true); }, + click() { + openExternalUrl( + `${GITHUB_FERDI_URL}/ferdi/blob/develop/CHANGELOG.md`, + true, + ); + }, }, { label: intl.formatMessage(menuItems.importExportData), - click() { openExternalUrl(apiBase(false), true); }, - enabled: !locked, - }, - { - type: 'separator', - }, - { - label: intl.formatMessage(menuItems.announcement), - click: () => { - announcementActions.show(); + click() { + openExternalUrl(apiBase(false), true); }, - enabled: !locked && window.ferdi.stores.user.isLoggedIn && announcementsStore.areNewsAvailable, + enabled: !locked, }, { type: 'separator', }, { label: intl.formatMessage(menuItems.support), - click() { openExternalUrl(`${LIVE_API_FERDI_WEBSITE}/contact`, true); }, + click() { + openExternalUrl(`${LIVE_API_FERDI_WEBSITE}/contact`, true); + }, }, { type: 'separator', }, { label: intl.formatMessage(menuItems.tos), - click() { openExternalUrl(`${termsBase()}/terms`, true); }, + click() { + openExternalUrl(`${termsBase()}/terms`, true); + }, }, { label: intl.formatMessage(menuItems.privacy), - click() { openExternalUrl(`${termsBase()}/privacy`, true); }, + click() { + openExternalUrl(`${termsBase()}/privacy`, true); + }, }, ], }, @@ -599,7 +614,8 @@ export default class FranzMenu { window.ferdi.actions.settings.update({ type: 'app', data: { - autohideMenuBar: !window.ferdi.stores.settings.app.autohideMenuBar, + autohideMenuBar: + !window.ferdi.stores.settings.app.autohideMenuBar, }, }); }, @@ -607,22 +623,28 @@ export default class FranzMenu { } if (!this.stores.settings.app.locked) { - tpl[1].submenu.push({ - type: 'separator', - }, { - label: intl.formatMessage(menuItems.toggleDevTools), - accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+I`, - click: (menuItem, browserWindow) => { - browserWindow.webContents.toggleDevTools(); + tpl[1].submenu.push( + { + type: 'separator', }, - }, { - label: intl.formatMessage(menuItems.toggleServiceDevTools), - accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+${altKey()}+I`, - click: () => { - this.actions.service.openDevToolsForActiveService(); + { + label: intl.formatMessage(menuItems.toggleDevTools), + accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+I`, + click: (menuItem, browserWindow) => { + browserWindow.webContents.toggleDevTools(); + }, }, - enabled: this.stores.user.isLoggedIn && this.stores.services.enabled.length > 0, - }); + { + label: intl.formatMessage(menuItems.toggleServiceDevTools), + accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+${altKey()}+I`, + click: () => { + this.actions.service.openDevToolsForActiveService(); + }, + enabled: + this.stores.user.isLoggedIn && + this.stores.services.enabled.length > 0, + }, + ); if (this.stores.features.features.isTodosEnabled) { tpl[1].submenu.push({ @@ -635,49 +657,62 @@ export default class FranzMenu { }); } - tpl[1].submenu.unshift({ - label: intl.formatMessage(menuItems.reloadService), - id: 'reloadService', // TODO: needed? - accelerator: `${cmdOrCtrlShortcutKey()}+R`, - click: () => { - if (this.stores.user.isLoggedIn - && this.stores.services.enabled.length > 0) { - if (this.stores.services.active.recipe.id === CUSTOM_WEBSITE_RECIPE_ID) { - this.stores.services.active.webview.reload(); + tpl[1].submenu.unshift( + { + label: intl.formatMessage(menuItems.reloadService), + id: 'reloadService', // TODO: needed? + accelerator: `${cmdOrCtrlShortcutKey()}+R`, + click: () => { + if ( + this.stores.user.isLoggedIn && + this.stores.services.enabled.length > 0 + ) { + if ( + this.stores.services.active.recipe.id === + CUSTOM_WEBSITE_RECIPE_ID + ) { + this.stores.services.active.webview.reload(); + } else { + this.actions.service.reloadActive(); + } } else { - this.actions.service.reloadActive(); + window.location.reload(); } - } else { + }, + }, + { + label: intl.formatMessage(menuItems.reloadFerdi), + accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+R`, + click: () => { window.location.reload(); - } + }, }, - }, { - label: intl.formatMessage(menuItems.reloadFerdi), - accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+R`, - click: () => { - window.location.reload(); + { + label: intl.formatMessage(menuItems.reloadTodos), + accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+${altKey()}+R`, + click: () => { + this.actions.todos.reload(); + }, }, - }, { - label: intl.formatMessage(menuItems.reloadTodos), - accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+${altKey()}+R`, - click: () => { - this.actions.todos.reload(); + { + type: 'separator', }, - }, { - type: 'separator', - }, { - label: intl.formatMessage(menuItems.lockFerdi), - accelerator: `${lockFerdiShortcutKey()}`, - enabled: this.stores.user.isLoggedIn && this.stores.settings.app.lockingFeatureEnabled, - click() { - actions.settings.update({ - type: 'app', - data: { - locked: true, - }, - }); + { + label: intl.formatMessage(menuItems.lockFerdi), + accelerator: `${lockFerdiShortcutKey()}`, + enabled: + this.stores.user.isLoggedIn && + this.stores.settings.app.lockingFeatureEnabled, + click() { + actions.settings.update({ + type: 'app', + data: { + locked: true, + }, + }); + }, }, - }); + ); if (serviceTpl.length > 0) { tpl[2].submenu = serviceTpl; @@ -691,26 +726,34 @@ export default class FranzMenu { tpl[4].submenu = this.todosMenu(); } } else { - const touchIdEnabled = isMac ? (this.stores.settings.app.useTouchIdToUnlock && systemPreferences.canPromptTouchID()) : false; + const touchIdEnabled = isMac + ? this.stores.settings.app.useTouchIdToUnlock && + systemPreferences.canPromptTouchID() + : false; - tpl[0].submenu.unshift({ - label: intl.formatMessage(menuItems.touchId), - accelerator: `${lockFerdiShortcutKey()}`, - visible: touchIdEnabled, - click() { - systemPreferences.promptTouchID(intl.formatMessage(menuItems.touchIdPrompt)).then(() => { - actions.settings.update({ - type: 'app', - data: { - locked: false, - }, - }); - }); + tpl[0].submenu.unshift( + { + label: intl.formatMessage(menuItems.touchId), + accelerator: `${lockFerdiShortcutKey()}`, + visible: touchIdEnabled, + click() { + systemPreferences + .promptTouchID(intl.formatMessage(menuItems.touchIdPrompt)) + .then(() => { + actions.settings.update({ + type: 'app', + data: { + locked: false, + }, + }); + }); + }, }, - }, { - type: 'separator', - visible: touchIdEnabled, - }); + { + type: 'separator', + visible: touchIdEnabled, + }, + ); } tpl.unshift({ @@ -838,9 +881,12 @@ export default class FranzMenu { }, ]; - tpl[tpl.length - 1].submenu.push({ - type: 'separator', - }, about); + tpl[tpl.length - 1].submenu.push( + { + type: 'separator', + }, + about, + ); } if (!this.stores.settings.app.locked) { @@ -856,9 +902,12 @@ export default class FranzMenu { tpl[5].submenu = this.todosMenu(); } - tpl[tpl.length - 1].submenu.push({ - type: 'separator', - }, ...this.debugMenu()); + tpl[tpl.length - 1].submenu.push( + { + type: 'separator', + }, + ...this.debugMenu(), + ); } this.currentTemplate = tpl; const menu = Menu.buildFromTemplate(tpl); @@ -872,73 +921,95 @@ export default class FranzMenu { const menu = []; const cmdAltShortcutsVisibile = !isLinux; - menu.push({ - label: intl.formatMessage(menuItems.addNewService), - accelerator: `${addNewServiceShortcutKey()}`, - click: () => { - this.actions.ui.openSettings({ path: 'recipes' }); + menu.push( + { + label: intl.formatMessage(menuItems.addNewService), + accelerator: `${addNewServiceShortcutKey()}`, + click: () => { + this.actions.ui.openSettings({ path: 'recipes' }); + }, }, - }, { - type: 'separator', - }, { - label: intl.formatMessage(menuItems.activateNextService), - accelerator: `${cmdOrCtrlShortcutKey()}+tab`, - click: () => this.actions.service.setActiveNext(), - visible: !cmdAltShortcutsVisibile, - }, { - label: intl.formatMessage(menuItems.activateNextService), - accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+right`, - click: () => this.actions.service.setActiveNext(), - visible: cmdAltShortcutsVisibile, - }, { - label: intl.formatMessage(menuItems.activatePreviousService), - accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+tab`, - click: () => this.actions.service.setActivePrev(), - visible: !cmdAltShortcutsVisibile, - }, { - label: intl.formatMessage(menuItems.activatePreviousService), - accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+left`, - click: () => this.actions.service.setActivePrev(), - visible: cmdAltShortcutsVisibile, - }, { - label: intl.formatMessage( - settings.all.app.isAppMuted ? menuItems.unmuteApp : menuItems.muteApp, - ).replace('&', '&&'), - accelerator: `${muteFerdiShortcutKey()}`, - click: () => this.actions.app.toggleMuteApp(), - }, { - type: 'separator', - }); - - services.allDisplayed.forEach((service, i) => (menu.push({ - label: this._getServiceName(service), - accelerator: i < 9 ? `${cmdOrCtrlShortcutKey()}+${i + 1}` : null, - type: 'radio', - checked: service.isActive, - click: () => { - this.actions.service.setActive({ serviceId: service.id }); - - if (isMac && i === 0) { - app.mainWindow.restore(); - } + { + type: 'separator', + }, + { + label: intl.formatMessage(menuItems.activateNextService), + accelerator: `${cmdOrCtrlShortcutKey()}+tab`, + click: () => this.actions.service.setActiveNext(), + visible: !cmdAltShortcutsVisibile, + }, + { + label: intl.formatMessage(menuItems.activateNextService), + accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+right`, + click: () => this.actions.service.setActiveNext(), + visible: cmdAltShortcutsVisibile, + }, + { + label: intl.formatMessage(menuItems.activatePreviousService), + accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+tab`, + click: () => this.actions.service.setActivePrev(), + visible: !cmdAltShortcutsVisibile, + }, + { + label: intl.formatMessage(menuItems.activatePreviousService), + accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+left`, + click: () => this.actions.service.setActivePrev(), + visible: cmdAltShortcutsVisibile, + }, + { + label: intl + .formatMessage( + settings.all.app.isAppMuted + ? menuItems.unmuteApp + : menuItems.muteApp, + ) + .replace('&', '&&'), + accelerator: `${muteFerdiShortcutKey()}`, + click: () => this.actions.app.toggleMuteApp(), + }, + { + type: 'separator', }, - }))); + ); - if (services.active && services.active.recipe.id === CUSTOM_WEBSITE_RECIPE_ID) { + services.allDisplayed.forEach((service, i) => menu.push({ - type: 'separator', - }, { - label: intl.formatMessage(menuItems.serviceGoHome), - accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+H`, - click: () => this.actions.service.reloadActive(), - }); + label: this._getServiceName(service), + accelerator: i < 9 ? `${cmdOrCtrlShortcutKey()}+${i + 1}` : null, + type: 'radio', + checked: service.isActive, + click: () => { + this.actions.service.setActive({ serviceId: service.id }); + + if (isMac && i === 0) { + app.mainWindow.restore(); + } + }, + }), + ); + + if ( + services.active && + services.active.recipe.id === CUSTOM_WEBSITE_RECIPE_ID + ) { + menu.push( + { + type: 'separator', + }, + { + label: intl.formatMessage(menuItems.serviceGoHome), + accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+H`, + click: () => this.actions.service.reloadActive(), + }, + ); } return menu; } workspacesMenu() { - const { workspaces, activeWorkspace, isWorkspaceDrawerOpen } = workspaceStore; + const { workspaces, activeWorkspace, isWorkspaceDrawerOpen } = + workspaceStore; const { intl } = window.ferdi; const menu = []; @@ -954,9 +1025,9 @@ export default class FranzMenu { // Open workspace drawer: if (!this.stores.settings.app.alwaysShowWorkspaces) { - const drawerLabel = ( - isWorkspaceDrawerOpen ? menuItems.closeWorkspaceDrawer : menuItems.openWorkspaceDrawer - ); + const drawerLabel = isWorkspaceDrawerOpen + ? menuItems.closeWorkspaceDrawer + : menuItems.openWorkspaceDrawer; menu.push({ label: intl.formatMessage(drawerLabel), accelerator: `${workspaceToggleShortcutKey()}`, @@ -983,15 +1054,18 @@ export default class FranzMenu { }); // Workspace items - workspaces.forEach((workspace, i) => menu.push({ - label: workspace.name, - accelerator: i < 9 ? `${cmdOrCtrlShortcutKey()}+${altKey()}+${i + 1}` : null, - type: 'radio', - checked: activeWorkspace ? workspace.id === activeWorkspace.id : false, - click: () => { - workspaceActions.activate({ workspace }); - }, - })); + workspaces.forEach((workspace, i) => + menu.push({ + label: workspace.name, + accelerator: + i < 9 ? `${cmdOrCtrlShortcutKey()}+${altKey()}+${i + 1}` : null, + type: 'radio', + checked: activeWorkspace ? workspace.id === activeWorkspace.id : false, + click: () => { + workspaceActions.activate({ workspace }); + }, + }), + ); return menu; } @@ -1001,7 +1075,9 @@ export default class FranzMenu { const { intl } = window.ferdi; const menu = []; - const drawerLabel = isTodosPanelVisible ? menuItems.closeTodosDrawer : menuItems.openTodosDrawer; + const drawerLabel = isTodosPanelVisible + ? menuItems.closeTodosDrawer + : menuItems.openTodosDrawer; menu.push({ label: intl.formatMessage(drawerLabel), @@ -1013,14 +1089,17 @@ export default class FranzMenu { }); if (!isFeatureEnabledByUser) { - menu.push({ - type: 'separator', - }, { - label: intl.formatMessage(menuItems.enableTodos), - click: () => { - todoActions.toggleTodosFeatureVisibility(); + menu.push( + { + type: 'separator', }, - }); + { + label: intl.formatMessage(menuItems.enableTodos), + click: () => { + todoActions.toggleTodosFeatureVisibility(); + }, + }, + ); } return menu; @@ -1029,28 +1108,31 @@ export default class FranzMenu { debugMenu() { const { intl } = window.ferdi; - return [{ - label: intl.formatMessage(menuItems.debugInfo), - click: () => { - const { debugInfo } = this.stores.app; + return [ + { + label: intl.formatMessage(menuItems.debugInfo), + click: () => { + const { debugInfo } = this.stores.app; - clipboard.write({ - text: JSON.stringify(debugInfo), - }); + clipboard.write({ + text: JSON.stringify(debugInfo), + }); - this.actions.app.notify({ - title: intl.formatMessage(menuItems.debugInfoCopiedHeadline), - options: { - body: intl.formatMessage(menuItems.debugInfoCopiedBody), - }, - }); + this.actions.app.notify({ + title: intl.formatMessage(menuItems.debugInfoCopiedHeadline), + options: { + body: intl.formatMessage(menuItems.debugInfoCopiedBody), + }, + }); + }, }, - }, { - label: intl.formatMessage(menuItems.publishDebugInfo), - click: () => { - window.ferdi.features.publishDebugInfo.state.isModalVisible = true; + { + label: intl.formatMessage(menuItems.publishDebugInfo), + click: () => { + window.ferdi.features.publishDebugInfo.state.isModalVisible = true; + }, }, - }]; + ]; } _getServiceName(service) { diff --git a/src/routes.js b/src/routes.js index d67ccee13..5af0c4db9 100644 --- a/src/routes.js +++ b/src/routes.js @@ -1,9 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { inject, observer } from 'mobx-react'; -import { - Router, Route, IndexRedirect, -} from 'react-router'; +import { Router, Route, IndexRedirect } from 'react-router'; import AppLayoutContainer from './containers/layout/AppLayoutContainer'; import SettingsWindow from './containers/settings/SettingsWindow'; @@ -29,38 +27,39 @@ import AuthLayoutContainer from './containers/auth/AuthLayoutContainer'; import WorkspacesScreen from './features/workspaces/containers/WorkspacesScreen'; import EditWorkspaceScreen from './features/workspaces/containers/EditWorkspaceScreen'; import { WORKSPACES_ROUTES } from './features/workspaces/constants'; -import AnnouncementScreen from './features/announcements/components/AnnouncementScreen'; -import { ANNOUNCEMENTS_ROUTES } from './features/announcements/constants'; import SettingsStore from './stores/SettingsStore'; -export default @inject('stores', 'actions') @observer class Routes extends Component { +export default +@inject('stores', 'actions') +@observer +class Routes extends Component { render() { - const { - locked, - lockingFeatureEnabled, - } = this.props.stores.settings.app; + const { locked, lockingFeatureEnabled } = this.props.stores.settings.app; const { history } = this.props; if (lockingFeatureEnabled && locked) { - return ( - - ); + return ; } return ( - - + - + diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index cb8c71268..469e7519e 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js @@ -48,7 +48,8 @@ const autoLauncher = new AutoLaunch({ path: executablePath, }); -const CATALINA_NOTIFICATION_HACK_KEY = '_temp_askedForCatalinaNotificationPermissions'; +const CATALINA_NOTIFICATION_HACK_KEY = + '_temp_askedForCatalinaNotificationPermissions'; export default class AppStore extends Store { updateStatusTypes = { @@ -92,8 +93,6 @@ export default class AppStore extends Store { @observable isFocused = true; - @observable nextAppReleaseVersion = null; - dictionaries = []; fetchDataInterval = null; @@ -175,7 +174,6 @@ export default class AppStore extends Store { ipcRenderer.on('autoUpdate', (event, data) => { if (data.available) { this.updateStatus = this.updateStatusTypes.AVAILABLE; - this.nextAppReleaseVersion = data.version; if (isMac) { app.dock.bounce(); } @@ -236,8 +234,8 @@ export default class AppStore extends Store { this.actions.service.resetLastPollTimer(); if ( - this.timeSuspensionStart.add(10, 'm').isBefore(moment()) - && this.stores.settings.app.get('reloadAfterResume') + this.timeSuspensionStart.add(10, 'm').isBefore(moment()) && + this.stores.settings.app.get('reloadAfterResume') ) { debug('Reloading services, user info and features'); @@ -283,15 +281,15 @@ export default class AppStore extends Store { ferdi: { version: ferdiVersion, electron: electronVersion, - installedRecipes: this.stores.recipes.all.map((recipe) => ({ + installedRecipes: this.stores.recipes.all.map(recipe => ({ id: recipe.id, version: recipe.version, })), - devRecipes: this.stores.recipePreviews.dev.map((recipe) => ({ + devRecipes: this.stores.recipePreviews.dev.map(recipe => ({ id: recipe.id, version: recipe.version, })), - services: this.stores.services.all.map((service) => ({ + services: this.stores.services.all.map(service => ({ id: service.id, recipe: service.recipe.id, isAttached: service.isAttached, @@ -302,7 +300,7 @@ export default class AppStore extends Store { isDarkModeEnabled: service.isDarkModeEnabled, })), messages: this.stores.globalError.messages, - workspaces: this.stores.workspaces.workspaces.map((workspace) => ({ + workspaces: this.stores.workspaces.workspaces.map(workspace => ({ id: workspace.id, services: workspace.services, })), @@ -315,9 +313,7 @@ export default class AppStore extends Store { } // Actions - @action _notify({ - title, options, notificationId, serviceId = null, - }) { + @action _notify({ title, options, notificationId, serviceId = null }) { if (this.stores.settings.all.app.isAppMuted) return; // TODO: is there a simple way to use blobs for notifications without storing them on disk? @@ -359,8 +355,8 @@ export default class AppStore extends Store { if (indicator === 0 && unreadIndirectMessageCount !== 0) { indicator = '•'; } else if ( - unreadDirectMessageCount === 0 - && unreadIndirectMessageCount === 0 + unreadDirectMessageCount === 0 && + unreadIndirectMessageCount === 0 ) { indicator = 0; } else { @@ -441,22 +437,25 @@ export default class AppStore extends Store { const clearAppCache = this.clearAppCacheRequest.execute(); const allServiceIds = await getServiceIdsFromPartitions(); const allOrphanedServiceIds = allServiceIds.filter( - (id) => !this.stores.services.all.find( - (s) => id.replace('service-', '') === s.id, - ), + id => + !this.stores.services.all.find( + s => id.replace('service-', '') === s.id, + ), ); try { await Promise.all( - allOrphanedServiceIds.map((id) => removeServicePartitionDirectory(id)), + allOrphanedServiceIds.map(id => removeServicePartitionDirectory(id)), ); } catch (ex) { console.log('Error while deleting service partition directory - ', ex); } await Promise.all( - this.stores.services.all.map((s) => this.actions.service.clearCache({ - serviceId: s.id, - })), + this.stores.services.all.map(s => + this.actions.service.clearCache({ + serviceId: s.id, + }), + ), ); await clearAppCache._promise; @@ -488,9 +487,9 @@ export default class AppStore extends Store { } if ( - locale - && Object.prototype.hasOwnProperty.call(locales, locale) - && locale !== this.locale + locale && + Object.prototype.hasOwnProperty.call(locales, locale) && + locale !== this.locale ) { this.locale = locale; } else if (!locale) { @@ -568,8 +567,8 @@ export default class AppStore extends Store { const dnd = await ipcRenderer.invoke('get-dnd'); debug('Do not disturb mode is', dnd); if ( - dnd !== this.stores.settings.all.app.isAppMuted - && !this.isSystemMuteOverridden + dnd !== this.stores.settings.all.app.isAppMuted && + !this.isSystemMuteOverridden ) { this.actions.app.muteApp({ isMuted: dnd, diff --git a/src/stores/FeaturesStore.js b/src/stores/FeaturesStore.js index 0dff2fda2..1d50dd714 100644 --- a/src/stores/FeaturesStore.js +++ b/src/stores/FeaturesStore.js @@ -1,8 +1,4 @@ -import { - computed, - observable, - runInAction, -} from 'mobx'; +import { computed, observable, runInAction } from 'mobx'; import Store from './lib/Store'; import CachedRequest from './lib/CachedRequest'; @@ -13,7 +9,6 @@ import workspaces from '../features/workspaces'; import quickSwitch from '../features/quickSwitch'; import nightlyBuilds from '../features/nightlyBuilds'; import publishDebugInfo from '../features/publishDebugInfo'; -import announcements from '../features/announcements'; import settingsWS from '../features/settingsWS'; import communityRecipes from '../features/communityRecipes'; import todos from '../features/todos'; @@ -22,11 +17,17 @@ import appearance from '../features/appearance'; import { DEFAULT_FEATURES_CONFIG } from '../config'; export default class FeaturesStore extends Store { - @observable defaultFeaturesRequest = new CachedRequest(this.api.features, 'default'); + @observable defaultFeaturesRequest = new CachedRequest( + this.api.features, + 'default', + ); - @observable featuresRequest = new CachedRequest(this.api.features, 'features'); + @observable featuresRequest = new CachedRequest( + this.api.features, + 'features', + ); - @observable features = ({ ...DEFAULT_FEATURES_CONFIG }); + @observable features = { ...DEFAULT_FEATURES_CONFIG }; async setup() { this.registerReactions([ @@ -39,7 +40,9 @@ export default class FeaturesStore extends Store { } @computed get anonymousFeatures() { - return this.defaultFeaturesRequest.execute().result || DEFAULT_FEATURES_CONFIG; + return ( + this.defaultFeaturesRequest.execute().result || DEFAULT_FEATURES_CONFIG + ); } _updateFeatures = () => { @@ -72,7 +75,6 @@ export default class FeaturesStore extends Store { quickSwitch(this.stores, this.actions); nightlyBuilds(this.stores, this.actions); publishDebugInfo(this.stores, this.actions); - announcements(this.stores, this.actions); settingsWS(this.stores, this.actions); communityRecipes(this.stores, this.actions); todos(this.stores, this.actions); diff --git a/src/stores/index.ts b/src/stores/index.ts index e980f2c5b..4cd4e92ea 100644 --- a/src/stores/index.ts +++ b/src/stores/index.ts @@ -10,7 +10,6 @@ import NewsStore from './NewsStore'; import RequestStore from './RequestStore'; import GlobalErrorStore from './GlobalErrorStore'; import { workspaceStore } from '../features/workspaces'; -import { announcementsStore } from '../features/announcements'; import { communityRecipesStore } from '../features/communityRecipes'; import { todosStore } from '../features/todos'; @@ -30,13 +29,12 @@ export default (api, actions, router) => { requests: new RequestStore(stores, api, actions), globalError: new GlobalErrorStore(stores, api, actions), workspaces: workspaceStore, - announcements: announcementsStore, communityRecipes: communityRecipesStore, todos: todosStore, }); // Initialize all stores - Object.keys(stores).forEach((name) => { + Object.keys(stores).forEach(name => { if (stores[name] && stores[name].initialize) { stores[name].initialize(); } -- cgit v1.2.3-54-g00ecf