From 4a537e890d95e8666985ce77df4c6327582332be Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Mon, 10 Dec 2018 17:15:37 +0100 Subject: basic setup for workspaces feature --- src/features/workspaces/store.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/features/workspaces/store.js (limited to 'src/features/workspaces/store.js') diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js new file mode 100644 index 000000000..4b4e729ed --- /dev/null +++ b/src/features/workspaces/store.js @@ -0,0 +1,29 @@ +import { observable, reaction } from 'mobx'; +import Store from '../../stores/lib/Store'; +import CachedRequest from '../../stores/lib/CachedRequest'; + +const debug = require('debug')('Franz:feature:workspaces'); + +export default class WorkspacesStore extends Store { + @observable allWorkspacesRequest = new CachedRequest(this.api, 'getUserWorkspaces'); + + constructor(stores, api, actions, state) { + super(stores, api, actions); + this.state = state; + } + + setup() { + debug('fetching user workspaces'); + this.allWorkspacesRequest.execute(); + + reaction( + () => this.allWorkspacesRequest.result, + workspaces => this.setWorkspaces(workspaces), + ); + } + + setWorkspaces = (workspaces) => { + debug('setting user workspaces', workspaces.slice()); + this.state.workspaces = workspaces; + }; +} -- cgit v1.2.3-70-g09d2 From 84755ddf8b8fb015ee2bfd70e9c4aa50d256f9d0 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Mon, 14 Jan 2019 17:11:27 +0100 Subject: basic setup of workspaces settings screen --- src/api/utils/auth.js | 24 ++++++++++ src/app.js | 2 + .../settings/workspaces/WorkspaceItem.js | 41 ++++++++++++++++ .../settings/workspaces/WorkspacesDashboard.js | 56 ++++++++++++++++++++++ src/containers/settings/WorkspacesScreen.js | 29 +++++++++++ src/environment.js | 1 + src/features/workspaces/api.js | 16 ++++--- src/features/workspaces/index.js | 10 ++-- src/features/workspaces/state.js | 12 +++++ src/features/workspaces/store.js | 15 ++++-- src/i18n/locales/en-US.json | 1 + src/models/Workspace.js | 25 ++++++++++ 12 files changed, 216 insertions(+), 16 deletions(-) create mode 100644 src/api/utils/auth.js create mode 100644 src/components/settings/workspaces/WorkspaceItem.js create mode 100644 src/components/settings/workspaces/WorkspacesDashboard.js create mode 100644 src/containers/settings/WorkspacesScreen.js create mode 100644 src/features/workspaces/state.js create mode 100644 src/models/Workspace.js (limited to 'src/features/workspaces/store.js') diff --git a/src/api/utils/auth.js b/src/api/utils/auth.js new file mode 100644 index 000000000..47ac94c19 --- /dev/null +++ b/src/api/utils/auth.js @@ -0,0 +1,24 @@ +import { remote } from 'electron'; +import localStorage from 'mobx-localstorage'; + +const { app } = remote; + +export const prepareAuthRequest = (options, auth = true) => { + const request = Object.assign(options, { + mode: 'cors', + headers: Object.assign({ + 'Content-Type': 'application/json', + 'X-Franz-Source': 'desktop', + 'X-Franz-Version': app.getVersion(), + 'X-Franz-platform': process.platform, + 'X-Franz-Timezone-Offset': new Date().getTimezoneOffset(), + 'X-Franz-System-Locale': app.getLocale(), + }, options.headers), + }); + + if (auth) { + request.headers.Authorization = `Bearer ${localStorage.getItem('authToken')}`; + } + + return request; +}; diff --git a/src/app.js b/src/app.js index 6660feb46..ee1b12939 100644 --- a/src/app.js +++ b/src/app.js @@ -39,6 +39,7 @@ import PricingScreen from './containers/auth/PricingScreen'; import InviteScreen from './containers/auth/InviteScreen'; import AuthLayoutContainer from './containers/auth/AuthLayoutContainer'; import SubscriptionPopupScreen from './containers/subscription/SubscriptionPopupScreen'; +import WorkspacesScreen from './containers/settings/WorkspacesScreen'; // Add Polyfills smoothScroll.polyfill(); @@ -75,6 +76,7 @@ window.addEventListener('load', () => { + diff --git a/src/components/settings/workspaces/WorkspaceItem.js b/src/components/settings/workspaces/WorkspaceItem.js new file mode 100644 index 000000000..82a578ebd --- /dev/null +++ b/src/components/settings/workspaces/WorkspaceItem.js @@ -0,0 +1,41 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { defineMessages, intlShape } from 'react-intl'; +import { observer } from 'mobx-react'; +import classnames from 'classnames'; +import Workspace from '../../../models/Workspace'; + +// const messages = defineMessages({}); + +@observer +class WorkspaceItem extends Component { + static propTypes = { + workspace: PropTypes.instanceOf(Workspace).isRequired, + }; + + static contextTypes = { + intl: intlShape, + }; + + render() { + const { workspace } = this.props; + // const { intl } = this.context; + + return ( + + console.log('go to workspace', workspace.name)} + > + {workspace.name} + + + ); + } +} + +export default WorkspaceItem; diff --git a/src/components/settings/workspaces/WorkspacesDashboard.js b/src/components/settings/workspaces/WorkspacesDashboard.js new file mode 100644 index 000000000..830f32f08 --- /dev/null +++ b/src/components/settings/workspaces/WorkspacesDashboard.js @@ -0,0 +1,56 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; +import { defineMessages, intlShape } from 'react-intl'; + +import Loader from '../../ui/Loader'; +import WorkspaceItem from './WorkspaceItem'; + +const messages = defineMessages({ + headline: { + id: 'settings.workspaces.headline', + defaultMessage: '!!!Your workspaces', + }, + noServicesAdded: { + id: 'settings.workspaces.noWorkspacesAdded', + defaultMessage: '!!!You haven\'t added any workspaces yet.', + }, +}); + +@observer +class WorkspacesDashboard extends Component { + static propTypes = { + workspaces: MobxPropTypes.arrayOrObservableArray.isRequired, + isLoading: PropTypes.bool.isRequired, + }; + + static contextTypes = { + intl: intlShape, + }; + + render() { + const { workspaces, isLoading } = this.props; + const { intl } = this.context; + + return ( +
+
+

{intl.formatMessage(messages.headline)}

+
+
+ {isLoading ? ( + + ) : ( + + + {workspaces.map(workspace => )} + +
+ )} +
+
+ ); + } +} + +export default WorkspacesDashboard; diff --git a/src/containers/settings/WorkspacesScreen.js b/src/containers/settings/WorkspacesScreen.js new file mode 100644 index 000000000..e767fdfbe --- /dev/null +++ b/src/containers/settings/WorkspacesScreen.js @@ -0,0 +1,29 @@ +import React, { Component } from 'react'; +import { observer } from 'mobx-react'; +import { gaPage } from '../../lib/analytics'; +import { state } from '../../features/workspaces/state'; + +import WorkspacesDashboard from '../../components/settings/workspaces/WorkspacesDashboard'; +import ErrorBoundary from '../../components/util/ErrorBoundary'; + +@observer +class WorkspacesScreen extends Component { + static propTypes = {}; + + componentDidMount() { + gaPage('Settings/Workspaces Dashboard'); + } + + render() { + return ( + + + + ); + } +} + +export default WorkspacesScreen; diff --git a/src/environment.js b/src/environment.js index 73b1c7ab2..d67fd6adb 100644 --- a/src/environment.js +++ b/src/environment.js @@ -28,3 +28,4 @@ if (!isDevMode || (isDevMode && useLiveAPI)) { } export const API = api; +export const API_VERSION = 'v1'; diff --git a/src/features/workspaces/api.js b/src/features/workspaces/api.js index 1ee2440fe..97badbd01 100644 --- a/src/features/workspaces/api.js +++ b/src/features/workspaces/api.js @@ -1,9 +1,13 @@ -// TODO: use real server instead -const workspaces = [ - { id: 'workspace-1', name: 'Private' }, - { id: 'workspace-2', name: 'Office' }, -]; +import { prepareAuthRequest } from '../../api/utils/auth'; +import { API, API_VERSION } from '../../environment'; export default { - getUserWorkspaces: () => Promise.resolve(workspaces), + getUserWorkspaces: async () => { + const url = `${API}/${API_VERSION}/workspace`; + const request = await window.fetch(url, prepareAuthRequest({ + method: 'GET', + })); + if (!request.ok) throw request; + return request.json(); + }, }; diff --git a/src/features/workspaces/index.js b/src/features/workspaces/index.js index b4cfd3c2d..50ac3b414 100644 --- a/src/features/workspaces/index.js +++ b/src/features/workspaces/index.js @@ -1,14 +1,11 @@ -import { observable, reaction } from 'mobx'; -import { merge } from 'lodash'; +import { reaction } from 'mobx'; import WorkspacesStore from './store'; import api from './api'; +import { state, resetState } from './state'; const debug = require('debug')('Franz:feature:workspaces'); let store = null; -const defaultState = { workspaces: [] }; - -export const state = observable(defaultState); export default function initWorkspaces(stores, actions) { const { features, user } = stores; @@ -27,8 +24,7 @@ export default function initWorkspaces(stores, actions) { debug('Disabling `workspaces` feature'); store.teardown(); store = null; - // Reset state to default - merge(state, defaultState); + resetState(); // Reset state to default } }, { diff --git a/src/features/workspaces/state.js b/src/features/workspaces/state.js new file mode 100644 index 000000000..ed3fe9f00 --- /dev/null +++ b/src/features/workspaces/state.js @@ -0,0 +1,12 @@ +import { observable } from 'mobx'; + +const defaultState = { + isLoading: false, + workspaces: [], +}; + +export const state = observable(defaultState); + +export function resetState() { + Object.assign(state, defaultState); +} diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 4b4e729ed..2b6d55cc7 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -1,6 +1,7 @@ import { observable, reaction } from 'mobx'; import Store from '../../stores/lib/Store'; import CachedRequest from '../../stores/lib/CachedRequest'; +import Workspace from '../../models/Workspace'; const debug = require('debug')('Franz:feature:workspaces'); @@ -18,12 +19,20 @@ export default class WorkspacesStore extends Store { reaction( () => this.allWorkspacesRequest.result, - workspaces => this.setWorkspaces(workspaces), + workspaces => this._setWorkspaces(workspaces), + ); + reaction( + () => this.allWorkspacesRequest.isExecuting, + isExecuting => this._setIsLoading(isExecuting), ); } - setWorkspaces = (workspaces) => { + _setWorkspaces = (workspaces) => { debug('setting user workspaces', workspaces.slice()); - this.state.workspaces = workspaces; + this.state.workspaces = workspaces.map(data => new Workspace(data)); + }; + + _setIsLoading = (isLoading) => { + this.state.isLoading = isLoading; }; } diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 1b869aff1..1652b5585 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -196,6 +196,7 @@ "settings.user.form.accountType.individual": "Individual", "settings.user.form.accountType.non-profit": "Non-Profit", "settings.user.form.accountType.company": "Company", + "settings.workspaces.headline": "Your workspaces", "subscription.type.free": "free", "subscription.type.month": "month", "subscription.type.year": "year", diff --git a/src/models/Workspace.js b/src/models/Workspace.js new file mode 100644 index 000000000..ede2710dc --- /dev/null +++ b/src/models/Workspace.js @@ -0,0 +1,25 @@ +import { observable } from 'mobx'; + +export default class Workspace { + id = null; + + @observable name = null; + + @observable order = null; + + @observable services = []; + + @observable userId = null; + + constructor(data) { + if (!data.id) { + throw Error('Workspace requires Id'); + } + + this.id = data.id; + this.name = data.name; + this.order = data.order; + this.services = data.services; + this.userId = data.userId; + } +} -- cgit v1.2.3-70-g09d2 From e6da59b728bf44342428531a2c7e4024829234ed Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Mon, 14 Jan 2019 19:01:46 +0100 Subject: setup logic to display workspace edit page --- src/actions/index.js | 2 + src/actions/workspace.js | 8 ++++ src/app.js | 2 + .../settings/workspaces/WorkspaceItem.js | 5 +- .../settings/workspaces/WorkspacesDashboard.js | 4 +- src/containers/settings/EditWorkspaceScreen.js | 54 ++++++++++++++++++++++ src/containers/settings/WorkspacesScreen.js | 16 +++++-- src/features/workspaces/state.js | 1 + src/features/workspaces/store.js | 32 ++++++++++++- 9 files changed, 116 insertions(+), 8 deletions(-) create mode 100644 src/actions/workspace.js create mode 100644 src/containers/settings/EditWorkspaceScreen.js (limited to 'src/features/workspaces/store.js') diff --git a/src/actions/index.js b/src/actions/index.js index 59acabb0b..a406af50a 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -11,6 +11,7 @@ import payment from './payment'; import news from './news'; import settings from './settings'; import requests from './requests'; +import workspace from './workspace'; const actions = Object.assign({}, { service, @@ -23,6 +24,7 @@ const actions = Object.assign({}, { news, settings, requests, + workspace, }); export default defineActions(actions, PropTypes.checkPropTypes); diff --git a/src/actions/workspace.js b/src/actions/workspace.js new file mode 100644 index 000000000..ab07a96c0 --- /dev/null +++ b/src/actions/workspace.js @@ -0,0 +1,8 @@ +import PropTypes from 'prop-types'; +import Workspace from '../models/Workspace'; + +export default { + edit: { + workspace: PropTypes.instanceOf(Workspace).isRequired, + }, +}; diff --git a/src/app.js b/src/app.js index ee1b12939..320ba679f 100644 --- a/src/app.js +++ b/src/app.js @@ -40,6 +40,7 @@ import InviteScreen from './containers/auth/InviteScreen'; import AuthLayoutContainer from './containers/auth/AuthLayoutContainer'; import SubscriptionPopupScreen from './containers/subscription/SubscriptionPopupScreen'; import WorkspacesScreen from './containers/settings/WorkspacesScreen'; +import EditWorkspaceScreen from './containers/settings/EditWorkspaceScreen'; // Add Polyfills smoothScroll.polyfill(); @@ -77,6 +78,7 @@ window.addEventListener('load', () => { + diff --git a/src/components/settings/workspaces/WorkspaceItem.js b/src/components/settings/workspaces/WorkspaceItem.js index a71e6583d..088d61433 100644 --- a/src/components/settings/workspaces/WorkspaceItem.js +++ b/src/components/settings/workspaces/WorkspaceItem.js @@ -11,6 +11,7 @@ import Workspace from '../../../models/Workspace'; class WorkspaceItem extends Component { static propTypes = { workspace: PropTypes.instanceOf(Workspace).isRequired, + onItemClick: PropTypes.func.isRequired, }; static contextTypes = { @@ -18,7 +19,7 @@ class WorkspaceItem extends Component { }; render() { - const { workspace } = this.props; + const { workspace, onItemClick } = this.props; // const { intl } = this.context; return ( @@ -29,7 +30,7 @@ class WorkspaceItem extends Component { > console.log('go to workspace', workspace.name)} + onClick={() => onItemClick(workspace)} > {workspace.name} diff --git a/src/components/settings/workspaces/WorkspacesDashboard.js b/src/components/settings/workspaces/WorkspacesDashboard.js index b286adc68..a5bb18cb7 100644 --- a/src/components/settings/workspaces/WorkspacesDashboard.js +++ b/src/components/settings/workspaces/WorkspacesDashboard.js @@ -22,6 +22,7 @@ class WorkspacesDashboard extends Component { static propTypes = { workspaces: MobxPropTypes.arrayOrObservableArray.isRequired, isLoading: PropTypes.bool.isRequired, + onWorkspaceClick: PropTypes.func.isRequired, }; static contextTypes = { @@ -29,7 +30,7 @@ class WorkspacesDashboard extends Component { }; render() { - const { workspaces, isLoading } = this.props; + const { workspaces, isLoading, onWorkspaceClick } = this.props; const { intl } = this.context; return ( @@ -47,6 +48,7 @@ class WorkspacesDashboard extends Component { onWorkspaceClick(w)} /> ))} diff --git a/src/containers/settings/EditWorkspaceScreen.js b/src/containers/settings/EditWorkspaceScreen.js new file mode 100644 index 000000000..665b405bd --- /dev/null +++ b/src/containers/settings/EditWorkspaceScreen.js @@ -0,0 +1,54 @@ +import React, { Component } from 'react'; +import { inject, observer } from 'mobx-react'; +import { defineMessages, intlShape } from 'react-intl'; +import Form from '../../lib/Form'; +import ErrorBoundary from '../../components/util/ErrorBoundary'; +import { gaPage } from '../../lib/analytics'; +import { state } from '../../features/workspaces/state'; + +const messages = defineMessages({ + name: { + id: 'settings.workspace.form.name', + defaultMessage: '!!!Name', + }, +}); + +@inject('stores', 'actions') @observer +class EditWorkspaceScreen extends Component { + static contextTypes = { + intl: intlShape, + }; + + componentDidMount() { + gaPage('Settings/Workspace/Edit'); + } + + prepareForm(workspace) { + const { intl } = this.context; + const config = { + fields: { + name: { + label: intl.formatMessage(messages.name), + placeholder: intl.formatMessage(messages.name), + value: workspace.name, + }, + }, + }; + return new Form(config); + } + + render() { + const { workspaceBeingEdited } = state; + if (!workspaceBeingEdited) return null; + + // const form = this.prepareForm(workspaceBeingEdited); + + return ( + +
{workspaceBeingEdited.name}
+
+ ); + } +} + +export default EditWorkspaceScreen; diff --git a/src/containers/settings/WorkspacesScreen.js b/src/containers/settings/WorkspacesScreen.js index e767fdfbe..5e91f7673 100644 --- a/src/containers/settings/WorkspacesScreen.js +++ b/src/containers/settings/WorkspacesScreen.js @@ -1,25 +1,33 @@ import React, { Component } from 'react'; -import { observer } from 'mobx-react'; +import { inject, observer } from 'mobx-react'; +import PropTypes from 'prop-types'; import { gaPage } from '../../lib/analytics'; import { state } from '../../features/workspaces/state'; - import WorkspacesDashboard from '../../components/settings/workspaces/WorkspacesDashboard'; import ErrorBoundary from '../../components/util/ErrorBoundary'; -@observer +@inject('actions') @observer class WorkspacesScreen extends Component { - static propTypes = {}; + static propTypes = { + actions: PropTypes.shape({ + workspace: PropTypes.shape({ + edit: PropTypes.func.isRequired, + }), + }).isRequired, + }; componentDidMount() { gaPage('Settings/Workspaces Dashboard'); } render() { + const { workspace } = this.props.actions; return ( workspace.edit({ workspace: w })} /> ); diff --git a/src/features/workspaces/state.js b/src/features/workspaces/state.js index ed3fe9f00..f938c1470 100644 --- a/src/features/workspaces/state.js +++ b/src/features/workspaces/state.js @@ -3,6 +3,7 @@ import { observable } from 'mobx'; const defaultState = { isLoading: false, workspaces: [], + workspaceBeingEdited: null, }; export const state = observable(defaultState); diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 2b6d55cc7..aab66708b 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -2,6 +2,7 @@ import { observable, reaction } from 'mobx'; import Store from '../../stores/lib/Store'; import CachedRequest from '../../stores/lib/CachedRequest'; import Workspace from '../../models/Workspace'; +import { matchRoute } from '../../helpers/routing-helpers'; const debug = require('debug')('Franz:feature:workspaces'); @@ -14,17 +15,40 @@ export default class WorkspacesStore extends Store { } setup() { - debug('fetching user workspaces'); + debug('fetching workspaces'); this.allWorkspacesRequest.execute(); + /** + * Update the state workspaces array when workspaces request has results. + */ reaction( () => this.allWorkspacesRequest.result, workspaces => this._setWorkspaces(workspaces), ); + /** + * Update the loading state when workspace request is executing. + */ reaction( () => this.allWorkspacesRequest.isExecuting, isExecuting => this._setIsLoading(isExecuting), ); + /** + * Update the state with the workspace to be edited when route matches. + */ + reaction( + () => ({ + pathname: this.stores.router.location.pathname, + workspaces: this.state.workspaces, + }), + ({ pathname }) => { + const match = matchRoute('/settings/workspaces/edit/:id', pathname); + if (match) { + this.state.workspaceBeingEdited = this._getWorkspaceById(match.id); + } + }, + ); + + this.actions.workspace.edit.listen(this._edit); } _setWorkspaces = (workspaces) => { @@ -35,4 +59,10 @@ export default class WorkspacesStore extends Store { _setIsLoading = (isLoading) => { this.state.isLoading = isLoading; }; + + _getWorkspaceById = id => this.state.workspaces.find(w => w.id === id); + + _edit = ({ workspace }) => { + this.stores.router.push(`/settings/workspaces/edit/${workspace.id}`); + } } -- cgit v1.2.3-70-g09d2 From 90399cc608b93cc185b0ee1c9b79e98cfafb8bc1 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Tue, 12 Feb 2019 14:59:58 +0100 Subject: consolidate workspace feature for further development --- src/actions/index.js | 2 +- src/actions/workspace.js | 8 --- src/app.js | 4 +- .../settings/workspaces/WorkspaceItem.js | 42 ------------ .../settings/workspaces/WorkspacesDashboard.js | 63 ------------------ src/containers/settings/EditWorkspaceScreen.js | 54 ---------------- src/containers/settings/WorkspacesScreen.js | 37 ----------- src/features/workspaces/actions.js | 8 +++ .../workspaces/components/WorkspaceItem.js | 42 ++++++++++++ .../workspaces/components/WorkspacesDashboard.js | 63 ++++++++++++++++++ .../workspaces/containers/EditWorkspaceScreen.js | 75 ++++++++++++++++++++++ .../workspaces/containers/WorkspacesScreen.js | 37 +++++++++++ src/features/workspaces/models/Workspace.js | 25 ++++++++ src/features/workspaces/store.js | 2 +- .../workspaces/styles/workspaces-table.scss | 53 +++++++++++++++ src/i18n/locales/de.json | 3 + src/i18n/locales/en-US.json | 1 + src/models/Workspace.js | 25 -------- src/styles/main.scss | 2 +- src/styles/workspace-table.scss | 53 --------------- 20 files changed, 312 insertions(+), 287 deletions(-) delete mode 100644 src/actions/workspace.js delete mode 100644 src/components/settings/workspaces/WorkspaceItem.js delete mode 100644 src/components/settings/workspaces/WorkspacesDashboard.js delete mode 100644 src/containers/settings/EditWorkspaceScreen.js delete mode 100644 src/containers/settings/WorkspacesScreen.js create mode 100644 src/features/workspaces/actions.js create mode 100644 src/features/workspaces/components/WorkspaceItem.js create mode 100644 src/features/workspaces/components/WorkspacesDashboard.js create mode 100644 src/features/workspaces/containers/EditWorkspaceScreen.js create mode 100644 src/features/workspaces/containers/WorkspacesScreen.js create mode 100644 src/features/workspaces/models/Workspace.js create mode 100644 src/features/workspaces/styles/workspaces-table.scss delete mode 100644 src/models/Workspace.js delete mode 100644 src/styles/workspace-table.scss (limited to 'src/features/workspaces/store.js') diff --git a/src/actions/index.js b/src/actions/index.js index a406af50a..45e6da515 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -11,7 +11,7 @@ import payment from './payment'; import news from './news'; import settings from './settings'; import requests from './requests'; -import workspace from './workspace'; +import workspace from '../features/workspaces/actions'; const actions = Object.assign({}, { service, diff --git a/src/actions/workspace.js b/src/actions/workspace.js deleted file mode 100644 index ab07a96c0..000000000 --- a/src/actions/workspace.js +++ /dev/null @@ -1,8 +0,0 @@ -import PropTypes from 'prop-types'; -import Workspace from '../models/Workspace'; - -export default { - edit: { - workspace: PropTypes.instanceOf(Workspace).isRequired, - }, -}; diff --git a/src/app.js b/src/app.js index 320ba679f..d3b540f62 100644 --- a/src/app.js +++ b/src/app.js @@ -39,8 +39,8 @@ import PricingScreen from './containers/auth/PricingScreen'; import InviteScreen from './containers/auth/InviteScreen'; import AuthLayoutContainer from './containers/auth/AuthLayoutContainer'; import SubscriptionPopupScreen from './containers/subscription/SubscriptionPopupScreen'; -import WorkspacesScreen from './containers/settings/WorkspacesScreen'; -import EditWorkspaceScreen from './containers/settings/EditWorkspaceScreen'; +import WorkspacesScreen from './features/workspaces/containers/WorkspacesScreen'; +import EditWorkspaceScreen from './features/workspaces/containers/EditWorkspaceScreen'; // Add Polyfills smoothScroll.polyfill(); diff --git a/src/components/settings/workspaces/WorkspaceItem.js b/src/components/settings/workspaces/WorkspaceItem.js deleted file mode 100644 index 088d61433..000000000 --- a/src/components/settings/workspaces/WorkspaceItem.js +++ /dev/null @@ -1,42 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { intlShape } from 'react-intl'; -import { observer } from 'mobx-react'; -import classnames from 'classnames'; -import Workspace from '../../../models/Workspace'; - -// const messages = defineMessages({}); - -@observer -class WorkspaceItem extends Component { - static propTypes = { - workspace: PropTypes.instanceOf(Workspace).isRequired, - onItemClick: PropTypes.func.isRequired, - }; - - static contextTypes = { - intl: intlShape, - }; - - render() { - const { workspace, onItemClick } = this.props; - // const { intl } = this.context; - - return ( - - onItemClick(workspace)} - > - {workspace.name} - - - ); - } -} - -export default WorkspaceItem; diff --git a/src/components/settings/workspaces/WorkspacesDashboard.js b/src/components/settings/workspaces/WorkspacesDashboard.js deleted file mode 100644 index a5bb18cb7..000000000 --- a/src/components/settings/workspaces/WorkspacesDashboard.js +++ /dev/null @@ -1,63 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; -import { defineMessages, intlShape } from 'react-intl'; - -import Loader from '../../ui/Loader'; -import WorkspaceItem from './WorkspaceItem'; - -const messages = defineMessages({ - headline: { - id: 'settings.workspaces.headline', - defaultMessage: '!!!Your workspaces', - }, - noServicesAdded: { - id: 'settings.workspaces.noWorkspacesAdded', - defaultMessage: '!!!You haven\'t added any workspaces yet.', - }, -}); - -@observer -class WorkspacesDashboard extends Component { - static propTypes = { - workspaces: MobxPropTypes.arrayOrObservableArray.isRequired, - isLoading: PropTypes.bool.isRequired, - onWorkspaceClick: PropTypes.func.isRequired, - }; - - static contextTypes = { - intl: intlShape, - }; - - render() { - const { workspaces, isLoading, onWorkspaceClick } = this.props; - const { intl } = this.context; - - return ( -
-
-

{intl.formatMessage(messages.headline)}

-
-
- {isLoading ? ( - - ) : ( - - - {workspaces.map(workspace => ( - onWorkspaceClick(w)} - /> - ))} - -
- )} -
-
- ); - } -} - -export default WorkspacesDashboard; diff --git a/src/containers/settings/EditWorkspaceScreen.js b/src/containers/settings/EditWorkspaceScreen.js deleted file mode 100644 index 665b405bd..000000000 --- a/src/containers/settings/EditWorkspaceScreen.js +++ /dev/null @@ -1,54 +0,0 @@ -import React, { Component } from 'react'; -import { inject, observer } from 'mobx-react'; -import { defineMessages, intlShape } from 'react-intl'; -import Form from '../../lib/Form'; -import ErrorBoundary from '../../components/util/ErrorBoundary'; -import { gaPage } from '../../lib/analytics'; -import { state } from '../../features/workspaces/state'; - -const messages = defineMessages({ - name: { - id: 'settings.workspace.form.name', - defaultMessage: '!!!Name', - }, -}); - -@inject('stores', 'actions') @observer -class EditWorkspaceScreen extends Component { - static contextTypes = { - intl: intlShape, - }; - - componentDidMount() { - gaPage('Settings/Workspace/Edit'); - } - - prepareForm(workspace) { - const { intl } = this.context; - const config = { - fields: { - name: { - label: intl.formatMessage(messages.name), - placeholder: intl.formatMessage(messages.name), - value: workspace.name, - }, - }, - }; - return new Form(config); - } - - render() { - const { workspaceBeingEdited } = state; - if (!workspaceBeingEdited) return null; - - // const form = this.prepareForm(workspaceBeingEdited); - - return ( - -
{workspaceBeingEdited.name}
-
- ); - } -} - -export default EditWorkspaceScreen; diff --git a/src/containers/settings/WorkspacesScreen.js b/src/containers/settings/WorkspacesScreen.js deleted file mode 100644 index 5e91f7673..000000000 --- a/src/containers/settings/WorkspacesScreen.js +++ /dev/null @@ -1,37 +0,0 @@ -import React, { Component } from 'react'; -import { inject, observer } from 'mobx-react'; -import PropTypes from 'prop-types'; -import { gaPage } from '../../lib/analytics'; -import { state } from '../../features/workspaces/state'; -import WorkspacesDashboard from '../../components/settings/workspaces/WorkspacesDashboard'; -import ErrorBoundary from '../../components/util/ErrorBoundary'; - -@inject('actions') @observer -class WorkspacesScreen extends Component { - static propTypes = { - actions: PropTypes.shape({ - workspace: PropTypes.shape({ - edit: PropTypes.func.isRequired, - }), - }).isRequired, - }; - - componentDidMount() { - gaPage('Settings/Workspaces Dashboard'); - } - - render() { - const { workspace } = this.props.actions; - return ( - - workspace.edit({ workspace: w })} - /> - - ); - } -} - -export default WorkspacesScreen; diff --git a/src/features/workspaces/actions.js b/src/features/workspaces/actions.js new file mode 100644 index 000000000..30866af96 --- /dev/null +++ b/src/features/workspaces/actions.js @@ -0,0 +1,8 @@ +import PropTypes from 'prop-types'; +import Workspace from './models/Workspace'; + +export default { + edit: { + workspace: PropTypes.instanceOf(Workspace).isRequired, + }, +}; diff --git a/src/features/workspaces/components/WorkspaceItem.js b/src/features/workspaces/components/WorkspaceItem.js new file mode 100644 index 000000000..b2c2a4830 --- /dev/null +++ b/src/features/workspaces/components/WorkspaceItem.js @@ -0,0 +1,42 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { intlShape } from 'react-intl'; +import { observer } from 'mobx-react'; +import classnames from 'classnames'; +import Workspace from '../models/Workspace'; + +// const messages = defineMessages({}); + +@observer +class WorkspaceItem extends Component { + static propTypes = { + workspace: PropTypes.instanceOf(Workspace).isRequired, + onItemClick: PropTypes.func.isRequired, + }; + + static contextTypes = { + intl: intlShape, + }; + + render() { + const { workspace, onItemClick } = this.props; + // const { intl } = this.context; + + return ( + + onItemClick(workspace)} + > + {workspace.name} + + + ); + } +} + +export default WorkspaceItem; diff --git a/src/features/workspaces/components/WorkspacesDashboard.js b/src/features/workspaces/components/WorkspacesDashboard.js new file mode 100644 index 000000000..2a8b3a5ee --- /dev/null +++ b/src/features/workspaces/components/WorkspacesDashboard.js @@ -0,0 +1,63 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; +import { defineMessages, intlShape } from 'react-intl'; + +import Loader from '../../../components/ui/Loader'; +import WorkspaceItem from './WorkspaceItem'; + +const messages = defineMessages({ + headline: { + id: 'settings.workspaces.headline', + defaultMessage: '!!!Your workspaces', + }, + noServicesAdded: { + id: 'settings.workspaces.noWorkspacesAdded', + defaultMessage: '!!!You haven\'t added any workspaces yet.', + }, +}); + +@observer +class WorkspacesDashboard extends Component { + static propTypes = { + workspaces: MobxPropTypes.arrayOrObservableArray.isRequired, + isLoading: PropTypes.bool.isRequired, + onWorkspaceClick: PropTypes.func.isRequired, + }; + + static contextTypes = { + intl: intlShape, + }; + + render() { + const { workspaces, isLoading, onWorkspaceClick } = this.props; + const { intl } = this.context; + + return ( +
+
+

{intl.formatMessage(messages.headline)}

+
+
+ {isLoading ? ( + + ) : ( + + + {workspaces.map(workspace => ( + onWorkspaceClick(w)} + /> + ))} + +
+ )} +
+
+ ); + } +} + +export default WorkspacesDashboard; diff --git a/src/features/workspaces/containers/EditWorkspaceScreen.js b/src/features/workspaces/containers/EditWorkspaceScreen.js new file mode 100644 index 000000000..d8c52f586 --- /dev/null +++ b/src/features/workspaces/containers/EditWorkspaceScreen.js @@ -0,0 +1,75 @@ +import React, { Component } from 'react'; +import { inject, observer } from 'mobx-react'; +import { defineMessages, intlShape } from 'react-intl'; +import { Link } from 'react-router'; +import Form from '../../../lib/Form'; +import ErrorBoundary from '../../../components/util/ErrorBoundary'; +import { gaPage } from '../../../lib/analytics'; +import { state } from '../state'; + +const messages = defineMessages({ + name: { + id: 'settings.workspace.form.name', + defaultMessage: '!!!Name', + }, + yourWorkspaces: { + id: 'settings.workspace.form.yourWorkspaces', + defaultMessage: '!!!Your workspaces', + }, +}); + +@inject('stores', 'actions') @observer +class EditWorkspaceScreen extends Component { + static contextTypes = { + intl: intlShape, + }; + + componentDidMount() { + gaPage('Settings/Workspace/Edit'); + } + + prepareForm(workspace) { + const { intl } = this.context; + const config = { + fields: { + name: { + label: intl.formatMessage(messages.name), + placeholder: intl.formatMessage(messages.name), + value: workspace.name, + }, + }, + }; + return new Form(config); + } + + render() { + const { intl } = this.context; + const { workspaceBeingEdited } = state; + if (!workspaceBeingEdited) return null; + + // const form = this.prepareForm(workspaceBeingEdited); + + return ( + +
+
+ + + {intl.formatMessage(messages.yourWorkspaces)} + + + + + {workspaceBeingEdited.name} + +
+
+ test +
+
+
+ ); + } +} + +export default EditWorkspaceScreen; diff --git a/src/features/workspaces/containers/WorkspacesScreen.js b/src/features/workspaces/containers/WorkspacesScreen.js new file mode 100644 index 000000000..f129edec5 --- /dev/null +++ b/src/features/workspaces/containers/WorkspacesScreen.js @@ -0,0 +1,37 @@ +import React, { Component } from 'react'; +import { inject, observer } from 'mobx-react'; +import PropTypes from 'prop-types'; +import { gaPage } from '../../../lib/analytics'; +import { state } from '../state'; +import WorkspacesDashboard from '../components/WorkspacesDashboard'; +import ErrorBoundary from '../../../components/util/ErrorBoundary'; + +@inject('actions') @observer +class WorkspacesScreen extends Component { + static propTypes = { + actions: PropTypes.shape({ + workspace: PropTypes.shape({ + edit: PropTypes.func.isRequired, + }), + }).isRequired, + }; + + componentDidMount() { + gaPage('Settings/Workspaces Dashboard'); + } + + render() { + const { workspace } = this.props.actions; + return ( + + workspace.edit({ workspace: w })} + /> + + ); + } +} + +export default WorkspacesScreen; diff --git a/src/features/workspaces/models/Workspace.js b/src/features/workspaces/models/Workspace.js new file mode 100644 index 000000000..ede2710dc --- /dev/null +++ b/src/features/workspaces/models/Workspace.js @@ -0,0 +1,25 @@ +import { observable } from 'mobx'; + +export default class Workspace { + id = null; + + @observable name = null; + + @observable order = null; + + @observable services = []; + + @observable userId = null; + + constructor(data) { + if (!data.id) { + throw Error('Workspace requires Id'); + } + + this.id = data.id; + this.name = data.name; + this.order = data.order; + this.services = data.services; + this.userId = data.userId; + } +} diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index aab66708b..ea61cec31 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -1,7 +1,7 @@ import { observable, reaction } from 'mobx'; import Store from '../../stores/lib/Store'; import CachedRequest from '../../stores/lib/CachedRequest'; -import Workspace from '../../models/Workspace'; +import Workspace from './models/Workspace'; import { matchRoute } from '../../helpers/routing-helpers'; const debug = require('debug')('Franz:feature:workspaces'); diff --git a/src/features/workspaces/styles/workspaces-table.scss b/src/features/workspaces/styles/workspaces-table.scss new file mode 100644 index 000000000..6d0e7b4f5 --- /dev/null +++ b/src/features/workspaces/styles/workspaces-table.scss @@ -0,0 +1,53 @@ +@import '../../../styles/config'; + +.theme__dark .workspace-table { + .workspace-table__column-info .mdi { color: $dark-theme-gray-lightest; } + + .workspace-table__row { + border-bottom: 1px solid $dark-theme-gray-darker; + + &:hover { background: $dark-theme-gray-darker; } + &.workspace-table__row--disabled { color: $dark-theme-gray; } + } +} + +.workspace-table { + width: 100%; + + .workspace-table__toggle { + width: 60px; + + .franz-form__field { + margin-bottom: 0; + } + } + + .workspace-table__column-action { + width: 40px + } + + .workspace-table__column-info { + width: 40px; + + .mdi { + color: $theme-gray-light; + display: block; + font-size: 18px; + } + } + + .workspace-table__row { + border-bottom: 1px solid $theme-gray-lightest; + + &:hover { + cursor: initial; + background: $theme-gray-lightest; + } + + &.workspace-table__row--disabled { + color: $theme-gray-light; + } + } + + td { padding: 10px; } +} diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index b5abb56d4..5cb8c6bd3 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -158,6 +158,7 @@ "settings.navigation.logout" : "Abmelden", "settings.navigation.settings" : "Einstellungen", "settings.navigation.yourServices" : "Deine Dienste", + "settings.navigation.yourWorkspaces": "Deine Workspaces", "settings.recipes.all" : "Alle Dienste", "settings.recipes.dev" : "Entwicklung", "settings.recipes.headline" : "Verfügbare Dienste", @@ -216,6 +217,8 @@ "settings.services.tooltip.isMuted" : "Alle Töne sind deaktiviert", "settings.services.tooltip.notificationsDisabled" : "Benachrichtigungen deaktiviert", "settings.services.updatedInfo" : "Deine Änderungen wurden gespeichert", + "settings.workspaces.headline": "Deine Workspaces", + "settings.workspace.form.yourWorkspaces": "Deine Workspaces", "settings.user.form.accountType.company" : "Firma", "settings.user.form.accountType.individual" : "Einzelperson", "settings.user.form.accountType.label" : "Konto-Typ", diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 1652b5585..9b323e323 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -197,6 +197,7 @@ "settings.user.form.accountType.non-profit": "Non-Profit", "settings.user.form.accountType.company": "Company", "settings.workspaces.headline": "Your workspaces", + "settings.workspace.form.yourWorkspaces": "Your workspaces", "subscription.type.free": "free", "subscription.type.month": "month", "subscription.type.year": "year", diff --git a/src/models/Workspace.js b/src/models/Workspace.js deleted file mode 100644 index ede2710dc..000000000 --- a/src/models/Workspace.js +++ /dev/null @@ -1,25 +0,0 @@ -import { observable } from 'mobx'; - -export default class Workspace { - id = null; - - @observable name = null; - - @observable order = null; - - @observable services = []; - - @observable userId = null; - - constructor(data) { - if (!data.id) { - throw Error('Workspace requires Id'); - } - - this.id = data.id; - this.name = data.name; - this.order = data.order; - this.services = data.services; - this.userId = data.userId; - } -} diff --git a/src/styles/main.scss b/src/styles/main.scss index 30f43532f..a941d89d0 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -30,7 +30,7 @@ $mdi-font-path: '../node_modules/mdi/fonts'; @import './content-tabs.scss'; @import './invite.scss'; @import './title-bar.scss'; -@import './workspace-table.scss'; +@import '../features/workspaces/styles/workspaces-table'; // form @import './input.scss'; diff --git a/src/styles/workspace-table.scss b/src/styles/workspace-table.scss deleted file mode 100644 index 05ebfa629..000000000 --- a/src/styles/workspace-table.scss +++ /dev/null @@ -1,53 +0,0 @@ -@import './config.scss'; - -.theme__dark .workspace-table { - .workspace-table__column-info .mdi { color: $dark-theme-gray-lightest; } - - .workspace-table__row { - border-bottom: 1px solid $dark-theme-gray-darker; - - &:hover { background: $dark-theme-gray-darker; } - &.workspace-table__row--disabled { color: $dark-theme-gray; } - } -} - -.workspace-table { - width: 100%; - - .workspace-table__toggle { - width: 60px; - - .franz-form__field { - margin-bottom: 0; - } - } - - .workspace-table__column-action { - width: 40px - } - - .workspace-table__column-info { - width: 40px; - - .mdi { - color: $theme-gray-light; - display: block; - font-size: 18px; - } - } - - .workspace-table__row { - border-bottom: 1px solid $theme-gray-lightest; - - &:hover { - cursor: initial; - background: $theme-gray-lightest; - } - - &.workspace-table__row--disabled { - color: $theme-gray-light; - } - } - - td { padding: 10px; } -} -- cgit v1.2.3-70-g09d2 From 7e40b08e2f8ab2448dcbe2ce7b4e38ca66764b9c Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Fri, 22 Feb 2019 12:34:27 +0100 Subject: add form for creating workspaces --- .eslintrc | 2 +- src/features/delayApp/Component.js | 2 +- src/features/workspaces/actions.js | 3 + src/features/workspaces/api.js | 9 +++ .../workspaces/components/CreateWorkspaceForm.js | 94 ++++++++++++++++++++++ .../workspaces/components/WorkspacesDashboard.js | 58 ++++++++----- .../workspaces/containers/WorkspacesScreen.js | 1 + src/features/workspaces/store.js | 14 +++- src/i18n/locales/de.json | 6 +- src/i18n/locales/en-US.json | 2 + src/styles/main.scss | 2 + 11 files changed, 170 insertions(+), 23 deletions(-) create mode 100644 src/features/workspaces/components/CreateWorkspaceForm.js (limited to 'src/features/workspaces/store.js') diff --git a/.eslintrc b/.eslintrc index e15148e96..48fb21250 100644 --- a/.eslintrc +++ b/.eslintrc @@ -13,7 +13,7 @@ "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], - "react/forbid-prop-types": 1, + "react/forbid-prop-types": 0, "react/destructuring-assignment": 1, "prefer-destructuring": 1, "no-underscore-dangle": 0, diff --git a/src/features/delayApp/Component.js b/src/features/delayApp/Component.js index ff84510e8..ff0f1f2f8 100644 --- a/src/features/delayApp/Component.js +++ b/src/features/delayApp/Component.js @@ -38,7 +38,7 @@ export default @inject('actions') @injectSheet(styles) @observer class DelayApp state = { countdown: config.delayDuration, - } + }; countdownInterval = null; diff --git a/src/features/workspaces/actions.js b/src/features/workspaces/actions.js index 30866af96..390af0696 100644 --- a/src/features/workspaces/actions.js +++ b/src/features/workspaces/actions.js @@ -5,4 +5,7 @@ export default { edit: { workspace: PropTypes.instanceOf(Workspace).isRequired, }, + create: { + name: PropTypes.string.isRequired, + }, }; diff --git a/src/features/workspaces/api.js b/src/features/workspaces/api.js index 97badbd01..65108a077 100644 --- a/src/features/workspaces/api.js +++ b/src/features/workspaces/api.js @@ -10,4 +10,13 @@ export default { if (!request.ok) throw request; return request.json(); }, + createWorkspace: async (name) => { + const url = `${API}/${API_VERSION}/workspace`; + const request = await window.fetch(url, prepareAuthRequest({ + method: 'POST', + body: JSON.stringify({ name }), + })); + if (!request.ok) throw request; + return request.json(); + }, }; diff --git a/src/features/workspaces/components/CreateWorkspaceForm.js b/src/features/workspaces/components/CreateWorkspaceForm.js new file mode 100644 index 000000000..d440b9bae --- /dev/null +++ b/src/features/workspaces/components/CreateWorkspaceForm.js @@ -0,0 +1,94 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { observer } from 'mobx-react'; +import { defineMessages, intlShape } from 'react-intl'; +import { Input, Button } from '@meetfranz/forms'; +import injectSheet from 'react-jss'; + +import Form from '../../../lib/Form'; + +const messages = defineMessages({ + submitButton: { + id: 'settings.workspace.add.form.submitButton', + defaultMessage: '!!!Save workspace', + }, + name: { + id: 'settings.workspace.add.form.name', + defaultMessage: '!!!Name', + }, +}); + +const styles = () => ({ + form: { + display: 'flex', + }, + input: { + flexGrow: 1, + marginRight: '10px', + }, + submitButton: { + height: 'inherit', + marginTop: '17px', + }, +}); + +@observer @injectSheet(styles) +class CreateWorkspaceForm extends Component { + static contextTypes = { + intl: intlShape, + }; + + static propTypes = { + classes: PropTypes.object.isRequired, + onSubmit: PropTypes.func.isRequired, + }; + + prepareForm() { + const { intl } = this.context; + const config = { + fields: { + name: { + label: intl.formatMessage(messages.name), + placeholder: intl.formatMessage(messages.name), + value: '', + }, + }, + }; + return new Form(config); + } + + submitForm(form) { + form.submit({ + onSuccess: async (f) => { + const { onSubmit } = this.props; + const values = f.values(); + onSubmit(values); + }, + onError: async () => {}, + }); + } + + render() { + const { intl } = this.context; + const { classes } = this.props; + const form = this.prepareForm(); + + return ( +
+ +
+ ); + } +} + +export default CreateWorkspaceForm; diff --git a/src/features/workspaces/components/WorkspacesDashboard.js b/src/features/workspaces/components/WorkspacesDashboard.js index 2a8b3a5ee..917807302 100644 --- a/src/features/workspaces/components/WorkspacesDashboard.js +++ b/src/features/workspaces/components/WorkspacesDashboard.js @@ -2,9 +2,11 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; import { defineMessages, intlShape } from 'react-intl'; +import injectSheet from 'react-jss'; import Loader from '../../../components/ui/Loader'; import WorkspaceItem from './WorkspaceItem'; +import CreateWorkspaceForm from './CreateWorkspaceForm'; const messages = defineMessages({ headline: { @@ -17,12 +19,21 @@ const messages = defineMessages({ }, }); -@observer +const styles = () => ({ + createForm: { + height: 'auto', + marginBottom: '20px', + }, +}); + +@observer @injectSheet(styles) class WorkspacesDashboard extends Component { static propTypes = { - workspaces: MobxPropTypes.arrayOrObservableArray.isRequired, + classes: PropTypes.object.isRequired, isLoading: PropTypes.bool.isRequired, + onCreateWorkspaceSubmit: PropTypes.func.isRequired, onWorkspaceClick: PropTypes.func.isRequired, + workspaces: MobxPropTypes.arrayOrObservableArray.isRequired, }; static contextTypes = { @@ -30,7 +41,13 @@ class WorkspacesDashboard extends Component { }; render() { - const { workspaces, isLoading, onWorkspaceClick } = this.props; + const { + workspaces, + isLoading, + onCreateWorkspaceSubmit, + onWorkspaceClick, + classes, + } = this.props; const { intl } = this.context; return ( @@ -39,21 +56,26 @@ class WorkspacesDashboard extends Component {

{intl.formatMessage(messages.headline)}

- {isLoading ? ( - - ) : ( - - - {workspaces.map(workspace => ( - onWorkspaceClick(w)} - /> - ))} - -
- )} +
+
+ +
+ {isLoading ? ( + + ) : ( + + + {workspaces.map(workspace => ( + onWorkspaceClick(w)} + /> + ))} + +
+ )} +
); diff --git a/src/features/workspaces/containers/WorkspacesScreen.js b/src/features/workspaces/containers/WorkspacesScreen.js index f129edec5..eb3287952 100644 --- a/src/features/workspaces/containers/WorkspacesScreen.js +++ b/src/features/workspaces/containers/WorkspacesScreen.js @@ -27,6 +27,7 @@ class WorkspacesScreen extends Component { workspace.create(data)} onWorkspaceClick={w => workspace.edit({ workspace: w })} /> diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index ea61cec31..d90f9caac 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -49,6 +49,7 @@ export default class WorkspacesStore extends Store { ); this.actions.workspace.edit.listen(this._edit); + this.actions.workspace.create.listen(this._create); } _setWorkspaces = (workspaces) => { @@ -64,5 +65,16 @@ export default class WorkspacesStore extends Store { _edit = ({ workspace }) => { this.stores.router.push(`/settings/workspaces/edit/${workspace.id}`); - } + }; + + _create = async ({ name }) => { + try { + const result = await this.api.createWorkspace(name); + const workspace = new Workspace(result); + this.state.workspaces.push(workspace); + this._edit({ workspace }); + } catch (error) { + throw error; + } + }; } diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index ffad8b835..b795b90f8 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -218,10 +218,12 @@ "settings.services.tooltip.notificationsDisabled" : "Benachrichtigungen deaktiviert", "settings.services.updatedInfo" : "Deine Änderungen wurden gespeichert", "settings.workspaces.headline": "Deine Workspaces", + "settings.workspace.add.form.submitButton": "Create Workspace", + "settings.workspace.add.form.name": "Name", "settings.workspace.form.yourWorkspaces": "Deine Workspaces", "settings.workspace.form.name": "Name", - "settings.workspace.form.buttonDelete": "Workspace löschen", - "settings.workspace.form.buttonSave": "Workspace speichern", + "settings.workspace.form.buttonDelete": "Workspace löschen", + "settings.workspace.form.buttonSave": "Workspace speichern", "settings.user.form.accountType.company" : "Firma", "settings.user.form.accountType.individual" : "Einzelperson", "settings.user.form.accountType.label" : "Konto-Typ", diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 899c62651..24c96cb26 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -197,6 +197,8 @@ "settings.user.form.accountType.non-profit": "Non-Profit", "settings.user.form.accountType.company": "Company", "settings.workspaces.headline": "Your workspaces", + "settings.workspace.add.form.submitButton": "Create Workspace", + "settings.workspace.add.form.name": "Name", "settings.workspace.form.yourWorkspaces": "Your workspaces", "settings.workspace.form.name": "Name", "settings.workspace.form.buttonDelete": "Delete Workspace", diff --git a/src/styles/main.scss b/src/styles/main.scss index a941d89d0..9ba7f5827 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -30,6 +30,8 @@ $mdi-font-path: '../node_modules/mdi/fonts'; @import './content-tabs.scss'; @import './invite.scss'; @import './title-bar.scss'; + +// Workspaces legacy css @import '../features/workspaces/styles/workspaces-table'; // form -- cgit v1.2.3-70-g09d2 From 3de31efa29b8f2729f968d9d63c42d21c7d8dcf5 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Fri, 22 Feb 2019 13:04:51 +0100 Subject: adds flow for deleting workspaces --- src/api/utils/auth.js | 4 ++++ src/features/workspaces/actions.js | 3 +++ src/features/workspaces/api.js | 18 ++++++++++++------ .../workspaces/containers/EditWorkspaceScreen.js | 14 +++++++++++++- src/features/workspaces/containers/WorkspacesScreen.js | 6 +++--- src/features/workspaces/store.js | 11 +++++++++++ 6 files changed, 46 insertions(+), 10 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/src/api/utils/auth.js b/src/api/utils/auth.js index 47ac94c19..d469853a5 100644 --- a/src/api/utils/auth.js +++ b/src/api/utils/auth.js @@ -22,3 +22,7 @@ export const prepareAuthRequest = (options, auth = true) => { return request; }; + +export const sendAuthRequest = (url, options) => ( + window.fetch(url, prepareAuthRequest(options)) +); diff --git a/src/features/workspaces/actions.js b/src/features/workspaces/actions.js index 390af0696..83d3447c3 100644 --- a/src/features/workspaces/actions.js +++ b/src/features/workspaces/actions.js @@ -8,4 +8,7 @@ export default { create: { name: PropTypes.string.isRequired, }, + delete: { + workspace: PropTypes.instanceOf(Workspace).isRequired, + }, }; diff --git a/src/features/workspaces/api.js b/src/features/workspaces/api.js index 65108a077..fabc12455 100644 --- a/src/features/workspaces/api.js +++ b/src/features/workspaces/api.js @@ -1,21 +1,27 @@ -import { prepareAuthRequest } from '../../api/utils/auth'; +import { sendAuthRequest } from '../../api/utils/auth'; import { API, API_VERSION } from '../../environment'; export default { getUserWorkspaces: async () => { const url = `${API}/${API_VERSION}/workspace`; - const request = await window.fetch(url, prepareAuthRequest({ - method: 'GET', - })); + const request = await sendAuthRequest(url, { method: 'GET' }); if (!request.ok) throw request; return request.json(); }, + createWorkspace: async (name) => { const url = `${API}/${API_VERSION}/workspace`; - const request = await window.fetch(url, prepareAuthRequest({ + const request = await sendAuthRequest(url, { method: 'POST', body: JSON.stringify({ name }), - })); + }); + if (!request.ok) throw request; + return request.json(); + }, + + deleteWorkspace: async (workspace) => { + const url = `${API}/${API_VERSION}/workspace/${workspace.id}`; + const request = await sendAuthRequest(url, { method: 'DELETE' }); if (!request.ok) throw request; return request.json(); }, diff --git a/src/features/workspaces/containers/EditWorkspaceScreen.js b/src/features/workspaces/containers/EditWorkspaceScreen.js index ed54b194e..87b6062fb 100644 --- a/src/features/workspaces/containers/EditWorkspaceScreen.js +++ b/src/features/workspaces/containers/EditWorkspaceScreen.js @@ -5,15 +5,27 @@ import ErrorBoundary from '../../../components/util/ErrorBoundary'; import { gaPage } from '../../../lib/analytics'; import { state } from '../state'; import EditWorkspaceForm from '../components/EditWorkspaceForm'; +import PropTypes from 'prop-types'; @inject('stores', 'actions') @observer class EditWorkspaceScreen extends Component { + static propTypes = { + actions: PropTypes.shape({ + workspace: PropTypes.shape({ + delete: PropTypes.func.isRequired, + }), + }).isRequired, + }; + componentDidMount() { gaPage('Settings/Workspace/Edit'); } onDelete = () => { - console.log('delete workspace'); + const { workspaceBeingEdited } = state; + const { actions } = this.props; + if (!workspaceBeingEdited) return null; + actions.workspace.delete({ workspace: workspaceBeingEdited }); }; onSave = (values) => { diff --git a/src/features/workspaces/containers/WorkspacesScreen.js b/src/features/workspaces/containers/WorkspacesScreen.js index eb3287952..a3876a01a 100644 --- a/src/features/workspaces/containers/WorkspacesScreen.js +++ b/src/features/workspaces/containers/WorkspacesScreen.js @@ -21,14 +21,14 @@ class WorkspacesScreen extends Component { } render() { - const { workspace } = this.props.actions; + const { actions } = this.props; return ( workspace.create(data)} - onWorkspaceClick={w => workspace.edit({ workspace: w })} + onCreateWorkspaceSubmit={data => actions.workspace.create(data)} + onWorkspaceClick={w => actions.workspace.edit({ workspace: w })} /> ); diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index d90f9caac..a9b93f904 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -50,6 +50,7 @@ export default class WorkspacesStore extends Store { this.actions.workspace.edit.listen(this._edit); this.actions.workspace.create.listen(this._create); + this.actions.workspace.delete.listen(this._delete); } _setWorkspaces = (workspaces) => { @@ -77,4 +78,14 @@ export default class WorkspacesStore extends Store { throw error; } }; + + _delete = async ({ workspace }) => { + try { + await this.api.deleteWorkspace(workspace); + this.state.workspaces.remove(workspace); + this.stores.router.push('/settings/workspaces'); + } catch (error) { + throw error; + } + }; } -- cgit v1.2.3-70-g09d2 From dca7437b45c8eb67692a1df563fb4e969826b1cc Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Tue, 26 Feb 2019 15:29:34 +0100 Subject: finish basic workspace settings --- src/features/workspaces/actions.js | 3 ++ src/features/workspaces/api.js | 11 +++++ .../workspaces/components/EditWorkspaceForm.js | 46 +++++++++++++++++++-- .../workspaces/components/ServiceListItem.js | 48 ++++++++++++++++++++++ .../workspaces/containers/EditWorkspaceScreen.js | 14 ++++++- src/features/workspaces/models/Workspace.js | 2 +- src/features/workspaces/store.js | 12 ++++++ src/i18n/locales/de.json | 1 + src/i18n/locales/en-US.json | 1 + 9 files changed, 132 insertions(+), 6 deletions(-) create mode 100644 src/features/workspaces/components/ServiceListItem.js (limited to 'src/features/workspaces/store.js') diff --git a/src/features/workspaces/actions.js b/src/features/workspaces/actions.js index 83d3447c3..84de2b011 100644 --- a/src/features/workspaces/actions.js +++ b/src/features/workspaces/actions.js @@ -11,4 +11,7 @@ export default { delete: { workspace: PropTypes.instanceOf(Workspace).isRequired, }, + update: { + workspace: PropTypes.instanceOf(Workspace).isRequired, + }, }; diff --git a/src/features/workspaces/api.js b/src/features/workspaces/api.js index fabc12455..733cb5593 100644 --- a/src/features/workspaces/api.js +++ b/src/features/workspaces/api.js @@ -1,3 +1,4 @@ +import { pick } from 'lodash'; import { sendAuthRequest } from '../../api/utils/auth'; import { API, API_VERSION } from '../../environment'; @@ -25,4 +26,14 @@ export default { if (!request.ok) throw request; return request.json(); }, + + updateWorkspace: async (workspace) => { + const url = `${API}/${API_VERSION}/workspace/${workspace.id}`; + const request = await sendAuthRequest(url, { + method: 'PUT', + body: JSON.stringify(pick(workspace, ['name', 'services'])), + }); + if (!request.ok) throw request; + return request.json(); + }, }; diff --git a/src/features/workspaces/components/EditWorkspaceForm.js b/src/features/workspaces/components/EditWorkspaceForm.js index 05ca65403..48090f608 100644 --- a/src/features/workspaces/components/EditWorkspaceForm.js +++ b/src/features/workspaces/components/EditWorkspaceForm.js @@ -7,8 +7,10 @@ import { Input, Button } from '@meetfranz/forms'; import injectSheet from 'react-jss'; import Workspace from '../models/Workspace'; +import Service from '../../../models/Service'; import Form from '../../../lib/Form'; import { required } from '../../../helpers/validation-helpers'; +import ServiceListItem from './ServiceListItem'; const messages = defineMessages({ buttonDelete: { @@ -27,12 +29,19 @@ const messages = defineMessages({ id: 'settings.workspace.form.yourWorkspaces', defaultMessage: '!!!Your workspaces', }, + servicesInWorkspaceHeadline: { + id: 'settings.workspace.form.servicesInWorkspaceHeadline', + defaultMessage: '!!!Services in this Workspace', + }, }); const styles = () => ({ nameInput: { height: 'auto', }, + serviceList: { + height: 'auto', + }, }); @injectSheet(styles) @observer @@ -42,11 +51,13 @@ class EditWorkspaceForm extends Component { }; static propTypes = { - workspace: PropTypes.instanceOf(Workspace).isRequired, - onSave: PropTypes.func.isRequired, - onDelete: PropTypes.func.isRequired, - isSaving: PropTypes.bool.isRequired, + classes: PropTypes.object.isRequired, isDeleting: PropTypes.bool.isRequired, + isSaving: PropTypes.bool.isRequired, + onDelete: PropTypes.func.isRequired, + onSave: PropTypes.func.isRequired, + services: PropTypes.arrayOf(PropTypes.instanceOf(Service)).isRequired, + workspace: PropTypes.instanceOf(Workspace).isRequired, }; form = this.prepareWorkspaceForm(this.props.workspace); @@ -68,6 +79,9 @@ class EditWorkspaceForm extends Component { value: workspace.name, validators: [required], }, + services: { + value: workspace.services.slice(), + }, }, }); } @@ -83,6 +97,17 @@ class EditWorkspaceForm extends Component { }); } + toggleService(service) { + const servicesField = this.form.$('services'); + const serviceIds = servicesField.value; + if (serviceIds.includes(service.id)) { + serviceIds.splice(serviceIds.indexOf(service.id), 1); + } else { + serviceIds.push(service.id); + } + servicesField.set(serviceIds); + } + render() { const { intl } = this.context; const { @@ -91,8 +116,10 @@ class EditWorkspaceForm extends Component { isSaving, onDelete, workspace, + services, } = this.props; const { form } = this; + const workspaceServices = form.$('services').value; return (
@@ -110,6 +137,17 @@ class EditWorkspaceForm extends Component {
+

{intl.formatMessage(messages.servicesInWorkspaceHeadline)}

+
+ {services.map(s => ( + this.toggleService(s)} + /> + ))} +
{/* ===== Delete Button ===== */} diff --git a/src/features/workspaces/components/ServiceListItem.js b/src/features/workspaces/components/ServiceListItem.js new file mode 100644 index 000000000..146cc5a36 --- /dev/null +++ b/src/features/workspaces/components/ServiceListItem.js @@ -0,0 +1,48 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { observer } from 'mobx-react'; +import injectSheet from 'react-jss'; +import { Toggle } from '@meetfranz/forms'; + +import Service from '../../../models/Service'; + +const styles = () => ({ + service: { + height: 'auto', + display: 'flex', + }, + name: { + marginTop: '4px', + }, +}); + +@injectSheet(styles) @observer +class ServiceListItem extends Component { + static propTypes = { + classes: PropTypes.object.isRequired, + isInWorkspace: PropTypes.bool.isRequired, + onToggle: PropTypes.func.isRequired, + service: PropTypes.instanceOf(Service).isRequired, + }; + + render() { + const { + classes, + isInWorkspace, + onToggle, + service, + } = this.props; + + return ( +
+ +
+ ); + } +} + +export default ServiceListItem; diff --git a/src/features/workspaces/containers/EditWorkspaceScreen.js b/src/features/workspaces/containers/EditWorkspaceScreen.js index 17b723303..790b8a0fe 100644 --- a/src/features/workspaces/containers/EditWorkspaceScreen.js +++ b/src/features/workspaces/containers/EditWorkspaceScreen.js @@ -5,6 +5,8 @@ import PropTypes from 'prop-types'; import ErrorBoundary from '../../../components/util/ErrorBoundary'; import EditWorkspaceForm from '../components/EditWorkspaceForm'; import { state } from '../state'; +import ServicesStore from '../../../stores/ServicesStore'; +import Workspace from '../models/Workspace'; @inject('stores', 'actions') @observer class EditWorkspaceScreen extends Component { @@ -14,6 +16,9 @@ class EditWorkspaceScreen extends Component { delete: PropTypes.func.isRequired, }), }).isRequired, + stores: PropTypes.shape({ + services: PropTypes.instanceOf(ServicesStore).isRequired, + }).isRequired, }; onDelete = () => { @@ -24,16 +29,23 @@ class EditWorkspaceScreen extends Component { }; onSave = (values) => { - console.log('save workspace', values); + const { workspaceBeingEdited } = state; + const { actions } = this.props; + const workspace = new Workspace( + Object.assign({}, workspaceBeingEdited, values), + ); + actions.workspace.update({ workspace }); }; render() { const { workspaceBeingEdited } = state; + const { stores } = this.props; if (!workspaceBeingEdited) return null; return ( { @@ -88,4 +89,15 @@ export default class WorkspacesStore extends Store { throw error; } }; + + _update = async ({ workspace }) => { + try { + await this.api.updateWorkspace(workspace); + const localWorkspace = this.state.workspaces.find(ws => ws.id === workspace.id); + Object.assign(localWorkspace, workspace); + this.stores.router.push('/settings/workspaces'); + } catch (error) { + throw error; + } + }; } diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index e1a955176..4906070a3 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -224,6 +224,7 @@ "settings.workspace.form.name": "Name", "settings.workspace.form.buttonDelete": "Workspace löschen", "settings.workspace.form.buttonSave": "Workspace speichern", + "settings.workspace.form.servicesInWorkspaceHeadline": "Services in diesem Workspace", "settings.user.form.accountType.company" : "Firma", "settings.user.form.accountType.individual" : "Einzelperson", "settings.user.form.accountType.label" : "Konto-Typ", diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index fe16e916f..cd5c417e3 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -207,6 +207,7 @@ "settings.workspace.form.name": "Name", "settings.workspace.form.buttonDelete": "Delete Workspace", "settings.workspace.form.buttonSave": "Save Workspace", + "settings.workspace.form.servicesInWorkspaceHeadline": "Services in this Workspace", "subscription.type.free": "free", "subscription.type.month": "month", "subscription.type.year": "year", -- cgit v1.2.3-70-g09d2 From 739ef2e8a2dec94c3e10c3d26d797fe759fac7aa Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Fri, 1 Mar 2019 14:25:44 +0100 Subject: finish workspaces mvp --- src/actions/index.js | 8 ++- src/actions/lib/actions.js | 29 +++++---- src/components/layout/Sidebar.js | 2 +- src/components/services/tabs/Tabbar.js | 4 +- src/features/workspaces/actions.js | 9 ++- .../workspaces/containers/EditWorkspaceScreen.js | 12 ++-- .../workspaces/containers/WorkspacesScreen.js | 10 +-- src/features/workspaces/index.js | 40 +++++++++++- src/features/workspaces/state.js | 6 +- src/features/workspaces/store.js | 37 +++++++---- src/i18n/locales/de.json | 5 +- src/i18n/locales/en-US.json | 5 +- src/lib/Menu.js | 71 +++++++++++++++++++++- src/stores/ServicesStore.js | 12 ++-- 14 files changed, 193 insertions(+), 57 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/src/actions/index.js b/src/actions/index.js index 45e6da515..00f843cd6 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -11,7 +11,7 @@ import payment from './payment'; import news from './news'; import settings from './settings'; import requests from './requests'; -import workspace from '../features/workspaces/actions'; +import workspaces from '../features/workspaces/actions'; const actions = Object.assign({}, { service, @@ -24,7 +24,9 @@ const actions = Object.assign({}, { news, settings, requests, - workspace, }); -export default defineActions(actions, PropTypes.checkPropTypes); +export default Object.assign( + defineActions(actions, PropTypes.checkPropTypes), + { workspaces }, +); diff --git a/src/actions/lib/actions.js b/src/actions/lib/actions.js index 499018d70..6571e9441 100644 --- a/src/actions/lib/actions.js +++ b/src/actions/lib/actions.js @@ -1,18 +1,23 @@ +export const createActionsFromDefinitions = (actionDefinitions, validate) => { + const actions = {}; + Object.keys(actionDefinitions).forEach((actionName) => { + const action = (params) => { + const schema = actionDefinitions[actionName]; + validate(schema, params, actionName); + action.notify(params); + }; + actions[actionName] = action; + action.listeners = []; + action.listen = listener => action.listeners.push(listener); + action.notify = params => action.listeners.forEach(listener => listener(params)); + }); + return actions; +}; + export default (definitions, validate) => { const newActions = {}; Object.keys(definitions).forEach((scopeName) => { - newActions[scopeName] = {}; - Object.keys(definitions[scopeName]).forEach((actionName) => { - const action = (params) => { - const schema = definitions[scopeName][actionName]; - validate(schema, params, actionName); - action.notify(params); - }; - newActions[scopeName][actionName] = action; - action.listeners = []; - action.listen = listener => action.listeners.push(listener); - action.notify = params => action.listeners.forEach(listener => listener(params)); - }); + newActions[scopeName] = createActionsFromDefinitions(definitions[scopeName], validate); }); return newActions; }; diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index 609a3b604..fcc5b0001 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js @@ -31,7 +31,7 @@ export default @observer class Sidebar extends Component { openSettings: PropTypes.func.isRequired, toggleMuteApp: PropTypes.func.isRequired, isAppMuted: PropTypes.bool.isRequired, - } + }; static contextTypes = { intl: intlShape, diff --git a/src/components/services/tabs/Tabbar.js b/src/components/services/tabs/Tabbar.js index dd5c2140f..5e8260ad0 100644 --- a/src/components/services/tabs/Tabbar.js +++ b/src/components/services/tabs/Tabbar.js @@ -19,7 +19,7 @@ export default @observer class TabBar extends Component { updateService: PropTypes.func.isRequired, showMessageBadgeWhenMutedSetting: PropTypes.bool.isRequired, showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, - } + }; onSortEnd = ({ oldIndex, newIndex }) => { const { @@ -45,7 +45,7 @@ export default @observer class TabBar extends Component { redirect: false, }); } - } + }; disableService({ serviceId }) { this.toggleService({ serviceId, isEnabled: false }); diff --git a/src/features/workspaces/actions.js b/src/features/workspaces/actions.js index 84de2b011..25246de09 100644 --- a/src/features/workspaces/actions.js +++ b/src/features/workspaces/actions.js @@ -1,7 +1,8 @@ import PropTypes from 'prop-types'; import Workspace from './models/Workspace'; +import { createActionsFromDefinitions } from '../../actions/lib/actions'; -export default { +export default createActionsFromDefinitions({ edit: { workspace: PropTypes.instanceOf(Workspace).isRequired, }, @@ -14,4 +15,8 @@ export default { update: { workspace: PropTypes.instanceOf(Workspace).isRequired, }, -}; + activate: { + workspace: PropTypes.instanceOf(Workspace).isRequired, + }, + deactivate: {}, +}, PropTypes.checkPropTypes); diff --git a/src/features/workspaces/containers/EditWorkspaceScreen.js b/src/features/workspaces/containers/EditWorkspaceScreen.js index 790b8a0fe..1b13bc2d4 100644 --- a/src/features/workspaces/containers/EditWorkspaceScreen.js +++ b/src/features/workspaces/containers/EditWorkspaceScreen.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; import ErrorBoundary from '../../../components/util/ErrorBoundary'; import EditWorkspaceForm from '../components/EditWorkspaceForm'; -import { state } from '../state'; +import { workspacesState } from '../state'; import ServicesStore from '../../../stores/ServicesStore'; import Workspace from '../models/Workspace'; @@ -22,23 +22,23 @@ class EditWorkspaceScreen extends Component { }; onDelete = () => { - const { workspaceBeingEdited } = state; + const { workspaceBeingEdited } = workspacesState; const { actions } = this.props; if (!workspaceBeingEdited) return null; - actions.workspace.delete({ workspace: workspaceBeingEdited }); + actions.workspaces.delete({ workspace: workspaceBeingEdited }); }; onSave = (values) => { - const { workspaceBeingEdited } = state; + const { workspaceBeingEdited } = workspacesState; const { actions } = this.props; const workspace = new Workspace( Object.assign({}, workspaceBeingEdited, values), ); - actions.workspace.update({ workspace }); + actions.workspaces.update({ workspace }); }; render() { - const { workspaceBeingEdited } = state; + const { workspaceBeingEdited } = workspacesState; const { stores } = this.props; if (!workspaceBeingEdited) return null; return ( diff --git a/src/features/workspaces/containers/WorkspacesScreen.js b/src/features/workspaces/containers/WorkspacesScreen.js index b89cbcf67..94e714255 100644 --- a/src/features/workspaces/containers/WorkspacesScreen.js +++ b/src/features/workspaces/containers/WorkspacesScreen.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { inject, observer } from 'mobx-react'; import PropTypes from 'prop-types'; -import { state } from '../state'; +import { workspacesState } from '../state'; import WorkspacesDashboard from '../components/WorkspacesDashboard'; import ErrorBoundary from '../../../components/util/ErrorBoundary'; @@ -20,10 +20,10 @@ class WorkspacesScreen extends Component { return ( actions.workspace.create(data)} - onWorkspaceClick={w => actions.workspace.edit({ workspace: w })} + workspaces={workspacesState.workspaces} + isLoading={workspacesState.isLoading} + onCreateWorkspaceSubmit={data => actions.workspaces.create(data)} + onWorkspaceClick={w => actions.workspaces.edit({ workspace: w })} /> ); diff --git a/src/features/workspaces/index.js b/src/features/workspaces/index.js index 50ac3b414..8091f49fc 100644 --- a/src/features/workspaces/index.js +++ b/src/features/workspaces/index.js @@ -1,14 +1,28 @@ -import { reaction } from 'mobx'; +import { reaction, runInAction } from 'mobx'; import WorkspacesStore from './store'; import api from './api'; -import { state, resetState } from './state'; +import { workspacesState, resetState } from './state'; const debug = require('debug')('Franz:feature:workspaces'); let store = null; +export const filterServicesByActiveWorkspace = (services) => { + const { isFeatureActive, activeWorkspace } = workspacesState; + if (isFeatureActive && activeWorkspace) { + return services.filter(s => activeWorkspace.services.includes(s.id)); + } + return services; +}; + +export const getActiveWorkspaceServices = (services) => { + return filterServicesByActiveWorkspace(services); +}; + export default function initWorkspaces(stores, actions) { const { features, user } = stores; + + // Toggle workspace feature reaction( () => ( features.features.isWorkspaceEnabled && ( @@ -18,10 +32,12 @@ export default function initWorkspaces(stores, actions) { (isEnabled) => { if (isEnabled) { debug('Initializing `workspaces` feature'); - store = new WorkspacesStore(stores, api, actions, state); + store = new WorkspacesStore(stores, api, actions, workspacesState); store.initialize(); + runInAction(() => { workspacesState.isFeatureActive = true; }); } else if (store) { debug('Disabling `workspaces` feature'); + runInAction(() => { workspacesState.isFeatureActive = false; }); store.teardown(); store = null; resetState(); // Reset state to default @@ -31,4 +47,22 @@ export default function initWorkspaces(stores, actions) { fireImmediately: true, }, ); + + // Update active service on workspace switches + reaction(() => ({ + isFeatureActive: workspacesState.isFeatureActive, + activeWorkspace: workspacesState.activeWorkspace, + }), ({ isFeatureActive, activeWorkspace }) => { + if (!isFeatureActive) return; + if (activeWorkspace) { + const services = stores.services.allDisplayed; + const activeService = services.find(s => s.isActive); + const workspaceServices = filterServicesByActiveWorkspace(services); + const isActiveServiceInWorkspace = workspaceServices.includes(activeService); + if (!isActiveServiceInWorkspace) { + console.log(workspaceServices[0].id); + actions.service.setActive({ serviceId: workspaceServices[0].id }); + } + } + }); } diff --git a/src/features/workspaces/state.js b/src/features/workspaces/state.js index f938c1470..963b96f81 100644 --- a/src/features/workspaces/state.js +++ b/src/features/workspaces/state.js @@ -1,13 +1,15 @@ import { observable } from 'mobx'; const defaultState = { + activeWorkspace: null, isLoading: false, + isFeatureActive: false, workspaces: [], workspaceBeingEdited: null, }; -export const state = observable(defaultState); +export const workspacesState = observable(defaultState); export function resetState() { - Object.assign(state, defaultState); + Object.assign(workspacesState, defaultState); } diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 5cccb2ab7..a2997a0d2 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -1,8 +1,9 @@ -import { observable, reaction } from 'mobx'; +import { observable, reaction, action } from 'mobx'; import Store from '../../stores/lib/Store'; import CachedRequest from '../../stores/lib/CachedRequest'; import Workspace from './models/Workspace'; import { matchRoute } from '../../helpers/routing-helpers'; +import workspaceActions from './actions'; const debug = require('debug')('Franz:feature:workspaces'); @@ -48,28 +49,30 @@ export default class WorkspacesStore extends Store { }, ); - this.actions.workspace.edit.listen(this._edit); - this.actions.workspace.create.listen(this._create); - this.actions.workspace.delete.listen(this._delete); - this.actions.workspace.update.listen(this._update); + workspaceActions.edit.listen(this._edit); + workspaceActions.create.listen(this._create); + workspaceActions.delete.listen(this._delete); + workspaceActions.update.listen(this._update); + workspaceActions.activate.listen(this._setActiveWorkspace); + workspaceActions.deactivate.listen(this._deactivateActiveWorkspace); } - _setWorkspaces = (workspaces) => { + _getWorkspaceById = id => this.state.workspaces.find(w => w.id === id); + + @action _setWorkspaces = (workspaces) => { debug('setting user workspaces', workspaces.slice()); this.state.workspaces = workspaces.map(data => new Workspace(data)); }; - _setIsLoading = (isLoading) => { + @action _setIsLoading = (isLoading) => { this.state.isLoading = isLoading; }; - _getWorkspaceById = id => this.state.workspaces.find(w => w.id === id); - - _edit = ({ workspace }) => { + @action _edit = ({ workspace }) => { this.stores.router.push(`/settings/workspaces/edit/${workspace.id}`); }; - _create = async ({ name }) => { + @action _create = async ({ name }) => { try { const result = await this.api.createWorkspace(name); const workspace = new Workspace(result); @@ -80,7 +83,7 @@ export default class WorkspacesStore extends Store { } }; - _delete = async ({ workspace }) => { + @action _delete = async ({ workspace }) => { try { await this.api.deleteWorkspace(workspace); this.state.workspaces.remove(workspace); @@ -90,7 +93,7 @@ export default class WorkspacesStore extends Store { } }; - _update = async ({ workspace }) => { + @action _update = async ({ workspace }) => { try { await this.api.updateWorkspace(workspace); const localWorkspace = this.state.workspaces.find(ws => ws.id === workspace.id); @@ -100,4 +103,12 @@ export default class WorkspacesStore extends Store { throw error; } }; + + @action _setActiveWorkspace = ({ workspace }) => { + this.state.activeWorkspace = workspace; + }; + + @action _deactivateActiveWorkspace = () => { + this.state.activeWorkspace = null; + }; } diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index 4906070a3..0c1fb8aa6 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -74,6 +74,9 @@ "menu.window" : "Fenster", "menu.window.close" : "Schließen", "menu.window.minimize" : "Minimieren", + "menu.workspaces": "Workspaces", + "menu.workspaces.defaultWorkspace": "All services", + "menu.workspaces.addNewWorkspace": "Add New Workspace", "password.email.label" : "E-Mail Adresse", "password.headline" : "Passwort zurücksetzen", "password.link.login" : "An Deinem Konto anmelden", @@ -224,7 +227,7 @@ "settings.workspace.form.name": "Name", "settings.workspace.form.buttonDelete": "Workspace löschen", "settings.workspace.form.buttonSave": "Workspace speichern", - "settings.workspace.form.servicesInWorkspaceHeadline": "Services in diesem Workspace", + "settings.workspace.form.servicesInWorkspaceHeadline": "Services in diesem Workspace", "settings.user.form.accountType.company" : "Firma", "settings.user.form.accountType.individual" : "Einzelperson", "settings.user.form.accountType.label" : "Konto-Typ", diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 988ac46f2..2a51662a2 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -276,7 +276,10 @@ "menu.app.hideOthers": "Hide Others", "menu.app.unhide": "Unhide", "menu.app.quit": "Quit", - "menu.services.addNewService": "Add New Service...", + "menu.services.addNewService": "Add New Service", + "menu.workspaces": "Workspaces", + "menu.workspaces.defaultWorkspace": "All services", + "menu.workspaces.addNewWorkspace": "Add New Workspace", "validation.required": "{field} is required", "validation.email": "{field} is not valid", "validation.url": "{field} is not a valid URL", diff --git a/src/lib/Menu.js b/src/lib/Menu.js index c378619ad..1560dd285 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js @@ -3,6 +3,8 @@ import { observable, autorun, computed } from 'mobx'; import { defineMessages } from 'react-intl'; import { isMac, ctrlKey, cmdKey } from '../environment'; +import { workspacesState } from '../features/workspaces/state'; +import workspaceActions from '../features/workspaces/actions'; const { app, Menu, dialog } = remote; @@ -179,6 +181,18 @@ const menuItems = defineMessages({ id: 'menu.services.addNewService', defaultMessage: '!!!Add New Service...', }, + workspaces: { + id: 'menu.workspaces', + defaultMessage: '!!!Workspaces', + }, + defaultWorkspace: { + id: 'menu.workspaces.defaultWorkspace', + defaultMessage: '!!!Default', + }, + addNewWorkspace: { + id: 'menu.workspaces.addNewWorkspace', + defaultMessage: '!!!Add New Workspace...', + }, }); function getActiveWebview() { @@ -265,6 +279,10 @@ const _templateFactory = intl => [ label: intl.formatMessage(menuItems.services), submenu: [], }, + { + label: intl.formatMessage(menuItems.workspaces), + submenu: [], + }, { label: intl.formatMessage(menuItems.window), role: 'window', @@ -499,7 +517,9 @@ export default class FranzMenu { } _build() { - const serviceTpl = Object.assign([], this.serviceTpl); // need to clone object so we don't modify computed (cached) object + // need to clone object so we don't modify computed (cached) object + const serviceTpl = Object.assign([], this.serviceTpl); + const workspacesMenu = Object.assign([], this.workspacesMenu); if (window.franz === undefined) { return; @@ -632,7 +652,7 @@ export default class FranzMenu { }, ); - tpl[4].submenu.unshift(about, { + tpl[5].submenu.unshift(about, { type: 'separator', }); } else { @@ -678,6 +698,8 @@ export default class FranzMenu { tpl[3].submenu = serviceTpl; } + tpl[4].submenu = workspacesMenu; + this.currentTemplate = tpl; const menu = Menu.buildFromTemplate(tpl); Menu.setApplicationMenu(menu); @@ -701,6 +723,51 @@ export default class FranzMenu { return []; } + @computed get workspacesMenu() { + const { workspaces, activeWorkspace } = workspacesState; + const { intl } = window.franz; + const menu = []; + + // Add new workspace item: + menu.push({ + label: intl.formatMessage(menuItems.addNewWorkspace), + accelerator: `${cmdKey}+Shift+N`, + click: () => { + this.actions.ui.openSettings({ path: 'workspaces' }); + }, + enabled: this.stores.user.isLoggedIn, + }, { + type: 'separator', + }); + + // Default workspace + menu.push({ + label: intl.formatMessage(menuItems.defaultWorkspace), + accelerator: `${cmdKey}+Alt+1`, + type: 'radio', + checked: !activeWorkspace, + click: () => { + workspaceActions.deactivate(); + }, + }); + + // Workspace items + if (this.stores.user.isLoggedIn) { + workspaces.forEach((workspace, i) => menu.push({ + label: workspace.name, + accelerator: i < 9 ? `${cmdKey}+Alt+${i + 2}` : null, + type: 'radio', + checked: activeWorkspace ? workspace.id === activeWorkspace.id : false, + click: () => { + workspaceActions.activate({ workspace }); + }, + })); + } + + console.log(menu); + return menu; + } + _getServiceName(service) { if (service.name) { return service.name; diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index c63bef196..a86db8103 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js @@ -2,7 +2,7 @@ import { action, reaction, computed, - observable, + observable, runInAction, } from 'mobx'; import { debounce, remove } from 'lodash'; import ms from 'ms'; @@ -12,6 +12,8 @@ import Request from './lib/Request'; import CachedRequest from './lib/CachedRequest'; import { matchRoute } from '../helpers/routing-helpers'; import { gaEvent } from '../lib/analytics'; +import { workspacesState } from '../features/workspaces/state'; +import { filterServicesByActiveWorkspace, getActiveWorkspaceServices } from '../features/workspaces'; const debug = require('debug')('Franz:ServiceStore'); @@ -98,7 +100,6 @@ export default class ServicesStore extends Store { return observable(services.slice().slice().sort((a, b) => a.order - b.order)); } } - return []; } @@ -107,13 +108,16 @@ export default class ServicesStore extends Store { } @computed get allDisplayed() { - return this.stores.settings.all.app.showDisabledServices ? this.all : this.enabled; + const services = this.stores.settings.all.app.showDisabledServices ? this.all : this.enabled; + return filterServicesByActiveWorkspace(services); } // This is just used to avoid unnecessary rerendering of resource-heavy webviews @computed get allDisplayedUnordered() { + const { showDisabledServices } = this.stores.settings.all.app; const services = this.allServicesRequest.execute().result || []; - return this.stores.settings.all.app.showDisabledServices ? services : services.filter(service => service.isEnabled); + const filteredServices = showDisabledServices ? services : services.filter(service => service.isEnabled); + return getActiveWorkspaceServices(filteredServices); } @computed get filtered() { -- cgit v1.2.3-70-g09d2 From e4f1862644d5921e2ee77078c10e16efa3e58c7b Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Tue, 19 Mar 2019 19:38:56 +0100 Subject: add workspace drawer --- packages/theme/src/themes/dark/index.ts | 9 +++ packages/theme/src/themes/default/index.ts | 10 +++ src/components/layout/AppLayout.js | 24 +++++- src/components/layout/Sidebar.js | 42 +++++++++- src/components/services/content/ServiceView.js | 1 + src/containers/layout/AppLayoutContainer.js | 14 ++++ src/features/workspaces/actions.js | 6 +- .../workspaces/components/WorkspaceDrawer.js | 94 ++++++++++++++++++++++ .../workspaces/components/WorkspaceDrawerItem.js | 88 ++++++++++++++++++++ src/features/workspaces/state.js | 1 + src/features/workspaces/store.js | 12 ++- src/i18n/locales/defaultMessages.json | 57 +++++++++++++ src/i18n/locales/en-US.json | 8 +- .../messages/src/components/layout/AppLayout.json | 24 +++--- .../messages/src/components/layout/Sidebar.json | 26 ++++++ .../workspaces/components/WorkspaceDrawer.json | 28 +++++++ src/lib/Menu.js | 4 +- src/styles/layout.scss | 12 ++- 18 files changed, 435 insertions(+), 25 deletions(-) create mode 100644 src/features/workspaces/components/WorkspaceDrawer.js create mode 100644 src/features/workspaces/components/WorkspaceDrawerItem.js create mode 100644 src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json (limited to 'src/features/workspaces/store.js') diff --git a/packages/theme/src/themes/dark/index.ts b/packages/theme/src/themes/dark/index.ts index 3a56719b2..eaa552961 100644 --- a/packages/theme/src/themes/dark/index.ts +++ b/packages/theme/src/themes/dark/index.ts @@ -63,3 +63,12 @@ export const selectSearchColor = inputBackground; // Modal export const colorModalOverlayBackground = color(legacyStyles.darkThemeBlack).alpha(0.8).rgb().string(); + +// Workspace Drawer +export const workspaceDrawerBackground = color(colorBackground).lighten(0.3).hex(); +export const workspaceDrawerItemBorder = color(workspaceDrawerBackground).lighten(0.2).hex(); +export const workspaceDrawerItemActiveBackground = defaultStyles.brandPrimary; +export const workspaceDrawerNameColor = colorText; +export const workspaceDrawerNameActiveColor = 'white'; +export const workspaceDrawerServicesColor = color(colorText).darken(0.5).hex(); +export const workspaceDrawerServicesActiveColor = color(defaultStyles.brandPrimary).lighten(0.5).hex(); diff --git a/packages/theme/src/themes/default/index.ts b/packages/theme/src/themes/default/index.ts index 8a71e61cf..fc03b67de 100644 --- a/packages/theme/src/themes/default/index.ts +++ b/packages/theme/src/themes/default/index.ts @@ -140,3 +140,13 @@ export const badgeBorderRadius = 50; // Modal export const colorModalOverlayBackground = color('#000').alpha(0.5).rgb().string(); + +// Workspace Drawer +export const workspaceDrawerWidth = '220px'; +export const workspaceDrawerBackground = color(colorBackground).lighten(0.1).hex(); +export const workspaceDrawerItemActiveBackground = legacyStyles.themeGrayLightest; +export const workspaceDrawerItemBorder = color(workspaceDrawerBackground).darken(0.05).hex(); +export const workspaceDrawerNameColor = colorText; +export const workspaceDrawerNameActiveColor = colorText; +export const workspaceDrawerServicesColor = color(colorText).lighten(1.5).hex(); +export const workspaceDrawerServicesActiveColor = workspaceDrawerServicesColor; diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index 593149e72..e06192f87 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; import { defineMessages, intlShape } from 'react-intl'; import { TitleBar } from 'electron-react-titlebar'; +import injectSheet from 'react-jss'; import InfoBar from '../ui/InfoBar'; import { Component as DelayApp } from '../../features/delayApp'; @@ -13,6 +14,7 @@ import ErrorBoundary from '../util/ErrorBoundary'; // import globalMessages from '../../i18n/globalMessages'; import { isWindows } from '../../environment'; +import { workspacesState } from '../../features/workspaces/state'; function createMarkup(HTMLString) { return { __html: HTMLString }; @@ -45,10 +47,23 @@ const messages = defineMessages({ }, }); -export default @observer class AppLayout extends Component { +const styles = theme => ({ + appContent: { + width: `calc(100% + ${theme.workspaceDrawerWidth})`, + transition: 'transform 0.5s ease', + transform() { + return workspacesState.isWorkspaceDrawerOpen ? 'translateX(0)' : 'translateX(-220px)'; + }, + }, +}); + +@injectSheet(styles) @observer +class AppLayout extends Component { static propTypes = { + classes: PropTypes.object.isRequired, isFullScreen: PropTypes.bool.isRequired, sidebar: PropTypes.element.isRequired, + workspacesDrawer: PropTypes.element.isRequired, services: PropTypes.element.isRequired, children: PropTypes.element, news: MobxPropTypes.arrayOrObservableArray.isRequired, @@ -76,7 +91,9 @@ export default @observer class AppLayout extends Component { render() { const { + classes, isFullScreen, + workspacesDrawer, sidebar, services, children, @@ -102,7 +119,8 @@ export default @observer class AppLayout extends Component {
{isWindows && !isFullScreen && } -
+
+ {workspacesDrawer} {sidebar}
{news.length > 0 && news.map(item => ( @@ -176,3 +194,5 @@ export default @observer class AppLayout extends Component { ); } } + +export default AppLayout; diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index fcc5b0001..de379875e 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js @@ -24,6 +24,14 @@ const messages = defineMessages({ id: 'sidebar.unmuteApp', defaultMessage: '!!!Enable notifications & audio', }, + openWorkspaceDrawer: { + id: 'sidebar.openWorkspaceDrawer', + defaultMessage: '!!!Open workspace drawer', + }, + closeWorkspaceDrawer: { + id: 'sidebar.closeWorkspaceDrawer', + defaultMessage: '!!!Close workspace drawer', + }, }); export default @observer class Sidebar extends Component { @@ -31,6 +39,8 @@ export default @observer class Sidebar extends Component { openSettings: PropTypes.func.isRequired, toggleMuteApp: PropTypes.func.isRequired, isAppMuted: PropTypes.bool.isRequired, + isWorkspaceDrawerOpen: PropTypes.bool.isRequired, + toggleWorkspaceDrawer: PropTypes.func.isRequired, }; static contextTypes = { @@ -53,9 +63,23 @@ export default @observer class Sidebar extends Component { this.setState({ tooltipEnabled: false }); } + updateToolTip() { + this.disableToolTip(); + setTimeout(this.enableToolTip.bind(this)); + } + render() { - const { openSettings, toggleMuteApp, isAppMuted } = this.props; + const { + openSettings, + toggleMuteApp, + isAppMuted, + isWorkspaceDrawerOpen, + toggleWorkspaceDrawer, + } = this.props; const { intl } = this.context; + const workspaceToggleMessage = ( + isWorkspaceDrawerOpen ? messages.closeWorkspaceDrawer : messages.openWorkspaceDrawer + ); return (
@@ -66,7 +90,21 @@ export default @observer class Sidebar extends Component { /> +
diff --git a/src/features/workspaces/containers/WorkspacesScreen.js b/src/features/workspaces/containers/WorkspacesScreen.js index 5fdea217e..89bd2a2ef 100644 --- a/src/features/workspaces/containers/WorkspacesScreen.js +++ b/src/features/workspaces/containers/WorkspacesScreen.js @@ -22,7 +22,7 @@ class WorkspacesScreen extends Component { actions.workspaces.create(data)} onWorkspaceClick={w => actions.workspaces.edit({ workspace: w })} /> diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 86a8a2c76..3cec5f360 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -30,7 +30,7 @@ export default class WorkspacesStore { @computed get workspaces() { if (!this.isFeatureActive) return []; - return getUserWorkspacesRequest.execute().result || []; + return getUserWorkspacesRequest.result || []; } constructor() { @@ -57,6 +57,7 @@ export default class WorkspacesStore { this.actions = actions; this._reactions.forEach(r => r.start()); this.isFeatureActive = true; + getUserWorkspacesRequest.execute(); } stop() { diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 03e96fc40..afbacf28a 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json @@ -3388,26 +3388,52 @@ "defaultMessage": "!!!Your workspaces", "end": { "column": 3, - "line": 15 + "line": 17 }, "file": "src/features/workspaces/components/WorkspacesDashboard.js", "id": "settings.workspaces.headline", "start": { "column": 12, - "line": 12 + "line": 14 } }, { "defaultMessage": "!!!You haven't added any workspaces yet.", "end": { "column": 3, - "line": 19 + "line": 21 }, "file": "src/features/workspaces/components/WorkspacesDashboard.js", "id": "settings.workspaces.noWorkspacesAdded", "start": { "column": 19, - "line": 16 + "line": 18 + } + }, + { + "defaultMessage": "!!!Could not load your workspaces", + "end": { + "column": 3, + "line": 25 + }, + "file": "src/features/workspaces/components/WorkspacesDashboard.js", + "id": "settings.workspaces.workspacesRequestFailed", + "start": { + "column": 27, + "line": 22 + } + }, + { + "defaultMessage": "!!!Try again", + "end": { + "column": 3, + "line": 29 + }, + "file": "src/features/workspaces/components/WorkspacesDashboard.js", + "id": "settings.workspaces.tryReloadWorkspaces", + "start": { + "column": 23, + "line": 26 } } ], diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 4206d4358..2b4e79621 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -251,6 +251,8 @@ "settings.workspace.form.yourWorkspaces": "Your workspaces", "settings.workspaces.headline": "Your workspaces", "settings.workspaces.noWorkspacesAdded": "You haven't added any workspaces yet.", + "settings.workspaces.tryReloadWorkspaces": "Try again", + "settings.workspaces.workspacesRequestFailed": "Could not load your workspaces", "sidebar.addNewService": "Add new service", "sidebar.closeWorkspaceDrawer": "Close workspace drawer", "sidebar.muteApp": "Disable notifications & audio", @@ -305,4 +307,4 @@ "workspaceDrawer.headline": "Workspaces", "workspaceDrawer.item.noServicesAddedYet": "No services added yet", "workspaces.switchingIndicator.switchingTo": "Switching to" -} \ No newline at end of file +} diff --git a/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json b/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json index 0e053a124..f875ace8a 100644 --- a/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json +++ b/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json @@ -4,11 +4,11 @@ "defaultMessage": "!!!Your workspaces", "file": "src/features/workspaces/components/WorkspacesDashboard.js", "start": { - "line": 12, + "line": 14, "column": 12 }, "end": { - "line": 15, + "line": 17, "column": 3 } }, @@ -17,11 +17,37 @@ "defaultMessage": "!!!You haven't added any workspaces yet.", "file": "src/features/workspaces/components/WorkspacesDashboard.js", "start": { - "line": 16, + "line": 18, "column": 19 }, "end": { - "line": 19, + "line": 21, + "column": 3 + } + }, + { + "id": "settings.workspaces.workspacesRequestFailed", + "defaultMessage": "!!!Could not load your workspaces", + "file": "src/features/workspaces/components/WorkspacesDashboard.js", + "start": { + "line": 22, + "column": 27 + }, + "end": { + "line": 25, + "column": 3 + } + }, + { + "id": "settings.workspaces.tryReloadWorkspaces", + "defaultMessage": "!!!Try again", + "file": "src/features/workspaces/components/WorkspacesDashboard.js", + "start": { + "line": 26, + "column": 23 + }, + "end": { + "line": 29, "column": 3 } } diff --git a/src/stores/lib/Request.js b/src/stores/lib/Request.js index 04f528156..1fb67cc15 100644 --- a/src/stores/lib/Request.js +++ b/src/stores/lib/Request.js @@ -85,6 +85,8 @@ export default class Request { return this.execute(...this._currentApiCall.args); } + retry = () => this.reload(); + isExecutingWithArgs(...args) { return this.isExecuting && this._currentApiCall && isEqual(this._currentApiCall.args, args); } -- cgit v1.2.3-70-g09d2 From a2e4316879908c5bc2c38cef81eef9152476b6f6 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Tue, 26 Mar 2019 15:26:20 +0100 Subject: show infobox when updating workspaces --- packages/ui/src/infobox/index.tsx | 7 ++ src/components/ui/Infobox.js | 17 ++++- .../workspaces/components/WorkspacesDashboard.js | 89 +++++++++++++--------- .../workspaces/containers/WorkspacesScreen.js | 3 +- src/features/workspaces/store.js | 15 ++-- src/i18n/locales/defaultMessages.json | 29 +++++-- src/i18n/locales/en-US.json | 3 +- .../workspaces/components/WorkspacesDashboard.json | 29 +++++-- src/stores/lib/Request.js | 4 +- 9 files changed, 129 insertions(+), 67 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/packages/ui/src/infobox/index.tsx b/packages/ui/src/infobox/index.tsx index 1a442a733..9066a623e 100644 --- a/packages/ui/src/infobox/index.tsx +++ b/packages/ui/src/infobox/index.tsx @@ -11,6 +11,7 @@ interface IProps extends IWithStyle { type?: string; dismissable?: boolean; onDismiss?: () => void; + onUnmount?: () => void; ctaOnClick?: () => void; ctaLabel?: string; ctaLoading?: boolean; @@ -46,6 +47,7 @@ const styles = (theme: Theme) => ({ wrapper: { position: 'relative', overflow: 'hidden', + height: 'auto', }, infobox: { alignItems: 'center', @@ -129,6 +131,11 @@ class InfoboxComponent extends Component { }, 3000); } + componentWillUnmount(): void { + const { onUnmount } = this.props; + if (onUnmount) onUnmount(); + } + render() { const { classes, diff --git a/src/components/ui/Infobox.js b/src/components/ui/Infobox.js index a33c6474a..0917ee9f0 100644 --- a/src/components/ui/Infobox.js +++ b/src/components/ui/Infobox.js @@ -13,6 +13,8 @@ export default @observer class Infobox extends Component { ctaLabel: PropTypes.string, ctaLoading: PropTypes.bool, dismissable: PropTypes.bool, + onDismiss: PropTypes.func, + onSeen: PropTypes.func, }; static defaultProps = { @@ -22,12 +24,19 @@ export default @observer class Infobox extends Component { ctaOnClick: () => null, ctaLabel: '', ctaLoading: false, + onDismiss: () => null, + onSeen: () => null, }; state = { dismissed: false, }; + componentDidMount() { + const { onSeen } = this.props; + if (onSeen) onSeen(); + } + render() { const { children, @@ -37,6 +46,7 @@ export default @observer class Infobox extends Component { ctaLoading, ctaOnClick, dismissable, + onDismiss, } = this.props; if (this.state.dismissed) { @@ -76,9 +86,10 @@ export default @observer class Infobox extends Component { {dismissable && (
-
-
- -
- {getUserWorkspacesRequest.isExecuting ? ( - - ) : ( - - {getUserWorkspacesRequest.error ? ( - - {intl.formatMessage(messages.workspacesRequestFailed)} - - ) : ( - - - {workspaces.map(workspace => ( - onWorkspaceClick(w)} - /> - ))} - -
- )} -
- )} + {updateWorkspaceRequest.wasExecuted && updateWorkspaceRequest.result && ( + + + {intl.formatMessage(messages.updatedInfo)} + + + )} +
+
+ {getUserWorkspacesRequest.isExecuting ? ( + + ) : ( + + {getUserWorkspacesRequest.error ? ( + + {intl.formatMessage(messages.workspacesRequestFailed)} + + ) : ( + + + {workspaces.map(workspace => ( + onWorkspaceClick(w)} + /> + ))} + +
+ )} +
+ )}
); diff --git a/src/features/workspaces/containers/WorkspacesScreen.js b/src/features/workspaces/containers/WorkspacesScreen.js index 89bd2a2ef..3f41de0c2 100644 --- a/src/features/workspaces/containers/WorkspacesScreen.js +++ b/src/features/workspaces/containers/WorkspacesScreen.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; import WorkspacesDashboard from '../components/WorkspacesDashboard'; import ErrorBoundary from '../../../components/util/ErrorBoundary'; import { workspaceStore } from '../index'; -import { getUserWorkspacesRequest } from '../api'; +import { getUserWorkspacesRequest, updateWorkspaceRequest } from '../api'; @inject('actions') @observer class WorkspacesScreen extends Component { @@ -23,6 +23,7 @@ class WorkspacesScreen extends Component { actions.workspaces.create(data)} onWorkspaceClick={w => actions.workspaces.edit({ workspace: w })} /> diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 3cec5f360..f7df7b29c 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -102,9 +102,7 @@ export default class WorkspacesStore { @action _create = async ({ name }) => { try { const workspace = await createWorkspaceRequest.execute(name); - await getUserWorkspacesRequest.patch((result) => { - result.push(workspace); - }); + await getUserWorkspacesRequest.result.push(workspace); this._edit({ workspace }); } catch (error) { throw error; @@ -114,9 +112,7 @@ export default class WorkspacesStore { @action _delete = async ({ workspace }) => { try { await deleteWorkspaceRequest.execute(workspace); - await getUserWorkspacesRequest.patch((result) => { - result.remove(workspace); - }); + await getUserWorkspacesRequest.result.remove(workspace); this.stores.router.push('/settings/workspaces'); } catch (error) { throw error; @@ -126,10 +122,9 @@ export default class WorkspacesStore { @action _update = async ({ workspace }) => { try { await updateWorkspaceRequest.execute(workspace); - await getUserWorkspacesRequest.patch((result) => { - const localWorkspace = result.find(ws => ws.id === workspace.id); - Object.assign(localWorkspace, workspace); - }); + // Path local result optimistically + const localWorkspace = this._getWorkspaceById(workspace.id); + Object.assign(localWorkspace, workspace); this.stores.router.push('/settings/workspaces'); } catch (error) { throw error; diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index afbacf28a..891ad38d4 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json @@ -3388,52 +3388,65 @@ "defaultMessage": "!!!Your workspaces", "end": { "column": 3, - "line": 17 + "line": 18 }, "file": "src/features/workspaces/components/WorkspacesDashboard.js", "id": "settings.workspaces.headline", "start": { "column": 12, - "line": 14 + "line": 15 } }, { "defaultMessage": "!!!You haven't added any workspaces yet.", "end": { "column": 3, - "line": 21 + "line": 22 }, "file": "src/features/workspaces/components/WorkspacesDashboard.js", "id": "settings.workspaces.noWorkspacesAdded", "start": { "column": 19, - "line": 18 + "line": 19 } }, { "defaultMessage": "!!!Could not load your workspaces", "end": { "column": 3, - "line": 25 + "line": 26 }, "file": "src/features/workspaces/components/WorkspacesDashboard.js", "id": "settings.workspaces.workspacesRequestFailed", "start": { "column": 27, - "line": 22 + "line": 23 } }, { "defaultMessage": "!!!Try again", "end": { "column": 3, - "line": 29 + "line": 30 }, "file": "src/features/workspaces/components/WorkspacesDashboard.js", "id": "settings.workspaces.tryReloadWorkspaces", "start": { "column": 23, - "line": 26 + "line": 27 + } + }, + { + "defaultMessage": "!!!Your changes have been saved", + "end": { + "column": 3, + "line": 34 + }, + "file": "src/features/workspaces/components/WorkspacesDashboard.js", + "id": "settings.workspaces.updatedInfo", + "start": { + "column": 15, + "line": 31 } } ], diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 2b4e79621..ad179bc1d 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -252,6 +252,7 @@ "settings.workspaces.headline": "Your workspaces", "settings.workspaces.noWorkspacesAdded": "You haven't added any workspaces yet.", "settings.workspaces.tryReloadWorkspaces": "Try again", + "settings.workspaces.updatedInfo": "!!!Your changes have been saved", "settings.workspaces.workspacesRequestFailed": "Could not load your workspaces", "sidebar.addNewService": "Add new service", "sidebar.closeWorkspaceDrawer": "Close workspace drawer", @@ -307,4 +308,4 @@ "workspaceDrawer.headline": "Workspaces", "workspaceDrawer.item.noServicesAddedYet": "No services added yet", "workspaces.switchingIndicator.switchingTo": "Switching to" -} +} \ No newline at end of file diff --git a/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json b/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json index f875ace8a..d68899d9b 100644 --- a/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json +++ b/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json @@ -4,11 +4,11 @@ "defaultMessage": "!!!Your workspaces", "file": "src/features/workspaces/components/WorkspacesDashboard.js", "start": { - "line": 14, + "line": 15, "column": 12 }, "end": { - "line": 17, + "line": 18, "column": 3 } }, @@ -17,11 +17,11 @@ "defaultMessage": "!!!You haven't added any workspaces yet.", "file": "src/features/workspaces/components/WorkspacesDashboard.js", "start": { - "line": 18, + "line": 19, "column": 19 }, "end": { - "line": 21, + "line": 22, "column": 3 } }, @@ -30,11 +30,11 @@ "defaultMessage": "!!!Could not load your workspaces", "file": "src/features/workspaces/components/WorkspacesDashboard.js", "start": { - "line": 22, + "line": 23, "column": 27 }, "end": { - "line": 25, + "line": 26, "column": 3 } }, @@ -43,11 +43,24 @@ "defaultMessage": "!!!Try again", "file": "src/features/workspaces/components/WorkspacesDashboard.js", "start": { - "line": 26, + "line": 27, "column": 23 }, "end": { - "line": 29, + "line": 30, + "column": 3 + } + }, + { + "id": "settings.workspaces.updatedInfo", + "defaultMessage": "!!!Your changes have been saved", + "file": "src/features/workspaces/components/WorkspacesDashboard.js", + "start": { + "line": 31, + "column": 15 + }, + "end": { + "line": 34, "column": 3 } } diff --git a/src/stores/lib/Request.js b/src/stores/lib/Request.js index 1fb67cc15..486de8a49 100644 --- a/src/stores/lib/Request.js +++ b/src/stores/lib/Request.js @@ -109,7 +109,7 @@ export default class Request { Request._hooks.forEach(hook => hook(this)); } - reset() { + reset = () => { this.result = null; this.isExecuting = false; this.isError = false; @@ -118,5 +118,5 @@ export default class Request { this._promise = Promise; return this; - } + }; } -- cgit v1.2.3-70-g09d2 From 7941831bf773b49944001c095a1949a1bdec2cf2 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Thu, 28 Mar 2019 16:23:17 +0100 Subject: add workspace premium notice to dashboard --- src/actions/lib/actions.js | 4 ++ src/components/layout/Sidebar.js | 2 +- .../settings/navigation/SettingsNavigation.js | 2 +- .../settings/services/EditServiceForm.js | 10 +++- .../settings/settings/EditSettingsForm.js | 1 + src/components/ui/PremiumFeatureContainer/index.js | 21 ++++++- .../ui/PremiumFeatureContainer/styles.js | 3 +- src/features/delayApp/index.js | 2 +- src/features/utils/FeatureStore.js | 21 +++++++ .../workspaces/components/CreateWorkspaceForm.js | 1 - .../workspaces/components/WorkspacesDashboard.js | 42 ++++++++++--- src/features/workspaces/index.js | 3 +- src/features/workspaces/store.js | 69 +++++++++++++--------- src/i18n/locales/defaultMessages.json | 54 ++++++++++++----- src/i18n/locales/en-US.json | 2 + .../ui/PremiumFeatureContainer/index.json | 4 +- .../workspaces/components/WorkspacesDashboard.json | 50 ++++++++++++---- src/lib/Menu.js | 4 +- src/stores/FeaturesStore.js | 18 ++++-- 19 files changed, 230 insertions(+), 83 deletions(-) create mode 100644 src/features/utils/FeatureStore.js (limited to 'src/features/workspaces/store.js') diff --git a/src/actions/lib/actions.js b/src/actions/lib/actions.js index 6571e9441..2bc7d2711 100644 --- a/src/actions/lib/actions.js +++ b/src/actions/lib/actions.js @@ -9,6 +9,10 @@ export const createActionsFromDefinitions = (actionDefinitions, validate) => { actions[actionName] = action; action.listeners = []; action.listen = listener => action.listeners.push(listener); + action.off = (listener) => { + const { listeners } = action; + listeners.splice(listeners.indexOf(listener), 1); + }; action.notify = params => action.listeners.forEach(listener => listener(params)); }); return actions; diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index 4fa5e79de..327f76392 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js @@ -90,7 +90,7 @@ export default @observer class Sidebar extends Component { enableToolTip={() => this.enableToolTip()} disableToolTip={() => this.disableToolTip()} /> - {workspaceStore.isFeatureActive ? ( + {workspaceStore.isFeatureEnabled ? (
- +
actions.ui.openSettings({ path: 'user' })} + onClick={() => { + actions.ui.openSettings({ path: 'user' }); + if (gaEventInfo) { + const { category, event, label } = gaEventInfo; + gaEvent(category, event, label); + } + }} > {intl.formatMessage(messages.action)} @@ -73,3 +88,5 @@ PremiumFeatureContainer.wrappedComponent.propTypes = { }).isRequired, }).isRequired, }; + +export default PremiumFeatureContainer; diff --git a/src/components/ui/PremiumFeatureContainer/styles.js b/src/components/ui/PremiumFeatureContainer/styles.js index 81d6666c6..615ed0a79 100644 --- a/src/components/ui/PremiumFeatureContainer/styles.js +++ b/src/components/ui/PremiumFeatureContainer/styles.js @@ -6,6 +6,7 @@ export default theme => ({ padding: 20, 'border-radius': theme.borderRadius, pointerEvents: 'none', + height: 'auto', }, titleContainer: { display: 'flex', @@ -26,7 +27,7 @@ export default theme => ({ content: { opacity: 0.5, 'margin-top': 20, - '& :last-child': { + '& > :last-child': { 'margin-bottom': 0, }, }, diff --git a/src/features/delayApp/index.js b/src/features/delayApp/index.js index abc8274cf..67f0fc5e6 100644 --- a/src/features/delayApp/index.js +++ b/src/features/delayApp/index.js @@ -55,7 +55,7 @@ export default function init(stores) { setVisibility(true); gaPage('/delayApp'); - gaEvent('delayApp', 'show', 'Delay App Feature'); + gaEvent('DelayApp', 'show', 'Delay App Feature'); timeLastDelay = moment(); shownAfterLaunch = true; diff --git a/src/features/utils/FeatureStore.js b/src/features/utils/FeatureStore.js new file mode 100644 index 000000000..66b66a104 --- /dev/null +++ b/src/features/utils/FeatureStore.js @@ -0,0 +1,21 @@ +import Reaction from '../../stores/lib/Reaction'; + +export class FeatureStore { + _actions = null; + + _reactions = null; + + _listenToActions(actions) { + if (this._actions) this._actions.forEach(a => a[0].off(a[1])); + this._actions = []; + actions.forEach(a => this._actions.push(a)); + this._actions.forEach(a => a[0].listen(a[1])); + } + + _startReactions(reactions) { + if (this._reactions) this._reactions.forEach(r => r.stop()); + this._reactions = []; + reactions.forEach(r => this._reactions.push(new Reaction(r))); + this._reactions.forEach(r => r.start()); + } +} diff --git a/src/features/workspaces/components/CreateWorkspaceForm.js b/src/features/workspaces/components/CreateWorkspaceForm.js index a8f07d0d5..0be2d528f 100644 --- a/src/features/workspaces/components/CreateWorkspaceForm.js +++ b/src/features/workspaces/components/CreateWorkspaceForm.js @@ -30,7 +30,6 @@ const styles = () => ({ }, submitButton: { height: 'inherit', - marginTop: '3px', }, }); diff --git a/src/features/workspaces/components/WorkspacesDashboard.js b/src/features/workspaces/components/WorkspacesDashboard.js index 52c3afdcf..1fad1f71d 100644 --- a/src/features/workspaces/components/WorkspacesDashboard.js +++ b/src/features/workspaces/components/WorkspacesDashboard.js @@ -10,6 +10,8 @@ import WorkspaceItem from './WorkspaceItem'; import CreateWorkspaceForm from './CreateWorkspaceForm'; import Request from '../../../stores/lib/Request'; import Appear from '../../../components/ui/effects/Appear'; +import { workspaceStore } from '../index'; +import PremiumFeatureContainer from '../../../components/ui/PremiumFeatureContainer'; const messages = defineMessages({ headline: { @@ -36,6 +38,14 @@ const messages = defineMessages({ id: 'settings.workspaces.deletedInfo', defaultMessage: '!!!Workspace has been deleted', }, + workspaceFeatureInfo: { + id: 'settings.workspaces.workspaceFeatureInfo', + defaultMessage: '!!!Info about workspace feature', + }, + workspaceFeatureHeadline: { + id: 'settings.workspaces.workspaceFeatureHeadline', + defaultMessage: '!!!Less is More: Introducing Franz Workspaces', + }, }); const styles = () => ({ @@ -46,6 +56,12 @@ const styles = () => ({ appear: { height: 'auto', }, + premiumAnnouncement: { + padding: '20px', + backgroundColor: '#3498db', + marginLeft: '-20px', + height: 'auto', + }, }); @injectSheet(styles) @observer @@ -112,14 +128,24 @@ class WorkspacesDashboard extends Component { )} - {/* ===== Create workspace form ===== */} -
- -
- + + {/* ===== Create workspace form ===== */} +
+ +
+
+ {workspaceStore.isUpgradeToPremiumRequired && ( +
+

{intl.formatMessage(messages.workspaceFeatureHeadline)}

+

{intl.formatMessage(messages.workspaceFeatureInfo)}

+
+ )} {getUserWorkspacesRequest.isExecuting ? ( ) : ( diff --git a/src/features/workspaces/index.js b/src/features/workspaces/index.js index 89999ab0f..524a83e3c 100644 --- a/src/features/workspaces/index.js +++ b/src/features/workspaces/index.js @@ -4,11 +4,12 @@ import { resetApiRequests } from './api'; const debug = require('debug')('Franz:feature:workspaces'); -export const GA_CATEGORY_WORKSPACES = 'workspaces'; +export const GA_CATEGORY_WORKSPACES = 'Workspaces'; export const workspaceStore = new WorkspacesStore(); export default function initWorkspaces(stores, actions) { + stores.workspaces = workspaceStore; const { features, user } = stores; // Toggle workspace feature diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index f7df7b29c..62bf3efb4 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -3,9 +3,9 @@ import { observable, action, } from 'mobx'; -import Reaction from '../../stores/lib/Reaction'; import { matchRoute } from '../../helpers/routing-helpers'; import { workspaceActions } from './actions'; +import { FeatureStore } from '../utils/FeatureStore'; import { createWorkspaceRequest, deleteWorkspaceRequest, @@ -15,7 +15,11 @@ import { const debug = require('debug')('Franz:feature:workspaces:store'); -export default class WorkspacesStore { +export default class WorkspacesStore extends FeatureStore { + @observable isFeatureEnabled = false; + + @observable isPremiumFeature = true; + @observable isFeatureActive = false; @observable activeWorkspace = null; @@ -33,36 +37,39 @@ export default class WorkspacesStore { return getUserWorkspacesRequest.result || []; } - constructor() { - // Wire-up action handlers - workspaceActions.edit.listen(this._edit); - workspaceActions.create.listen(this._create); - workspaceActions.delete.listen(this._delete); - workspaceActions.update.listen(this._update); - workspaceActions.activate.listen(this._setActiveWorkspace); - workspaceActions.deactivate.listen(this._deactivateActiveWorkspace); - workspaceActions.toggleWorkspaceDrawer.listen(this._toggleWorkspaceDrawer); - workspaceActions.openWorkspaceSettings.listen(this._openWorkspaceSettings); - - // Register and start reactions - this._registerReactions([ - this._updateWorkspaceBeingEdited, - this._updateActiveServiceOnWorkspaceSwitch, - ]); + @computed get isUpgradeToPremiumRequired() { + return this.isFeatureEnabled && !this.isFeatureActive; } start(stores, actions) { debug('WorkspacesStore::start'); this.stores = stores; this.actions = actions; - this._reactions.forEach(r => r.start()); - this.isFeatureActive = true; + + this._listenToActions([ + [workspaceActions.edit, this._edit], + [workspaceActions.create, this._create], + [workspaceActions.delete, this._delete], + [workspaceActions.update, this._update], + [workspaceActions.activate, this._setActiveWorkspace], + [workspaceActions.deactivate, this._deactivateActiveWorkspace], + [workspaceActions.toggleWorkspaceDrawer, this._toggleWorkspaceDrawer], + [workspaceActions.openWorkspaceSettings, this._openWorkspaceSettings], + ]); + + this._startReactions([ + this._setWorkspaceBeingEditedReaction, + this._setActiveServiceOnWorkspaceSwitchReaction, + this._setFeatureEnabledReaction, + this._setIsPremiumFeatureReaction, + ]); + getUserWorkspacesRequest.execute(); + this.isFeatureActive = true; } stop() { debug('WorkspacesStore::stop'); - this._reactions.forEach(r => r.stop()); this.isFeatureActive = false; this.activeWorkspace = null; this.nextWorkspace = null; @@ -85,12 +92,6 @@ export default class WorkspacesStore { // ========== PRIVATE ========= // - _reactions = []; - - _registerReactions(reactions) { - reactions.forEach(r => this._reactions.push(new Reaction(r))); - } - _getWorkspaceById = id => this.workspaces.find(w => w.id === id); // Actions @@ -164,7 +165,17 @@ export default class WorkspacesStore { // Reactions - _updateWorkspaceBeingEdited = () => { + _setFeatureEnabledReaction = () => { + const { isWorkspaceEnabled } = this.stores.features.features; + this.isFeatureEnabled = isWorkspaceEnabled; + }; + + _setIsPremiumFeatureReaction = () => { + const { isWorkspacePremiumFeature } = this.stores.features.features; + this.isPremiumFeature = isWorkspacePremiumFeature; + }; + + _setWorkspaceBeingEditedReaction = () => { const { pathname } = this.stores.router.location; const match = matchRoute('/settings/workspaces/edit/:id', pathname); if (match) { @@ -172,7 +183,7 @@ export default class WorkspacesStore { } }; - _updateActiveServiceOnWorkspaceSwitch = () => { + _setActiveServiceOnWorkspaceSwitchReaction = () => { if (!this.isFeatureActive) return; if (this.activeWorkspace) { const services = this.stores.services.allDisplayed; diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 659b1b361..1747e1976 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json @@ -2535,13 +2535,13 @@ "defaultMessage": "!!!Upgrade account", "end": { "column": 3, - "line": 17 + "line": 18 }, "file": "src/components/ui/PremiumFeatureContainer/index.js", "id": "premiumFeature.button.upgradeAccount", "start": { "column": 10, - "line": 14 + "line": 15 } } ], @@ -3388,78 +3388,104 @@ "defaultMessage": "!!!Your workspaces", "end": { "column": 3, - "line": 18 + "line": 20 }, "file": "src/features/workspaces/components/WorkspacesDashboard.js", "id": "settings.workspaces.headline", "start": { "column": 12, - "line": 15 + "line": 17 } }, { "defaultMessage": "!!!You haven't added any workspaces yet.", "end": { "column": 3, - "line": 22 + "line": 24 }, "file": "src/features/workspaces/components/WorkspacesDashboard.js", "id": "settings.workspaces.noWorkspacesAdded", "start": { "column": 19, - "line": 19 + "line": 21 } }, { "defaultMessage": "!!!Could not load your workspaces", "end": { "column": 3, - "line": 26 + "line": 28 }, "file": "src/features/workspaces/components/WorkspacesDashboard.js", "id": "settings.workspaces.workspacesRequestFailed", "start": { "column": 27, - "line": 23 + "line": 25 } }, { "defaultMessage": "!!!Try again", "end": { "column": 3, - "line": 30 + "line": 32 }, "file": "src/features/workspaces/components/WorkspacesDashboard.js", "id": "settings.workspaces.tryReloadWorkspaces", "start": { "column": 23, - "line": 27 + "line": 29 } }, { "defaultMessage": "!!!Your changes have been saved", "end": { "column": 3, - "line": 34 + "line": 36 }, "file": "src/features/workspaces/components/WorkspacesDashboard.js", "id": "settings.workspaces.updatedInfo", "start": { "column": 15, - "line": 31 + "line": 33 } }, { "defaultMessage": "!!!Workspace has been deleted", "end": { "column": 3, - "line": 38 + "line": 40 }, "file": "src/features/workspaces/components/WorkspacesDashboard.js", "id": "settings.workspaces.deletedInfo", "start": { "column": 15, - "line": 35 + "line": 37 + } + }, + { + "defaultMessage": "!!!Info about workspace feature", + "end": { + "column": 3, + "line": 44 + }, + "file": "src/features/workspaces/components/WorkspacesDashboard.js", + "id": "settings.workspaces.workspaceFeatureInfo", + "start": { + "column": 24, + "line": 41 + } + }, + { + "defaultMessage": "!!!Less is More: Introducing Franz Workspaces", + "end": { + "column": 3, + "line": 48 + }, + "file": "src/features/workspaces/components/WorkspacesDashboard.js", + "id": "settings.workspaces.workspaceFeatureHeadline", + "start": { + "column": 28, + "line": 45 } } ], diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 5f7254317..987262c35 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -254,6 +254,8 @@ "settings.workspaces.noWorkspacesAdded": "You haven't added any workspaces yet.", "settings.workspaces.tryReloadWorkspaces": "Try again", "settings.workspaces.updatedInfo": "Your changes have been saved", + "settings.workspaces.workspaceFeatureHeadline": "Less is More: Introducing Franz Workspaces", + "settings.workspaces.workspaceFeatureInfo": "Franz 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.", "settings.workspaces.workspacesRequestFailed": "Could not load your workspaces", "sidebar.addNewService": "Add new service", "sidebar.closeWorkspaceDrawer": "Close workspace drawer", diff --git a/src/i18n/messages/src/components/ui/PremiumFeatureContainer/index.json b/src/i18n/messages/src/components/ui/PremiumFeatureContainer/index.json index 582d546fa..320d3ca3e 100644 --- a/src/i18n/messages/src/components/ui/PremiumFeatureContainer/index.json +++ b/src/i18n/messages/src/components/ui/PremiumFeatureContainer/index.json @@ -4,11 +4,11 @@ "defaultMessage": "!!!Upgrade account", "file": "src/components/ui/PremiumFeatureContainer/index.js", "start": { - "line": 14, + "line": 15, "column": 10 }, "end": { - "line": 17, + "line": 18, "column": 3 } } diff --git a/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json b/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json index a957358c8..ef8f1bebc 100644 --- a/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json +++ b/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json @@ -4,11 +4,11 @@ "defaultMessage": "!!!Your workspaces", "file": "src/features/workspaces/components/WorkspacesDashboard.js", "start": { - "line": 15, + "line": 17, "column": 12 }, "end": { - "line": 18, + "line": 20, "column": 3 } }, @@ -17,11 +17,11 @@ "defaultMessage": "!!!You haven't added any workspaces yet.", "file": "src/features/workspaces/components/WorkspacesDashboard.js", "start": { - "line": 19, + "line": 21, "column": 19 }, "end": { - "line": 22, + "line": 24, "column": 3 } }, @@ -30,11 +30,11 @@ "defaultMessage": "!!!Could not load your workspaces", "file": "src/features/workspaces/components/WorkspacesDashboard.js", "start": { - "line": 23, + "line": 25, "column": 27 }, "end": { - "line": 26, + "line": 28, "column": 3 } }, @@ -43,11 +43,11 @@ "defaultMessage": "!!!Try again", "file": "src/features/workspaces/components/WorkspacesDashboard.js", "start": { - "line": 27, + "line": 29, "column": 23 }, "end": { - "line": 30, + "line": 32, "column": 3 } }, @@ -56,11 +56,11 @@ "defaultMessage": "!!!Your changes have been saved", "file": "src/features/workspaces/components/WorkspacesDashboard.js", "start": { - "line": 31, + "line": 33, "column": 15 }, "end": { - "line": 34, + "line": 36, "column": 3 } }, @@ -69,11 +69,37 @@ "defaultMessage": "!!!Workspace has been deleted", "file": "src/features/workspaces/components/WorkspacesDashboard.js", "start": { - "line": 35, + "line": 37, "column": 15 }, "end": { - "line": 38, + "line": 40, + "column": 3 + } + }, + { + "id": "settings.workspaces.workspaceFeatureInfo", + "defaultMessage": "!!!Info about workspace feature", + "file": "src/features/workspaces/components/WorkspacesDashboard.js", + "start": { + "line": 41, + "column": 24 + }, + "end": { + "line": 44, + "column": 3 + } + }, + { + "id": "settings.workspaces.workspaceFeatureHeadline", + "defaultMessage": "!!!Less is More: Introducing Franz Workspaces", + "file": "src/features/workspaces/components/WorkspacesDashboard.js", + "start": { + "line": 45, + "column": 28 + }, + "end": { + "line": 48, "column": 3 } } diff --git a/src/lib/Menu.js b/src/lib/Menu.js index d19aa9d6e..a4e41c17c 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js @@ -323,7 +323,7 @@ const _templateFactory = intl => [ { label: intl.formatMessage(menuItems.workspaces), submenu: [], - visible: workspaceStore.isFeatureActive, + visible: workspaceStore.isFeatureEnabled, }, { label: intl.formatMessage(menuItems.window), @@ -732,7 +732,7 @@ export default class FranzMenu { tpl[3].submenu = serviceTpl; } - if (workspaceStore.isFeatureActive) { + if (workspaceStore.isFeatureEnabled) { tpl[4].submenu = this.workspacesMenu(); } diff --git a/src/stores/FeaturesStore.js b/src/stores/FeaturesStore.js index 2bda82e17..52e38ad96 100644 --- a/src/stores/FeaturesStore.js +++ b/src/stores/FeaturesStore.js @@ -1,4 +1,4 @@ -import { computed, observable, reaction } from 'mobx'; +import { computed, observable, reaction, runInAction } from 'mobx'; import Store from './lib/Store'; import CachedRequest from './lib/CachedRequest'; @@ -17,8 +17,11 @@ export default class FeaturesStore extends Store { @observable featuresRequest = new CachedRequest(this.api.features, 'features'); + @observable features = Object.assign({}, DEFAULT_FEATURES_CONFIG); + async setup() { this.registerReactions([ + this._updateFeatures, this._monitorLoginStatus.bind(this), ]); @@ -37,13 +40,16 @@ export default class FeaturesStore extends Store { return this.defaultFeaturesRequest.execute().result || DEFAULT_FEATURES_CONFIG; } - @computed get features() { + _updateFeatures = () => { + const features = Object.assign({}, DEFAULT_FEATURES_CONFIG); if (this.stores.user.isLoggedIn) { - return Object.assign({}, DEFAULT_FEATURES_CONFIG, this.featuresRequest.execute().result); + const requestResult = this.featuresRequest.execute().result; + Object.assign(features, requestResult); } - - return DEFAULT_FEATURES_CONFIG; - } + runInAction('FeaturesStore::_updateFeatures', () => { + this.features = features; + }); + }; _monitorLoginStatus() { if (this.stores.user.isLoggedIn) { -- cgit v1.2.3-70-g09d2 From b75206e9a0a2c0c7ffb6052ec0f18c6b9ef5a825 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 3 Apr 2019 15:14:45 +0200 Subject: add workspace feature info in drawer for free users --- src/features/spellchecker/index.js | 2 - .../workspaces/components/WorkspaceDrawer.js | 81 ++++++++++++++++------ .../workspaces/components/WorkspacesDashboard.js | 15 ++-- src/features/workspaces/store.js | 2 +- src/i18n/locales/defaultMessages.json | 38 ++++++++-- src/i18n/locales/en-US.json | 4 +- .../workspaces/components/WorkspaceDrawer.json | 38 ++++++++-- 7 files changed, 137 insertions(+), 43 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/src/features/spellchecker/index.js b/src/features/spellchecker/index.js index 94883ad17..79a2172b4 100644 --- a/src/features/spellchecker/index.js +++ b/src/features/spellchecker/index.js @@ -14,8 +14,6 @@ export default function init(stores) { autorun(() => { const { isSpellcheckerPremiumFeature } = stores.features.features; - console.log('isSpellcheckerPremiumFeature', isSpellcheckerPremiumFeature); - config.isPremium = isSpellcheckerPremiumFeature !== undefined ? isSpellcheckerPremiumFeature : DEFAULT_FEATURES_CONFIG.isSpellcheckerPremiumFeature; if (!stores.user.data.isPremium && config.isPremium && stores.settings.app.enableSpellchecking) { diff --git a/src/features/workspaces/components/WorkspaceDrawer.js b/src/features/workspaces/components/WorkspaceDrawer.js index 4d48c45ef..6eacafa68 100644 --- a/src/features/workspaces/components/WorkspaceDrawer.js +++ b/src/features/workspaces/components/WorkspaceDrawer.js @@ -2,8 +2,9 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { observer } from 'mobx-react'; import injectSheet from 'react-jss'; -import { defineMessages, intlShape } from 'react-intl'; +import { defineMessages, FormattedHTMLMessage, intlShape } from 'react-intl'; import { H1, Icon } from '@meetfranz/ui'; +import { Button } from '@meetfranz/forms/lib'; import ReactTooltip from 'react-tooltip'; import WorkspaceDrawerItem from './WorkspaceDrawerItem'; @@ -24,6 +25,14 @@ const messages = defineMessages({ id: 'workspaceDrawer.addWorkspaceTooltip', defaultMessage: '!!!Add workspace', }, + workspaceFeatureInfo: { + id: 'workspaceDrawer.workspaceFeatureInfo', + defaultMessage: '!!!Info about workspace feature', + }, + premiumCtaButtonLabel: { + id: 'workspaceDrawer.premiumCtaButtonLabel', + defaultMessage: '!!!Create your first workspace', + }, }); const styles = theme => ({ @@ -48,6 +57,19 @@ const styles = theme => ({ fill: theme.workspaceDrawerAddButtonHoverColor, }, }, + workspaces: { + height: 'auto', + }, + premiumAnnouncement: { + padding: '20px', + paddingTop: '0', + height: 'auto', + }, + premiumCtaButton: { + marginTop: '20px', + width: '100%', + color: 'white !important', + }, }); @injectSheet(styles) @observer @@ -84,7 +106,10 @@ class WorkspaceDrawer extends Component { {intl.formatMessage(messages.headline)} { + workspaceActions.openWorkspaceSettings(); + gaEvent(GA_CATEGORY_WORKSPACES, 'add', 'drawerHeadline'); + }} data-tip={`${intl.formatMessage(messages.addWorkspaceTooltip)}`} > -
- { - workspaceActions.deactivate(); - gaEvent(GA_CATEGORY_WORKSPACES, 'switch', 'drawer'); - }} - services={getServicesForWorkspace(null)} - isActive={actualWorkspace == null} - /> - {workspaces.map(workspace => ( + {workspaceStore.isPremiumUpgradeRequired ? ( +
+ +
+ ) : ( +
{ - workspaceActions.activate({ workspace }); + workspaceActions.deactivate(); gaEvent(GA_CATEGORY_WORKSPACES, 'switch', 'drawer'); }} - services={getServicesForWorkspace(workspace)} + services={getServicesForWorkspace(null)} + isActive={actualWorkspace == null} /> - ))} -
+ {workspaces.map(workspace => ( + { + workspaceActions.activate({ workspace }); + gaEvent(GA_CATEGORY_WORKSPACES, 'switch', 'drawer'); + }} + services={getServicesForWorkspace(workspace)} + /> + ))} +
+ )}
); diff --git a/src/features/workspaces/components/WorkspacesDashboard.js b/src/features/workspaces/components/WorkspacesDashboard.js index 1fad1f71d..b141dc960 100644 --- a/src/features/workspaces/components/WorkspacesDashboard.js +++ b/src/features/workspaces/components/WorkspacesDashboard.js @@ -51,7 +51,6 @@ const messages = defineMessages({ const styles = () => ({ createForm: { height: 'auto', - marginBottom: '20px', }, appear: { height: 'auto', @@ -60,6 +59,7 @@ const styles = () => ({ padding: '20px', backgroundColor: '#3498db', marginLeft: '-20px', + marginBottom: '20px', height: 'auto', }, }); @@ -128,6 +128,13 @@ class WorkspacesDashboard extends Component { )} + {workspaceStore.isPremiumUpgradeRequired && ( +
+

{intl.formatMessage(messages.workspaceFeatureHeadline)}

+

{intl.formatMessage(messages.workspaceFeatureInfo)}

+
+ )} +
- {workspaceStore.isUpgradeToPremiumRequired && ( -
-

{intl.formatMessage(messages.workspaceFeatureHeadline)}

-

{intl.formatMessage(messages.workspaceFeatureInfo)}

-
- )} {getUserWorkspacesRequest.isExecuting ? ( ) : ( diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 62bf3efb4..712945bdc 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -37,7 +37,7 @@ export default class WorkspacesStore extends FeatureStore { return getUserWorkspacesRequest.result || []; } - @computed get isUpgradeToPremiumRequired() { + @computed get isPremiumUpgradeRequired() { return this.isFeatureEnabled && !this.isFeatureActive; } diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 1747e1976..a8f4a2cbf 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json @@ -3326,39 +3326,65 @@ "defaultMessage": "!!!Workspaces", "end": { "column": 3, - "line": 18 + "line": 19 }, "file": "src/features/workspaces/components/WorkspaceDrawer.js", "id": "workspaceDrawer.headline", "start": { "column": 12, - "line": 15 + "line": 16 } }, { "defaultMessage": "!!!All services", "end": { "column": 3, - "line": 22 + "line": 23 }, "file": "src/features/workspaces/components/WorkspaceDrawer.js", "id": "workspaceDrawer.allServices", "start": { "column": 15, - "line": 19 + "line": 20 } }, { "defaultMessage": "!!!Add workspace", "end": { "column": 3, - "line": 26 + "line": 27 }, "file": "src/features/workspaces/components/WorkspaceDrawer.js", "id": "workspaceDrawer.addWorkspaceTooltip", "start": { "column": 23, - "line": 23 + "line": 24 + } + }, + { + "defaultMessage": "!!!Info about workspace feature", + "end": { + "column": 3, + "line": 31 + }, + "file": "src/features/workspaces/components/WorkspaceDrawer.js", + "id": "workspaceDrawer.workspaceFeatureInfo", + "start": { + "column": 24, + "line": 28 + } + }, + { + "defaultMessage": "!!!Create your first workspace", + "end": { + "column": 3, + "line": 35 + }, + "file": "src/features/workspaces/components/WorkspaceDrawer.js", + "id": "workspaceDrawer.premiumCtaButton", + "start": { + "column": 20, + "line": 32 } } ], diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 987262c35..981946d00 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -310,5 +310,7 @@ "workspaceDrawer.allServices": "All services", "workspaceDrawer.headline": "Workspaces", "workspaceDrawer.item.noServicesAddedYet": "No services added yet", + "workspaceDrawer.premiumCtaButtonLabel": "Create your first workspace", + "workspaceDrawer.workspaceFeatureInfo": "

Franz 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.

", "workspaces.switchingIndicator.switchingTo": "Switching to" -} \ No newline at end of file +} diff --git a/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json b/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json index 7026708e2..acd304253 100644 --- a/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json +++ b/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json @@ -4,11 +4,11 @@ "defaultMessage": "!!!Workspaces", "file": "src/features/workspaces/components/WorkspaceDrawer.js", "start": { - "line": 15, + "line": 16, "column": 12 }, "end": { - "line": 18, + "line": 19, "column": 3 } }, @@ -17,11 +17,11 @@ "defaultMessage": "!!!All services", "file": "src/features/workspaces/components/WorkspaceDrawer.js", "start": { - "line": 19, + "line": 20, "column": 15 }, "end": { - "line": 22, + "line": 23, "column": 3 } }, @@ -30,11 +30,37 @@ "defaultMessage": "!!!Add workspace", "file": "src/features/workspaces/components/WorkspaceDrawer.js", "start": { - "line": 23, + "line": 24, "column": 23 }, "end": { - "line": 26, + "line": 27, + "column": 3 + } + }, + { + "id": "workspaceDrawer.workspaceFeatureInfo", + "defaultMessage": "!!!Info about workspace feature", + "file": "src/features/workspaces/components/WorkspaceDrawer.js", + "start": { + "line": 28, + "column": 24 + }, + "end": { + "line": 31, + "column": 3 + } + }, + { + "id": "workspaceDrawer.premiumCtaButtonLabel", + "defaultMessage": "!!!Create your first workspace", + "file": "src/features/workspaces/components/WorkspaceDrawer.js", + "start": { + "line": 32, + "column": 25 + }, + "end": { + "line": 35, "column": 3 } } -- cgit v1.2.3-70-g09d2 From 07d10ad573d36d460acabe282d6020487e95c090 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 3 Apr 2019 17:53:50 +0200 Subject: add open last used workspace logic --- src/features/workspaces/api.js | 11 +++++++++++ src/features/workspaces/store.js | 40 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 3 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/src/features/workspaces/api.js b/src/features/workspaces/api.js index 0ec20c9ea..0a3e2bfa4 100644 --- a/src/features/workspaces/api.js +++ b/src/features/workspaces/api.js @@ -1,4 +1,5 @@ import { pick } from 'lodash'; +import localStorage from 'mobx-localstorage'; import { sendAuthRequest } from '../../api/utils/auth'; import { API, API_VERSION } from '../../environment'; import Request from '../../stores/lib/Request'; @@ -51,12 +52,22 @@ export const workspaceApi = { if (!result.ok) throw result; return new Workspace(await result.json()); }, + + getWorkspaceSettings: async () => ( + localStorage.getItem('workspaces') || {} + ), + + setWorkspaceSettings: async settings => ( + localStorage.setItem('workspaces', settings) + ), }; export const getUserWorkspacesRequest = new Request(workspaceApi, 'getUserWorkspaces'); export const createWorkspaceRequest = new Request(workspaceApi, 'createWorkspace'); export const deleteWorkspaceRequest = new Request(workspaceApi, 'deleteWorkspace'); export const updateWorkspaceRequest = new Request(workspaceApi, 'updateWorkspace'); +export const getWorkspaceSettingsRequest = new Request(workspaceApi, 'getWorkspaceSettings'); +export const setWorkspaceSettingsRequest = new Request(workspaceApi, 'setWorkspaceSettings'); export const resetApiRequests = () => { getUserWorkspacesRequest.reset(); diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 712945bdc..2abb91c22 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -9,7 +9,7 @@ import { FeatureStore } from '../utils/FeatureStore'; import { createWorkspaceRequest, deleteWorkspaceRequest, - getUserWorkspacesRequest, + getUserWorkspacesRequest, getWorkspaceSettingsRequest, setWorkspaceSettingsRequest, updateWorkspaceRequest, } from './api'; @@ -37,6 +37,14 @@ export default class WorkspacesStore extends FeatureStore { return getUserWorkspacesRequest.result || []; } + @computed get settings() { + return getWorkspaceSettingsRequest.result; + } + + @computed get userHasWorkspaces() { + return getUserWorkspacesRequest.wasExecuted && this.workspaces.length > 0; + } + @computed get isPremiumUpgradeRequired() { return this.isFeatureEnabled && !this.isFeatureActive; } @@ -62,9 +70,11 @@ export default class WorkspacesStore extends FeatureStore { this._setActiveServiceOnWorkspaceSwitchReaction, this._setFeatureEnabledReaction, this._setIsPremiumFeatureReaction, + this._activateLastUsedWorkspaceReaction, ]); getUserWorkspacesRequest.execute(); + getWorkspaceSettingsRequest.execute(); this.isFeatureActive = true; } @@ -94,6 +104,13 @@ export default class WorkspacesStore extends FeatureStore { _getWorkspaceById = id => this.workspaces.find(w => w.id === id); + _updateSettings = (changes) => { + setWorkspaceSettingsRequest.execute({ + ...this.settings, + ...changes, + }); + }; + // Actions @action _edit = ({ workspace }) => { @@ -137,7 +154,10 @@ export default class WorkspacesStore extends FeatureStore { this.isSwitchingWorkspace = true; this.nextWorkspace = workspace; // Delay switching to next workspace so that the services loading does not drag down UI - setTimeout(() => { this.activeWorkspace = workspace; }, 100); + setTimeout(() => { + this.activeWorkspace = workspace; + this._updateSettings({ lastActiveWorkspace: workspace.id }); + }, 100); // Indicate that we are done switching to the next workspace setTimeout(() => { this.isSwitchingWorkspace = false; @@ -149,8 +169,12 @@ export default class WorkspacesStore extends FeatureStore { // Indicate that we are switching to default workspace this.isSwitchingWorkspace = true; this.nextWorkspace = null; + this._updateSettings({ lastActiveWorkspace: null }); + getWorkspaceSettingsRequest.execute(); // Delay switching to next workspace so that the services loading does not drag down UI - setTimeout(() => { this.activeWorkspace = null; }, 100); + setTimeout(() => { + this.activeWorkspace = null; + }, 100); // Indicate that we are done switching to the default workspace setTimeout(() => { this.isSwitchingWorkspace = false; }, 1000); }; @@ -195,4 +219,14 @@ export default class WorkspacesStore extends FeatureStore { } } }; + + _activateLastUsedWorkspaceReaction = () => { + if (!this.activeWorkspace && this.userHasWorkspaces) { + const { lastActiveWorkspace } = this.settings; + if (lastActiveWorkspace) { + const workspace = this._getWorkspaceById(lastActiveWorkspace); + if (workspace) this._setActiveWorkspace({ workspace }); + } + } + }; } -- cgit v1.2.3-70-g09d2 From 913b9e8614be3ae1e904423311d3adf55a210e5d Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Thu, 4 Apr 2019 14:02:34 +0200 Subject: use mobx-localstorage directly in the store --- src/features/workspaces/api.js | 10 ---------- src/features/workspaces/store.js | 9 ++++----- 2 files changed, 4 insertions(+), 15 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/src/features/workspaces/api.js b/src/features/workspaces/api.js index 0a3e2bfa4..356e48cdb 100644 --- a/src/features/workspaces/api.js +++ b/src/features/workspaces/api.js @@ -52,22 +52,12 @@ export const workspaceApi = { if (!result.ok) throw result; return new Workspace(await result.json()); }, - - getWorkspaceSettings: async () => ( - localStorage.getItem('workspaces') || {} - ), - - setWorkspaceSettings: async settings => ( - localStorage.setItem('workspaces', settings) - ), }; export const getUserWorkspacesRequest = new Request(workspaceApi, 'getUserWorkspaces'); export const createWorkspaceRequest = new Request(workspaceApi, 'createWorkspace'); export const deleteWorkspaceRequest = new Request(workspaceApi, 'deleteWorkspace'); export const updateWorkspaceRequest = new Request(workspaceApi, 'updateWorkspace'); -export const getWorkspaceSettingsRequest = new Request(workspaceApi, 'getWorkspaceSettings'); -export const setWorkspaceSettingsRequest = new Request(workspaceApi, 'setWorkspaceSettings'); export const resetApiRequests = () => { getUserWorkspacesRequest.reset(); diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 2abb91c22..4d65712a7 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -3,13 +3,14 @@ import { observable, action, } from 'mobx'; +import localStorage from 'mobx-localstorage'; import { matchRoute } from '../../helpers/routing-helpers'; import { workspaceActions } from './actions'; import { FeatureStore } from '../utils/FeatureStore'; import { createWorkspaceRequest, deleteWorkspaceRequest, - getUserWorkspacesRequest, getWorkspaceSettingsRequest, setWorkspaceSettingsRequest, + getUserWorkspacesRequest, updateWorkspaceRequest, } from './api'; @@ -38,7 +39,7 @@ export default class WorkspacesStore extends FeatureStore { } @computed get settings() { - return getWorkspaceSettingsRequest.result; + return localStorage.getItem('workspaces') || {}; } @computed get userHasWorkspaces() { @@ -74,7 +75,6 @@ export default class WorkspacesStore extends FeatureStore { ]); getUserWorkspacesRequest.execute(); - getWorkspaceSettingsRequest.execute(); this.isFeatureActive = true; } @@ -105,7 +105,7 @@ export default class WorkspacesStore extends FeatureStore { _getWorkspaceById = id => this.workspaces.find(w => w.id === id); _updateSettings = (changes) => { - setWorkspaceSettingsRequest.execute({ + localStorage.setItem('workspaces', { ...this.settings, ...changes, }); @@ -170,7 +170,6 @@ export default class WorkspacesStore extends FeatureStore { this.isSwitchingWorkspace = true; this.nextWorkspace = null; this._updateSettings({ lastActiveWorkspace: null }); - getWorkspaceSettingsRequest.execute(); // Delay switching to next workspace so that the services loading does not drag down UI setTimeout(() => { this.activeWorkspace = null; -- cgit v1.2.3-70-g09d2 From 2243edb4aa8d837332e9727217983ec4fe334b58 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Thu, 4 Apr 2019 15:59:09 +0200 Subject: fix bug in workspace feature initialization --- src/features/workspaces/index.js | 8 ++------ src/features/workspaces/store.js | 13 +++++++------ 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/src/features/workspaces/index.js b/src/features/workspaces/index.js index 524a83e3c..fb5135743 100644 --- a/src/features/workspaces/index.js +++ b/src/features/workspaces/index.js @@ -10,15 +10,11 @@ export const workspaceStore = new WorkspacesStore(); export default function initWorkspaces(stores, actions) { stores.workspaces = workspaceStore; - const { features, user } = stores; + const { features } = stores; // Toggle workspace feature reaction( - () => ( - features.features.isWorkspaceEnabled && ( - !features.features.isWorkspacePremiumFeature || user.data.isPremium - ) - ), + () => features.features.isWorkspaceEnabled, (isEnabled) => { if (isEnabled && !workspaceStore.isFeatureActive) { debug('Initializing `workspaces` feature'); diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 4d65712a7..7bd969be0 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -19,9 +19,11 @@ const debug = require('debug')('Franz:feature:workspaces:store'); export default class WorkspacesStore extends FeatureStore { @observable isFeatureEnabled = false; + @observable isFeatureActive = false; + @observable isPremiumFeature = true; - @observable isFeatureActive = false; + @observable isPremiumUpgradeRequired = true; @observable activeWorkspace = null; @@ -46,10 +48,6 @@ export default class WorkspacesStore extends FeatureStore { return getUserWorkspacesRequest.wasExecuted && this.workspaces.length > 0; } - @computed get isPremiumUpgradeRequired() { - return this.isFeatureEnabled && !this.isFeatureActive; - } - start(stores, actions) { debug('WorkspacesStore::start'); this.stores = stores; @@ -194,8 +192,11 @@ export default class WorkspacesStore extends FeatureStore { }; _setIsPremiumFeatureReaction = () => { - const { isWorkspacePremiumFeature } = this.stores.features.features; + const { features, user } = this.stores; + const { isPremium } = user.data; + const { isWorkspacePremiumFeature } = features.features; this.isPremiumFeature = isWorkspacePremiumFeature; + this.isPremiumUpgradeRequired = isWorkspacePremiumFeature && !isPremium; }; _setWorkspaceBeingEditedReaction = () => { -- cgit v1.2.3-70-g09d2 From 05d13dea31861df7366dfe40395c1b04462d02ce Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Fri, 5 Apr 2019 20:46:10 +0200 Subject: ensure drawer is open on workspace settings routes --- src/app.js | 5 +++-- src/features/workspaces/index.js | 5 +++++ src/features/workspaces/store.js | 26 ++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/src/app.js b/src/app.js index d3b540f62..fb9f1c6ab 100644 --- a/src/app.js +++ b/src/app.js @@ -41,6 +41,7 @@ import AuthLayoutContainer from './containers/auth/AuthLayoutContainer'; import SubscriptionPopupScreen from './containers/subscription/SubscriptionPopupScreen'; import WorkspacesScreen from './features/workspaces/containers/WorkspacesScreen'; import EditWorkspaceScreen from './features/workspaces/containers/EditWorkspaceScreen'; +import { WORKSPACES_ROUTES } from './features/workspaces'; // Add Polyfills smoothScroll.polyfill(); @@ -77,8 +78,8 @@ window.addEventListener('load', () => { - - + + diff --git a/src/features/workspaces/index.js b/src/features/workspaces/index.js index fb5135743..ad9023b8b 100644 --- a/src/features/workspaces/index.js +++ b/src/features/workspaces/index.js @@ -30,3 +30,8 @@ export default function initWorkspaces(stores, actions) { }, ); } + +export const WORKSPACES_ROUTES = { + ROOT: '/settings/workspaces', + EDIT: '/settings/workspaces/:action/:id', +}; diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 7bd969be0..2e1764f99 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -13,6 +13,7 @@ import { getUserWorkspacesRequest, updateWorkspaceRequest, } from './api'; +import { WORKSPACES_ROUTES } from './index'; const debug = require('debug')('Franz:feature:workspaces:store'); @@ -70,6 +71,7 @@ export default class WorkspacesStore extends FeatureStore { this._setFeatureEnabledReaction, this._setIsPremiumFeatureReaction, this._activateLastUsedWorkspaceReaction, + this._openDrawerWithSettingsReaction, ]); getUserWorkspacesRequest.execute(); @@ -100,6 +102,10 @@ export default class WorkspacesStore extends FeatureStore { // ========== PRIVATE ========= // + _wasDrawerOpenBeforeSettingsRoute = null; + + _isSettingsRouteActive = null; + _getWorkspaceById = id => this.workspaces.find(w => w.id === id); _updateSettings = (changes) => { @@ -229,4 +235,24 @@ export default class WorkspacesStore extends FeatureStore { } } }; + + _openDrawerWithSettingsReaction = () => { + const { router } = this.stores; + const isWorkspaceSettingsRoute = router.location.pathname.includes(WORKSPACES_ROUTES.ROOT); + const isSwitchingToSettingsRoute = !this._isSettingsRouteActive && isWorkspaceSettingsRoute; + const isLeavingSettingsRoute = !isWorkspaceSettingsRoute && this._isSettingsRouteActive; + + if (isSwitchingToSettingsRoute) { + this._isSettingsRouteActive = true; + this._wasDrawerOpenBeforeSettingsRoute = this.isWorkspaceDrawerOpen; + if (!this._wasDrawerOpenBeforeSettingsRoute) { + workspaceActions.toggleWorkspaceDrawer(); + } + } else if (isLeavingSettingsRoute) { + this._isSettingsRouteActive = false; + if (!this._wasDrawerOpenBeforeSettingsRoute && this.isWorkspaceDrawerOpen) { + workspaceActions.toggleWorkspaceDrawer(); + } + } + }; } -- cgit v1.2.3-70-g09d2 From 073212bf046b9218f9e3129988b1b63fba5d685d Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 10 Apr 2019 16:12:38 +0200 Subject: added generic pro badge component for settings nav --- packages/ui/src/badge/ProBadge.tsx | 65 ++++++++++++++++++++++ packages/ui/src/index.ts | 1 + .../settings/navigation/SettingsNavigation.js | 13 +++-- src/features/workspaces/store.js | 12 ++-- src/i18n/locales/defaultMessages.json | 28 +++++----- src/i18n/locales/en-US.json | 2 +- .../settings/navigation/SettingsNavigation.json | 28 +++++----- src/stores/UIStore.js | 9 +-- src/styles/settings.scss | 26 --------- uidev/src/stories/badge.stories.tsx | 12 +++- 10 files changed, 125 insertions(+), 71 deletions(-) create mode 100644 packages/ui/src/badge/ProBadge.tsx (limited to 'src/features/workspaces/store.js') diff --git a/packages/ui/src/badge/ProBadge.tsx b/packages/ui/src/badge/ProBadge.tsx new file mode 100644 index 000000000..eb00e156d --- /dev/null +++ b/packages/ui/src/badge/ProBadge.tsx @@ -0,0 +1,65 @@ +import { Theme } from '@meetfranz/theme'; +import classnames from 'classnames'; +import React, { Component } from 'react'; +import injectStyle from 'react-jss'; + +import { Icon, Badge } from '../'; +import { IWithStyle } from '../typings/generic'; + +interface IProps extends IWithStyle { + badgeClasses?: string; + iconClasses?: string; + inverted?: boolean; +} + +const styles = (theme: Theme) => ({ + badge: { + height: 'auto', + padding: [4, 6, 2, 7], + borderRadius: theme.borderRadiusSmall, + }, + invertedBadge: { + background: theme.styleTypes.primary.contrast, + color: theme.styleTypes.primary.accent, + }, + icon: { + fill: theme.styleTypes.primary.contrast, + }, + invertedIcon: { + fill: theme.styleTypes.primary.accent, + }, +}); + +class ProBadgeComponent extends Component { + render() { + const { + classes, + badgeClasses, + iconClasses, + inverted, + } = this.props; + + return ( + + + + ); + } +} + +export const ProBadge = injectStyle(styles)(ProBadgeComponent); diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index 1eeec5144..666495ce9 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -3,3 +3,4 @@ export { Infobox } from './infobox'; export * from './headline'; export { Loader } from './loader'; export { Badge } from './badge'; +export { ProBadge } from './badge/ProBadge'; diff --git a/src/components/settings/navigation/SettingsNavigation.js b/src/components/settings/navigation/SettingsNavigation.js index 1c51d50d6..993b0a44a 100644 --- a/src/components/settings/navigation/SettingsNavigation.js +++ b/src/components/settings/navigation/SettingsNavigation.js @@ -2,10 +2,11 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { defineMessages, intlShape } from 'react-intl'; import { inject, observer } from 'mobx-react'; -import { Icon } from '@meetfranz/ui'; +import { ProBadge } from '@meetfranz/ui'; import Link from '../../ui/Link'; import { workspaceStore } from '../../../features/workspaces'; +import UIStore from '../../../stores/UIStore'; const messages = defineMessages({ availableServices: { @@ -40,6 +41,9 @@ const messages = defineMessages({ export default @inject('stores') @observer class SettingsNavigation extends Component { static propTypes = { + stores: PropTypes.shape({ + ui: PropTypes.instanceOf(UIStore).isRequired, + }).isRequired, serviceCount: PropTypes.number.isRequired, workspaceCount: PropTypes.number.isRequired, }; @@ -49,7 +53,8 @@ export default @inject('stores') @observer class SettingsNavigation extends Comp }; render() { - const { serviceCount, workspaceCount } = this.props; + const { serviceCount, workspaceCount, stores } = this.props; + const { isDarkThemeActive } = stores.ui; const { intl } = this.context; return ( @@ -79,9 +84,7 @@ export default @inject('stores') @observer class SettingsNavigation extends Comp {intl.formatMessage(messages.yourWorkspaces)} {' '} {workspaceStore.isPremiumUpgradeRequired ? ( - - - + ) : ( {workspaceCount} )} diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 2e1764f99..ba48022c2 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -36,6 +36,8 @@ export default class WorkspacesStore extends FeatureStore { @observable isWorkspaceDrawerOpen = false; + @observable isSettingsRouteActive = null; + @computed get workspaces() { if (!this.isFeatureActive) return []; return getUserWorkspacesRequest.result || []; @@ -104,8 +106,6 @@ export default class WorkspacesStore extends FeatureStore { _wasDrawerOpenBeforeSettingsRoute = null; - _isSettingsRouteActive = null; - _getWorkspaceById = id => this.workspaces.find(w => w.id === id); _updateSettings = (changes) => { @@ -239,17 +239,17 @@ export default class WorkspacesStore extends FeatureStore { _openDrawerWithSettingsReaction = () => { const { router } = this.stores; const isWorkspaceSettingsRoute = router.location.pathname.includes(WORKSPACES_ROUTES.ROOT); - const isSwitchingToSettingsRoute = !this._isSettingsRouteActive && isWorkspaceSettingsRoute; - const isLeavingSettingsRoute = !isWorkspaceSettingsRoute && this._isSettingsRouteActive; + const isSwitchingToSettingsRoute = !this.isSettingsRouteActive && isWorkspaceSettingsRoute; + const isLeavingSettingsRoute = !isWorkspaceSettingsRoute && this.isSettingsRouteActive; if (isSwitchingToSettingsRoute) { - this._isSettingsRouteActive = true; + this.isSettingsRouteActive = true; this._wasDrawerOpenBeforeSettingsRoute = this.isWorkspaceDrawerOpen; if (!this._wasDrawerOpenBeforeSettingsRoute) { workspaceActions.toggleWorkspaceDrawer(); } } else if (isLeavingSettingsRoute) { - this._isSettingsRouteActive = false; + this.isSettingsRouteActive = false; if (!this._wasDrawerOpenBeforeSettingsRoute && this.isWorkspaceDrawerOpen) { workspaceActions.toggleWorkspaceDrawer(); } diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index f882e6030..791c4dd53 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json @@ -1302,91 +1302,91 @@ "defaultMessage": "!!!Available services", "end": { "column": 3, - "line": 14 + "line": 15 }, "file": "src/components/settings/navigation/SettingsNavigation.js", "id": "settings.navigation.availableServices", "start": { "column": 21, - "line": 11 + "line": 12 } }, { "defaultMessage": "!!!Your services", "end": { "column": 3, - "line": 18 + "line": 19 }, "file": "src/components/settings/navigation/SettingsNavigation.js", "id": "settings.navigation.yourServices", "start": { "column": 16, - "line": 15 + "line": 16 } }, { "defaultMessage": "!!!Your workspaces", "end": { "column": 3, - "line": 22 + "line": 23 }, "file": "src/components/settings/navigation/SettingsNavigation.js", "id": "settings.navigation.yourWorkspaces", "start": { "column": 18, - "line": 19 + "line": 20 } }, { "defaultMessage": "!!!Account", "end": { "column": 3, - "line": 26 + "line": 27 }, "file": "src/components/settings/navigation/SettingsNavigation.js", "id": "settings.navigation.account", "start": { "column": 11, - "line": 23 + "line": 24 } }, { "defaultMessage": "!!!Settings", "end": { "column": 3, - "line": 30 + "line": 31 }, "file": "src/components/settings/navigation/SettingsNavigation.js", "id": "settings.navigation.settings", "start": { "column": 12, - "line": 27 + "line": 28 } }, { "defaultMessage": "!!!Invite Friends", "end": { "column": 3, - "line": 34 + "line": 35 }, "file": "src/components/settings/navigation/SettingsNavigation.js", "id": "settings.navigation.inviteFriends", "start": { "column": 17, - "line": 31 + "line": 32 } }, { "defaultMessage": "!!!Logout", "end": { "column": 3, - "line": 38 + "line": 39 }, "file": "src/components/settings/navigation/SettingsNavigation.js", "id": "settings.navigation.logout", "start": { "column": 10, - "line": 35 + "line": 36 } } ], diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index db1d51f3b..6591af2e2 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -315,4 +315,4 @@ "workspaceDrawer.workspaceFeatureInfo": "

Franz 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/settings/navigation/SettingsNavigation.json b/src/i18n/messages/src/components/settings/navigation/SettingsNavigation.json index de78a71cf..77b0ed8a4 100644 --- a/src/i18n/messages/src/components/settings/navigation/SettingsNavigation.json +++ b/src/i18n/messages/src/components/settings/navigation/SettingsNavigation.json @@ -4,11 +4,11 @@ "defaultMessage": "!!!Available services", "file": "src/components/settings/navigation/SettingsNavigation.js", "start": { - "line": 11, + "line": 12, "column": 21 }, "end": { - "line": 14, + "line": 15, "column": 3 } }, @@ -17,11 +17,11 @@ "defaultMessage": "!!!Your services", "file": "src/components/settings/navigation/SettingsNavigation.js", "start": { - "line": 15, + "line": 16, "column": 16 }, "end": { - "line": 18, + "line": 19, "column": 3 } }, @@ -30,11 +30,11 @@ "defaultMessage": "!!!Your workspaces", "file": "src/components/settings/navigation/SettingsNavigation.js", "start": { - "line": 19, + "line": 20, "column": 18 }, "end": { - "line": 22, + "line": 23, "column": 3 } }, @@ -43,11 +43,11 @@ "defaultMessage": "!!!Account", "file": "src/components/settings/navigation/SettingsNavigation.js", "start": { - "line": 23, + "line": 24, "column": 11 }, "end": { - "line": 26, + "line": 27, "column": 3 } }, @@ -56,11 +56,11 @@ "defaultMessage": "!!!Settings", "file": "src/components/settings/navigation/SettingsNavigation.js", "start": { - "line": 27, + "line": 28, "column": 12 }, "end": { - "line": 30, + "line": 31, "column": 3 } }, @@ -69,11 +69,11 @@ "defaultMessage": "!!!Invite Friends", "file": "src/components/settings/navigation/SettingsNavigation.js", "start": { - "line": 31, + "line": 32, "column": 17 }, "end": { - "line": 34, + "line": 35, "column": 3 } }, @@ -82,11 +82,11 @@ "defaultMessage": "!!!Logout", "file": "src/components/settings/navigation/SettingsNavigation.js", "start": { - "line": 35, + "line": 36, "column": 10 }, "end": { - "line": 38, + "line": 39, "column": 3 } } diff --git a/src/stores/UIStore.js b/src/stores/UIStore.js index bb7965a4a..a95a8e1e0 100644 --- a/src/stores/UIStore.js +++ b/src/stores/UIStore.js @@ -21,11 +21,12 @@ export default class UIStore extends Store { return (settings.app.isAppMuted && settings.app.showMessageBadgeWhenMuted) || !settings.isAppMuted; } - @computed get theme() { - if (this.stores.settings.all.app.darkMode) { - return theme('dark'); - } + @computed get isDarkThemeActive() { + return this.stores.settings.all.app.darkMode; + } + @computed get theme() { + if (this.isDarkThemeActive) return theme('dark'); return theme('default'); } diff --git a/src/styles/settings.scss b/src/styles/settings.scss index 6340f2951..dd6f56d2b 100644 --- a/src/styles/settings.scss +++ b/src/styles/settings.scss @@ -85,11 +85,6 @@ .badge { background: $dark-theme-gray-lighter; color: $dark-theme-gray-smoke; - - &.badge--pro { - background: $theme-brand-primary; - padding: 4px 6px 3px 7px; - } } &:hover { @@ -98,11 +93,6 @@ .badge { background: $dark-theme-gray-lighter; color: $dark-theme-gray-smoke; - - &.badge--pro { - background: $theme-brand-primary; - padding: 4px 6px 3px 7px; - } } } @@ -433,15 +423,6 @@ text-decoration: none; transition: background $theme-transition-time, color $theme-transition-time; - .badge--pro { - background: $theme-brand-primary !important; - padding: 4px 6px 3px 7px; - - .badge-icon-pro { - fill: white; - } - } - &:hover { background: darken($theme-gray-lightest, 5%); @@ -454,13 +435,6 @@ background: $theme-brand-primary; color: #FFF; - .badge--pro { - background: white !important; - .badge-icon-pro { - fill: $theme-brand-primary; - } - } - .badge { background: #FFF; color: $theme-brand-primary; diff --git a/uidev/src/stories/badge.stories.tsx b/uidev/src/stories/badge.stories.tsx index 6de2034bf..d7b4d55b5 100644 --- a/uidev/src/stories/badge.stories.tsx +++ b/uidev/src/stories/badge.stories.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Badge } from '@meetfranz/ui'; +import { Badge, ProBadge } from '@meetfranz/ui'; import { storiesOf } from '../stores/stories'; storiesOf('Badge') @@ -18,4 +18,14 @@ storiesOf('Badge') danger inverted + )) + .add('Pro Badge', () => ( + <> + + + )) + .add('Pro Badge inverted', () => ( + <> + + )); -- cgit v1.2.3-70-g09d2 From adf5ac074626dac5bfec9d8fb54b28149e492e1b Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 10 Apr 2019 17:17:02 +0200 Subject: handle deleted services that are attached to workspaces --- src/containers/layout/AppLayoutContainer.js | 2 +- src/features/workspaces/store.js | 32 ++++++++++++++++++++++------- src/i18n/locales/en-US.json | 2 +- 3 files changed, 27 insertions(+), 9 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 52d4e0c27..2d855c78f 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js @@ -88,7 +88,7 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e const workspacesDrawer = ( ( - workspace ? workspace.services.map(id => services.one(id).name) : services.all.map(s => s.name) + workspace ? workspaceStore.getWorkspaceServices(workspace).map(s => s.name) : services.all.map(s => s.name) )} onUpgradeAccountClick={() => openSettings({ path: 'user' })} /> diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index ba48022c2..ea601700e 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -74,6 +74,7 @@ export default class WorkspacesStore extends FeatureStore { this._setIsPremiumFeatureReaction, this._activateLastUsedWorkspaceReaction, this._openDrawerWithSettingsReaction, + this._cleanupInvalidServiceReferences, ]); getUserWorkspacesRequest.execute(); @@ -92,16 +93,17 @@ export default class WorkspacesStore extends FeatureStore { filterServicesByActiveWorkspace = (services) => { const { activeWorkspace, isFeatureActive } = this; - - if (!isFeatureActive) return services; - if (activeWorkspace) { - return services.filter(s => ( - activeWorkspace.services.includes(s.id) - )); + if (isFeatureActive && activeWorkspace) { + return this.getWorkspaceServices(activeWorkspace); } return services; }; + getWorkspaceServices(workspace) { + const { services } = this.stores; + return workspace.services.map(id => services.one(id)).filter(s => !!s); + } + // ========== PRIVATE ========= // _wasDrawerOpenBeforeSettingsRoute = null; @@ -218,7 +220,8 @@ export default class WorkspacesStore extends FeatureStore { if (this.activeWorkspace) { const services = this.stores.services.allDisplayed; const activeService = services.find(s => s.isActive); - const workspaceServices = this.filterServicesByActiveWorkspace(services); + const workspaceServices = this.getWorkspaceServices(this.activeWorkspace); + if (workspaceServices.length <= 0) return; const isActiveServiceInWorkspace = workspaceServices.includes(activeService); if (!isActiveServiceInWorkspace) { this.actions.service.setActive({ serviceId: workspaceServices[0].id }); @@ -255,4 +258,19 @@ export default class WorkspacesStore extends FeatureStore { } } }; + + _cleanupInvalidServiceReferences = () => { + const { services } = this.stores; + let invalidServiceReferencesExist = false; + this.workspaces.forEach((workspace) => { + workspace.services.forEach((serviceId) => { + if (!services.one(serviceId)) { + invalidServiceReferencesExist = true; + } + }); + }); + if (invalidServiceReferencesExist) { + getUserWorkspacesRequest.execute(); + } + }; } diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index da7649b90..84a71117a 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -317,4 +317,4 @@ "workspaceDrawer.workspaceFeatureInfo": "

Franz 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 -- cgit v1.2.3-70-g09d2 From eaf4aff646eed56e65c8dd8e70143ab5634ad4b4 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Thu, 11 Apr 2019 16:44:16 +0200 Subject: WIP: announcement feature and workspace fixes --- packages/theme/src/themes/dark/index.ts | 19 -- packages/theme/src/themes/default/index.ts | 20 -- src/features/announcements/actions.js | 4 +- src/features/announcements/api.js | 18 +- .../announcements/components/AnnouncementScreen.js | 152 ++++++++++++--- src/features/announcements/store.js | 151 +++++++++------ src/features/utils/FeatureStore.js | 29 ++- src/features/workspaces/store.js | 18 +- src/i18n/locales/defaultMessages.json | 6 +- src/i18n/locales/en-US.json | 6 +- .../src/features/announcements/Component.json | 4 +- .../components/AnnouncementScreen.json | 8 +- src/i18n/messages/src/lib/Menu.json | 214 ++++++++++----------- src/lib/Menu.js | 15 +- src/stores/index.js | 4 + 15 files changed, 405 insertions(+), 263 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/packages/theme/src/themes/dark/index.ts b/packages/theme/src/themes/dark/index.ts index fd04b106c..b17dc8965 100644 --- a/packages/theme/src/themes/dark/index.ts +++ b/packages/theme/src/themes/dark/index.ts @@ -111,22 +111,3 @@ export const workspaces = merge({}, defaultStyles.workspaces, { }, }, }); - -// // Workspace settings -// export const workspaceSettings = merge({}, defaultStyles.workspaceSettings, { -// listItemBorderColor: legacyStyles.darkThemeGrayDarker, -// listItemHoverBgColor: legacyStyles.darkThemeGrayDarker, -// }); -// -// // Workspace Drawer -// export const workspaceDrawerBackground = color(colorBackground).lighten(0.3).hex(); -// export const workspaceDrawerAddButtonColor = legacyStyles.darkThemeGrayLighter; -// export const workspaceDrawerAddButtonHoverColor = legacyStyles.darkThemeGraySmoke; -// export const workspaceDrawerItemBorder = color(workspaceDrawerBackground).lighten(0.2).hex(); -// export const workspaceDrawerItemHoverBackground = color(workspaceDrawerBackground).lighten(0.2).hex(); -// export const workspaceDrawerItemActiveBackground = defaultStyles.brandPrimary; -// export const workspaceDrawerItemNameColor = colorText; -// export const workspaceDrawerItemNameActiveColor = 'white'; -// export const workspaceDrawerServicesColor = color(colorText).darken(0.5).hex(); -// export const workspaceDrawerServicesActiveColor = color(defaultStyles.brandPrimary).lighten(0.5).hex(); -// diff --git a/packages/theme/src/themes/default/index.ts b/packages/theme/src/themes/default/index.ts index d0493b82f..46d29f593 100644 --- a/packages/theme/src/themes/default/index.ts +++ b/packages/theme/src/themes/default/index.ts @@ -200,23 +200,3 @@ export const workspaces = { spinnerColor: 'white', }, }; - -// export const workspaceSettings = { -// listItemHeight: 57, -// listItemBorderColor: legacyStyles.themeGrayLightest, -// listItemHoverBgColor: legacyStyles.themeGrayLightest, -// }; -// -// // Workspace Drawer -// export const workspaceDrawerWidth = 300; -// export const workspaceDrawerPadding = 20; -// export const workspaceDrawerBackground = color(colorBackground).lighten(0.1).hex(); -// export const workspaceDrawerAddButtonColor = legacyStyles.themeGrayLight; -// export const workspaceDrawerAddButtonHoverColor = color(legacyStyles.themeGrayLight).lighten(0.1).hex(); -// export const workspaceDrawerItemHoverBackground = color(workspaceDrawerBackground).darken(0.01).hex(); -// export const workspaceDrawerItemActiveBackground = legacyStyles.themeGrayLightest; -// export const workspaceDrawerItemBorder = color(workspaceDrawerBackground).darken(0.05).hex(); -// export const workspaceDrawerItemNameColor = colorText; -// export const workspaceDrawerItemNameActiveColor = colorText; -// export const workspaceDrawerServicesColor = color(colorText).lighten(1.5).hex(); -// export const workspaceDrawerServicesActiveColor = workspaceDrawerServicesColor; diff --git a/src/features/announcements/actions.js b/src/features/announcements/actions.js index 68b262ded..bab496314 100644 --- a/src/features/announcements/actions.js +++ b/src/features/announcements/actions.js @@ -2,7 +2,9 @@ import PropTypes from 'prop-types'; import { createActionsFromDefinitions } from '../../actions/lib/actions'; export const announcementActions = createActionsFromDefinitions({ - show: {}, + show: { + targetVersion: PropTypes.string, + }, }, PropTypes.checkPropTypes); export default announcementActions; diff --git a/src/features/announcements/api.js b/src/features/announcements/api.js index 09fcb8235..a581bd8de 100644 --- a/src/features/announcements/api.js +++ b/src/features/announcements/api.js @@ -1,5 +1,6 @@ import { remote } from 'electron'; import Request from '../../stores/lib/Request'; +import { API, API_VERSION } from '../../environment'; const debug = require('debug')('Franz:feature:announcements:api'); @@ -9,15 +10,24 @@ export const announcementsApi = { return Promise.resolve(remote.app.getVersion()); }, - async getAnnouncementForVersion(version) { - debug('fetching release announcement from Github'); + async getChangelog(version) { + debug('fetching release changelog from Github'); const url = `https://api.github.com/repos/meetfranz/franz/releases/tags/v${version}`; const request = await window.fetch(url, { method: 'GET' }); - if (!request.ok) throw request; + if (!request.ok) return null; const data = await request.json(); return data.body; }, + + async getAnnouncement(version) { + debug('fetching release announcement from api'); + const url = `${API}/${API_VERSION}/announcements/${version}`; + 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 getAnnouncementRequest = new Request(announcementsApi, 'getAnnouncementForVersion'); +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 index 5b3e7aeaa..2d5efc396 100644 --- a/src/features/announcements/components/AnnouncementScreen.js +++ b/src/features/announcements/components/AnnouncementScreen.js @@ -4,27 +4,29 @@ import PropTypes from 'prop-types'; import { inject, observer } from 'mobx-react'; import { defineMessages, intlShape } from 'react-intl'; import injectSheet from 'react-jss'; -import { themeSidebarWidth } from '../../../../packages/theme/lib/themes/legacy'; +import { Button } from '@meetfranz/forms'; + import { announcementsStore } from '../index'; +import UIStore from '../../../stores/UIStore'; const messages = defineMessages({ headline: { - id: 'feature.announcements.headline', - defaultMessage: '!!!What\'s new in Franz {version}?', + id: 'feature.announcements.changelog.headline', + defaultMessage: '!!!Changes in Franz {version}', }, }); +const smallScreen = '1000px'; + const styles = theme => ({ container: { background: theme.colorBackground, position: 'absolute', top: 0, zIndex: 140, - width: `calc(100% - ${themeSidebarWidth})`, - display: 'flex', - 'flex-direction': 'column', - 'align-items': 'center', - 'justify-content': 'center', + width: '100%', + height: '100%', + overflowY: 'auto', }, headline: { color: theme.colorHeadline, @@ -33,7 +35,76 @@ const styles = theme => ({ 'text-align': 'center', 'line-height': '1.3em', }, - body: { + announcement: { + height: '100vh', + display: 'flex', + flexDirection: 'column', + justifyContent: 'center', + }, + main: { + flexGrow: 1, + '& h1': { + marginTop: 40, + fontSize: 50, + color: theme.styleTypes.primary.accent, + textAlign: 'center', + [`@media(min-width: ${smallScreen})`]: { + marginTop: 75, + }, + }, + '& h2': { + fontSize: 24, + fontWeight: 300, + color: theme.colorText, + textAlign: 'center', + }, + }, + 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', + }, + changelog: { '& h3': { fontSize: '24px', margin: '1.5em 0 1em 0', @@ -45,10 +116,13 @@ const styles = theme => ({ }); -@inject('actions') @injectSheet(styles) @observer +@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, }; static contextTypes = { @@ -56,21 +130,55 @@ class AnnouncementScreen extends Component { }; render() { - const { classes } = this.props; + const { classes, stores } = this.props; const { intl } = this.context; + const { changelog, announcement } = announcementsStore; + const themeImage = stores.ui.isDarkThemeActive ? 'dark' : 'light'; return (
-

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

-
+
+
+

{announcement.main.headline}

+

{announcement.main.subHeadline}

+
+
+ +
+
+

+

+
+
+
+
+ {announcement.spotlight && ( +
+

{announcement.spotlight.title}

+
+ )} +
+ {changelog && ( +
+

+ {intl.formatMessage(messages.headline, { + version: announcementsStore.currentVersion, + })} +

+
+
+ )}
); } diff --git a/src/features/announcements/store.js b/src/features/announcements/store.js index c59700926..d4fb0a52c 100644 --- a/src/features/announcements/store.js +++ b/src/features/announcements/store.js @@ -1,96 +1,93 @@ -import { action, observable, reaction } from 'mobx'; +import { + action, + computed, + observable, + reaction, +} from 'mobx'; import semver from 'semver'; +import localStorage from 'mobx-localstorage'; + import { FeatureStore } from '../utils/FeatureStore'; -import { getAnnouncementRequest, getCurrentVersionRequest } from './api'; +import { getAnnouncementRequest, getChangelogRequest, getCurrentVersionRequest } from './api'; +import { announcementActions } from './actions'; + +const LOCAL_STORAGE_KEY = 'announcements'; const debug = require('debug')('Franz:feature:announcements:store'); export class AnnouncementsStore extends FeatureStore { - - @observable announcement = null; - - @observable currentVersion = null; - - @observable lastUsedVersion = null; + @observable targetVersion = null; @observable isAnnouncementVisible = false; @observable isFeatureActive = false; - async start(stores, actions) { - debug('AnnouncementsStore::start'); - this.stores = stores; - this.actions = actions; - await this.fetchLastUsedVersion(); - await this.fetchCurrentVersion(); - await this.fetchReleaseAnnouncement(); - this.showAnnouncementIfNotSeenYet(); - - this.actions.announcements.show.listen(this._showAnnouncement.bind(this)); - this.isFeatureActive = true; + @computed get changelog() { + return getChangelogRequest.result; } - stop() { - debug('AnnouncementsStore::stop'); - this.isFeatureActive = false; - this.isAnnouncementVisible = false; + @computed get announcement() { + return getAnnouncementRequest.result; } - // ====== PUBLIC ====== - - async fetchLastUsedVersion() { - debug('getting last used version from local storage'); - const lastUsedVersion = window.localStorage.getItem('lastUsedVersion'); - this._setLastUsedVersion(lastUsedVersion == null ? '0.0.0' : lastUsedVersion); + @computed get settings() { + return localStorage.getItem(LOCAL_STORAGE_KEY) || {}; } - async fetchCurrentVersion() { - debug('getting current version from api'); - const version = await getCurrentVersionRequest.execute(); - this._setCurrentVersion(version); + @computed get lastSeenAnnouncementVersion() { + return this.settings.lastSeenAnnouncementVersion || null; } - async fetchReleaseAnnouncement() { - debug('getting release announcement from api'); - try { - const announcement = await getAnnouncementRequest.execute(this.currentVersion); - this._setAnnouncement(announcement); - } catch (error) { - this._setAnnouncement(null); - } + @computed get currentVersion() { + return getCurrentVersionRequest.result; } - showAnnouncementIfNotSeenYet() { - const { announcement, currentVersion, lastUsedVersion } = this; - if (announcement && semver.gt(currentVersion, lastUsedVersion)) { - debug(`${currentVersion} < ${lastUsedVersion}: announcement is shown`); - this._showAnnouncement(); - } else { - debug(`${currentVersion} >= ${lastUsedVersion}: announcement is hidden`); - this._hideAnnouncement(); - } + @computed get isNewUser() { + return this.stores.settings.stats.appStarts <= 1; } - // ====== PRIVATE ====== + async start(stores, actions) { + debug('AnnouncementsStore::start'); + this.stores = stores; + this.actions = actions; + getCurrentVersionRequest.execute(); - @action _setCurrentVersion(version) { - debug(`setting current version to ${version}`); - this.currentVersion = version; - } + this._registerActions([ + [announcementActions.show, this._showAnnouncement], + ]); - @action _setLastUsedVersion(version) { - debug(`setting last used version to ${version}`); - this.lastUsedVersion = version; + this._registerReactions([ + this._fetchAnnouncements, + this._showAnnouncementToUsersWhoUpdatedApp, + ]); + this.isFeatureActive = true; } - @action _setAnnouncement(announcement) { - debug(`setting announcement to ${announcement}`); - this.announcement = announcement; + stop() { + super.stop(); + debug('AnnouncementsStore::stop'); + this.isFeatureActive = false; + this.isAnnouncementVisible = false; } - @action _showAnnouncement() { + // ======= HELPERS ======= // + + _updateSettings = (changes) => { + localStorage.setItem(LOCAL_STORAGE_KEY, { + ...this.settings, + ...changes, + }); + }; + + // ======= ACTIONS ======= // + + @action _showAnnouncement = ({ targetVersion } = {}) => { + this.targetVersion = targetVersion || this.currentVersion; this.isAnnouncementVisible = true; this.actions.service.blurActive(); + this._updateSettings({ + lastSeenAnnouncementVersion: this.currentVersion, + }); const dispose = reaction( () => this.stores.services.active, () => { @@ -98,9 +95,37 @@ export class AnnouncementsStore extends FeatureStore { dispose(); }, ); - } + }; @action _hideAnnouncement() { this.isAnnouncementVisible = false; } + + // ======= REACTIONS ======== + + _showAnnouncementToUsersWhoUpdatedApp = () => { + const { announcement, isNewUser } = this; + console.log(announcement, isNewUser); + // Check if there is an announcement and on't show announcements to new users + if (!announcement || isNewUser) return; + + this._showAnnouncement(); + + // Check if the user has already used current version (= has seen the announcement) + // const { currentVersion, lastSeenAnnouncementVersion } = this; + // if (semver.gt(currentVersion, lastSeenAnnouncementVersion)) { + // debug(`${currentVersion} < ${lastSeenAnnouncementVersion}: announcement is shown`); + // this._showAnnouncement(); + // } else { + // debug(`${currentVersion} >= ${lastSeenAnnouncementVersion}: announcement is hidden`); + // this._hideAnnouncement(); + // } + }; + + _fetchAnnouncements = () => { + const targetVersion = this.targetVersion || this.currentVersion; + if (!targetVersion) return; + getChangelogRequest.execute('5.0.1'); + getAnnouncementRequest.execute('5.1.0'); + } } diff --git a/src/features/utils/FeatureStore.js b/src/features/utils/FeatureStore.js index 66b66a104..48962561d 100644 --- a/src/features/utils/FeatureStore.js +++ b/src/features/utils/FeatureStore.js @@ -5,17 +5,38 @@ export class FeatureStore { _reactions = null; - _listenToActions(actions) { - if (this._actions) this._actions.forEach(a => a[0].off(a[1])); + _registerActions(actions) { this._actions = []; actions.forEach(a => this._actions.push(a)); + this._startListeningToActions(); + } + + _startListeningToActions() { + this._stopListeningToActions(); this._actions.forEach(a => a[0].listen(a[1])); } - _startReactions(reactions) { - if (this._reactions) this._reactions.forEach(r => r.stop()); + _stopListeningToActions() { + this._actions.forEach(a => a[0].off(a[1])); + } + + _registerReactions(reactions) { this._reactions = []; reactions.forEach(r => this._reactions.push(new Reaction(r))); + this._startReactions(); + } + + _startReactions() { + this._stopReactions(); this._reactions.forEach(r => r.start()); } + + _stopReactions() { + this._reactions.forEach(r => r.stop()); + } + + stop() { + this._stopListeningToActions(); + this._stopReactions(); + } } diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index ea601700e..4841a4e08 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -51,12 +51,16 @@ export default class WorkspacesStore extends FeatureStore { return getUserWorkspacesRequest.wasExecuted && this.workspaces.length > 0; } + @computed get isUserAllowedToUseFeature() { + return !this.isPremiumUpgradeRequired; + } + start(stores, actions) { debug('WorkspacesStore::start'); this.stores = stores; this.actions = actions; - this._listenToActions([ + this._registerActions([ [workspaceActions.edit, this._edit], [workspaceActions.create, this._create], [workspaceActions.delete, this._delete], @@ -67,7 +71,7 @@ export default class WorkspacesStore extends FeatureStore { [workspaceActions.openWorkspaceSettings, this._openWorkspaceSettings], ]); - this._startReactions([ + this._registerReactions([ this._setWorkspaceBeingEditedReaction, this._setActiveServiceOnWorkspaceSwitchReaction, this._setFeatureEnabledReaction, @@ -75,6 +79,7 @@ export default class WorkspacesStore extends FeatureStore { this._activateLastUsedWorkspaceReaction, this._openDrawerWithSettingsReaction, this._cleanupInvalidServiceReferences, + this._disableActionsForFreeUser, ]); getUserWorkspacesRequest.execute(); @@ -82,6 +87,7 @@ export default class WorkspacesStore extends FeatureStore { } stop() { + super.stop(); debug('WorkspacesStore::stop'); this.isFeatureActive = false; this.activeWorkspace = null; @@ -273,4 +279,12 @@ export default class WorkspacesStore extends FeatureStore { getUserWorkspacesRequest.execute(); } }; + + _disableActionsForFreeUser = () => { + if (!this.isUserAllowedToUseFeature) { + this._stopListeningToActions(); + } else { + this._startListeningToActions(); + } + } } diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 1dd31324e..5ad7a8bd8 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json @@ -3088,7 +3088,7 @@ "line": 14 }, "file": "src/features/announcements/Component.js", - "id": "feature.announcements.headline", + "id": "feature.announcements.changelog.headline", "start": { "column": 12, "line": 11 @@ -3106,7 +3106,7 @@ "line": 14 }, "file": "src/features/announcements/components/AnnouncementScreen.js", - "id": "feature.announcements.headline", + "id": "feature.announcements.changelog.headline", "start": { "column": 12, "line": 11 @@ -4470,4 +4470,4 @@ ], "path": "src/lib/Menu.json" } -] \ No newline at end of file +] diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 13775d758..958b6fb6a 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -1,7 +1,7 @@ { "app.errorHandler.action": "Reload", "app.errorHandler.headline": "Something went wrong", - "feature.announcements.headline": "What's new in Franz {version}?", + "feature.announcements.changelog.headline": "Changes in Franz {version}", "feature.delayApp.action": "Get a Franz Supporter License", "feature.delayApp.headline": "Please purchase a Franz Supporter License to skip waiting", "feature.delayApp.text": "Franz will continue in {seconds} seconds.", @@ -44,7 +44,7 @@ "login.submit.label": "Sign in", "login.tokenExpired": "Your session expired, please login again.", "menu.app.about": "About Franz", - "menu.app.announcement": "What's new in Franz?", + "menu.app.announcement": "What's new?", "menu.app.hide": "Hide", "menu.app.hideOthers": "Hide Others", "menu.app.quit": "Quit", @@ -319,4 +319,4 @@ "workspaceDrawer.workspaceFeatureInfo": "

Franz 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/features/announcements/Component.json b/src/i18n/messages/src/features/announcements/Component.json index 18e1b84c5..c31c35fc7 100644 --- a/src/i18n/messages/src/features/announcements/Component.json +++ b/src/i18n/messages/src/features/announcements/Component.json @@ -1,6 +1,6 @@ [ { - "id": "feature.announcements.headline", + "id": "feature.announcements.changelog.headline", "defaultMessage": "!!!What's new in Franz {version}?", "file": "src/features/announcements/Component.js", "start": { @@ -12,4 +12,4 @@ "column": 3 } } -] \ No newline at end of file +] diff --git a/src/i18n/messages/src/features/announcements/components/AnnouncementScreen.json b/src/i18n/messages/src/features/announcements/components/AnnouncementScreen.json index 225670ee2..874c9dd9d 100644 --- a/src/i18n/messages/src/features/announcements/components/AnnouncementScreen.json +++ b/src/i18n/messages/src/features/announcements/components/AnnouncementScreen.json @@ -1,14 +1,14 @@ [ { - "id": "feature.announcements.headline", - "defaultMessage": "!!!What's new in Franz {version}?", + "id": "feature.announcements.changelog.headline", + "defaultMessage": "!!!Changes in Franz {version}", "file": "src/features/announcements/components/AnnouncementScreen.js", "start": { - "line": 11, + "line": 13, "column": 12 }, "end": { - "line": 14, + "line": 16, "column": 3 } } diff --git a/src/i18n/messages/src/lib/Menu.json b/src/i18n/messages/src/lib/Menu.json index f4cd35582..a2ce34cd4 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": 13, + "line": 14, "column": 8 }, "end": { - "line": 16, + "line": 17, "column": 3 } }, @@ -17,11 +17,11 @@ "defaultMessage": "!!!Undo", "file": "src/lib/Menu.js", "start": { - "line": 17, + "line": 18, "column": 8 }, "end": { - "line": 20, + "line": 21, "column": 3 } }, @@ -30,11 +30,11 @@ "defaultMessage": "!!!Redo", "file": "src/lib/Menu.js", "start": { - "line": 21, + "line": 22, "column": 8 }, "end": { - "line": 24, + "line": 25, "column": 3 } }, @@ -43,11 +43,11 @@ "defaultMessage": "!!!Cut", "file": "src/lib/Menu.js", "start": { - "line": 25, + "line": 26, "column": 7 }, "end": { - "line": 28, + "line": 29, "column": 3 } }, @@ -56,11 +56,11 @@ "defaultMessage": "!!!Copy", "file": "src/lib/Menu.js", "start": { - "line": 29, + "line": 30, "column": 8 }, "end": { - "line": 32, + "line": 33, "column": 3 } }, @@ -69,11 +69,11 @@ "defaultMessage": "!!!Paste", "file": "src/lib/Menu.js", "start": { - "line": 33, + "line": 34, "column": 9 }, "end": { - "line": 36, + "line": 37, "column": 3 } }, @@ -82,11 +82,11 @@ "defaultMessage": "!!!Paste And Match Style", "file": "src/lib/Menu.js", "start": { - "line": 37, + "line": 38, "column": 22 }, "end": { - "line": 40, + "line": 41, "column": 3 } }, @@ -95,11 +95,11 @@ "defaultMessage": "!!!Delete", "file": "src/lib/Menu.js", "start": { - "line": 41, + "line": 42, "column": 10 }, "end": { - "line": 44, + "line": 45, "column": 3 } }, @@ -108,11 +108,11 @@ "defaultMessage": "!!!Select All", "file": "src/lib/Menu.js", "start": { - "line": 45, + "line": 46, "column": 13 }, "end": { - "line": 48, + "line": 49, "column": 3 } }, @@ -121,11 +121,11 @@ "defaultMessage": "!!!Speech", "file": "src/lib/Menu.js", "start": { - "line": 49, + "line": 50, "column": 10 }, "end": { - "line": 52, + "line": 53, "column": 3 } }, @@ -134,11 +134,11 @@ "defaultMessage": "!!!Start Speaking", "file": "src/lib/Menu.js", "start": { - "line": 53, + "line": 54, "column": 17 }, "end": { - "line": 56, + "line": 57, "column": 3 } }, @@ -147,11 +147,11 @@ "defaultMessage": "!!!Stop Speaking", "file": "src/lib/Menu.js", "start": { - "line": 57, + "line": 58, "column": 16 }, "end": { - "line": 60, + "line": 61, "column": 3 } }, @@ -160,11 +160,11 @@ "defaultMessage": "!!!Start Dictation", "file": "src/lib/Menu.js", "start": { - "line": 61, + "line": 62, "column": 18 }, "end": { - "line": 64, + "line": 65, "column": 3 } }, @@ -173,11 +173,11 @@ "defaultMessage": "!!!Emoji & Symbols", "file": "src/lib/Menu.js", "start": { - "line": 65, + "line": 66, "column": 16 }, "end": { - "line": 68, + "line": 69, "column": 3 } }, @@ -186,11 +186,11 @@ "defaultMessage": "!!!Actual Size", "file": "src/lib/Menu.js", "start": { - "line": 69, + "line": 70, "column": 13 }, "end": { - "line": 72, + "line": 73, "column": 3 } }, @@ -199,11 +199,11 @@ "defaultMessage": "!!!Zoom In", "file": "src/lib/Menu.js", "start": { - "line": 73, + "line": 74, "column": 10 }, "end": { - "line": 76, + "line": 77, "column": 3 } }, @@ -212,11 +212,11 @@ "defaultMessage": "!!!Zoom Out", "file": "src/lib/Menu.js", "start": { - "line": 77, + "line": 78, "column": 11 }, "end": { - "line": 80, + "line": 81, "column": 3 } }, @@ -225,11 +225,11 @@ "defaultMessage": "!!!Enter Full Screen", "file": "src/lib/Menu.js", "start": { - "line": 81, + "line": 82, "column": 19 }, "end": { - "line": 84, + "line": 85, "column": 3 } }, @@ -238,11 +238,11 @@ "defaultMessage": "!!!Exit Full Screen", "file": "src/lib/Menu.js", "start": { - "line": 85, + "line": 86, "column": 18 }, "end": { - "line": 88, + "line": 89, "column": 3 } }, @@ -251,11 +251,11 @@ "defaultMessage": "!!!Toggle Full Screen", "file": "src/lib/Menu.js", "start": { - "line": 89, + "line": 90, "column": 20 }, "end": { - "line": 92, + "line": 93, "column": 3 } }, @@ -264,11 +264,11 @@ "defaultMessage": "!!!Toggle Developer Tools", "file": "src/lib/Menu.js", "start": { - "line": 93, + "line": 94, "column": 18 }, "end": { - "line": 96, + "line": 97, "column": 3 } }, @@ -277,11 +277,11 @@ "defaultMessage": "!!!Toggle Service Developer Tools", "file": "src/lib/Menu.js", "start": { - "line": 97, + "line": 98, "column": 25 }, "end": { - "line": 100, + "line": 101, "column": 3 } }, @@ -290,11 +290,11 @@ "defaultMessage": "!!!Reload Service", "file": "src/lib/Menu.js", "start": { - "line": 101, + "line": 102, "column": 17 }, "end": { - "line": 104, + "line": 105, "column": 3 } }, @@ -303,11 +303,11 @@ "defaultMessage": "!!!Reload Franz", "file": "src/lib/Menu.js", "start": { - "line": 105, + "line": 106, "column": 15 }, "end": { - "line": 108, + "line": 109, "column": 3 } }, @@ -316,11 +316,11 @@ "defaultMessage": "!!!Minimize", "file": "src/lib/Menu.js", "start": { - "line": 109, + "line": 110, "column": 12 }, "end": { - "line": 112, + "line": 113, "column": 3 } }, @@ -329,11 +329,11 @@ "defaultMessage": "!!!Close", "file": "src/lib/Menu.js", "start": { - "line": 113, + "line": 114, "column": 9 }, "end": { - "line": 116, + "line": 117, "column": 3 } }, @@ -342,11 +342,11 @@ "defaultMessage": "!!!Learn More", "file": "src/lib/Menu.js", "start": { - "line": 117, + "line": 118, "column": 13 }, "end": { - "line": 120, + "line": 121, "column": 3 } }, @@ -355,11 +355,11 @@ "defaultMessage": "!!!Changelog", "file": "src/lib/Menu.js", "start": { - "line": 121, + "line": 122, "column": 13 }, "end": { - "line": 124, + "line": 125, "column": 3 } }, @@ -368,11 +368,11 @@ "defaultMessage": "!!!Support", "file": "src/lib/Menu.js", "start": { - "line": 125, + "line": 126, "column": 11 }, "end": { - "line": 128, + "line": 129, "column": 3 } }, @@ -381,11 +381,11 @@ "defaultMessage": "!!!Terms of Service", "file": "src/lib/Menu.js", "start": { - "line": 129, + "line": 130, "column": 7 }, "end": { - "line": 132, + "line": 133, "column": 3 } }, @@ -394,11 +394,11 @@ "defaultMessage": "!!!Privacy Statement", "file": "src/lib/Menu.js", "start": { - "line": 133, + "line": 134, "column": 11 }, "end": { - "line": 136, + "line": 137, "column": 3 } }, @@ -407,11 +407,11 @@ "defaultMessage": "!!!File", "file": "src/lib/Menu.js", "start": { - "line": 137, + "line": 138, "column": 8 }, "end": { - "line": 140, + "line": 141, "column": 3 } }, @@ -420,11 +420,11 @@ "defaultMessage": "!!!View", "file": "src/lib/Menu.js", "start": { - "line": 141, + "line": 142, "column": 8 }, "end": { - "line": 144, + "line": 145, "column": 3 } }, @@ -433,11 +433,11 @@ "defaultMessage": "!!!Services", "file": "src/lib/Menu.js", "start": { - "line": 145, + "line": 146, "column": 12 }, "end": { - "line": 148, + "line": 149, "column": 3 } }, @@ -446,11 +446,11 @@ "defaultMessage": "!!!Window", "file": "src/lib/Menu.js", "start": { - "line": 149, + "line": 150, "column": 10 }, "end": { - "line": 152, + "line": 153, "column": 3 } }, @@ -459,11 +459,11 @@ "defaultMessage": "!!!Help", "file": "src/lib/Menu.js", "start": { - "line": 153, + "line": 154, "column": 8 }, "end": { - "line": 156, + "line": 157, "column": 3 } }, @@ -472,24 +472,24 @@ "defaultMessage": "!!!About Franz", "file": "src/lib/Menu.js", "start": { - "line": 157, + "line": 158, "column": 9 }, "end": { - "line": 160, + "line": 161, "column": 3 } }, { "id": "menu.app.announcement", - "defaultMessage": "!!!What's new in Franz?", + "defaultMessage": "!!!What's new?", "file": "src/lib/Menu.js", "start": { - "line": 161, + "line": 162, "column": 16 }, "end": { - "line": 164, + "line": 165, "column": 3 } }, @@ -498,11 +498,11 @@ "defaultMessage": "!!!Settings", "file": "src/lib/Menu.js", "start": { - "line": 165, + "line": 166, "column": 12 }, "end": { - "line": 168, + "line": 169, "column": 3 } }, @@ -511,11 +511,11 @@ "defaultMessage": "!!!Hide", "file": "src/lib/Menu.js", "start": { - "line": 169, + "line": 170, "column": 8 }, "end": { - "line": 172, + "line": 173, "column": 3 } }, @@ -524,11 +524,11 @@ "defaultMessage": "!!!Hide Others", "file": "src/lib/Menu.js", "start": { - "line": 173, + "line": 174, "column": 14 }, "end": { - "line": 176, + "line": 177, "column": 3 } }, @@ -537,11 +537,11 @@ "defaultMessage": "!!!Unhide", "file": "src/lib/Menu.js", "start": { - "line": 177, + "line": 178, "column": 10 }, "end": { - "line": 180, + "line": 181, "column": 3 } }, @@ -550,11 +550,11 @@ "defaultMessage": "!!!Quit", "file": "src/lib/Menu.js", "start": { - "line": 181, + "line": 182, "column": 8 }, "end": { - "line": 184, + "line": 185, "column": 3 } }, @@ -563,11 +563,11 @@ "defaultMessage": "!!!Add New Service...", "file": "src/lib/Menu.js", "start": { - "line": 185, + "line": 186, "column": 17 }, "end": { - "line": 188, + "line": 189, "column": 3 } }, @@ -576,11 +576,11 @@ "defaultMessage": "!!!Add New Workspace...", "file": "src/lib/Menu.js", "start": { - "line": 189, + "line": 190, "column": 19 }, "end": { - "line": 192, + "line": 193, "column": 3 } }, @@ -589,11 +589,11 @@ "defaultMessage": "!!!Open workspace drawer", "file": "src/lib/Menu.js", "start": { - "line": 193, + "line": 194, "column": 23 }, "end": { - "line": 196, + "line": 197, "column": 3 } }, @@ -602,11 +602,11 @@ "defaultMessage": "!!!Close workspace drawer", "file": "src/lib/Menu.js", "start": { - "line": 197, + "line": 198, "column": 24 }, "end": { - "line": 200, + "line": 201, "column": 3 } }, @@ -615,11 +615,11 @@ "defaultMessage": "!!!Activate next service...", "file": "src/lib/Menu.js", "start": { - "line": 201, + "line": 202, "column": 23 }, "end": { - "line": 204, + "line": 205, "column": 3 } }, @@ -628,11 +628,11 @@ "defaultMessage": "!!!Activate previous service...", "file": "src/lib/Menu.js", "start": { - "line": 205, + "line": 206, "column": 27 }, "end": { - "line": 208, + "line": 209, "column": 3 } }, @@ -641,11 +641,11 @@ "defaultMessage": "!!!Disable notifications & audio", "file": "src/lib/Menu.js", "start": { - "line": 209, + "line": 210, "column": 11 }, "end": { - "line": 212, + "line": 213, "column": 3 } }, @@ -654,11 +654,11 @@ "defaultMessage": "!!!Enable notifications & audio", "file": "src/lib/Menu.js", "start": { - "line": 213, + "line": 214, "column": 13 }, "end": { - "line": 216, + "line": 217, "column": 3 } }, @@ -667,11 +667,11 @@ "defaultMessage": "!!!Workspaces", "file": "src/lib/Menu.js", "start": { - "line": 217, + "line": 218, "column": 14 }, "end": { - "line": 220, + "line": 221, "column": 3 } }, @@ -680,11 +680,11 @@ "defaultMessage": "!!!Default", "file": "src/lib/Menu.js", "start": { - "line": 221, + "line": 222, "column": 20 }, "end": { - "line": 224, + "line": 225, "column": 3 } } diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 46a347237..3df06e05a 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js @@ -6,6 +6,7 @@ import { isMac, ctrlKey, cmdKey } from '../environment'; import { GA_CATEGORY_WORKSPACES, workspaceStore } from '../features/workspaces/index'; import { workspaceActions } from '../features/workspaces/actions'; import { gaEvent } from './analytics'; +import announcementActions from '../features/announcements/actions'; const { app, Menu, dialog } = remote; @@ -160,7 +161,7 @@ const menuItems = defineMessages({ }, announcement: { id: 'menu.app.announcement', - defaultMessage: '!!!What\'s new in Franz?', + defaultMessage: '!!!What\'s new?', }, settings: { id: 'menu.app.settings', @@ -352,8 +353,10 @@ const _templateFactory = intl => [ click() { shell.openExternal('https://meetfranz.com'); }, }, { - label: intl.formatMessage(menuItems.changelog), - click() { shell.openExternal('https://github.com/meetfranz/franz/blob/master/CHANGELOG.md'); }, + label: intl.formatMessage(menuItems.announcement), + click: () => { + announcementActions.show(); + }, }, { type: 'separator', @@ -621,12 +624,6 @@ export default class FranzMenu { label: intl.formatMessage(menuItems.about), role: 'about', }, - { - label: intl.formatMessage(menuItems.announcement), - click: () => { - this.actions.announcements.show(); - }, - }, { type: 'separator', }, diff --git a/src/stores/index.js b/src/stores/index.js index 96b844c95..1912418a2 100644 --- a/src/stores/index.js +++ b/src/stores/index.js @@ -10,6 +10,8 @@ import PaymentStore from './PaymentStore'; import NewsStore from './NewsStore'; import RequestStore from './RequestStore'; import GlobalErrorStore from './GlobalErrorStore'; +import { workspaceStore } from '../features/workspaces'; +import { announcementsStore } from '../features/announcements'; export default (api, actions, router) => { const stores = {}; @@ -27,6 +29,8 @@ export default (api, actions, router) => { news: new NewsStore(stores, api, actions), requests: new RequestStore(stores, api, actions), globalError: new GlobalErrorStore(stores, api, actions), + workspaces: workspaceStore, + announcements: announcementsStore, }); // Initialize all stores Object.keys(stores).forEach((name) => { -- cgit v1.2.3-70-g09d2 From 70ed64197835377ef701d2ee80830a50cfec93b4 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Fri, 12 Apr 2019 12:12:25 +0200 Subject: improve starting and stopping logic for workspace actions and reactions --- src/features/utils/FeatureStore.js | 36 ++++++++++---------- src/features/workspaces/store.js | 67 ++++++++++++++++++++++++++++---------- src/stores/lib/Reaction.js | 14 +++++--- 3 files changed, 78 insertions(+), 39 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/src/features/utils/FeatureStore.js b/src/features/utils/FeatureStore.js index 48962561d..d863f7464 100644 --- a/src/features/utils/FeatureStore.js +++ b/src/features/utils/FeatureStore.js @@ -5,38 +5,40 @@ export class FeatureStore { _reactions = null; + stop() { + this._stopActions(); + this._stopReactions(); + } + + // ACTIONS + _registerActions(actions) { this._actions = []; actions.forEach(a => this._actions.push(a)); - this._startListeningToActions(); + this._startActions(this._actions); } - _startListeningToActions() { - this._stopListeningToActions(); - this._actions.forEach(a => a[0].listen(a[1])); + _startActions(actions = this._actions) { + actions.forEach(a => a[0].listen(a[1])); } - _stopListeningToActions() { - this._actions.forEach(a => a[0].off(a[1])); + _stopActions(actions = this._actions) { + actions.forEach(a => a[0].off(a[1])); } + // REACTIONS + _registerReactions(reactions) { this._reactions = []; reactions.forEach(r => this._reactions.push(new Reaction(r))); - this._startReactions(); + this._startReactions(this._reactions); } - _startReactions() { - this._stopReactions(); - this._reactions.forEach(r => r.start()); - } - - _stopReactions() { - this._reactions.forEach(r => r.stop()); + _startReactions(reactions = this._reactions) { + reactions.forEach(r => r.start()); } - stop() { - this._stopListeningToActions(); - this._stopReactions(); + _stopReactions(reactions = this._reactions) { + reactions.forEach(r => r.stop()); } } diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 4841a4e08..bb18dc182 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -55,32 +55,65 @@ export default class WorkspacesStore extends FeatureStore { return !this.isPremiumUpgradeRequired; } + // ========== PRIVATE PROPERTIES ========= // + + _wasDrawerOpenBeforeSettingsRoute = null; + + _freeUserActions = []; + + _premiumUserActions = []; + + _allActions = []; + + _freeUserReactions = []; + + _premiumUserReactions = []; + + _allReactions = []; + + // ========== PUBLIC API ========= // + start(stores, actions) { debug('WorkspacesStore::start'); this.stores = stores; this.actions = actions; - this._registerActions([ + // ACTIONS + + this._freeUserActions = [ + [workspaceActions.toggleWorkspaceDrawer, this._toggleWorkspaceDrawer], + [workspaceActions.openWorkspaceSettings, this._openWorkspaceSettings], + ]; + this._premiumUserActions = [ [workspaceActions.edit, this._edit], [workspaceActions.create, this._create], [workspaceActions.delete, this._delete], [workspaceActions.update, this._update], [workspaceActions.activate, this._setActiveWorkspace], [workspaceActions.deactivate, this._deactivateActiveWorkspace], - [workspaceActions.toggleWorkspaceDrawer, this._toggleWorkspaceDrawer], - [workspaceActions.openWorkspaceSettings, this._openWorkspaceSettings], - ]); + ]; + this._allActions = this._freeUserActions.concat(this._premiumUserActions); + this._registerActions(this._allActions); - this._registerReactions([ - this._setWorkspaceBeingEditedReaction, - this._setActiveServiceOnWorkspaceSwitchReaction, + // REACTIONS + + this._freeUserReactions = [ + this._stopPremiumActionsAndReactions, + this._openDrawerWithSettingsReaction, this._setFeatureEnabledReaction, this._setIsPremiumFeatureReaction, - this._activateLastUsedWorkspaceReaction, - this._openDrawerWithSettingsReaction, this._cleanupInvalidServiceReferences, - this._disableActionsForFreeUser, - ]); + ]; + this._premiumUserReactions = [ + this._setActiveServiceOnWorkspaceSwitchReaction, + this._activateLastUsedWorkspaceReaction, + this._setWorkspaceBeingEditedReaction, + ]; + this._allReactions = this._freeUserReactions.concat(this._premiumUserReactions); + + this._registerReactions(this._allReactions); + + console.log(this._reactions); getUserWorkspacesRequest.execute(); this.isFeatureActive = true; @@ -110,9 +143,7 @@ export default class WorkspacesStore extends FeatureStore { return workspace.services.map(id => services.one(id)).filter(s => !!s); } - // ========== PRIVATE ========= // - - _wasDrawerOpenBeforeSettingsRoute = null; + // ========== PRIVATE METHODS ========= // _getWorkspaceById = id => this.workspaces.find(w => w.id === id); @@ -280,11 +311,13 @@ export default class WorkspacesStore extends FeatureStore { } }; - _disableActionsForFreeUser = () => { + _stopPremiumActionsAndReactions = () => { if (!this.isUserAllowedToUseFeature) { - this._stopListeningToActions(); + this._stopActions(this._premiumUserActions); + this._stopReactions(this._premiumUserReactions); } else { - this._startListeningToActions(); + this._startActions(this._premiumUserActions); + this._startReactions(this._premiumUserReactions); } } } diff --git a/src/stores/lib/Reaction.js b/src/stores/lib/Reaction.js index 46aa4dae6..b123ec01c 100644 --- a/src/stores/lib/Reaction.js +++ b/src/stores/lib/Reaction.js @@ -4,21 +4,25 @@ import { autorun } from 'mobx'; export default class Reaction { reaction; - hasBeenStarted; + isRunning = false; dispose; constructor(reaction) { this.reaction = reaction; - this.hasBeenStarted = false; } start() { - this.dispose = autorun(() => this.reaction()); - this.hasBeenStarted = true; + if (!this.isRunning) { + this.dispose = autorun(() => this.reaction()); + this.isRunning = true; + } } stop() { - if (this.hasBeenStarted) this.dispose(); + if (this.isRunning) { + this.dispose(); + this.isRunning = true; + } } } -- cgit v1.2.3-70-g09d2 From 76bf7b840ea7d607a21b0294d10be01b26ad0607 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Fri, 12 Apr 2019 15:51:57 +0200 Subject: merge-in latest develop --- package-lock.json | 108 +- package.json | 4 +- packages/theme/src/themes/default/index.ts | 1 - .../settings/settings/EditSettingsForm.js | 8 + src/features/announcements/store.js | 14 +- src/features/utils/ActionBinding.js | 29 + src/features/utils/FeatureStore.js | 17 +- src/features/workspaces/store.js | 20 +- src/i18n/locales/defaultMessages.json | 4473 -------------------- src/i18n/locales/en-US.json | 3 +- src/i18n/messages/src/components/auth/Import.json | 54 - src/i18n/messages/src/components/auth/Invite.json | 93 - src/i18n/messages/src/components/auth/Login.json | 119 - .../messages/src/components/auth/Password.json | 93 - src/i18n/messages/src/components/auth/Pricing.json | 54 - src/i18n/messages/src/components/auth/Signup.json | 158 - src/i18n/messages/src/components/auth/Welcome.json | 28 - .../messages/src/components/layout/AppLayout.json | 80 - .../messages/src/components/layout/Sidebar.json | 80 - .../content/ErrorHandlers/WebviewErrorHandler.json | 67 - .../services/content/ServiceDisabled.json | 28 - .../src/components/services/content/Services.json | 28 - .../services/content/WebviewCrashHandler.json | 54 - .../src/components/services/tabs/TabItem.json | 119 - .../settings/account/AccountDashboard.json | 197 - .../settings/navigation/SettingsNavigation.json | 93 - .../settings/recipes/RecipesDashboard.json | 106 - .../settings/services/EditServiceForm.json | 288 -- .../components/settings/services/ServiceError.json | 54 - .../components/settings/services/ServiceItem.json | 41 - .../settings/services/ServicesDashboard.json | 119 - .../settings/settings/EditSettingsForm.json | 223 - .../src/components/settings/user/EditUserForm.json | 80 - .../components/subscription/SubscriptionForm.json | 171 - .../components/subscription/SubscriptionPopup.json | 28 - .../ui/PremiumFeatureContainer/index.json | 15 - .../src/components/ui/WebviewLoader/index.json | 15 - .../src/components/util/ErrorBoundary/index.json | 28 - .../src/containers/settings/EditServiceScreen.json | 197 - .../containers/settings/EditSettingsScreen.json | 158 - .../src/containers/settings/EditUserScreen.json | 119 - .../src/features/announcements/Component.json | 15 - .../components/AnnouncementScreen.json | 15 - .../messages/src/features/delayApp/Component.json | 41 - .../src/features/shareFranz/Component.json | 93 - .../workspaces/components/CreateWorkspaceForm.json | 28 - .../workspaces/components/EditWorkspaceForm.json | 67 - .../workspaces/components/WorkspaceDrawer.json | 106 - .../workspaces/components/WorkspaceDrawerItem.json | 28 - .../components/WorkspaceSwitchingIndicator.json | 15 - .../workspaces/components/WorkspacesDashboard.json | 106 - .../messages/src/helpers/validation-helpers.json | 67 - src/i18n/messages/src/i18n/globalMessages.json | 80 - src/i18n/messages/src/lib/Menu.json | 691 --- src/index.js | 14 + src/stores/UserStore.js | 1 + src/stores/lib/Reaction.js | 9 +- 57 files changed, 142 insertions(+), 8898 deletions(-) create mode 100644 src/features/utils/ActionBinding.js delete mode 100644 src/i18n/locales/defaultMessages.json delete mode 100644 src/i18n/messages/src/components/auth/Import.json delete mode 100644 src/i18n/messages/src/components/auth/Invite.json delete mode 100644 src/i18n/messages/src/components/auth/Login.json delete mode 100644 src/i18n/messages/src/components/auth/Password.json delete mode 100644 src/i18n/messages/src/components/auth/Pricing.json delete mode 100644 src/i18n/messages/src/components/auth/Signup.json delete mode 100644 src/i18n/messages/src/components/auth/Welcome.json delete mode 100644 src/i18n/messages/src/components/layout/AppLayout.json delete mode 100644 src/i18n/messages/src/components/layout/Sidebar.json delete mode 100644 src/i18n/messages/src/components/services/content/ErrorHandlers/WebviewErrorHandler.json delete mode 100644 src/i18n/messages/src/components/services/content/ServiceDisabled.json delete mode 100644 src/i18n/messages/src/components/services/content/Services.json delete mode 100644 src/i18n/messages/src/components/services/content/WebviewCrashHandler.json delete mode 100644 src/i18n/messages/src/components/services/tabs/TabItem.json delete mode 100644 src/i18n/messages/src/components/settings/account/AccountDashboard.json delete mode 100644 src/i18n/messages/src/components/settings/navigation/SettingsNavigation.json delete mode 100644 src/i18n/messages/src/components/settings/recipes/RecipesDashboard.json delete mode 100644 src/i18n/messages/src/components/settings/services/EditServiceForm.json delete mode 100644 src/i18n/messages/src/components/settings/services/ServiceError.json delete mode 100644 src/i18n/messages/src/components/settings/services/ServiceItem.json delete mode 100644 src/i18n/messages/src/components/settings/services/ServicesDashboard.json delete mode 100644 src/i18n/messages/src/components/settings/settings/EditSettingsForm.json delete mode 100644 src/i18n/messages/src/components/settings/user/EditUserForm.json delete mode 100644 src/i18n/messages/src/components/subscription/SubscriptionForm.json delete mode 100644 src/i18n/messages/src/components/subscription/SubscriptionPopup.json delete mode 100644 src/i18n/messages/src/components/ui/PremiumFeatureContainer/index.json delete mode 100644 src/i18n/messages/src/components/ui/WebviewLoader/index.json delete mode 100644 src/i18n/messages/src/components/util/ErrorBoundary/index.json delete mode 100644 src/i18n/messages/src/containers/settings/EditServiceScreen.json delete mode 100644 src/i18n/messages/src/containers/settings/EditSettingsScreen.json delete mode 100644 src/i18n/messages/src/containers/settings/EditUserScreen.json delete mode 100644 src/i18n/messages/src/features/announcements/Component.json delete mode 100644 src/i18n/messages/src/features/announcements/components/AnnouncementScreen.json delete mode 100644 src/i18n/messages/src/features/delayApp/Component.json delete mode 100644 src/i18n/messages/src/features/shareFranz/Component.json delete mode 100644 src/i18n/messages/src/features/workspaces/components/CreateWorkspaceForm.json delete mode 100644 src/i18n/messages/src/features/workspaces/components/EditWorkspaceForm.json delete mode 100644 src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json delete mode 100644 src/i18n/messages/src/features/workspaces/components/WorkspaceDrawerItem.json delete mode 100644 src/i18n/messages/src/features/workspaces/components/WorkspaceSwitchingIndicator.json delete mode 100644 src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json delete mode 100644 src/i18n/messages/src/helpers/validation-helpers.json delete mode 100644 src/i18n/messages/src/i18n/globalMessages.json delete mode 100644 src/i18n/messages/src/lib/Menu.json (limited to 'src/features/workspaces/store.js') diff --git a/package-lock.json b/package-lock.json index 33f7d69f2..70f3b2484 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6153,9 +6153,9 @@ } }, "ecdsa-sig-formatter": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", - "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", "requires": { "safe-buffer": "^5.0.1" } @@ -6173,9 +6173,9 @@ "dev": true }, "electron": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/electron/-/electron-4.0.8.tgz", - "integrity": "sha512-FOBJIHkuv8wc15N+ZyqwDzPavYVu5CHMBEf14jHDWv7QW2vkEIpJjVK+PIT31kfZfvjsIP0j2wvA/FBsiqB7pw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/electron/-/electron-4.1.4.tgz", + "integrity": "sha512-MelOjntJvd33izEjR6H4N/Uii7y535z/b2BuYXJGLNSHL6o1IlyhUQmfiT87kWABayERgeuYERgvsyf956OOFw==", "dev": true, "requires": { "@types/node": "^10.12.18", @@ -6184,9 +6184,9 @@ }, "dependencies": { "@types/node": { - "version": "10.12.30", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.30.tgz", - "integrity": "sha512-nsqTN6zUcm9xtdJiM9OvOJ5EF0kOI8f1Zuug27O/rgtxCRJHGqncSWfCMZUP852dCKPsDsYXGvBhxfRjDBkF5Q==", + "version": "10.14.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.4.tgz", + "integrity": "sha512-DT25xX/YgyPKiHFOpNuANIQIVvYEwCWXgK2jYYwqgaMrYE6+tq+DtmMwlD3drl6DJbUwtlIDnn0d7tIn/EbXBg==", "dev": true } } @@ -10191,7 +10191,8 @@ "hoek": { "version": "2.16.3", "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true }, "hoist-non-react-statics": { "version": "3.3.0", @@ -11186,11 +11187,6 @@ "buffer-alloc": "^1.2.0" } }, - "isemail": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz", - "integrity": "sha1-vgPfjMPineTSxd9lASY/H6RZXpo=" - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -11217,17 +11213,6 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, - "joi": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/joi/-/joi-6.10.1.tgz", - "integrity": "sha1-TVDDGAeRIgAP5fFq8f+OGRe3fgY=", - "requires": { - "hoek": "2.x.x", - "isemail": "1.x.x", - "moment": "2.x.x", - "topo": "1.x.x" - } - }, "js-base64": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz", @@ -11341,15 +11326,20 @@ "dev": true }, "jsonwebtoken": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-7.4.3.tgz", - "integrity": "sha1-d/UCHeBYtgWheD+hKD6ZgS5kVjg=", - "requires": { - "joi": "^6.10.1", - "jws": "^3.1.4", + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", "lodash.once": "^4.0.0", - "ms": "^2.0.0", - "xtend": "^4.0.1" + "ms": "^2.1.1", + "semver": "^5.6.0" } }, "jsprim": { @@ -11475,21 +11465,21 @@ "dev": true }, "jwa": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.2.0.tgz", - "integrity": "sha512-Grku9ZST5NNQ3hqNUodSkDfEBqAmGA1R8yiyPHOnLzEKI0GaCQC/XhFmsheXYuXzFQJdILbh+lYBiliqG5R/Vg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", "requires": { "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.10", + "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "jws": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.1.tgz", - "integrity": "sha512-bGA2omSrFUkd72dhh05bIAN832znP4wOU3lfuXtRBuGTbsmNmDXMQg28f0Vsxaxgk4myF5YkKQpz6qeRpMgX9g==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", "requires": { - "jwa": "^1.2.0", + "jwa": "^1.4.1", "safe-buffer": "^5.0.1" } }, @@ -11882,6 +11872,11 @@ "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" + }, "lodash.isarguments": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", @@ -11894,6 +11889,11 @@ "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", "dev": true }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" + }, "lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", @@ -11905,17 +11905,25 @@ "integrity": "sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==", "dev": true }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" + }, "lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" }, "lodash.isstring": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", - "dev": true + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" }, "lodash.keys": { "version": "3.1.2", @@ -17724,14 +17732,6 @@ "through2": "^2.0.3" } }, - "topo": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/topo/-/topo-1.1.0.tgz", - "integrity": "sha1-6ddRYV0buH3IZdsYL6HKCl71NtU=", - "requires": { - "hoek": "2.x.x" - } - }, "tough-cookie": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", diff --git a/package.json b/package.json index 7e926139d..c43e0b3a9 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "electron-window-state": "5.0.3", "fs-extra": "7.0.1", "hex-to-rgba": "1.0.2", - "jsonwebtoken": "^7.4.1", + "jsonwebtoken": "8.5.1", "lodash": "^4.17.4", "marked": "0.6.1", "mdi": "^1.9.33", @@ -114,7 +114,7 @@ "cross-env": "^5.0.5", "cz-conventional-changelog": "2.1.0", "dotenv": "^4.0.0", - "electron": "4.0.8", + "electron": "4.1.4", "electron-builder": "20.38.4", "electron-rebuild": "1.8.4", "eslint": "5.10.0", diff --git a/packages/theme/src/themes/default/index.ts b/packages/theme/src/themes/default/index.ts index a85dcb366..0f02fa3c8 100644 --- a/packages/theme/src/themes/default/index.ts +++ b/packages/theme/src/themes/default/index.ts @@ -1,7 +1,6 @@ import color from 'color'; import { cloneDeep } from 'lodash'; -import { theme } from '../..'; import * as legacyStyles from '../legacy'; export interface IStyleTypes { diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 8429d0ecb..efd453356 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js @@ -81,6 +81,10 @@ const messages = defineMessages({ id: 'settings.app.restartRequired', defaultMessage: '!!!Changes require restart', }, + languageDisclaimer: { + id: 'settings.app.languageDisclaimer', + defaultMessage: '!!!Official translations are English & German. All other languages are community based translations.', + }, }); export default @observer class EditSettingsForm extends Component { @@ -239,6 +243,10 @@ export default @observer class EditSettingsForm extends Component { {intl.formatMessage(messages.currentVersion)} {' '} {remote.app.getVersion()} +

+ + {intl.formatMessage(messages.languageDisclaimer)} +

diff --git a/src/features/announcements/store.js b/src/features/announcements/store.js index 3c46828bb..b99309ca7 100644 --- a/src/features/announcements/store.js +++ b/src/features/announcements/store.js @@ -10,6 +10,8 @@ import localStorage from 'mobx-localstorage'; import { FeatureStore } from '../utils/FeatureStore'; import { getAnnouncementRequest, getChangelogRequest, getCurrentVersionRequest } from './api'; import { announcementActions } from './actions'; +import { createActionBindings } from '../utils/ActionBinding'; +import { createReactions } from '../../stores/lib/Reaction'; const LOCAL_STORAGE_KEY = 'announcements'; @@ -52,14 +54,15 @@ export class AnnouncementsStore extends FeatureStore { this.actions = actions; getCurrentVersionRequest.execute(); - this._registerActions([ + this._registerActions(createActionBindings([ [announcementActions.show, this._showAnnouncement], - ]); + ])); - this._registerReactions([ + this._reactions = createReactions([ this._fetchAnnouncements, this._showAnnouncementToUsersWhoUpdatedApp, ]); + this._registerReactions(this._reactions); this.isFeatureActive = true; } @@ -105,7 +108,6 @@ export class AnnouncementsStore extends FeatureStore { _showAnnouncementToUsersWhoUpdatedApp = () => { const { announcement, isNewUser } = this; - console.log(announcement, isNewUser); // Check if there is an announcement and on't show announcements to new users if (!announcement || isNewUser) return; @@ -125,7 +127,7 @@ export class AnnouncementsStore extends FeatureStore { _fetchAnnouncements = () => { const targetVersion = this.targetVersion || this.currentVersion; if (!targetVersion) return; - getChangelogRequest.execute('5.0.1'); - getAnnouncementRequest.execute('5.1.0'); + getChangelogRequest.execute(targetVersion); + getAnnouncementRequest.execute(targetVersion); } } diff --git a/src/features/utils/ActionBinding.js b/src/features/utils/ActionBinding.js new file mode 100644 index 000000000..497aa071b --- /dev/null +++ b/src/features/utils/ActionBinding.js @@ -0,0 +1,29 @@ +export default class ActionBinding { + action; + + isActive = false; + + constructor(action) { + this.action = action; + } + + start() { + if (!this.isActive) { + const { action } = this; + action[0].listen(action[1]); + this.isActive = true; + } + } + + stop() { + if (this.isActive) { + const { action } = this; + action[0].off(action[1]); + this.isActive = false; + } + } +} + +export const createActionBindings = actions => ( + actions.map(a => new ActionBinding(a)) +); diff --git a/src/features/utils/FeatureStore.js b/src/features/utils/FeatureStore.js index d863f7464..967e745b2 100644 --- a/src/features/utils/FeatureStore.js +++ b/src/features/utils/FeatureStore.js @@ -1,4 +1,4 @@ -import Reaction from '../../stores/lib/Reaction'; +import { union } from 'lodash'; export class FeatureStore { _actions = null; @@ -13,25 +13,24 @@ export class FeatureStore { // ACTIONS _registerActions(actions) { - this._actions = []; - actions.forEach(a => this._actions.push(a)); - this._startActions(this._actions); + this._actions = union(this._actions, actions); + this._startActions(); } _startActions(actions = this._actions) { - actions.forEach(a => a[0].listen(a[1])); + console.log(actions); + actions.forEach(a => a.start()); } _stopActions(actions = this._actions) { - actions.forEach(a => a[0].off(a[1])); + actions.forEach(a => a.stop()); } // REACTIONS _registerReactions(reactions) { - this._reactions = []; - reactions.forEach(r => this._reactions.push(new Reaction(r))); - this._startReactions(this._reactions); + this._reactions = union(this._reactions, reactions); + this._startReactions(); } _startReactions(reactions = this._reactions) { diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index bb18dc182..e11513d1f 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -14,6 +14,8 @@ import { updateWorkspaceRequest, } from './api'; import { WORKSPACES_ROUTES } from './index'; +import { createReactions } from '../../stores/lib/Reaction'; +import { createActionBindings } from '../utils/ActionBinding'; const debug = require('debug')('Franz:feature:workspaces:store'); @@ -80,41 +82,39 @@ export default class WorkspacesStore extends FeatureStore { // ACTIONS - this._freeUserActions = [ + this._freeUserActions = createActionBindings([ [workspaceActions.toggleWorkspaceDrawer, this._toggleWorkspaceDrawer], [workspaceActions.openWorkspaceSettings, this._openWorkspaceSettings], - ]; - this._premiumUserActions = [ + ]); + this._premiumUserActions = createActionBindings([ [workspaceActions.edit, this._edit], [workspaceActions.create, this._create], [workspaceActions.delete, this._delete], [workspaceActions.update, this._update], [workspaceActions.activate, this._setActiveWorkspace], [workspaceActions.deactivate, this._deactivateActiveWorkspace], - ]; + ]); this._allActions = this._freeUserActions.concat(this._premiumUserActions); this._registerActions(this._allActions); // REACTIONS - this._freeUserReactions = [ + this._freeUserReactions = createReactions([ this._stopPremiumActionsAndReactions, this._openDrawerWithSettingsReaction, this._setFeatureEnabledReaction, this._setIsPremiumFeatureReaction, this._cleanupInvalidServiceReferences, - ]; - this._premiumUserReactions = [ + ]); + this._premiumUserReactions = createReactions([ this._setActiveServiceOnWorkspaceSwitchReaction, this._activateLastUsedWorkspaceReaction, this._setWorkspaceBeingEditedReaction, - ]; + ]); this._allReactions = this._freeUserReactions.concat(this._premiumUserReactions); this._registerReactions(this._allReactions); - console.log(this._reactions); - getUserWorkspacesRequest.execute(); this.isFeatureActive = true; } diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json deleted file mode 100644 index 877e67588..000000000 --- a/src/i18n/locales/defaultMessages.json +++ /dev/null @@ -1,4473 +0,0 @@ -[ - { - "descriptors": [ - { - "defaultMessage": "!!!Import your Franz 4 services", - "end": { - "column": 3, - "line": 16 - }, - "file": "src/components/auth/Import.js", - "id": "import.headline", - "start": { - "column": 12, - "line": 13 - } - }, - { - "defaultMessage": "!!!Services not yet supported in Franz 5", - "end": { - "column": 3, - "line": 20 - }, - "file": "src/components/auth/Import.js", - "id": "import.notSupportedHeadline", - "start": { - "column": 24, - "line": 17 - } - }, - { - "defaultMessage": "!!!Import {count} services", - "end": { - "column": 3, - "line": 24 - }, - "file": "src/components/auth/Import.js", - "id": "import.submit.label", - "start": { - "column": 21, - "line": 21 - } - }, - { - "defaultMessage": "!!!I want to add services manually", - "end": { - "column": 3, - "line": 28 - }, - "file": "src/components/auth/Import.js", - "id": "import.skip.label", - "start": { - "column": 19, - "line": 25 - } - } - ], - "path": "src/components/auth/Import.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Invite Friends", - "end": { - "column": 3, - "line": 19 - }, - "file": "src/components/auth/Invite.js", - "id": "settings.invite.headline", - "start": { - "column": 20, - "line": 16 - } - }, - { - "defaultMessage": "!!!Invite 3 of your friends or colleagues", - "end": { - "column": 3, - "line": 23 - }, - "file": "src/components/auth/Invite.js", - "id": "invite.headline.friends", - "start": { - "column": 12, - "line": 20 - } - }, - { - "defaultMessage": "!!!Name", - "end": { - "column": 3, - "line": 27 - }, - "file": "src/components/auth/Invite.js", - "id": "invite.name.label", - "start": { - "column": 13, - "line": 24 - } - }, - { - "defaultMessage": "!!!Email address", - "end": { - "column": 3, - "line": 31 - }, - "file": "src/components/auth/Invite.js", - "id": "invite.email.label", - "start": { - "column": 14, - "line": 28 - } - }, - { - "defaultMessage": "!!!Send invites", - "end": { - "column": 3, - "line": 35 - }, - "file": "src/components/auth/Invite.js", - "id": "invite.submit.label", - "start": { - "column": 21, - "line": 32 - } - }, - { - "defaultMessage": "!!!I want to do this later", - "end": { - "column": 3, - "line": 39 - }, - "file": "src/components/auth/Invite.js", - "id": "invite.skip.label", - "start": { - "column": 19, - "line": 36 - } - }, - { - "defaultMessage": "!!!Invitations sent successfully", - "end": { - "column": 3, - "line": 43 - }, - "file": "src/components/auth/Invite.js", - "id": "invite.successInfo", - "start": { - "column": 21, - "line": 40 - } - } - ], - "path": "src/components/auth/Invite.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Sign in", - "end": { - "column": 3, - "line": 20 - }, - "file": "src/components/auth/Login.js", - "id": "login.headline", - "start": { - "column": 12, - "line": 17 - } - }, - { - "defaultMessage": "!!!Email address", - "end": { - "column": 3, - "line": 24 - }, - "file": "src/components/auth/Login.js", - "id": "login.email.label", - "start": { - "column": 14, - "line": 21 - } - }, - { - "defaultMessage": "!!!Password", - "end": { - "column": 3, - "line": 28 - }, - "file": "src/components/auth/Login.js", - "id": "login.password.label", - "start": { - "column": 17, - "line": 25 - } - }, - { - "defaultMessage": "!!!Sign in", - "end": { - "column": 3, - "line": 32 - }, - "file": "src/components/auth/Login.js", - "id": "login.submit.label", - "start": { - "column": 21, - "line": 29 - } - }, - { - "defaultMessage": "!!!Email or password not valid", - "end": { - "column": 3, - "line": 36 - }, - "file": "src/components/auth/Login.js", - "id": "login.invalidCredentials", - "start": { - "column": 22, - "line": 33 - } - }, - { - "defaultMessage": "!!!Your session expired, please login again.", - "end": { - "column": 3, - "line": 40 - }, - "file": "src/components/auth/Login.js", - "id": "login.tokenExpired", - "start": { - "column": 16, - "line": 37 - } - }, - { - "defaultMessage": "!!!Your session expired, please login again.", - "end": { - "column": 3, - "line": 44 - }, - "file": "src/components/auth/Login.js", - "id": "login.serverLogout", - "start": { - "column": 16, - "line": 41 - } - }, - { - "defaultMessage": "!!!Create a free account", - "end": { - "column": 3, - "line": 48 - }, - "file": "src/components/auth/Login.js", - "id": "login.link.signup", - "start": { - "column": 14, - "line": 45 - } - }, - { - "defaultMessage": "!!!Forgot password", - "end": { - "column": 3, - "line": 52 - }, - "file": "src/components/auth/Login.js", - "id": "login.link.password", - "start": { - "column": 16, - "line": 49 - } - } - ], - "path": "src/components/auth/Login.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Forgot password", - "end": { - "column": 3, - "line": 17 - }, - "file": "src/components/auth/Password.js", - "id": "password.headline", - "start": { - "column": 12, - "line": 14 - } - }, - { - "defaultMessage": "!!!Email address", - "end": { - "column": 3, - "line": 21 - }, - "file": "src/components/auth/Password.js", - "id": "password.email.label", - "start": { - "column": 14, - "line": 18 - } - }, - { - "defaultMessage": "!!!Submit", - "end": { - "column": 3, - "line": 25 - }, - "file": "src/components/auth/Password.js", - "id": "password.submit.label", - "start": { - "column": 21, - "line": 22 - } - }, - { - "defaultMessage": "!!!Your new password was sent to your email address", - "end": { - "column": 3, - "line": 29 - }, - "file": "src/components/auth/Password.js", - "id": "password.successInfo", - "start": { - "column": 15, - "line": 26 - } - }, - { - "defaultMessage": "!!!No user affiliated with that email address", - "end": { - "column": 3, - "line": 33 - }, - "file": "src/components/auth/Password.js", - "id": "password.noUser", - "start": { - "column": 10, - "line": 30 - } - }, - { - "defaultMessage": "!!!Create a free account", - "end": { - "column": 3, - "line": 37 - }, - "file": "src/components/auth/Password.js", - "id": "password.link.signup", - "start": { - "column": 14, - "line": 34 - } - }, - { - "defaultMessage": "!!!Sign in to your account", - "end": { - "column": 3, - "line": 41 - }, - "file": "src/components/auth/Password.js", - "id": "password.link.login", - "start": { - "column": 13, - "line": 38 - } - } - ], - "path": "src/components/auth/Password.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Support Franz", - "end": { - "column": 3, - "line": 16 - }, - "file": "src/components/auth/Pricing.js", - "id": "pricing.headline", - "start": { - "column": 12, - "line": 13 - } - }, - { - "defaultMessage": "!!!Select your support plan", - "end": { - "column": 3, - "line": 20 - }, - "file": "src/components/auth/Pricing.js", - "id": "pricing.support.label", - "start": { - "column": 23, - "line": 17 - } - }, - { - "defaultMessage": "!!!Support the development of Franz", - "end": { - "column": 3, - "line": 24 - }, - "file": "src/components/auth/Pricing.js", - "id": "pricing.submit.label", - "start": { - "column": 21, - "line": 21 - } - }, - { - "defaultMessage": "!!!I don't want to support the development of Franz.", - "end": { - "column": 3, - "line": 28 - }, - "file": "src/components/auth/Pricing.js", - "id": "pricing.link.skipPayment", - "start": { - "column": 15, - "line": 25 - } - } - ], - "path": "src/components/auth/Pricing.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Sign up", - "end": { - "column": 3, - "line": 21 - }, - "file": "src/components/auth/Signup.js", - "id": "signup.headline", - "start": { - "column": 12, - "line": 18 - } - }, - { - "defaultMessage": "!!!Firstname", - "end": { - "column": 3, - "line": 25 - }, - "file": "src/components/auth/Signup.js", - "id": "signup.firstname.label", - "start": { - "column": 18, - "line": 22 - } - }, - { - "defaultMessage": "!!!Lastname", - "end": { - "column": 3, - "line": 29 - }, - "file": "src/components/auth/Signup.js", - "id": "signup.lastname.label", - "start": { - "column": 17, - "line": 26 - } - }, - { - "defaultMessage": "!!!Email address", - "end": { - "column": 3, - "line": 33 - }, - "file": "src/components/auth/Signup.js", - "id": "signup.email.label", - "start": { - "column": 14, - "line": 30 - } - }, - { - "defaultMessage": "!!!Company", - "end": { - "column": 3, - "line": 37 - }, - "file": "src/components/auth/Signup.js", - "id": "signup.company.label", - "start": { - "column": 16, - "line": 34 - } - }, - { - "defaultMessage": "!!!Password", - "end": { - "column": 3, - "line": 41 - }, - "file": "src/components/auth/Signup.js", - "id": "signup.password.label", - "start": { - "column": 17, - "line": 38 - } - }, - { - "defaultMessage": "!!!By creating a Franz account you accept the", - "end": { - "column": 3, - "line": 45 - }, - "file": "src/components/auth/Signup.js", - "id": "signup.legal.info", - "start": { - "column": 13, - "line": 42 - } - }, - { - "defaultMessage": "!!!Terms of service", - "end": { - "column": 3, - "line": 49 - }, - "file": "src/components/auth/Signup.js", - "id": "signup.legal.terms", - "start": { - "column": 9, - "line": 46 - } - }, - { - "defaultMessage": "!!!Privacy Statement", - "end": { - "column": 3, - "line": 53 - }, - "file": "src/components/auth/Signup.js", - "id": "signup.legal.privacy", - "start": { - "column": 11, - "line": 50 - } - }, - { - "defaultMessage": "!!!Create account", - "end": { - "column": 3, - "line": 57 - }, - "file": "src/components/auth/Signup.js", - "id": "signup.submit.label", - "start": { - "column": 21, - "line": 54 - } - }, - { - "defaultMessage": "!!!Already have an account, sign in?", - "end": { - "column": 3, - "line": 61 - }, - "file": "src/components/auth/Signup.js", - "id": "signup.link.login", - "start": { - "column": 13, - "line": 58 - } - }, - { - "defaultMessage": "!!!A user with that email address already exists", - "end": { - "column": 3, - "line": 65 - }, - "file": "src/components/auth/Signup.js", - "id": "signup.emailDuplicate", - "start": { - "column": 18, - "line": 62 - } - } - ], - "path": "src/components/auth/Signup.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Create a free account", - "end": { - "column": 3, - "line": 12 - }, - "file": "src/components/auth/Welcome.js", - "id": "welcome.signupButton", - "start": { - "column": 16, - "line": 9 - } - }, - { - "defaultMessage": "!!!Login to your account", - "end": { - "column": 3, - "line": 16 - }, - "file": "src/components/auth/Welcome.js", - "id": "welcome.loginButton", - "start": { - "column": 15, - "line": 13 - } - } - ], - "path": "src/components/auth/Welcome.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Your services have been updated.", - "end": { - "column": 3, - "line": 29 - }, - "file": "src/components/layout/AppLayout.js", - "id": "infobar.servicesUpdated", - "start": { - "column": 19, - "line": 26 - } - }, - { - "defaultMessage": "!!!A new update for Franz is available.", - "end": { - "column": 3, - "line": 33 - }, - "file": "src/components/layout/AppLayout.js", - "id": "infobar.updateAvailable", - "start": { - "column": 19, - "line": 30 - } - }, - { - "defaultMessage": "!!!Reload services", - "end": { - "column": 3, - "line": 37 - }, - "file": "src/components/layout/AppLayout.js", - "id": "infobar.buttonReloadServices", - "start": { - "column": 24, - "line": 34 - } - }, - { - "defaultMessage": "!!!Changelog", - "end": { - "column": 3, - "line": 41 - }, - "file": "src/components/layout/AppLayout.js", - "id": "infobar.buttonChangelog", - "start": { - "column": 13, - "line": 38 - } - }, - { - "defaultMessage": "!!!Restart & install update", - "end": { - "column": 3, - "line": 45 - }, - "file": "src/components/layout/AppLayout.js", - "id": "infobar.buttonInstallUpdate", - "start": { - "column": 23, - "line": 42 - } - }, - { - "defaultMessage": "!!!Could not load services and user information", - "end": { - "column": 3, - "line": 49 - }, - "file": "src/components/layout/AppLayout.js", - "id": "infobar.requiredRequestsFailed", - "start": { - "column": 26, - "line": 46 - } - } - ], - "path": "src/components/layout/AppLayout.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Settings", - "end": { - "column": 3, - "line": 16 - }, - "file": "src/components/layout/Sidebar.js", - "id": "sidebar.settings", - "start": { - "column": 12, - "line": 13 - } - }, - { - "defaultMessage": "!!!Add new service", - "end": { - "column": 3, - "line": 20 - }, - "file": "src/components/layout/Sidebar.js", - "id": "sidebar.addNewService", - "start": { - "column": 17, - "line": 17 - } - }, - { - "defaultMessage": "!!!Disable notifications & audio", - "end": { - "column": 3, - "line": 24 - }, - "file": "src/components/layout/Sidebar.js", - "id": "sidebar.muteApp", - "start": { - "column": 8, - "line": 21 - } - }, - { - "defaultMessage": "!!!Enable notifications & audio", - "end": { - "column": 3, - "line": 28 - }, - "file": "src/components/layout/Sidebar.js", - "id": "sidebar.unmuteApp", - "start": { - "column": 10, - "line": 25 - } - }, - { - "defaultMessage": "!!!Open workspace drawer", - "end": { - "column": 3, - "line": 32 - }, - "file": "src/components/layout/Sidebar.js", - "id": "sidebar.openWorkspaceDrawer", - "start": { - "column": 23, - "line": 29 - } - }, - { - "defaultMessage": "!!!Close workspace drawer", - "end": { - "column": 3, - "line": 36 - }, - "file": "src/components/layout/Sidebar.js", - "id": "sidebar.closeWorkspaceDrawer", - "start": { - "column": 24, - "line": 33 - } - } - ], - "path": "src/components/layout/Sidebar.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Oh no!", - "end": { - "column": 3, - "line": 15 - }, - "file": "src/components/services/content/ErrorHandlers/WebviewErrorHandler.js", - "id": "service.errorHandler.headline", - "start": { - "column": 12, - "line": 12 - } - }, - { - "defaultMessage": "!!!{name} has failed to load.", - "end": { - "column": 3, - "line": 19 - }, - "file": "src/components/services/content/ErrorHandlers/WebviewErrorHandler.js", - "id": "service.errorHandler.text", - "start": { - "column": 8, - "line": 16 - } - }, - { - "defaultMessage": "!!!Reload {name}", - "end": { - "column": 3, - "line": 23 - }, - "file": "src/components/services/content/ErrorHandlers/WebviewErrorHandler.js", - "id": "service.errorHandler.action", - "start": { - "column": 10, - "line": 20 - } - }, - { - "defaultMessage": "!!!Edit {name}", - "end": { - "column": 3, - "line": 27 - }, - "file": "src/components/services/content/ErrorHandlers/WebviewErrorHandler.js", - "id": "service.errorHandler.editAction", - "start": { - "column": 14, - "line": 24 - } - }, - { - "defaultMessage": "!!!Error:", - "end": { - "column": 3, - "line": 31 - }, - "file": "src/components/services/content/ErrorHandlers/WebviewErrorHandler.js", - "id": "service.errorHandler.message", - "start": { - "column": 16, - "line": 28 - } - } - ], - "path": "src/components/services/content/ErrorHandlers/WebviewErrorHandler.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!{name} is disabled", - "end": { - "column": 3, - "line": 12 - }, - "file": "src/components/services/content/ServiceDisabled.js", - "id": "service.disabledHandler.headline", - "start": { - "column": 12, - "line": 9 - } - }, - { - "defaultMessage": "!!!Enable {name}", - "end": { - "column": 3, - "line": 16 - }, - "file": "src/components/services/content/ServiceDisabled.js", - "id": "service.disabledHandler.action", - "start": { - "column": 10, - "line": 13 - } - } - ], - "path": "src/components/services/content/ServiceDisabled.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Welcome to Franz", - "end": { - "column": 3, - "line": 14 - }, - "file": "src/components/services/content/Services.js", - "id": "services.welcome", - "start": { - "column": 11, - "line": 11 - } - }, - { - "defaultMessage": "!!!Get started", - "end": { - "column": 3, - "line": 18 - }, - "file": "src/components/services/content/Services.js", - "id": "services.getStarted", - "start": { - "column": 14, - "line": 15 - } - } - ], - "path": "src/components/services/content/Services.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Oh no!", - "end": { - "column": 3, - "line": 13 - }, - "file": "src/components/services/content/WebviewCrashHandler.js", - "id": "service.crashHandler.headline", - "start": { - "column": 12, - "line": 10 - } - }, - { - "defaultMessage": "!!!{name} has caused an error.", - "end": { - "column": 3, - "line": 17 - }, - "file": "src/components/services/content/WebviewCrashHandler.js", - "id": "service.crashHandler.text", - "start": { - "column": 8, - "line": 14 - } - }, - { - "defaultMessage": "!!!Reload {name}", - "end": { - "column": 3, - "line": 21 - }, - "file": "src/components/services/content/WebviewCrashHandler.js", - "id": "service.crashHandler.action", - "start": { - "column": 10, - "line": 18 - } - }, - { - "defaultMessage": "!!!Trying to automatically restore {name} in {seconds} seconds", - "end": { - "column": 3, - "line": 25 - }, - "file": "src/components/services/content/WebviewCrashHandler.js", - "id": "service.crashHandler.autoReload", - "start": { - "column": 14, - "line": 22 - } - } - ], - "path": "src/components/services/content/WebviewCrashHandler.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Reload", - "end": { - "column": 3, - "line": 18 - }, - "file": "src/components/services/tabs/TabItem.js", - "id": "tabs.item.reload", - "start": { - "column": 10, - "line": 15 - } - }, - { - "defaultMessage": "!!!Edit", - "end": { - "column": 3, - "line": 22 - }, - "file": "src/components/services/tabs/TabItem.js", - "id": "tabs.item.edit", - "start": { - "column": 8, - "line": 19 - } - }, - { - "defaultMessage": "!!!Disable notifications", - "end": { - "column": 3, - "line": 26 - }, - "file": "src/components/services/tabs/TabItem.js", - "id": "tabs.item.disableNotifications", - "start": { - "column": 24, - "line": 23 - } - }, - { - "defaultMessage": "!!!Enable notifications", - "end": { - "column": 3, - "line": 30 - }, - "file": "src/components/services/tabs/TabItem.js", - "id": "tabs.item.enableNotification", - "start": { - "column": 23, - "line": 27 - } - }, - { - "defaultMessage": "!!!Disable audio", - "end": { - "column": 3, - "line": 34 - }, - "file": "src/components/services/tabs/TabItem.js", - "id": "tabs.item.disableAudio", - "start": { - "column": 16, - "line": 31 - } - }, - { - "defaultMessage": "!!!Enable audio", - "end": { - "column": 3, - "line": 38 - }, - "file": "src/components/services/tabs/TabItem.js", - "id": "tabs.item.enableAudio", - "start": { - "column": 15, - "line": 35 - } - }, - { - "defaultMessage": "!!!Disable Service", - "end": { - "column": 3, - "line": 42 - }, - "file": "src/components/services/tabs/TabItem.js", - "id": "tabs.item.disableService", - "start": { - "column": 18, - "line": 39 - } - }, - { - "defaultMessage": "!!!Enable Service", - "end": { - "column": 3, - "line": 46 - }, - "file": "src/components/services/tabs/TabItem.js", - "id": "tabs.item.enableService", - "start": { - "column": 17, - "line": 43 - } - }, - { - "defaultMessage": "!!!Delete Service", - "end": { - "column": 3, - "line": 50 - }, - "file": "src/components/services/tabs/TabItem.js", - "id": "tabs.item.deleteService", - "start": { - "column": 17, - "line": 47 - } - } - ], - "path": "src/components/services/tabs/TabItem.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Account", - "end": { - "column": 3, - "line": 18 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.headline", - "start": { - "column": 12, - "line": 15 - } - }, - { - "defaultMessage": "!!!Your Subscription", - "end": { - "column": 3, - "line": 22 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.headlineSubscription", - "start": { - "column": 24, - "line": 19 - } - }, - { - "defaultMessage": "!!!Upgrade your Account", - "end": { - "column": 3, - "line": 26 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.headlineUpgrade", - "start": { - "column": 19, - "line": 23 - } - }, - { - "defaultMessage": "!!Invoices", - "end": { - "column": 3, - "line": 30 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.headlineInvoices", - "start": { - "column": 20, - "line": 27 - } - }, - { - "defaultMessage": "!!Danger Zone", - "end": { - "column": 3, - "line": 34 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.headlineDangerZone", - "start": { - "column": 22, - "line": 31 - } - }, - { - "defaultMessage": "!!!Manage your subscription", - "end": { - "column": 3, - "line": 38 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.manageSubscription.label", - "start": { - "column": 33, - "line": 35 - } - }, - { - "defaultMessage": "!!!Basic Account", - "end": { - "column": 3, - "line": 42 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.accountType.basic", - "start": { - "column": 20, - "line": 39 - } - }, - { - "defaultMessage": "!!!Premium Supporter Account", - "end": { - "column": 3, - "line": 46 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.accountType.premium", - "start": { - "column": 22, - "line": 43 - } - }, - { - "defaultMessage": "!!!Edit Account", - "end": { - "column": 3, - "line": 50 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.account.editButton", - "start": { - "column": 21, - "line": 47 - } - }, - { - "defaultMessage": "!!!Download", - "end": { - "column": 3, - "line": 54 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.invoiceDownload", - "start": { - "column": 19, - "line": 51 - } - }, - { - "defaultMessage": "!!!Could not load user information", - "end": { - "column": 3, - "line": 58 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.userInfoRequestFailed", - "start": { - "column": 25, - "line": 55 - } - }, - { - "defaultMessage": "!!!Try again", - "end": { - "column": 3, - "line": 62 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.tryReloadUserInfoRequest", - "start": { - "column": 28, - "line": 59 - } - }, - { - "defaultMessage": "!!!Delete account", - "end": { - "column": 3, - "line": 66 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.deleteAccount", - "start": { - "column": 17, - "line": 63 - } - }, - { - "defaultMessage": "!!!If you don't need your Franz account any longer, you can delete your account and all related data here.", - "end": { - "column": 3, - "line": 70 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.deleteInfo", - "start": { - "column": 14, - "line": 67 - } - }, - { - "defaultMessage": "!!!You have received an email with a link to confirm your account deletion. Your account and data cannot be restored!", - "end": { - "column": 3, - "line": 74 - }, - "file": "src/components/settings/account/AccountDashboard.js", - "id": "settings.account.deleteEmailSent", - "start": { - "column": 19, - "line": 71 - } - } - ], - "path": "src/components/settings/account/AccountDashboard.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Available services", - "end": { - "column": 3, - "line": 15 - }, - "file": "src/components/settings/navigation/SettingsNavigation.js", - "id": "settings.navigation.availableServices", - "start": { - "column": 21, - "line": 12 - } - }, - { - "defaultMessage": "!!!Your services", - "end": { - "column": 3, - "line": 19 - }, - "file": "src/components/settings/navigation/SettingsNavigation.js", - "id": "settings.navigation.yourServices", - "start": { - "column": 16, - "line": 16 - } - }, - { - "defaultMessage": "!!!Your workspaces", - "end": { - "column": 3, - "line": 23 - }, - "file": "src/components/settings/navigation/SettingsNavigation.js", - "id": "settings.navigation.yourWorkspaces", - "start": { - "column": 18, - "line": 20 - } - }, - { - "defaultMessage": "!!!Account", - "end": { - "column": 3, - "line": 27 - }, - "file": "src/components/settings/navigation/SettingsNavigation.js", - "id": "settings.navigation.account", - "start": { - "column": 11, - "line": 24 - } - }, - { - "defaultMessage": "!!!Settings", - "end": { - "column": 3, - "line": 31 - }, - "file": "src/components/settings/navigation/SettingsNavigation.js", - "id": "settings.navigation.settings", - "start": { - "column": 12, - "line": 28 - } - }, - { - "defaultMessage": "!!!Invite Friends", - "end": { - "column": 3, - "line": 35 - }, - "file": "src/components/settings/navigation/SettingsNavigation.js", - "id": "settings.navigation.inviteFriends", - "start": { - "column": 17, - "line": 32 - } - }, - { - "defaultMessage": "!!!Logout", - "end": { - "column": 3, - "line": 39 - }, - "file": "src/components/settings/navigation/SettingsNavigation.js", - "id": "settings.navigation.logout", - "start": { - "column": 10, - "line": 36 - } - } - ], - "path": "src/components/settings/navigation/SettingsNavigation.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Available Services", - "end": { - "column": 3, - "line": 18 - }, - "file": "src/components/settings/recipes/RecipesDashboard.js", - "id": "settings.recipes.headline", - "start": { - "column": 12, - "line": 15 - } - }, - { - "defaultMessage": "!!!Search service", - "end": { - "column": 3, - "line": 22 - }, - "file": "src/components/settings/recipes/RecipesDashboard.js", - "id": "settings.searchService", - "start": { - "column": 17, - "line": 19 - } - }, - { - "defaultMessage": "!!!Most popular", - "end": { - "column": 3, - "line": 26 - }, - "file": "src/components/settings/recipes/RecipesDashboard.js", - "id": "settings.recipes.mostPopular", - "start": { - "column": 22, - "line": 23 - } - }, - { - "defaultMessage": "!!!All services", - "end": { - "column": 3, - "line": 30 - }, - "file": "src/components/settings/recipes/RecipesDashboard.js", - "id": "settings.recipes.all", - "start": { - "column": 14, - "line": 27 - } - }, - { - "defaultMessage": "!!!Development", - "end": { - "column": 3, - "line": 34 - }, - "file": "src/components/settings/recipes/RecipesDashboard.js", - "id": "settings.recipes.dev", - "start": { - "column": 14, - "line": 31 - } - }, - { - "defaultMessage": "!!!Sorry, but no service matched your search term.", - "end": { - "column": 3, - "line": 38 - }, - "file": "src/components/settings/recipes/RecipesDashboard.js", - "id": "settings.recipes.nothingFound", - "start": { - "column": 16, - "line": 35 - } - }, - { - "defaultMessage": "!!!Service successfully added", - "end": { - "column": 3, - "line": 42 - }, - "file": "src/components/settings/recipes/RecipesDashboard.js", - "id": "settings.recipes.servicesSuccessfulAddedInfo", - "start": { - "column": 31, - "line": 39 - } - }, - { - "defaultMessage": "!!!Missing a service?", - "end": { - "column": 3, - "line": 46 - }, - "file": "src/components/settings/recipes/RecipesDashboard.js", - "id": "settings.recipes.missingService", - "start": { - "column": 18, - "line": 43 - } - } - ], - "path": "src/components/settings/recipes/RecipesDashboard.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Save service", - "end": { - "column": 3, - "line": 25 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.saveButton", - "start": { - "column": 15, - "line": 22 - } - }, - { - "defaultMessage": "!!!Delete Service", - "end": { - "column": 3, - "line": 29 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.deleteButton", - "start": { - "column": 17, - "line": 26 - } - }, - { - "defaultMessage": "!!!Available services", - "end": { - "column": 3, - "line": 33 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.availableServices", - "start": { - "column": 21, - "line": 30 - } - }, - { - "defaultMessage": "!!!Your services", - "end": { - "column": 3, - "line": 37 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.yourServices", - "start": { - "column": 16, - "line": 34 - } - }, - { - "defaultMessage": "!!!Add {name}", - "end": { - "column": 3, - "line": 41 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.addServiceHeadline", - "start": { - "column": 22, - "line": 38 - } - }, - { - "defaultMessage": "!!!Edit {name}", - "end": { - "column": 3, - "line": 45 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.editServiceHeadline", - "start": { - "column": 23, - "line": 42 - } - }, - { - "defaultMessage": "!!!Hosted", - "end": { - "column": 3, - "line": 49 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.tabHosted", - "start": { - "column": 13, - "line": 46 - } - }, - { - "defaultMessage": "!!!Self hosted ⭐️", - "end": { - "column": 3, - "line": 53 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.tabOnPremise", - "start": { - "column": 16, - "line": 50 - } - }, - { - "defaultMessage": "!!!Use the hosted {name} service.", - "end": { - "column": 3, - "line": 57 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.useHostedService", - "start": { - "column": 20, - "line": 54 - } - }, - { - "defaultMessage": "!!!Could not validate custom {name} server.", - "end": { - "column": 3, - "line": 61 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.customUrlValidationError", - "start": { - "column": 28, - "line": 58 - } - }, - { - "defaultMessage": "!!!To add self hosted services, you need a Franz Premium Supporter Account.", - "end": { - "column": 3, - "line": 65 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.customUrlPremiumInfo", - "start": { - "column": 24, - "line": 62 - } - }, - { - "defaultMessage": "!!!Upgrade your account", - "end": { - "column": 3, - "line": 69 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.customUrlUpgradeAccount", - "start": { - "column": 27, - "line": 66 - } - }, - { - "defaultMessage": "!!!You will be notified about all new messages in a channel, not just @username, @channel, @here, ...", - "end": { - "column": 3, - "line": 73 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.indirectMessageInfo", - "start": { - "column": 23, - "line": 70 - } - }, - { - "defaultMessage": "!!!When disabled, all notification sounds and audio playback are muted", - "end": { - "column": 3, - "line": 77 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.isMutedInfo", - "start": { - "column": 15, - "line": 74 - } - }, - { - "defaultMessage": "!!!Notifications", - "end": { - "column": 3, - "line": 81 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.headlineNotifications", - "start": { - "column": 25, - "line": 78 - } - }, - { - "defaultMessage": "!!!Unread message badges", - "end": { - "column": 3, - "line": 85 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.headlineBadges", - "start": { - "column": 18, - "line": 82 - } - }, - { - "defaultMessage": "!!!General", - "end": { - "column": 3, - "line": 89 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.headlineGeneral", - "start": { - "column": 19, - "line": 86 - } - }, - { - "defaultMessage": "!!!Delete", - "end": { - "column": 3, - "line": 93 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.iconDelete", - "start": { - "column": 14, - "line": 90 - } - }, - { - "defaultMessage": "!!!Drop your image, or click here", - "end": { - "column": 3, - "line": 97 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.iconUpload", - "start": { - "column": 14, - "line": 94 - } - }, - { - "defaultMessage": "!!!HTTP/HTTPS Proxy Settings", - "end": { - "column": 3, - "line": 101 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.proxy.headline", - "start": { - "column": 17, - "line": 98 - } - }, - { - "defaultMessage": "!!!Please restart Franz after changing proxy Settings.", - "end": { - "column": 3, - "line": 105 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.proxy.restartInfo", - "start": { - "column": 20, - "line": 102 - } - }, - { - "defaultMessage": "!!!Proxy settings will not be synchronized with the Franz servers.", - "end": { - "column": 3, - "line": 109 - }, - "file": "src/components/settings/services/EditServiceForm.js", - "id": "settings.service.form.proxy.info", - "start": { - "column": 13, - "line": 106 - } - } - ], - "path": "src/components/settings/services/EditServiceForm.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Error", - "end": { - "column": 3, - "line": 13 - }, - "file": "src/components/settings/services/ServiceError.js", - "id": "settings.service.error.headline", - "start": { - "column": 12, - "line": 10 - } - }, - { - "defaultMessage": "!!!Back to services", - "end": { - "column": 3, - "line": 17 - }, - "file": "src/components/settings/services/ServiceError.js", - "id": "settings.service.error.goBack", - "start": { - "column": 10, - "line": 14 - } - }, - { - "defaultMessage": "!!!Available services", - "end": { - "column": 3, - "line": 21 - }, - "file": "src/components/settings/services/ServiceError.js", - "id": "settings.service.form.availableServices", - "start": { - "column": 21, - "line": 18 - } - }, - { - "defaultMessage": "!!!Could not load service recipe.", - "end": { - "column": 3, - "line": 25 - }, - "file": "src/components/settings/services/ServiceError.js", - "id": "settings.service.error.message", - "start": { - "column": 16, - "line": 22 - } - } - ], - "path": "src/components/settings/services/ServiceError.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Service is disabled", - "end": { - "column": 3, - "line": 14 - }, - "file": "src/components/settings/services/ServiceItem.js", - "id": "settings.services.tooltip.isDisabled", - "start": { - "column": 21, - "line": 11 - } - }, - { - "defaultMessage": "!!!Notifications are disabled", - "end": { - "column": 3, - "line": 18 - }, - "file": "src/components/settings/services/ServiceItem.js", - "id": "settings.services.tooltip.notificationsDisabled", - "start": { - "column": 32, - "line": 15 - } - }, - { - "defaultMessage": "!!!All sounds are muted", - "end": { - "column": 3, - "line": 22 - }, - "file": "src/components/settings/services/ServiceItem.js", - "id": "settings.services.tooltip.isMuted", - "start": { - "column": 18, - "line": 19 - } - } - ], - "path": "src/components/settings/services/ServiceItem.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Your services", - "end": { - "column": 3, - "line": 17 - }, - "file": "src/components/settings/services/ServicesDashboard.js", - "id": "settings.services.headline", - "start": { - "column": 12, - "line": 14 - } - }, - { - "defaultMessage": "!!!Search service", - "end": { - "column": 3, - "line": 21 - }, - "file": "src/components/settings/services/ServicesDashboard.js", - "id": "settings.searchService", - "start": { - "column": 17, - "line": 18 - } - }, - { - "defaultMessage": "!!!You haven't added any services yet.", - "end": { - "column": 3, - "line": 25 - }, - "file": "src/components/settings/services/ServicesDashboard.js", - "id": "settings.services.noServicesAdded", - "start": { - "column": 19, - "line": 22 - } - }, - { - "defaultMessage": "!!!Sorry, but no service matched your search term.", - "end": { - "column": 3, - "line": 29 - }, - "file": "src/components/settings/services/ServicesDashboard.js", - "id": "settings.recipes.nothingFound", - "start": { - "column": 18, - "line": 26 - } - }, - { - "defaultMessage": "!!!Discover services", - "end": { - "column": 3, - "line": 33 - }, - "file": "src/components/settings/services/ServicesDashboard.js", - "id": "settings.services.discoverServices", - "start": { - "column": 20, - "line": 30 - } - }, - { - "defaultMessage": "!!!Could not load your services", - "end": { - "column": 3, - "line": 37 - }, - "file": "src/components/settings/services/ServicesDashboard.js", - "id": "settings.services.servicesRequestFailed", - "start": { - "column": 25, - "line": 34 - } - }, - { - "defaultMessage": "!!!Try again", - "end": { - "column": 3, - "line": 41 - }, - "file": "src/components/settings/services/ServicesDashboard.js", - "id": "settings.account.tryReloadServices", - "start": { - "column": 21, - "line": 38 - } - }, - { - "defaultMessage": "!!!Your changes have been saved", - "end": { - "column": 3, - "line": 45 - }, - "file": "src/components/settings/services/ServicesDashboard.js", - "id": "settings.services.updatedInfo", - "start": { - "column": 15, - "line": 42 - } - }, - { - "defaultMessage": "!!!Service has been deleted", - "end": { - "column": 3, - "line": 49 - }, - "file": "src/components/settings/services/ServicesDashboard.js", - "id": "settings.services.deletedInfo", - "start": { - "column": 15, - "line": 46 - } - } - ], - "path": "src/components/settings/services/ServicesDashboard.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Settings", - "end": { - "column": 3, - "line": 19 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.headline", - "start": { - "column": 12, - "line": 16 - } - }, - { - "defaultMessage": "!!!General", - "end": { - "column": 3, - "line": 23 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.headlineGeneral", - "start": { - "column": 19, - "line": 20 - } - }, - { - "defaultMessage": "!!!Language", - "end": { - "column": 3, - "line": 27 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.headlineLanguage", - "start": { - "column": 20, - "line": 24 - } - }, - { - "defaultMessage": "!!!Updates", - "end": { - "column": 3, - "line": 31 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.headlineUpdates", - "start": { - "column": 19, - "line": 28 - } - }, - { - "defaultMessage": "!!!Appearance", - "end": { - "column": 3, - "line": 35 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.headlineAppearance", - "start": { - "column": 22, - "line": 32 - } - }, - { - "defaultMessage": "!!!Advanced", - "end": { - "column": 3, - "line": 39 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.headlineAdvanced", - "start": { - "column": 20, - "line": 36 - } - }, - { - "defaultMessage": "!!!Help us to translate Franz into your language.", - "end": { - "column": 3, - "line": 43 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.translationHelp", - "start": { - "column": 19, - "line": 40 - } - }, - { - "defaultMessage": "!!!Cache", - "end": { - "column": 3, - "line": 47 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.subheadlineCache", - "start": { - "column": 20, - "line": 44 - } - }, - { - "defaultMessage": "!!!Franz cache is currently using {size} of disk space.", - "end": { - "column": 3, - "line": 51 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.cacheInfo", - "start": { - "column": 13, - "line": 48 - } - }, - { - "defaultMessage": "!!!Clear cache", - "end": { - "column": 3, - "line": 55 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.buttonClearAllCache", - "start": { - "column": 23, - "line": 52 - } - }, - { - "defaultMessage": "!!!Check for updates", - "end": { - "column": 3, - "line": 59 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.buttonSearchForUpdate", - "start": { - "column": 25, - "line": 56 - } - }, - { - "defaultMessage": "!!!Restart & install update", - "end": { - "column": 3, - "line": 63 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.buttonInstallUpdate", - "start": { - "column": 23, - "line": 60 - } - }, - { - "defaultMessage": "!!!Is searching for update", - "end": { - "column": 3, - "line": 67 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.updateStatusSearching", - "start": { - "column": 25, - "line": 64 - } - }, - { - "defaultMessage": "!!!Update available, downloading...", - "end": { - "column": 3, - "line": 71 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.updateStatusAvailable", - "start": { - "column": 25, - "line": 68 - } - }, - { - "defaultMessage": "!!!You are using the latest version of Franz", - "end": { - "column": 3, - "line": 75 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.updateStatusUpToDate", - "start": { - "column": 24, - "line": 72 - } - }, - { - "defaultMessage": "!!!Current version:", - "end": { - "column": 3, - "line": 79 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.currentVersion", - "start": { - "column": 18, - "line": 76 - } - }, - { - "defaultMessage": "!!!Changes require restart", - "end": { - "column": 3, - "line": 83 - }, - "file": "src/components/settings/settings/EditSettingsForm.js", - "id": "settings.app.restartRequired", - "start": { - "column": 29, - "line": 80 - } - } - ], - "path": "src/components/settings/settings/EditSettingsForm.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Account", - "end": { - "column": 3, - "line": 18 - }, - "file": "src/components/settings/user/EditUserForm.js", - "id": "settings.account.headline", - "start": { - "column": 12, - "line": 15 - } - }, - { - "defaultMessage": "!!!Update Profile", - "end": { - "column": 3, - "line": 22 - }, - "file": "src/components/settings/user/EditUserForm.js", - "id": "settings.account.headlineProfile", - "start": { - "column": 19, - "line": 19 - } - }, - { - "defaultMessage": "!!!Account Information", - "end": { - "column": 3, - "line": 26 - }, - "file": "src/components/settings/user/EditUserForm.js", - "id": "settings.account.headlineAccount", - "start": { - "column": 19, - "line": 23 - } - }, - { - "defaultMessage": "!!!Change Password", - "end": { - "column": 3, - "line": 30 - }, - "file": "src/components/settings/user/EditUserForm.js", - "id": "settings.account.headlinePassword", - "start": { - "column": 20, - "line": 27 - } - }, - { - "defaultMessage": "!!!Your changes have been saved", - "end": { - "column": 3, - "line": 34 - }, - "file": "src/components/settings/user/EditUserForm.js", - "id": "settings.account.successInfo", - "start": { - "column": 15, - "line": 31 - } - }, - { - "defaultMessage": "!!!Update profile", - "end": { - "column": 3, - "line": 38 - }, - "file": "src/components/settings/user/EditUserForm.js", - "id": "settings.account.buttonSave", - "start": { - "column": 14, - "line": 35 - } - } - ], - "path": "src/components/settings/user/EditUserForm.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Support the development of Franz", - "end": { - "column": 3, - "line": 17 - }, - "file": "src/components/subscription/SubscriptionForm.js", - "id": "subscription.submit.label", - "start": { - "column": 21, - "line": 14 - } - }, - { - "defaultMessage": "!!!Could not initialize payment form", - "end": { - "column": 3, - "line": 21 - }, - "file": "src/components/subscription/SubscriptionForm.js", - "id": "subscription.paymentSessionError", - "start": { - "column": 23, - "line": 18 - } - }, - { - "defaultMessage": "!!!free", - "end": { - "column": 3, - "line": 25 - }, - "file": "src/components/subscription/SubscriptionForm.js", - "id": "subscription.type.free", - "start": { - "column": 12, - "line": 22 - } - }, - { - "defaultMessage": "!!!month", - "end": { - "column": 3, - "line": 29 - }, - "file": "src/components/subscription/SubscriptionForm.js", - "id": "subscription.type.month", - "start": { - "column": 15, - "line": 26 - } - }, - { - "defaultMessage": "!!!year", - "end": { - "column": 3, - "line": 33 - }, - "file": "src/components/subscription/SubscriptionForm.js", - "id": "subscription.type.year", - "start": { - "column": 14, - "line": 30 - } - }, - { - "defaultMessage": "!!!The Franz Premium Supporter Account includes", - "end": { - "column": 3, - "line": 37 - }, - "file": "src/components/subscription/SubscriptionForm.js", - "id": "subscription.includedFeatures", - "start": { - "column": 20, - "line": 34 - } - }, - { - "defaultMessage": "!!!Add on-premise/hosted services like Mattermost", - "end": { - "column": 3, - "line": 41 - }, - "file": "src/components/subscription/SubscriptionForm.js", - "id": "subscription.features.onpremise.mattermost", - "start": { - "column": 13, - "line": 38 - } - }, - { - "defaultMessage": "!!!No app delays & nagging to upgrade license", - "end": { - "column": 3, - "line": 45 - }, - "file": "src/components/subscription/SubscriptionForm.js", - "id": "subscription.features.noInterruptions", - "start": { - "column": 19, - "line": 42 - } - }, - { - "defaultMessage": "!!!Proxy support for services", - "end": { - "column": 3, - "line": 49 - }, - "file": "src/components/subscription/SubscriptionForm.js", - "id": "subscription.features.proxy", - "start": { - "column": 9, - "line": 46 - } - }, - { - "defaultMessage": "!!!Support for Spellchecker", - "end": { - "column": 3, - "line": 53 - }, - "file": "src/components/subscription/SubscriptionForm.js", - "id": "subscription.features.spellchecker", - "start": { - "column": 16, - "line": 50 - } - }, - { - "defaultMessage": "!!!No ads, ever!", - "end": { - "column": 3, - "line": 57 - }, - "file": "src/components/subscription/SubscriptionForm.js", - "id": "subscription.features.ads", - "start": { - "column": 7, - "line": 54 - } - }, - { - "defaultMessage": "!!!coming soon", - "end": { - "column": 3, - "line": 61 - }, - "file": "src/components/subscription/SubscriptionForm.js", - "id": "subscription.features.comingSoon", - "start": { - "column": 14, - "line": 58 - } - }, - { - "defaultMessage": "!!!EU residents: local sales tax may apply", - "end": { - "column": 3, - "line": 65 - }, - "file": "src/components/subscription/SubscriptionForm.js", - "id": "subscription.euTaxInfo", - "start": { - "column": 13, - "line": 62 - } - } - ], - "path": "src/components/subscription/SubscriptionForm.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Cancel", - "end": { - "column": 3, - "line": 14 - }, - "file": "src/components/subscription/SubscriptionPopup.js", - "id": "subscriptionPopup.buttonCancel", - "start": { - "column": 16, - "line": 11 - } - }, - { - "defaultMessage": "!!!Done", - "end": { - "column": 3, - "line": 18 - }, - "file": "src/components/subscription/SubscriptionPopup.js", - "id": "subscriptionPopup.buttonDone", - "start": { - "column": 14, - "line": 15 - } - } - ], - "path": "src/components/subscription/SubscriptionPopup.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Upgrade account", - "end": { - "column": 3, - "line": 18 - }, - "file": "src/components/ui/PremiumFeatureContainer/index.js", - "id": "premiumFeature.button.upgradeAccount", - "start": { - "column": 10, - "line": 15 - } - } - ], - "path": "src/components/ui/PremiumFeatureContainer/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Loading", - "end": { - "column": 3, - "line": 14 - }, - "file": "src/components/ui/WebviewLoader/index.js", - "id": "service.webviewLoader.loading", - "start": { - "column": 11, - "line": 11 - } - } - ], - "path": "src/components/ui/WebviewLoader/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Something went wrong.", - "end": { - "column": 3, - "line": 14 - }, - "file": "src/components/util/ErrorBoundary/index.js", - "id": "app.errorHandler.headline", - "start": { - "column": 12, - "line": 11 - } - }, - { - "defaultMessage": "!!!Reload", - "end": { - "column": 3, - "line": 18 - }, - "file": "src/components/util/ErrorBoundary/index.js", - "id": "app.errorHandler.action", - "start": { - "column": 10, - "line": 15 - } - } - ], - "path": "src/components/util/ErrorBoundary/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Name", - "end": { - "column": 3, - "line": 31 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.name", - "start": { - "column": 8, - "line": 28 - } - }, - { - "defaultMessage": "!!!Enable service", - "end": { - "column": 3, - "line": 35 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.enableService", - "start": { - "column": 17, - "line": 32 - } - }, - { - "defaultMessage": "!!!Enable Notifications", - "end": { - "column": 3, - "line": 39 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.enableNotification", - "start": { - "column": 22, - "line": 36 - } - }, - { - "defaultMessage": "!!!Show unread message badges", - "end": { - "column": 3, - "line": 43 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.enableBadge", - "start": { - "column": 15, - "line": 40 - } - }, - { - "defaultMessage": "!!!Enable audio", - "end": { - "column": 3, - "line": 47 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.enableAudio", - "start": { - "column": 15, - "line": 44 - } - }, - { - "defaultMessage": "!!!Team", - "end": { - "column": 3, - "line": 51 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.team", - "start": { - "column": 8, - "line": 48 - } - }, - { - "defaultMessage": "!!!Custom server", - "end": { - "column": 3, - "line": 55 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.customUrl", - "start": { - "column": 13, - "line": 52 - } - }, - { - "defaultMessage": "!!!Show message badge for all new messages", - "end": { - "column": 3, - "line": 59 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.indirectMessages", - "start": { - "column": 20, - "line": 56 - } - }, - { - "defaultMessage": "!!!Custom icon", - "end": { - "column": 3, - "line": 63 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.icon", - "start": { - "column": 8, - "line": 60 - } - }, - { - "defaultMessage": "!!!Enable Dark Mode", - "end": { - "column": 3, - "line": 67 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.enableDarkMode", - "start": { - "column": 18, - "line": 64 - } - }, - { - "defaultMessage": "!!!Use Proxy", - "end": { - "column": 3, - "line": 71 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.proxy.isEnabled", - "start": { - "column": 15, - "line": 68 - } - }, - { - "defaultMessage": "!!!Proxy Host/IP", - "end": { - "column": 3, - "line": 75 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.proxy.host", - "start": { - "column": 13, - "line": 72 - } - }, - { - "defaultMessage": "!!!Port", - "end": { - "column": 3, - "line": 79 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.proxy.port", - "start": { - "column": 13, - "line": 76 - } - }, - { - "defaultMessage": "!!!User", - "end": { - "column": 3, - "line": 83 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.proxy.user", - "start": { - "column": 13, - "line": 80 - } - }, - { - "defaultMessage": "!!!Password", - "end": { - "column": 3, - "line": 87 - }, - "file": "src/containers/settings/EditServiceScreen.js", - "id": "settings.service.form.proxy.password", - "start": { - "column": 17, - "line": 84 - } - } - ], - "path": "src/containers/settings/EditServiceScreen.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Launch Franz on start", - "end": { - "column": 3, - "line": 25 - }, - "file": "src/containers/settings/EditSettingsScreen.js", - "id": "settings.app.form.autoLaunchOnStart", - "start": { - "column": 21, - "line": 22 - } - }, - { - "defaultMessage": "!!!Open in background", - "end": { - "column": 3, - "line": 29 - }, - "file": "src/containers/settings/EditSettingsScreen.js", - "id": "settings.app.form.autoLaunchInBackground", - "start": { - "column": 26, - "line": 26 - } - }, - { - "defaultMessage": "!!!Keep Franz in background when closing the window", - "end": { - "column": 3, - "line": 33 - }, - "file": "src/containers/settings/EditSettingsScreen.js", - "id": "settings.app.form.runInBackground", - "start": { - "column": 19, - "line": 30 - } - }, - { - "defaultMessage": "!!!Show Franz in system tray", - "end": { - "column": 3, - "line": 37 - }, - "file": "src/containers/settings/EditSettingsScreen.js", - "id": "settings.app.form.enableSystemTray", - "start": { - "column": 20, - "line": 34 - } - }, - { - "defaultMessage": "!!!Minimize Franz to system tray", - "end": { - "column": 3, - "line": 41 - }, - "file": "src/containers/settings/EditSettingsScreen.js", - "id": "settings.app.form.minimizeToSystemTray", - "start": { - "column": 24, - "line": 38 - } - }, - { - "defaultMessage": "!!!Language", - "end": { - "column": 3, - "line": 45 - }, - "file": "src/containers/settings/EditSettingsScreen.js", - "id": "settings.app.form.language", - "start": { - "column": 12, - "line": 42 - } - }, - { - "defaultMessage": "!!!Dark Mode", - "end": { - "column": 3, - "line": 49 - }, - "file": "src/containers/settings/EditSettingsScreen.js", - "id": "settings.app.form.darkMode", - "start": { - "column": 12, - "line": 46 - } - }, - { - "defaultMessage": "!!!Display disabled services tabs", - "end": { - "column": 3, - "line": 53 - }, - "file": "src/containers/settings/EditSettingsScreen.js", - "id": "settings.app.form.showDisabledServices", - "start": { - "column": 24, - "line": 50 - } - }, - { - "defaultMessage": "!!!Show unread message badge when notifications are disabled", - "end": { - "column": 3, - "line": 57 - }, - "file": "src/containers/settings/EditSettingsScreen.js", - "id": "settings.app.form.showMessagesBadgesWhenMuted", - "start": { - "column": 29, - "line": 54 - } - }, - { - "defaultMessage": "!!!Enable spell checking", - "end": { - "column": 3, - "line": 61 - }, - "file": "src/containers/settings/EditSettingsScreen.js", - "id": "settings.app.form.enableSpellchecking", - "start": { - "column": 23, - "line": 58 - } - }, - { - "defaultMessage": "!!!Enable GPU Acceleration", - "end": { - "column": 3, - "line": 65 - }, - "file": "src/containers/settings/EditSettingsScreen.js", - "id": "settings.app.form.enableGPUAcceleration", - "start": { - "column": 25, - "line": 62 - } - }, - { - "defaultMessage": "!!!Include beta versions", - "end": { - "column": 3, - "line": 69 - }, - "file": "src/containers/settings/EditSettingsScreen.js", - "id": "settings.app.form.beta", - "start": { - "column": 8, - "line": 66 - } - } - ], - "path": "src/containers/settings/EditSettingsScreen.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Firstname", - "end": { - "column": 3, - "line": 17 - }, - "file": "src/containers/settings/EditUserScreen.js", - "id": "settings.user.form.firstname", - "start": { - "column": 13, - "line": 14 - } - }, - { - "defaultMessage": "!!!Lastname", - "end": { - "column": 3, - "line": 21 - }, - "file": "src/containers/settings/EditUserScreen.js", - "id": "settings.user.form.lastname", - "start": { - "column": 12, - "line": 18 - } - }, - { - "defaultMessage": "!!!Email", - "end": { - "column": 3, - "line": 25 - }, - "file": "src/containers/settings/EditUserScreen.js", - "id": "settings.user.form.email", - "start": { - "column": 9, - "line": 22 - } - }, - { - "defaultMessage": "!!!Account type", - "end": { - "column": 3, - "line": 29 - }, - "file": "src/containers/settings/EditUserScreen.js", - "id": "settings.user.form.accountType.label", - "start": { - "column": 20, - "line": 26 - } - }, - { - "defaultMessage": "!!!Individual", - "end": { - "column": 3, - "line": 33 - }, - "file": "src/containers/settings/EditUserScreen.js", - "id": "settings.user.form.accountType.individual", - "start": { - "column": 25, - "line": 30 - } - }, - { - "defaultMessage": "!!!Non-Profit", - "end": { - "column": 3, - "line": 37 - }, - "file": "src/containers/settings/EditUserScreen.js", - "id": "settings.user.form.accountType.non-profit", - "start": { - "column": 24, - "line": 34 - } - }, - { - "defaultMessage": "!!!Company", - "end": { - "column": 3, - "line": 41 - }, - "file": "src/containers/settings/EditUserScreen.js", - "id": "settings.user.form.accountType.company", - "start": { - "column": 22, - "line": 38 - } - }, - { - "defaultMessage": "!!!Current password", - "end": { - "column": 3, - "line": 45 - }, - "file": "src/containers/settings/EditUserScreen.js", - "id": "settings.user.form.currentPassword", - "start": { - "column": 19, - "line": 42 - } - }, - { - "defaultMessage": "!!!New password", - "end": { - "column": 3, - "line": 49 - }, - "file": "src/containers/settings/EditUserScreen.js", - "id": "settings.user.form.newPassword", - "start": { - "column": 15, - "line": 46 - } - } - ], - "path": "src/containers/settings/EditUserScreen.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!What's new in Franz {version}?", - "end": { - "column": 3, - "line": 14 - }, - "file": "src/features/announcements/Component.js", - "id": "feature.announcements.changelog.headline", - "start": { - "column": 12, - "line": 11 - } - } - ], - "path": "src/features/announcements/Component.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Changes in Franz {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": [ - { - "defaultMessage": "!!!Please purchase license to skip waiting", - "end": { - "column": 3, - "line": 18 - }, - "file": "src/features/delayApp/Component.js", - "id": "feature.delayApp.headline", - "start": { - "column": 12, - "line": 15 - } - }, - { - "defaultMessage": "!!!Get a Franz Supporter License", - "end": { - "column": 3, - "line": 22 - }, - "file": "src/features/delayApp/Component.js", - "id": "feature.delayApp.action", - "start": { - "column": 10, - "line": 19 - } - }, - { - "defaultMessage": "!!!Franz will continue in {seconds} seconds.", - "end": { - "column": 3, - "line": 26 - }, - "file": "src/features/delayApp/Component.js", - "id": "feature.delayApp.text", - "start": { - "column": 8, - "line": 23 - } - } - ], - "path": "src/features/delayApp/Component.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Franz is better together!", - "end": { - "column": 3, - "line": 18 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.headline", - "start": { - "column": 12, - "line": 15 - } - }, - { - "defaultMessage": "!!!Tell your friends and colleagues how awesome Franz is and help us to spread the word.", - "end": { - "column": 3, - "line": 22 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.text", - "start": { - "column": 8, - "line": 19 - } - }, - { - "defaultMessage": "!!!Share as email", - "end": { - "column": 3, - "line": 26 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.action.email", - "start": { - "column": 16, - "line": 23 - } - }, - { - "defaultMessage": "!!!Share on Facebook", - "end": { - "column": 3, - "line": 30 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.action.facebook", - "start": { - "column": 19, - "line": 27 - } - }, - { - "defaultMessage": "!!!Share on Twitter", - "end": { - "column": 3, - "line": 34 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.action.twitter", - "start": { - "column": 18, - "line": 31 - } - }, - { - "defaultMessage": "!!! I've added {count} services to Franz! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.meetfranz.com", - "end": { - "column": 3, - "line": 38 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.shareText.email", - "start": { - "column": 18, - "line": 35 - } - }, - { - "defaultMessage": "!!! I've added {count} services to Franz! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.meetfranz.com /cc @FranzMessenger", - "end": { - "column": 3, - "line": 42 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.shareText.twitter", - "start": { - "column": 20, - "line": 39 - } - } - ], - "path": "src/features/shareFranz/Component.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Create workspace", - "end": { - "column": 3, - "line": 16 - }, - "file": "src/features/workspaces/components/CreateWorkspaceForm.js", - "id": "settings.workspace.add.form.submitButton", - "start": { - "column": 16, - "line": 13 - } - }, - { - "defaultMessage": "!!!Name", - "end": { - "column": 3, - "line": 20 - }, - "file": "src/features/workspaces/components/CreateWorkspaceForm.js", - "id": "settings.workspace.add.form.name", - "start": { - "column": 8, - "line": 17 - } - } - ], - "path": "src/features/workspaces/components/CreateWorkspaceForm.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Delete workspace", - "end": { - "column": 3, - "line": 22 - }, - "file": "src/features/workspaces/components/EditWorkspaceForm.js", - "id": "settings.workspace.form.buttonDelete", - "start": { - "column": 16, - "line": 19 - } - }, - { - "defaultMessage": "!!!Save workspace", - "end": { - "column": 3, - "line": 26 - }, - "file": "src/features/workspaces/components/EditWorkspaceForm.js", - "id": "settings.workspace.form.buttonSave", - "start": { - "column": 14, - "line": 23 - } - }, - { - "defaultMessage": "!!!Name", - "end": { - "column": 3, - "line": 30 - }, - "file": "src/features/workspaces/components/EditWorkspaceForm.js", - "id": "settings.workspace.form.name", - "start": { - "column": 8, - "line": 27 - } - }, - { - "defaultMessage": "!!!Your workspaces", - "end": { - "column": 3, - "line": 34 - }, - "file": "src/features/workspaces/components/EditWorkspaceForm.js", - "id": "settings.workspace.form.yourWorkspaces", - "start": { - "column": 18, - "line": 31 - } - }, - { - "defaultMessage": "!!!Services in this Workspace", - "end": { - "column": 3, - "line": 38 - }, - "file": "src/features/workspaces/components/EditWorkspaceForm.js", - "id": "settings.workspace.form.servicesInWorkspaceHeadline", - "start": { - "column": 31, - "line": 35 - } - } - ], - "path": "src/features/workspaces/components/EditWorkspaceForm.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Workspaces", - "end": { - "column": 3, - "line": 19 - }, - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "id": "workspaceDrawer.headline", - "start": { - "column": 12, - "line": 16 - } - }, - { - "defaultMessage": "!!!All services", - "end": { - "column": 3, - "line": 23 - }, - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "id": "workspaceDrawer.allServices", - "start": { - "column": 15, - "line": 20 - } - }, - { - "defaultMessage": "!!!Workspaces settings", - "end": { - "column": 3, - "line": 27 - }, - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "id": "workspaceDrawer.workspacesSettingsTooltip", - "start": { - "column": 29, - "line": 24 - } - }, - { - "defaultMessage": "!!!Info about workspace feature", - "end": { - "column": 3, - "line": 31 - }, - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "id": "workspaceDrawer.workspaceFeatureInfo", - "start": { - "column": 24, - "line": 28 - } - }, - { - "defaultMessage": "!!!Create your first workspace", - "end": { - "column": 3, - "line": 35 - }, - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "id": "workspaceDrawer.premiumCtaButtonLabel", - "start": { - "column": 25, - "line": 32 - } - }, - { - "defaultMessage": "!!!Reactivate premium account", - "end": { - "column": 3, - "line": 39 - }, - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "id": "workspaceDrawer.reactivatePremiumAccountLabel", - "start": { - "column": 28, - "line": 36 - } - }, - { - "defaultMessage": "!!!add new workspace", - "end": { - "column": 3, - "line": 43 - }, - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "id": "workspaceDrawer.addNewWorkspaceLabel", - "start": { - "column": 24, - "line": 40 - } - }, - { - "defaultMessage": "!!!Premium feature", - "end": { - "column": 3, - "line": 47 - }, - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "id": "workspaceDrawer.proFeatureBadge", - "start": { - "column": 23, - "line": 44 - } - } - ], - "path": "src/features/workspaces/components/WorkspaceDrawer.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!No services added yet", - "end": { - "column": 3, - "line": 15 - }, - "file": "src/features/workspaces/components/WorkspaceDrawerItem.js", - "id": "workspaceDrawer.item.noServicesAddedYet", - "start": { - "column": 22, - "line": 12 - } - }, - { - "defaultMessage": "!!!edit", - "end": { - "column": 3, - "line": 19 - }, - "file": "src/features/workspaces/components/WorkspaceDrawerItem.js", - "id": "workspaceDrawer.item.contextMenuEdit", - "start": { - "column": 19, - "line": 16 - } - } - ], - "path": "src/features/workspaces/components/WorkspaceDrawerItem.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Your workspaces", - "end": { - "column": 3, - "line": 20 - }, - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "id": "settings.workspaces.headline", - "start": { - "column": 12, - "line": 17 - } - }, - { - "defaultMessage": "!!!You haven't added any workspaces yet.", - "end": { - "column": 3, - "line": 24 - }, - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "id": "settings.workspaces.noWorkspacesAdded", - "start": { - "column": 19, - "line": 21 - } - }, - { - "defaultMessage": "!!!Could not load your workspaces", - "end": { - "column": 3, - "line": 28 - }, - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "id": "settings.workspaces.workspacesRequestFailed", - "start": { - "column": 27, - "line": 25 - } - }, - { - "defaultMessage": "!!!Try again", - "end": { - "column": 3, - "line": 32 - }, - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "id": "settings.workspaces.tryReloadWorkspaces", - "start": { - "column": 23, - "line": 29 - } - }, - { - "defaultMessage": "!!!Your changes have been saved", - "end": { - "column": 3, - "line": 36 - }, - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "id": "settings.workspaces.updatedInfo", - "start": { - "column": 15, - "line": 33 - } - }, - { - "defaultMessage": "!!!Workspace has been deleted", - "end": { - "column": 3, - "line": 40 - }, - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "id": "settings.workspaces.deletedInfo", - "start": { - "column": 15, - "line": 37 - } - }, - { - "defaultMessage": "!!!Info about workspace feature", - "end": { - "column": 3, - "line": 44 - }, - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "id": "settings.workspaces.workspaceFeatureInfo", - "start": { - "column": 24, - "line": 41 - } - }, - { - "defaultMessage": "!!!Less is More: Introducing Franz Workspaces", - "end": { - "column": 3, - "line": 48 - }, - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "id": "settings.workspaces.workspaceFeatureHeadline", - "start": { - "column": 28, - "line": 45 - } - } - ], - "path": "src/features/workspaces/components/WorkspacesDashboard.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Switching to", - "end": { - "column": 3, - "line": 15 - }, - "file": "src/features/workspaces/components/WorkspaceSwitchingIndicator.js", - "id": "workspaces.switchingIndicator.switchingTo", - "start": { - "column": 15, - "line": 12 - } - } - ], - "path": "src/features/workspaces/components/WorkspaceSwitchingIndicator.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Field is required", - "end": { - "column": 3, - "line": 7 - }, - "file": "src/helpers/validation-helpers.js", - "id": "validation.required", - "start": { - "column": 12, - "line": 4 - } - }, - { - "defaultMessage": "!!!Email not valid", - "end": { - "column": 3, - "line": 11 - }, - "file": "src/helpers/validation-helpers.js", - "id": "validation.email", - "start": { - "column": 9, - "line": 8 - } - }, - { - "defaultMessage": "!!!Not a valid URL", - "end": { - "column": 3, - "line": 15 - }, - "file": "src/helpers/validation-helpers.js", - "id": "validation.url", - "start": { - "column": 7, - "line": 12 - } - }, - { - "defaultMessage": "!!!Too few characters", - "end": { - "column": 3, - "line": 19 - }, - "file": "src/helpers/validation-helpers.js", - "id": "validation.minLength", - "start": { - "column": 13, - "line": 16 - } - }, - { - "defaultMessage": "!!!At least one is required", - "end": { - "column": 3, - "line": 23 - }, - "file": "src/helpers/validation-helpers.js", - "id": "validation.oneRequired", - "start": { - "column": 15, - "line": 20 - } - } - ], - "path": "src/helpers/validation-helpers.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Can't connect to Franz Online Services", - "end": { - "column": 3, - "line": 7 - }, - "file": "src/i18n/globalMessages.js", - "id": "global.api.unhealthy", - "start": { - "column": 16, - "line": 4 - } - }, - { - "defaultMessage": "!!!You are not connected to the internet.", - "end": { - "column": 3, - "line": 11 - }, - "file": "src/i18n/globalMessages.js", - "id": "global.notConnectedToTheInternet", - "start": { - "column": 29, - "line": 8 - } - }, - { - "defaultMessage": "!!!Spell checking language", - "end": { - "column": 3, - "line": 15 - }, - "file": "src/i18n/globalMessages.js", - "id": "global.spellchecking.language", - "start": { - "column": 24, - "line": 12 - } - }, - { - "defaultMessage": "!!!Use System Default ({default})", - "end": { - "column": 3, - "line": 19 - }, - "file": "src/i18n/globalMessages.js", - "id": "global.spellchecker.useDefault", - "start": { - "column": 29, - "line": 16 - } - }, - { - "defaultMessage": "!!!Detect language automatically", - "end": { - "column": 3, - "line": 23 - }, - "file": "src/i18n/globalMessages.js", - "id": "global.spellchecking.autodetect", - "start": { - "column": 34, - "line": 20 - } - }, - { - "defaultMessage": "!!!Automatic", - "end": { - "column": 3, - "line": 27 - }, - "file": "src/i18n/globalMessages.js", - "id": "global.spellchecking.autodetect.short", - "start": { - "column": 39, - "line": 24 - } - } - ], - "path": "src/i18n/globalMessages.json" - }, - { - "descriptors": [ - { - "defaultMessage": "!!!Edit", - "end": { - "column": 3, - "line": 17 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit", - "start": { - "column": 8, - "line": 14 - } - }, - { - "defaultMessage": "!!!Undo", - "end": { - "column": 3, - "line": 21 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit.undo", - "start": { - "column": 8, - "line": 18 - } - }, - { - "defaultMessage": "!!!Redo", - "end": { - "column": 3, - "line": 25 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit.redo", - "start": { - "column": 8, - "line": 22 - } - }, - { - "defaultMessage": "!!!Cut", - "end": { - "column": 3, - "line": 29 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit.cut", - "start": { - "column": 7, - "line": 26 - } - }, - { - "defaultMessage": "!!!Copy", - "end": { - "column": 3, - "line": 33 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit.copy", - "start": { - "column": 8, - "line": 30 - } - }, - { - "defaultMessage": "!!!Paste", - "end": { - "column": 3, - "line": 37 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit.paste", - "start": { - "column": 9, - "line": 34 - } - }, - { - "defaultMessage": "!!!Paste And Match Style", - "end": { - "column": 3, - "line": 41 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit.pasteAndMatchStyle", - "start": { - "column": 22, - "line": 38 - } - }, - { - "defaultMessage": "!!!Delete", - "end": { - "column": 3, - "line": 45 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit.delete", - "start": { - "column": 10, - "line": 42 - } - }, - { - "defaultMessage": "!!!Select All", - "end": { - "column": 3, - "line": 49 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit.selectAll", - "start": { - "column": 13, - "line": 46 - } - }, - { - "defaultMessage": "!!!Speech", - "end": { - "column": 3, - "line": 53 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit.speech", - "start": { - "column": 10, - "line": 50 - } - }, - { - "defaultMessage": "!!!Start Speaking", - "end": { - "column": 3, - "line": 57 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit.startSpeaking", - "start": { - "column": 17, - "line": 54 - } - }, - { - "defaultMessage": "!!!Stop Speaking", - "end": { - "column": 3, - "line": 61 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit.stopSpeaking", - "start": { - "column": 16, - "line": 58 - } - }, - { - "defaultMessage": "!!!Start Dictation", - "end": { - "column": 3, - "line": 65 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit.startDictation", - "start": { - "column": 18, - "line": 62 - } - }, - { - "defaultMessage": "!!!Emoji & Symbols", - "end": { - "column": 3, - "line": 69 - }, - "file": "src/lib/Menu.js", - "id": "menu.edit.emojiSymbols", - "start": { - "column": 16, - "line": 66 - } - }, - { - "defaultMessage": "!!!Actual Size", - "end": { - "column": 3, - "line": 73 - }, - "file": "src/lib/Menu.js", - "id": "menu.view.resetZoom", - "start": { - "column": 13, - "line": 70 - } - }, - { - "defaultMessage": "!!!Zoom In", - "end": { - "column": 3, - "line": 77 - }, - "file": "src/lib/Menu.js", - "id": "menu.view.zoomIn", - "start": { - "column": 10, - "line": 74 - } - }, - { - "defaultMessage": "!!!Zoom Out", - "end": { - "column": 3, - "line": 81 - }, - "file": "src/lib/Menu.js", - "id": "menu.view.zoomOut", - "start": { - "column": 11, - "line": 78 - } - }, - { - "defaultMessage": "!!!Enter Full Screen", - "end": { - "column": 3, - "line": 85 - }, - "file": "src/lib/Menu.js", - "id": "menu.view.enterFullScreen", - "start": { - "column": 19, - "line": 82 - } - }, - { - "defaultMessage": "!!!Exit Full Screen", - "end": { - "column": 3, - "line": 89 - }, - "file": "src/lib/Menu.js", - "id": "menu.view.exitFullScreen", - "start": { - "column": 18, - "line": 86 - } - }, - { - "defaultMessage": "!!!Toggle Full Screen", - "end": { - "column": 3, - "line": 93 - }, - "file": "src/lib/Menu.js", - "id": "menu.view.toggleFullScreen", - "start": { - "column": 20, - "line": 90 - } - }, - { - "defaultMessage": "!!!Toggle Developer Tools", - "end": { - "column": 3, - "line": 97 - }, - "file": "src/lib/Menu.js", - "id": "menu.view.toggleDevTools", - "start": { - "column": 18, - "line": 94 - } - }, - { - "defaultMessage": "!!!Toggle Service Developer Tools", - "end": { - "column": 3, - "line": 101 - }, - "file": "src/lib/Menu.js", - "id": "menu.view.toggleServiceDevTools", - "start": { - "column": 25, - "line": 98 - } - }, - { - "defaultMessage": "!!!Reload Service", - "end": { - "column": 3, - "line": 105 - }, - "file": "src/lib/Menu.js", - "id": "menu.view.reloadService", - "start": { - "column": 17, - "line": 102 - } - }, - { - "defaultMessage": "!!!Reload Franz", - "end": { - "column": 3, - "line": 109 - }, - "file": "src/lib/Menu.js", - "id": "menu.view.reloadFranz", - "start": { - "column": 15, - "line": 106 - } - }, - { - "defaultMessage": "!!!Minimize", - "end": { - "column": 3, - "line": 113 - }, - "file": "src/lib/Menu.js", - "id": "menu.window.minimize", - "start": { - "column": 12, - "line": 110 - } - }, - { - "defaultMessage": "!!!Close", - "end": { - "column": 3, - "line": 117 - }, - "file": "src/lib/Menu.js", - "id": "menu.window.close", - "start": { - "column": 9, - "line": 114 - } - }, - { - "defaultMessage": "!!!Learn More", - "end": { - "column": 3, - "line": 121 - }, - "file": "src/lib/Menu.js", - "id": "menu.help.learnMore", - "start": { - "column": 13, - "line": 118 - } - }, - { - "defaultMessage": "!!!Changelog", - "end": { - "column": 3, - "line": 125 - }, - "file": "src/lib/Menu.js", - "id": "menu.help.changelog", - "start": { - "column": 13, - "line": 122 - } - }, - { - "defaultMessage": "!!!Support", - "end": { - "column": 3, - "line": 129 - }, - "file": "src/lib/Menu.js", - "id": "menu.help.support", - "start": { - "column": 11, - "line": 126 - } - }, - { - "defaultMessage": "!!!Terms of Service", - "end": { - "column": 3, - "line": 133 - }, - "file": "src/lib/Menu.js", - "id": "menu.help.tos", - "start": { - "column": 7, - "line": 130 - } - }, - { - "defaultMessage": "!!!Privacy Statement", - "end": { - "column": 3, - "line": 137 - }, - "file": "src/lib/Menu.js", - "id": "menu.help.privacy", - "start": { - "column": 11, - "line": 134 - } - }, - { - "defaultMessage": "!!!File", - "end": { - "column": 3, - "line": 141 - }, - "file": "src/lib/Menu.js", - "id": "menu.file", - "start": { - "column": 8, - "line": 138 - } - }, - { - "defaultMessage": "!!!View", - "end": { - "column": 3, - "line": 145 - }, - "file": "src/lib/Menu.js", - "id": "menu.view", - "start": { - "column": 8, - "line": 142 - } - }, - { - "defaultMessage": "!!!Services", - "end": { - "column": 3, - "line": 149 - }, - "file": "src/lib/Menu.js", - "id": "menu.services", - "start": { - "column": 12, - "line": 146 - } - }, - { - "defaultMessage": "!!!Window", - "end": { - "column": 3, - "line": 153 - }, - "file": "src/lib/Menu.js", - "id": "menu.window", - "start": { - "column": 10, - "line": 150 - } - }, - { - "defaultMessage": "!!!Help", - "end": { - "column": 3, - "line": 157 - }, - "file": "src/lib/Menu.js", - "id": "menu.help", - "start": { - "column": 8, - "line": 154 - } - }, - { - "defaultMessage": "!!!About Franz", - "end": { - "column": 3, - "line": 161 - }, - "file": "src/lib/Menu.js", - "id": "menu.app.about", - "start": { - "column": 9, - "line": 158 - } - }, - { - "defaultMessage": "!!!What's new?", - "end": { - "column": 3, - "line": 165 - }, - "file": "src/lib/Menu.js", - "id": "menu.app.announcement", - "start": { - "column": 16, - "line": 162 - } - }, - { - "defaultMessage": "!!!Settings", - "end": { - "column": 3, - "line": 169 - }, - "file": "src/lib/Menu.js", - "id": "menu.app.settings", - "start": { - "column": 12, - "line": 166 - } - }, - { - "defaultMessage": "!!!Hide", - "end": { - "column": 3, - "line": 173 - }, - "file": "src/lib/Menu.js", - "id": "menu.app.hide", - "start": { - "column": 8, - "line": 170 - } - }, - { - "defaultMessage": "!!!Hide Others", - "end": { - "column": 3, - "line": 177 - }, - "file": "src/lib/Menu.js", - "id": "menu.app.hideOthers", - "start": { - "column": 14, - "line": 174 - } - }, - { - "defaultMessage": "!!!Unhide", - "end": { - "column": 3, - "line": 181 - }, - "file": "src/lib/Menu.js", - "id": "menu.app.unhide", - "start": { - "column": 10, - "line": 178 - } - }, - { - "defaultMessage": "!!!Quit", - "end": { - "column": 3, - "line": 185 - }, - "file": "src/lib/Menu.js", - "id": "menu.app.quit", - "start": { - "column": 8, - "line": 182 - } - }, - { - "defaultMessage": "!!!Add New Service...", - "end": { - "column": 3, - "line": 189 - }, - "file": "src/lib/Menu.js", - "id": "menu.services.addNewService", - "start": { - "column": 17, - "line": 186 - } - }, - { - "defaultMessage": "!!!Add New Workspace...", - "end": { - "column": 3, - "line": 193 - }, - "file": "src/lib/Menu.js", - "id": "menu.workspaces.addNewWorkspace", - "start": { - "column": 19, - "line": 190 - } - }, - { - "defaultMessage": "!!!Open workspace drawer", - "end": { - "column": 3, - "line": 197 - }, - "file": "src/lib/Menu.js", - "id": "menu.workspaces.openWorkspaceDrawer", - "start": { - "column": 23, - "line": 194 - } - }, - { - "defaultMessage": "!!!Close workspace drawer", - "end": { - "column": 3, - "line": 201 - }, - "file": "src/lib/Menu.js", - "id": "menu.workspaces.closeWorkspaceDrawer", - "start": { - "column": 24, - "line": 198 - } - }, - { - "defaultMessage": "!!!Activate next service...", - "end": { - "column": 3, - "line": 205 - }, - "file": "src/lib/Menu.js", - "id": "menu.services.setNextServiceActive", - "start": { - "column": 23, - "line": 202 - } - }, - { - "defaultMessage": "!!!Activate previous service...", - "end": { - "column": 3, - "line": 209 - }, - "file": "src/lib/Menu.js", - "id": "menu.services.activatePreviousService", - "start": { - "column": 27, - "line": 206 - } - }, - { - "defaultMessage": "!!!Disable notifications & audio", - "end": { - "column": 3, - "line": 213 - }, - "file": "src/lib/Menu.js", - "id": "sidebar.muteApp", - "start": { - "column": 11, - "line": 210 - } - }, - { - "defaultMessage": "!!!Enable notifications & audio", - "end": { - "column": 3, - "line": 217 - }, - "file": "src/lib/Menu.js", - "id": "sidebar.unmuteApp", - "start": { - "column": 13, - "line": 214 - } - }, - { - "defaultMessage": "!!!Workspaces", - "end": { - "column": 3, - "line": 221 - }, - "file": "src/lib/Menu.js", - "id": "menu.workspaces", - "start": { - "column": 14, - "line": 218 - } - }, - { - "defaultMessage": "!!!Default", - "end": { - "column": 3, - "line": 225 - }, - "file": "src/lib/Menu.js", - "id": "menu.workspaces.defaultWorkspace", - "start": { - "column": 20, - "line": 222 - } - } - ], - "path": "src/lib/Menu.json" - } -] \ No newline at end of file diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 07602e61f..70b869557 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -164,6 +164,7 @@ "settings.app.headlineGeneral": "General", "settings.app.headlineLanguage": "Language", "settings.app.headlineUpdates": "Updates", + "settings.app.languageDisclaimer": "Official translations are English & German. All other languages are community based translations.", "settings.app.restartRequired": "Changes require restart", "settings.app.subheadlineCache": "Cache", "settings.app.translationHelp": "Help us to translate Franz into your language.", @@ -319,4 +320,4 @@ "workspaceDrawer.workspaceFeatureInfo": "

Franz 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/auth/Import.json b/src/i18n/messages/src/components/auth/Import.json deleted file mode 100644 index 264fc729b..000000000 --- a/src/i18n/messages/src/components/auth/Import.json +++ /dev/null @@ -1,54 +0,0 @@ -[ - { - "id": "import.headline", - "defaultMessage": "!!!Import your Franz 4 services", - "file": "src/components/auth/Import.js", - "start": { - "line": 13, - "column": 12 - }, - "end": { - "line": 16, - "column": 3 - } - }, - { - "id": "import.notSupportedHeadline", - "defaultMessage": "!!!Services not yet supported in Franz 5", - "file": "src/components/auth/Import.js", - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 20, - "column": 3 - } - }, - { - "id": "import.submit.label", - "defaultMessage": "!!!Import {count} services", - "file": "src/components/auth/Import.js", - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 24, - "column": 3 - } - }, - { - "id": "import.skip.label", - "defaultMessage": "!!!I want to add services manually", - "file": "src/components/auth/Import.js", - "start": { - "line": 25, - "column": 19 - }, - "end": { - "line": 28, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/auth/Invite.json b/src/i18n/messages/src/components/auth/Invite.json deleted file mode 100644 index 57c9bddcf..000000000 --- a/src/i18n/messages/src/components/auth/Invite.json +++ /dev/null @@ -1,93 +0,0 @@ -[ - { - "id": "settings.invite.headline", - "defaultMessage": "!!!Invite Friends", - "file": "src/components/auth/Invite.js", - "start": { - "line": 16, - "column": 20 - }, - "end": { - "line": 19, - "column": 3 - } - }, - { - "id": "invite.headline.friends", - "defaultMessage": "!!!Invite 3 of your friends or colleagues", - "file": "src/components/auth/Invite.js", - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 23, - "column": 3 - } - }, - { - "id": "invite.name.label", - "defaultMessage": "!!!Name", - "file": "src/components/auth/Invite.js", - "start": { - "line": 24, - "column": 13 - }, - "end": { - "line": 27, - "column": 3 - } - }, - { - "id": "invite.email.label", - "defaultMessage": "!!!Email address", - "file": "src/components/auth/Invite.js", - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 31, - "column": 3 - } - }, - { - "id": "invite.submit.label", - "defaultMessage": "!!!Send invites", - "file": "src/components/auth/Invite.js", - "start": { - "line": 32, - "column": 21 - }, - "end": { - "line": 35, - "column": 3 - } - }, - { - "id": "invite.skip.label", - "defaultMessage": "!!!I want to do this later", - "file": "src/components/auth/Invite.js", - "start": { - "line": 36, - "column": 19 - }, - "end": { - "line": 39, - "column": 3 - } - }, - { - "id": "invite.successInfo", - "defaultMessage": "!!!Invitations sent successfully", - "file": "src/components/auth/Invite.js", - "start": { - "line": 40, - "column": 21 - }, - "end": { - "line": 43, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/auth/Login.json b/src/i18n/messages/src/components/auth/Login.json deleted file mode 100644 index 177f6000b..000000000 --- a/src/i18n/messages/src/components/auth/Login.json +++ /dev/null @@ -1,119 +0,0 @@ -[ - { - "id": "login.headline", - "defaultMessage": "!!!Sign in", - "file": "src/components/auth/Login.js", - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 20, - "column": 3 - } - }, - { - "id": "login.email.label", - "defaultMessage": "!!!Email address", - "file": "src/components/auth/Login.js", - "start": { - "line": 21, - "column": 14 - }, - "end": { - "line": 24, - "column": 3 - } - }, - { - "id": "login.password.label", - "defaultMessage": "!!!Password", - "file": "src/components/auth/Login.js", - "start": { - "line": 25, - "column": 17 - }, - "end": { - "line": 28, - "column": 3 - } - }, - { - "id": "login.submit.label", - "defaultMessage": "!!!Sign in", - "file": "src/components/auth/Login.js", - "start": { - "line": 29, - "column": 21 - }, - "end": { - "line": 32, - "column": 3 - } - }, - { - "id": "login.invalidCredentials", - "defaultMessage": "!!!Email or password not valid", - "file": "src/components/auth/Login.js", - "start": { - "line": 33, - "column": 22 - }, - "end": { - "line": 36, - "column": 3 - } - }, - { - "id": "login.tokenExpired", - "defaultMessage": "!!!Your session expired, please login again.", - "file": "src/components/auth/Login.js", - "start": { - "line": 37, - "column": 16 - }, - "end": { - "line": 40, - "column": 3 - } - }, - { - "id": "login.serverLogout", - "defaultMessage": "!!!Your session expired, please login again.", - "file": "src/components/auth/Login.js", - "start": { - "line": 41, - "column": 16 - }, - "end": { - "line": 44, - "column": 3 - } - }, - { - "id": "login.link.signup", - "defaultMessage": "!!!Create a free account", - "file": "src/components/auth/Login.js", - "start": { - "line": 45, - "column": 14 - }, - "end": { - "line": 48, - "column": 3 - } - }, - { - "id": "login.link.password", - "defaultMessage": "!!!Forgot password", - "file": "src/components/auth/Login.js", - "start": { - "line": 49, - "column": 16 - }, - "end": { - "line": 52, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/auth/Password.json b/src/i18n/messages/src/components/auth/Password.json deleted file mode 100644 index f335b3acb..000000000 --- a/src/i18n/messages/src/components/auth/Password.json +++ /dev/null @@ -1,93 +0,0 @@ -[ - { - "id": "password.headline", - "defaultMessage": "!!!Forgot password", - "file": "src/components/auth/Password.js", - "start": { - "line": 14, - "column": 12 - }, - "end": { - "line": 17, - "column": 3 - } - }, - { - "id": "password.email.label", - "defaultMessage": "!!!Email address", - "file": "src/components/auth/Password.js", - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 21, - "column": 3 - } - }, - { - "id": "password.submit.label", - "defaultMessage": "!!!Submit", - "file": "src/components/auth/Password.js", - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 25, - "column": 3 - } - }, - { - "id": "password.successInfo", - "defaultMessage": "!!!Your new password was sent to your email address", - "file": "src/components/auth/Password.js", - "start": { - "line": 26, - "column": 15 - }, - "end": { - "line": 29, - "column": 3 - } - }, - { - "id": "password.noUser", - "defaultMessage": "!!!No user affiliated with that email address", - "file": "src/components/auth/Password.js", - "start": { - "line": 30, - "column": 10 - }, - "end": { - "line": 33, - "column": 3 - } - }, - { - "id": "password.link.signup", - "defaultMessage": "!!!Create a free account", - "file": "src/components/auth/Password.js", - "start": { - "line": 34, - "column": 14 - }, - "end": { - "line": 37, - "column": 3 - } - }, - { - "id": "password.link.login", - "defaultMessage": "!!!Sign in to your account", - "file": "src/components/auth/Password.js", - "start": { - "line": 38, - "column": 13 - }, - "end": { - "line": 41, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/auth/Pricing.json b/src/i18n/messages/src/components/auth/Pricing.json deleted file mode 100644 index f711a55b4..000000000 --- a/src/i18n/messages/src/components/auth/Pricing.json +++ /dev/null @@ -1,54 +0,0 @@ -[ - { - "id": "pricing.headline", - "defaultMessage": "!!!Support Franz", - "file": "src/components/auth/Pricing.js", - "start": { - "line": 13, - "column": 12 - }, - "end": { - "line": 16, - "column": 3 - } - }, - { - "id": "pricing.support.label", - "defaultMessage": "!!!Select your support plan", - "file": "src/components/auth/Pricing.js", - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 20, - "column": 3 - } - }, - { - "id": "pricing.submit.label", - "defaultMessage": "!!!Support the development of Franz", - "file": "src/components/auth/Pricing.js", - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 24, - "column": 3 - } - }, - { - "id": "pricing.link.skipPayment", - "defaultMessage": "!!!I don't want to support the development of Franz.", - "file": "src/components/auth/Pricing.js", - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 28, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/auth/Signup.json b/src/i18n/messages/src/components/auth/Signup.json deleted file mode 100644 index a09745048..000000000 --- a/src/i18n/messages/src/components/auth/Signup.json +++ /dev/null @@ -1,158 +0,0 @@ -[ - { - "id": "signup.headline", - "defaultMessage": "!!!Sign up", - "file": "src/components/auth/Signup.js", - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 21, - "column": 3 - } - }, - { - "id": "signup.firstname.label", - "defaultMessage": "!!!Firstname", - "file": "src/components/auth/Signup.js", - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 25, - "column": 3 - } - }, - { - "id": "signup.lastname.label", - "defaultMessage": "!!!Lastname", - "file": "src/components/auth/Signup.js", - "start": { - "line": 26, - "column": 17 - }, - "end": { - "line": 29, - "column": 3 - } - }, - { - "id": "signup.email.label", - "defaultMessage": "!!!Email address", - "file": "src/components/auth/Signup.js", - "start": { - "line": 30, - "column": 14 - }, - "end": { - "line": 33, - "column": 3 - } - }, - { - "id": "signup.company.label", - "defaultMessage": "!!!Company", - "file": "src/components/auth/Signup.js", - "start": { - "line": 34, - "column": 16 - }, - "end": { - "line": 37, - "column": 3 - } - }, - { - "id": "signup.password.label", - "defaultMessage": "!!!Password", - "file": "src/components/auth/Signup.js", - "start": { - "line": 38, - "column": 17 - }, - "end": { - "line": 41, - "column": 3 - } - }, - { - "id": "signup.legal.info", - "defaultMessage": "!!!By creating a Franz account you accept the", - "file": "src/components/auth/Signup.js", - "start": { - "line": 42, - "column": 13 - }, - "end": { - "line": 45, - "column": 3 - } - }, - { - "id": "signup.legal.terms", - "defaultMessage": "!!!Terms of service", - "file": "src/components/auth/Signup.js", - "start": { - "line": 46, - "column": 9 - }, - "end": { - "line": 49, - "column": 3 - } - }, - { - "id": "signup.legal.privacy", - "defaultMessage": "!!!Privacy Statement", - "file": "src/components/auth/Signup.js", - "start": { - "line": 50, - "column": 11 - }, - "end": { - "line": 53, - "column": 3 - } - }, - { - "id": "signup.submit.label", - "defaultMessage": "!!!Create account", - "file": "src/components/auth/Signup.js", - "start": { - "line": 54, - "column": 21 - }, - "end": { - "line": 57, - "column": 3 - } - }, - { - "id": "signup.link.login", - "defaultMessage": "!!!Already have an account, sign in?", - "file": "src/components/auth/Signup.js", - "start": { - "line": 58, - "column": 13 - }, - "end": { - "line": 61, - "column": 3 - } - }, - { - "id": "signup.emailDuplicate", - "defaultMessage": "!!!A user with that email address already exists", - "file": "src/components/auth/Signup.js", - "start": { - "line": 62, - "column": 18 - }, - "end": { - "line": 65, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/auth/Welcome.json b/src/i18n/messages/src/components/auth/Welcome.json deleted file mode 100644 index b4d2ce689..000000000 --- a/src/i18n/messages/src/components/auth/Welcome.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "id": "welcome.signupButton", - "defaultMessage": "!!!Create a free account", - "file": "src/components/auth/Welcome.js", - "start": { - "line": 9, - "column": 16 - }, - "end": { - "line": 12, - "column": 3 - } - }, - { - "id": "welcome.loginButton", - "defaultMessage": "!!!Login to your account", - "file": "src/components/auth/Welcome.js", - "start": { - "line": 13, - "column": 15 - }, - "end": { - "line": 16, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/layout/AppLayout.json b/src/i18n/messages/src/components/layout/AppLayout.json deleted file mode 100644 index 4dd354afc..000000000 --- a/src/i18n/messages/src/components/layout/AppLayout.json +++ /dev/null @@ -1,80 +0,0 @@ -[ - { - "id": "infobar.servicesUpdated", - "defaultMessage": "!!!Your services have been updated.", - "file": "src/components/layout/AppLayout.js", - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 29, - "column": 3 - } - }, - { - "id": "infobar.updateAvailable", - "defaultMessage": "!!!A new update for Franz is available.", - "file": "src/components/layout/AppLayout.js", - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 33, - "column": 3 - } - }, - { - "id": "infobar.buttonReloadServices", - "defaultMessage": "!!!Reload services", - "file": "src/components/layout/AppLayout.js", - "start": { - "line": 34, - "column": 24 - }, - "end": { - "line": 37, - "column": 3 - } - }, - { - "id": "infobar.buttonChangelog", - "defaultMessage": "!!!Changelog", - "file": "src/components/layout/AppLayout.js", - "start": { - "line": 38, - "column": 13 - }, - "end": { - "line": 41, - "column": 3 - } - }, - { - "id": "infobar.buttonInstallUpdate", - "defaultMessage": "!!!Restart & install update", - "file": "src/components/layout/AppLayout.js", - "start": { - "line": 42, - "column": 23 - }, - "end": { - "line": 45, - "column": 3 - } - }, - { - "id": "infobar.requiredRequestsFailed", - "defaultMessage": "!!!Could not load services and user information", - "file": "src/components/layout/AppLayout.js", - "start": { - "line": 46, - "column": 26 - }, - "end": { - "line": 49, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/layout/Sidebar.json b/src/i18n/messages/src/components/layout/Sidebar.json deleted file mode 100644 index d67adc96e..000000000 --- a/src/i18n/messages/src/components/layout/Sidebar.json +++ /dev/null @@ -1,80 +0,0 @@ -[ - { - "id": "sidebar.settings", - "defaultMessage": "!!!Settings", - "file": "src/components/layout/Sidebar.js", - "start": { - "line": 13, - "column": 12 - }, - "end": { - "line": 16, - "column": 3 - } - }, - { - "id": "sidebar.addNewService", - "defaultMessage": "!!!Add new service", - "file": "src/components/layout/Sidebar.js", - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 20, - "column": 3 - } - }, - { - "id": "sidebar.muteApp", - "defaultMessage": "!!!Disable notifications & audio", - "file": "src/components/layout/Sidebar.js", - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 24, - "column": 3 - } - }, - { - "id": "sidebar.unmuteApp", - "defaultMessage": "!!!Enable notifications & audio", - "file": "src/components/layout/Sidebar.js", - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 28, - "column": 3 - } - }, - { - "id": "sidebar.openWorkspaceDrawer", - "defaultMessage": "!!!Open workspace drawer", - "file": "src/components/layout/Sidebar.js", - "start": { - "line": 29, - "column": 23 - }, - "end": { - "line": 32, - "column": 3 - } - }, - { - "id": "sidebar.closeWorkspaceDrawer", - "defaultMessage": "!!!Close workspace drawer", - "file": "src/components/layout/Sidebar.js", - "start": { - "line": 33, - "column": 24 - }, - "end": { - "line": 36, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/services/content/ErrorHandlers/WebviewErrorHandler.json b/src/i18n/messages/src/components/services/content/ErrorHandlers/WebviewErrorHandler.json deleted file mode 100644 index c8fe802df..000000000 --- a/src/i18n/messages/src/components/services/content/ErrorHandlers/WebviewErrorHandler.json +++ /dev/null @@ -1,67 +0,0 @@ -[ - { - "id": "service.errorHandler.headline", - "defaultMessage": "!!!Oh no!", - "file": "src/components/services/content/ErrorHandlers/WebviewErrorHandler.js", - "start": { - "line": 12, - "column": 12 - }, - "end": { - "line": 15, - "column": 3 - } - }, - { - "id": "service.errorHandler.text", - "defaultMessage": "!!!{name} has failed to load.", - "file": "src/components/services/content/ErrorHandlers/WebviewErrorHandler.js", - "start": { - "line": 16, - "column": 8 - }, - "end": { - "line": 19, - "column": 3 - } - }, - { - "id": "service.errorHandler.action", - "defaultMessage": "!!!Reload {name}", - "file": "src/components/services/content/ErrorHandlers/WebviewErrorHandler.js", - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 23, - "column": 3 - } - }, - { - "id": "service.errorHandler.editAction", - "defaultMessage": "!!!Edit {name}", - "file": "src/components/services/content/ErrorHandlers/WebviewErrorHandler.js", - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 27, - "column": 3 - } - }, - { - "id": "service.errorHandler.message", - "defaultMessage": "!!!Error:", - "file": "src/components/services/content/ErrorHandlers/WebviewErrorHandler.js", - "start": { - "line": 28, - "column": 16 - }, - "end": { - "line": 31, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/services/content/ServiceDisabled.json b/src/i18n/messages/src/components/services/content/ServiceDisabled.json deleted file mode 100644 index 8bfad28c7..000000000 --- a/src/i18n/messages/src/components/services/content/ServiceDisabled.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "id": "service.disabledHandler.headline", - "defaultMessage": "!!!{name} is disabled", - "file": "src/components/services/content/ServiceDisabled.js", - "start": { - "line": 9, - "column": 12 - }, - "end": { - "line": 12, - "column": 3 - } - }, - { - "id": "service.disabledHandler.action", - "defaultMessage": "!!!Enable {name}", - "file": "src/components/services/content/ServiceDisabled.js", - "start": { - "line": 13, - "column": 10 - }, - "end": { - "line": 16, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/services/content/Services.json b/src/i18n/messages/src/components/services/content/Services.json deleted file mode 100644 index 884ab0c90..000000000 --- a/src/i18n/messages/src/components/services/content/Services.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "id": "services.welcome", - "defaultMessage": "!!!Welcome to Franz", - "file": "src/components/services/content/Services.js", - "start": { - "line": 11, - "column": 11 - }, - "end": { - "line": 14, - "column": 3 - } - }, - { - "id": "services.getStarted", - "defaultMessage": "!!!Get started", - "file": "src/components/services/content/Services.js", - "start": { - "line": 15, - "column": 14 - }, - "end": { - "line": 18, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/services/content/WebviewCrashHandler.json b/src/i18n/messages/src/components/services/content/WebviewCrashHandler.json deleted file mode 100644 index c3d6c41a5..000000000 --- a/src/i18n/messages/src/components/services/content/WebviewCrashHandler.json +++ /dev/null @@ -1,54 +0,0 @@ -[ - { - "id": "service.crashHandler.headline", - "defaultMessage": "!!!Oh no!", - "file": "src/components/services/content/WebviewCrashHandler.js", - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 13, - "column": 3 - } - }, - { - "id": "service.crashHandler.text", - "defaultMessage": "!!!{name} has caused an error.", - "file": "src/components/services/content/WebviewCrashHandler.js", - "start": { - "line": 14, - "column": 8 - }, - "end": { - "line": 17, - "column": 3 - } - }, - { - "id": "service.crashHandler.action", - "defaultMessage": "!!!Reload {name}", - "file": "src/components/services/content/WebviewCrashHandler.js", - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 21, - "column": 3 - } - }, - { - "id": "service.crashHandler.autoReload", - "defaultMessage": "!!!Trying to automatically restore {name} in {seconds} seconds", - "file": "src/components/services/content/WebviewCrashHandler.js", - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 25, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/services/tabs/TabItem.json b/src/i18n/messages/src/components/services/tabs/TabItem.json deleted file mode 100644 index 08a07845c..000000000 --- a/src/i18n/messages/src/components/services/tabs/TabItem.json +++ /dev/null @@ -1,119 +0,0 @@ -[ - { - "id": "tabs.item.reload", - "defaultMessage": "!!!Reload", - "file": "src/components/services/tabs/TabItem.js", - "start": { - "line": 15, - "column": 10 - }, - "end": { - "line": 18, - "column": 3 - } - }, - { - "id": "tabs.item.edit", - "defaultMessage": "!!!Edit", - "file": "src/components/services/tabs/TabItem.js", - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 22, - "column": 3 - } - }, - { - "id": "tabs.item.disableNotifications", - "defaultMessage": "!!!Disable notifications", - "file": "src/components/services/tabs/TabItem.js", - "start": { - "line": 23, - "column": 24 - }, - "end": { - "line": 26, - "column": 3 - } - }, - { - "id": "tabs.item.enableNotification", - "defaultMessage": "!!!Enable notifications", - "file": "src/components/services/tabs/TabItem.js", - "start": { - "line": 27, - "column": 23 - }, - "end": { - "line": 30, - "column": 3 - } - }, - { - "id": "tabs.item.disableAudio", - "defaultMessage": "!!!Disable audio", - "file": "src/components/services/tabs/TabItem.js", - "start": { - "line": 31, - "column": 16 - }, - "end": { - "line": 34, - "column": 3 - } - }, - { - "id": "tabs.item.enableAudio", - "defaultMessage": "!!!Enable audio", - "file": "src/components/services/tabs/TabItem.js", - "start": { - "line": 35, - "column": 15 - }, - "end": { - "line": 38, - "column": 3 - } - }, - { - "id": "tabs.item.disableService", - "defaultMessage": "!!!Disable Service", - "file": "src/components/services/tabs/TabItem.js", - "start": { - "line": 39, - "column": 18 - }, - "end": { - "line": 42, - "column": 3 - } - }, - { - "id": "tabs.item.enableService", - "defaultMessage": "!!!Enable Service", - "file": "src/components/services/tabs/TabItem.js", - "start": { - "line": 43, - "column": 17 - }, - "end": { - "line": 46, - "column": 3 - } - }, - { - "id": "tabs.item.deleteService", - "defaultMessage": "!!!Delete Service", - "file": "src/components/services/tabs/TabItem.js", - "start": { - "line": 47, - "column": 17 - }, - "end": { - "line": 50, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/settings/account/AccountDashboard.json b/src/i18n/messages/src/components/settings/account/AccountDashboard.json deleted file mode 100644 index 603950395..000000000 --- a/src/i18n/messages/src/components/settings/account/AccountDashboard.json +++ /dev/null @@ -1,197 +0,0 @@ -[ - { - "id": "settings.account.headline", - "defaultMessage": "!!!Account", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 15, - "column": 12 - }, - "end": { - "line": 18, - "column": 3 - } - }, - { - "id": "settings.account.headlineSubscription", - "defaultMessage": "!!!Your Subscription", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 19, - "column": 24 - }, - "end": { - "line": 22, - "column": 3 - } - }, - { - "id": "settings.account.headlineUpgrade", - "defaultMessage": "!!!Upgrade your Account", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 23, - "column": 19 - }, - "end": { - "line": 26, - "column": 3 - } - }, - { - "id": "settings.account.headlineInvoices", - "defaultMessage": "!!Invoices", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 27, - "column": 20 - }, - "end": { - "line": 30, - "column": 3 - } - }, - { - "id": "settings.account.headlineDangerZone", - "defaultMessage": "!!Danger Zone", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 31, - "column": 22 - }, - "end": { - "line": 34, - "column": 3 - } - }, - { - "id": "settings.account.manageSubscription.label", - "defaultMessage": "!!!Manage your subscription", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 35, - "column": 33 - }, - "end": { - "line": 38, - "column": 3 - } - }, - { - "id": "settings.account.accountType.basic", - "defaultMessage": "!!!Basic Account", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 39, - "column": 20 - }, - "end": { - "line": 42, - "column": 3 - } - }, - { - "id": "settings.account.accountType.premium", - "defaultMessage": "!!!Premium Supporter Account", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 43, - "column": 22 - }, - "end": { - "line": 46, - "column": 3 - } - }, - { - "id": "settings.account.account.editButton", - "defaultMessage": "!!!Edit Account", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 47, - "column": 21 - }, - "end": { - "line": 50, - "column": 3 - } - }, - { - "id": "settings.account.invoiceDownload", - "defaultMessage": "!!!Download", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 51, - "column": 19 - }, - "end": { - "line": 54, - "column": 3 - } - }, - { - "id": "settings.account.userInfoRequestFailed", - "defaultMessage": "!!!Could not load user information", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 55, - "column": 25 - }, - "end": { - "line": 58, - "column": 3 - } - }, - { - "id": "settings.account.tryReloadUserInfoRequest", - "defaultMessage": "!!!Try again", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 59, - "column": 28 - }, - "end": { - "line": 62, - "column": 3 - } - }, - { - "id": "settings.account.deleteAccount", - "defaultMessage": "!!!Delete account", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 63, - "column": 17 - }, - "end": { - "line": 66, - "column": 3 - } - }, - { - "id": "settings.account.deleteInfo", - "defaultMessage": "!!!If you don't need your Franz account any longer, you can delete your account and all related data here.", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 67, - "column": 14 - }, - "end": { - "line": 70, - "column": 3 - } - }, - { - "id": "settings.account.deleteEmailSent", - "defaultMessage": "!!!You have received an email with a link to confirm your account deletion. Your account and data cannot be restored!", - "file": "src/components/settings/account/AccountDashboard.js", - "start": { - "line": 71, - "column": 19 - }, - "end": { - "line": 74, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/settings/navigation/SettingsNavigation.json b/src/i18n/messages/src/components/settings/navigation/SettingsNavigation.json deleted file mode 100644 index 77b0ed8a4..000000000 --- a/src/i18n/messages/src/components/settings/navigation/SettingsNavigation.json +++ /dev/null @@ -1,93 +0,0 @@ -[ - { - "id": "settings.navigation.availableServices", - "defaultMessage": "!!!Available services", - "file": "src/components/settings/navigation/SettingsNavigation.js", - "start": { - "line": 12, - "column": 21 - }, - "end": { - "line": 15, - "column": 3 - } - }, - { - "id": "settings.navigation.yourServices", - "defaultMessage": "!!!Your services", - "file": "src/components/settings/navigation/SettingsNavigation.js", - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 19, - "column": 3 - } - }, - { - "id": "settings.navigation.yourWorkspaces", - "defaultMessage": "!!!Your workspaces", - "file": "src/components/settings/navigation/SettingsNavigation.js", - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 23, - "column": 3 - } - }, - { - "id": "settings.navigation.account", - "defaultMessage": "!!!Account", - "file": "src/components/settings/navigation/SettingsNavigation.js", - "start": { - "line": 24, - "column": 11 - }, - "end": { - "line": 27, - "column": 3 - } - }, - { - "id": "settings.navigation.settings", - "defaultMessage": "!!!Settings", - "file": "src/components/settings/navigation/SettingsNavigation.js", - "start": { - "line": 28, - "column": 12 - }, - "end": { - "line": 31, - "column": 3 - } - }, - { - "id": "settings.navigation.inviteFriends", - "defaultMessage": "!!!Invite Friends", - "file": "src/components/settings/navigation/SettingsNavigation.js", - "start": { - "line": 32, - "column": 17 - }, - "end": { - "line": 35, - "column": 3 - } - }, - { - "id": "settings.navigation.logout", - "defaultMessage": "!!!Logout", - "file": "src/components/settings/navigation/SettingsNavigation.js", - "start": { - "line": 36, - "column": 10 - }, - "end": { - "line": 39, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/settings/recipes/RecipesDashboard.json b/src/i18n/messages/src/components/settings/recipes/RecipesDashboard.json deleted file mode 100644 index 7d9ed3283..000000000 --- a/src/i18n/messages/src/components/settings/recipes/RecipesDashboard.json +++ /dev/null @@ -1,106 +0,0 @@ -[ - { - "id": "settings.recipes.headline", - "defaultMessage": "!!!Available Services", - "file": "src/components/settings/recipes/RecipesDashboard.js", - "start": { - "line": 15, - "column": 12 - }, - "end": { - "line": 18, - "column": 3 - } - }, - { - "id": "settings.searchService", - "defaultMessage": "!!!Search service", - "file": "src/components/settings/recipes/RecipesDashboard.js", - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 22, - "column": 3 - } - }, - { - "id": "settings.recipes.mostPopular", - "defaultMessage": "!!!Most popular", - "file": "src/components/settings/recipes/RecipesDashboard.js", - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 26, - "column": 3 - } - }, - { - "id": "settings.recipes.all", - "defaultMessage": "!!!All services", - "file": "src/components/settings/recipes/RecipesDashboard.js", - "start": { - "line": 27, - "column": 14 - }, - "end": { - "line": 30, - "column": 3 - } - }, - { - "id": "settings.recipes.dev", - "defaultMessage": "!!!Development", - "file": "src/components/settings/recipes/RecipesDashboard.js", - "start": { - "line": 31, - "column": 14 - }, - "end": { - "line": 34, - "column": 3 - } - }, - { - "id": "settings.recipes.nothingFound", - "defaultMessage": "!!!Sorry, but no service matched your search term.", - "file": "src/components/settings/recipes/RecipesDashboard.js", - "start": { - "line": 35, - "column": 16 - }, - "end": { - "line": 38, - "column": 3 - } - }, - { - "id": "settings.recipes.servicesSuccessfulAddedInfo", - "defaultMessage": "!!!Service successfully added", - "file": "src/components/settings/recipes/RecipesDashboard.js", - "start": { - "line": 39, - "column": 31 - }, - "end": { - "line": 42, - "column": 3 - } - }, - { - "id": "settings.recipes.missingService", - "defaultMessage": "!!!Missing a service?", - "file": "src/components/settings/recipes/RecipesDashboard.js", - "start": { - "line": 43, - "column": 18 - }, - "end": { - "line": 46, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/settings/services/EditServiceForm.json b/src/i18n/messages/src/components/settings/services/EditServiceForm.json deleted file mode 100644 index 42b741b7a..000000000 --- a/src/i18n/messages/src/components/settings/services/EditServiceForm.json +++ /dev/null @@ -1,288 +0,0 @@ -[ - { - "id": "settings.service.form.saveButton", - "defaultMessage": "!!!Save service", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 22, - "column": 15 - }, - "end": { - "line": 25, - "column": 3 - } - }, - { - "id": "settings.service.form.deleteButton", - "defaultMessage": "!!!Delete Service", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 26, - "column": 17 - }, - "end": { - "line": 29, - "column": 3 - } - }, - { - "id": "settings.service.form.availableServices", - "defaultMessage": "!!!Available services", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 30, - "column": 21 - }, - "end": { - "line": 33, - "column": 3 - } - }, - { - "id": "settings.service.form.yourServices", - "defaultMessage": "!!!Your services", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 34, - "column": 16 - }, - "end": { - "line": 37, - "column": 3 - } - }, - { - "id": "settings.service.form.addServiceHeadline", - "defaultMessage": "!!!Add {name}", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 38, - "column": 22 - }, - "end": { - "line": 41, - "column": 3 - } - }, - { - "id": "settings.service.form.editServiceHeadline", - "defaultMessage": "!!!Edit {name}", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 42, - "column": 23 - }, - "end": { - "line": 45, - "column": 3 - } - }, - { - "id": "settings.service.form.tabHosted", - "defaultMessage": "!!!Hosted", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 46, - "column": 13 - }, - "end": { - "line": 49, - "column": 3 - } - }, - { - "id": "settings.service.form.tabOnPremise", - "defaultMessage": "!!!Self hosted ⭐️", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 50, - "column": 16 - }, - "end": { - "line": 53, - "column": 3 - } - }, - { - "id": "settings.service.form.useHostedService", - "defaultMessage": "!!!Use the hosted {name} service.", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 54, - "column": 20 - }, - "end": { - "line": 57, - "column": 3 - } - }, - { - "id": "settings.service.form.customUrlValidationError", - "defaultMessage": "!!!Could not validate custom {name} server.", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 58, - "column": 28 - }, - "end": { - "line": 61, - "column": 3 - } - }, - { - "id": "settings.service.form.customUrlPremiumInfo", - "defaultMessage": "!!!To add self hosted services, you need a Franz Premium Supporter Account.", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 62, - "column": 24 - }, - "end": { - "line": 65, - "column": 3 - } - }, - { - "id": "settings.service.form.customUrlUpgradeAccount", - "defaultMessage": "!!!Upgrade your account", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 66, - "column": 27 - }, - "end": { - "line": 69, - "column": 3 - } - }, - { - "id": "settings.service.form.indirectMessageInfo", - "defaultMessage": "!!!You will be notified about all new messages in a channel, not just @username, @channel, @here, ...", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 70, - "column": 23 - }, - "end": { - "line": 73, - "column": 3 - } - }, - { - "id": "settings.service.form.isMutedInfo", - "defaultMessage": "!!!When disabled, all notification sounds and audio playback are muted", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 74, - "column": 15 - }, - "end": { - "line": 77, - "column": 3 - } - }, - { - "id": "settings.service.form.headlineNotifications", - "defaultMessage": "!!!Notifications", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 78, - "column": 25 - }, - "end": { - "line": 81, - "column": 3 - } - }, - { - "id": "settings.service.form.headlineBadges", - "defaultMessage": "!!!Unread message badges", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 82, - "column": 18 - }, - "end": { - "line": 85, - "column": 3 - } - }, - { - "id": "settings.service.form.headlineGeneral", - "defaultMessage": "!!!General", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 86, - "column": 19 - }, - "end": { - "line": 89, - "column": 3 - } - }, - { - "id": "settings.service.form.iconDelete", - "defaultMessage": "!!!Delete", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 90, - "column": 14 - }, - "end": { - "line": 93, - "column": 3 - } - }, - { - "id": "settings.service.form.iconUpload", - "defaultMessage": "!!!Drop your image, or click here", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 94, - "column": 14 - }, - "end": { - "line": 97, - "column": 3 - } - }, - { - "id": "settings.service.form.proxy.headline", - "defaultMessage": "!!!HTTP/HTTPS Proxy Settings", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 98, - "column": 17 - }, - "end": { - "line": 101, - "column": 3 - } - }, - { - "id": "settings.service.form.proxy.restartInfo", - "defaultMessage": "!!!Please restart Franz after changing proxy Settings.", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 102, - "column": 20 - }, - "end": { - "line": 105, - "column": 3 - } - }, - { - "id": "settings.service.form.proxy.info", - "defaultMessage": "!!!Proxy settings will not be synchronized with the Franz servers.", - "file": "src/components/settings/services/EditServiceForm.js", - "start": { - "line": 106, - "column": 13 - }, - "end": { - "line": 109, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/settings/services/ServiceError.json b/src/i18n/messages/src/components/settings/services/ServiceError.json deleted file mode 100644 index 648fc5b3e..000000000 --- a/src/i18n/messages/src/components/settings/services/ServiceError.json +++ /dev/null @@ -1,54 +0,0 @@ -[ - { - "id": "settings.service.error.headline", - "defaultMessage": "!!!Error", - "file": "src/components/settings/services/ServiceError.js", - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 13, - "column": 3 - } - }, - { - "id": "settings.service.error.goBack", - "defaultMessage": "!!!Back to services", - "file": "src/components/settings/services/ServiceError.js", - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 17, - "column": 3 - } - }, - { - "id": "settings.service.form.availableServices", - "defaultMessage": "!!!Available services", - "file": "src/components/settings/services/ServiceError.js", - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 21, - "column": 3 - } - }, - { - "id": "settings.service.error.message", - "defaultMessage": "!!!Could not load service recipe.", - "file": "src/components/settings/services/ServiceError.js", - "start": { - "line": 22, - "column": 16 - }, - "end": { - "line": 25, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/settings/services/ServiceItem.json b/src/i18n/messages/src/components/settings/services/ServiceItem.json deleted file mode 100644 index ffea8b9e1..000000000 --- a/src/i18n/messages/src/components/settings/services/ServiceItem.json +++ /dev/null @@ -1,41 +0,0 @@ -[ - { - "id": "settings.services.tooltip.isDisabled", - "defaultMessage": "!!!Service is disabled", - "file": "src/components/settings/services/ServiceItem.js", - "start": { - "line": 11, - "column": 21 - }, - "end": { - "line": 14, - "column": 3 - } - }, - { - "id": "settings.services.tooltip.notificationsDisabled", - "defaultMessage": "!!!Notifications are disabled", - "file": "src/components/settings/services/ServiceItem.js", - "start": { - "line": 15, - "column": 32 - }, - "end": { - "line": 18, - "column": 3 - } - }, - { - "id": "settings.services.tooltip.isMuted", - "defaultMessage": "!!!All sounds are muted", - "file": "src/components/settings/services/ServiceItem.js", - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 22, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/settings/services/ServicesDashboard.json b/src/i18n/messages/src/components/settings/services/ServicesDashboard.json deleted file mode 100644 index 3803c6512..000000000 --- a/src/i18n/messages/src/components/settings/services/ServicesDashboard.json +++ /dev/null @@ -1,119 +0,0 @@ -[ - { - "id": "settings.services.headline", - "defaultMessage": "!!!Your services", - "file": "src/components/settings/services/ServicesDashboard.js", - "start": { - "line": 14, - "column": 12 - }, - "end": { - "line": 17, - "column": 3 - } - }, - { - "id": "settings.searchService", - "defaultMessage": "!!!Search service", - "file": "src/components/settings/services/ServicesDashboard.js", - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 21, - "column": 3 - } - }, - { - "id": "settings.services.noServicesAdded", - "defaultMessage": "!!!You haven't added any services yet.", - "file": "src/components/settings/services/ServicesDashboard.js", - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 25, - "column": 3 - } - }, - { - "id": "settings.recipes.nothingFound", - "defaultMessage": "!!!Sorry, but no service matched your search term.", - "file": "src/components/settings/services/ServicesDashboard.js", - "start": { - "line": 26, - "column": 18 - }, - "end": { - "line": 29, - "column": 3 - } - }, - { - "id": "settings.services.discoverServices", - "defaultMessage": "!!!Discover services", - "file": "src/components/settings/services/ServicesDashboard.js", - "start": { - "line": 30, - "column": 20 - }, - "end": { - "line": 33, - "column": 3 - } - }, - { - "id": "settings.services.servicesRequestFailed", - "defaultMessage": "!!!Could not load your services", - "file": "src/components/settings/services/ServicesDashboard.js", - "start": { - "line": 34, - "column": 25 - }, - "end": { - "line": 37, - "column": 3 - } - }, - { - "id": "settings.account.tryReloadServices", - "defaultMessage": "!!!Try again", - "file": "src/components/settings/services/ServicesDashboard.js", - "start": { - "line": 38, - "column": 21 - }, - "end": { - "line": 41, - "column": 3 - } - }, - { - "id": "settings.services.updatedInfo", - "defaultMessage": "!!!Your changes have been saved", - "file": "src/components/settings/services/ServicesDashboard.js", - "start": { - "line": 42, - "column": 15 - }, - "end": { - "line": 45, - "column": 3 - } - }, - { - "id": "settings.services.deletedInfo", - "defaultMessage": "!!!Service has been deleted", - "file": "src/components/settings/services/ServicesDashboard.js", - "start": { - "line": 46, - "column": 15 - }, - "end": { - "line": 49, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/settings/settings/EditSettingsForm.json b/src/i18n/messages/src/components/settings/settings/EditSettingsForm.json deleted file mode 100644 index c64f477be..000000000 --- a/src/i18n/messages/src/components/settings/settings/EditSettingsForm.json +++ /dev/null @@ -1,223 +0,0 @@ -[ - { - "id": "settings.app.headline", - "defaultMessage": "!!!Settings", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 19, - "column": 3 - } - }, - { - "id": "settings.app.headlineGeneral", - "defaultMessage": "!!!General", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 23, - "column": 3 - } - }, - { - "id": "settings.app.headlineLanguage", - "defaultMessage": "!!!Language", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 24, - "column": 20 - }, - "end": { - "line": 27, - "column": 3 - } - }, - { - "id": "settings.app.headlineUpdates", - "defaultMessage": "!!!Updates", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 28, - "column": 19 - }, - "end": { - "line": 31, - "column": 3 - } - }, - { - "id": "settings.app.headlineAppearance", - "defaultMessage": "!!!Appearance", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 32, - "column": 22 - }, - "end": { - "line": 35, - "column": 3 - } - }, - { - "id": "settings.app.headlineAdvanced", - "defaultMessage": "!!!Advanced", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 36, - "column": 20 - }, - "end": { - "line": 39, - "column": 3 - } - }, - { - "id": "settings.app.translationHelp", - "defaultMessage": "!!!Help us to translate Franz into your language.", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 40, - "column": 19 - }, - "end": { - "line": 43, - "column": 3 - } - }, - { - "id": "settings.app.subheadlineCache", - "defaultMessage": "!!!Cache", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 44, - "column": 20 - }, - "end": { - "line": 47, - "column": 3 - } - }, - { - "id": "settings.app.cacheInfo", - "defaultMessage": "!!!Franz cache is currently using {size} of disk space.", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 48, - "column": 13 - }, - "end": { - "line": 51, - "column": 3 - } - }, - { - "id": "settings.app.buttonClearAllCache", - "defaultMessage": "!!!Clear cache", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 52, - "column": 23 - }, - "end": { - "line": 55, - "column": 3 - } - }, - { - "id": "settings.app.buttonSearchForUpdate", - "defaultMessage": "!!!Check for updates", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 56, - "column": 25 - }, - "end": { - "line": 59, - "column": 3 - } - }, - { - "id": "settings.app.buttonInstallUpdate", - "defaultMessage": "!!!Restart & install update", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 60, - "column": 23 - }, - "end": { - "line": 63, - "column": 3 - } - }, - { - "id": "settings.app.updateStatusSearching", - "defaultMessage": "!!!Is searching for update", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 64, - "column": 25 - }, - "end": { - "line": 67, - "column": 3 - } - }, - { - "id": "settings.app.updateStatusAvailable", - "defaultMessage": "!!!Update available, downloading...", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 68, - "column": 25 - }, - "end": { - "line": 71, - "column": 3 - } - }, - { - "id": "settings.app.updateStatusUpToDate", - "defaultMessage": "!!!You are using the latest version of Franz", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 72, - "column": 24 - }, - "end": { - "line": 75, - "column": 3 - } - }, - { - "id": "settings.app.currentVersion", - "defaultMessage": "!!!Current version:", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 76, - "column": 18 - }, - "end": { - "line": 79, - "column": 3 - } - }, - { - "id": "settings.app.restartRequired", - "defaultMessage": "!!!Changes require restart", - "file": "src/components/settings/settings/EditSettingsForm.js", - "start": { - "line": 80, - "column": 29 - }, - "end": { - "line": 83, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/settings/user/EditUserForm.json b/src/i18n/messages/src/components/settings/user/EditUserForm.json deleted file mode 100644 index 3a59f8681..000000000 --- a/src/i18n/messages/src/components/settings/user/EditUserForm.json +++ /dev/null @@ -1,80 +0,0 @@ -[ - { - "id": "settings.account.headline", - "defaultMessage": "!!!Account", - "file": "src/components/settings/user/EditUserForm.js", - "start": { - "line": 15, - "column": 12 - }, - "end": { - "line": 18, - "column": 3 - } - }, - { - "id": "settings.account.headlineProfile", - "defaultMessage": "!!!Update Profile", - "file": "src/components/settings/user/EditUserForm.js", - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 22, - "column": 3 - } - }, - { - "id": "settings.account.headlineAccount", - "defaultMessage": "!!!Account Information", - "file": "src/components/settings/user/EditUserForm.js", - "start": { - "line": 23, - "column": 19 - }, - "end": { - "line": 26, - "column": 3 - } - }, - { - "id": "settings.account.headlinePassword", - "defaultMessage": "!!!Change Password", - "file": "src/components/settings/user/EditUserForm.js", - "start": { - "line": 27, - "column": 20 - }, - "end": { - "line": 30, - "column": 3 - } - }, - { - "id": "settings.account.successInfo", - "defaultMessage": "!!!Your changes have been saved", - "file": "src/components/settings/user/EditUserForm.js", - "start": { - "line": 31, - "column": 15 - }, - "end": { - "line": 34, - "column": 3 - } - }, - { - "id": "settings.account.buttonSave", - "defaultMessage": "!!!Update profile", - "file": "src/components/settings/user/EditUserForm.js", - "start": { - "line": 35, - "column": 14 - }, - "end": { - "line": 38, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/subscription/SubscriptionForm.json b/src/i18n/messages/src/components/subscription/SubscriptionForm.json deleted file mode 100644 index cc7470358..000000000 --- a/src/i18n/messages/src/components/subscription/SubscriptionForm.json +++ /dev/null @@ -1,171 +0,0 @@ -[ - { - "id": "subscription.submit.label", - "defaultMessage": "!!!Support the development of Franz", - "file": "src/components/subscription/SubscriptionForm.js", - "start": { - "line": 14, - "column": 21 - }, - "end": { - "line": 17, - "column": 3 - } - }, - { - "id": "subscription.paymentSessionError", - "defaultMessage": "!!!Could not initialize payment form", - "file": "src/components/subscription/SubscriptionForm.js", - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 21, - "column": 3 - } - }, - { - "id": "subscription.type.free", - "defaultMessage": "!!!free", - "file": "src/components/subscription/SubscriptionForm.js", - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 25, - "column": 3 - } - }, - { - "id": "subscription.type.month", - "defaultMessage": "!!!month", - "file": "src/components/subscription/SubscriptionForm.js", - "start": { - "line": 26, - "column": 15 - }, - "end": { - "line": 29, - "column": 3 - } - }, - { - "id": "subscription.type.year", - "defaultMessage": "!!!year", - "file": "src/components/subscription/SubscriptionForm.js", - "start": { - "line": 30, - "column": 14 - }, - "end": { - "line": 33, - "column": 3 - } - }, - { - "id": "subscription.includedFeatures", - "defaultMessage": "!!!The Franz Premium Supporter Account includes", - "file": "src/components/subscription/SubscriptionForm.js", - "start": { - "line": 34, - "column": 20 - }, - "end": { - "line": 37, - "column": 3 - } - }, - { - "id": "subscription.features.onpremise.mattermost", - "defaultMessage": "!!!Add on-premise/hosted services like Mattermost", - "file": "src/components/subscription/SubscriptionForm.js", - "start": { - "line": 38, - "column": 13 - }, - "end": { - "line": 41, - "column": 3 - } - }, - { - "id": "subscription.features.noInterruptions", - "defaultMessage": "!!!No app delays & nagging to upgrade license", - "file": "src/components/subscription/SubscriptionForm.js", - "start": { - "line": 42, - "column": 19 - }, - "end": { - "line": 45, - "column": 3 - } - }, - { - "id": "subscription.features.proxy", - "defaultMessage": "!!!Proxy support for services", - "file": "src/components/subscription/SubscriptionForm.js", - "start": { - "line": 46, - "column": 9 - }, - "end": { - "line": 49, - "column": 3 - } - }, - { - "id": "subscription.features.spellchecker", - "defaultMessage": "!!!Support for Spellchecker", - "file": "src/components/subscription/SubscriptionForm.js", - "start": { - "line": 50, - "column": 16 - }, - "end": { - "line": 53, - "column": 3 - } - }, - { - "id": "subscription.features.ads", - "defaultMessage": "!!!No ads, ever!", - "file": "src/components/subscription/SubscriptionForm.js", - "start": { - "line": 54, - "column": 7 - }, - "end": { - "line": 57, - "column": 3 - } - }, - { - "id": "subscription.features.comingSoon", - "defaultMessage": "!!!coming soon", - "file": "src/components/subscription/SubscriptionForm.js", - "start": { - "line": 58, - "column": 14 - }, - "end": { - "line": 61, - "column": 3 - } - }, - { - "id": "subscription.euTaxInfo", - "defaultMessage": "!!!EU residents: local sales tax may apply", - "file": "src/components/subscription/SubscriptionForm.js", - "start": { - "line": 62, - "column": 13 - }, - "end": { - "line": 65, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/subscription/SubscriptionPopup.json b/src/i18n/messages/src/components/subscription/SubscriptionPopup.json deleted file mode 100644 index c06da7531..000000000 --- a/src/i18n/messages/src/components/subscription/SubscriptionPopup.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "id": "subscriptionPopup.buttonCancel", - "defaultMessage": "!!!Cancel", - "file": "src/components/subscription/SubscriptionPopup.js", - "start": { - "line": 11, - "column": 16 - }, - "end": { - "line": 14, - "column": 3 - } - }, - { - "id": "subscriptionPopup.buttonDone", - "defaultMessage": "!!!Done", - "file": "src/components/subscription/SubscriptionPopup.js", - "start": { - "line": 15, - "column": 14 - }, - "end": { - "line": 18, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/ui/PremiumFeatureContainer/index.json b/src/i18n/messages/src/components/ui/PremiumFeatureContainer/index.json deleted file mode 100644 index 320d3ca3e..000000000 --- a/src/i18n/messages/src/components/ui/PremiumFeatureContainer/index.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "id": "premiumFeature.button.upgradeAccount", - "defaultMessage": "!!!Upgrade account", - "file": "src/components/ui/PremiumFeatureContainer/index.js", - "start": { - "line": 15, - "column": 10 - }, - "end": { - "line": 18, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/ui/WebviewLoader/index.json b/src/i18n/messages/src/components/ui/WebviewLoader/index.json deleted file mode 100644 index ef3e4b593..000000000 --- a/src/i18n/messages/src/components/ui/WebviewLoader/index.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "id": "service.webviewLoader.loading", - "defaultMessage": "!!!Loading", - "file": "src/components/ui/WebviewLoader/index.js", - "start": { - "line": 11, - "column": 11 - }, - "end": { - "line": 14, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/components/util/ErrorBoundary/index.json b/src/i18n/messages/src/components/util/ErrorBoundary/index.json deleted file mode 100644 index 43c323031..000000000 --- a/src/i18n/messages/src/components/util/ErrorBoundary/index.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "id": "app.errorHandler.headline", - "defaultMessage": "!!!Something went wrong.", - "file": "src/components/util/ErrorBoundary/index.js", - "start": { - "line": 11, - "column": 12 - }, - "end": { - "line": 14, - "column": 3 - } - }, - { - "id": "app.errorHandler.action", - "defaultMessage": "!!!Reload", - "file": "src/components/util/ErrorBoundary/index.js", - "start": { - "line": 15, - "column": 10 - }, - "end": { - "line": 18, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/containers/settings/EditServiceScreen.json b/src/i18n/messages/src/containers/settings/EditServiceScreen.json deleted file mode 100644 index 42ca42125..000000000 --- a/src/i18n/messages/src/containers/settings/EditServiceScreen.json +++ /dev/null @@ -1,197 +0,0 @@ -[ - { - "id": "settings.service.form.name", - "defaultMessage": "!!!Name", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 28, - "column": 8 - }, - "end": { - "line": 31, - "column": 3 - } - }, - { - "id": "settings.service.form.enableService", - "defaultMessage": "!!!Enable service", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 32, - "column": 17 - }, - "end": { - "line": 35, - "column": 3 - } - }, - { - "id": "settings.service.form.enableNotification", - "defaultMessage": "!!!Enable Notifications", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 36, - "column": 22 - }, - "end": { - "line": 39, - "column": 3 - } - }, - { - "id": "settings.service.form.enableBadge", - "defaultMessage": "!!!Show unread message badges", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 40, - "column": 15 - }, - "end": { - "line": 43, - "column": 3 - } - }, - { - "id": "settings.service.form.enableAudio", - "defaultMessage": "!!!Enable audio", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 44, - "column": 15 - }, - "end": { - "line": 47, - "column": 3 - } - }, - { - "id": "settings.service.form.team", - "defaultMessage": "!!!Team", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 48, - "column": 8 - }, - "end": { - "line": 51, - "column": 3 - } - }, - { - "id": "settings.service.form.customUrl", - "defaultMessage": "!!!Custom server", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 52, - "column": 13 - }, - "end": { - "line": 55, - "column": 3 - } - }, - { - "id": "settings.service.form.indirectMessages", - "defaultMessage": "!!!Show message badge for all new messages", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 56, - "column": 20 - }, - "end": { - "line": 59, - "column": 3 - } - }, - { - "id": "settings.service.form.icon", - "defaultMessage": "!!!Custom icon", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 60, - "column": 8 - }, - "end": { - "line": 63, - "column": 3 - } - }, - { - "id": "settings.service.form.enableDarkMode", - "defaultMessage": "!!!Enable Dark Mode", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 64, - "column": 18 - }, - "end": { - "line": 67, - "column": 3 - } - }, - { - "id": "settings.service.form.proxy.isEnabled", - "defaultMessage": "!!!Use Proxy", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 68, - "column": 15 - }, - "end": { - "line": 71, - "column": 3 - } - }, - { - "id": "settings.service.form.proxy.host", - "defaultMessage": "!!!Proxy Host/IP", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 72, - "column": 13 - }, - "end": { - "line": 75, - "column": 3 - } - }, - { - "id": "settings.service.form.proxy.port", - "defaultMessage": "!!!Port", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 76, - "column": 13 - }, - "end": { - "line": 79, - "column": 3 - } - }, - { - "id": "settings.service.form.proxy.user", - "defaultMessage": "!!!User", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 80, - "column": 13 - }, - "end": { - "line": 83, - "column": 3 - } - }, - { - "id": "settings.service.form.proxy.password", - "defaultMessage": "!!!Password", - "file": "src/containers/settings/EditServiceScreen.js", - "start": { - "line": 84, - "column": 17 - }, - "end": { - "line": 87, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/containers/settings/EditSettingsScreen.json b/src/i18n/messages/src/containers/settings/EditSettingsScreen.json deleted file mode 100644 index d3b413540..000000000 --- a/src/i18n/messages/src/containers/settings/EditSettingsScreen.json +++ /dev/null @@ -1,158 +0,0 @@ -[ - { - "id": "settings.app.form.autoLaunchOnStart", - "defaultMessage": "!!!Launch Franz on start", - "file": "src/containers/settings/EditSettingsScreen.js", - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 25, - "column": 3 - } - }, - { - "id": "settings.app.form.autoLaunchInBackground", - "defaultMessage": "!!!Open in background", - "file": "src/containers/settings/EditSettingsScreen.js", - "start": { - "line": 26, - "column": 26 - }, - "end": { - "line": 29, - "column": 3 - } - }, - { - "id": "settings.app.form.runInBackground", - "defaultMessage": "!!!Keep Franz in background when closing the window", - "file": "src/containers/settings/EditSettingsScreen.js", - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 33, - "column": 3 - } - }, - { - "id": "settings.app.form.enableSystemTray", - "defaultMessage": "!!!Show Franz in system tray", - "file": "src/containers/settings/EditSettingsScreen.js", - "start": { - "line": 34, - "column": 20 - }, - "end": { - "line": 37, - "column": 3 - } - }, - { - "id": "settings.app.form.minimizeToSystemTray", - "defaultMessage": "!!!Minimize Franz to system tray", - "file": "src/containers/settings/EditSettingsScreen.js", - "start": { - "line": 38, - "column": 24 - }, - "end": { - "line": 41, - "column": 3 - } - }, - { - "id": "settings.app.form.language", - "defaultMessage": "!!!Language", - "file": "src/containers/settings/EditSettingsScreen.js", - "start": { - "line": 42, - "column": 12 - }, - "end": { - "line": 45, - "column": 3 - } - }, - { - "id": "settings.app.form.darkMode", - "defaultMessage": "!!!Dark Mode", - "file": "src/containers/settings/EditSettingsScreen.js", - "start": { - "line": 46, - "column": 12 - }, - "end": { - "line": 49, - "column": 3 - } - }, - { - "id": "settings.app.form.showDisabledServices", - "defaultMessage": "!!!Display disabled services tabs", - "file": "src/containers/settings/EditSettingsScreen.js", - "start": { - "line": 50, - "column": 24 - }, - "end": { - "line": 53, - "column": 3 - } - }, - { - "id": "settings.app.form.showMessagesBadgesWhenMuted", - "defaultMessage": "!!!Show unread message badge when notifications are disabled", - "file": "src/containers/settings/EditSettingsScreen.js", - "start": { - "line": 54, - "column": 29 - }, - "end": { - "line": 57, - "column": 3 - } - }, - { - "id": "settings.app.form.enableSpellchecking", - "defaultMessage": "!!!Enable spell checking", - "file": "src/containers/settings/EditSettingsScreen.js", - "start": { - "line": 58, - "column": 23 - }, - "end": { - "line": 61, - "column": 3 - } - }, - { - "id": "settings.app.form.enableGPUAcceleration", - "defaultMessage": "!!!Enable GPU Acceleration", - "file": "src/containers/settings/EditSettingsScreen.js", - "start": { - "line": 62, - "column": 25 - }, - "end": { - "line": 65, - "column": 3 - } - }, - { - "id": "settings.app.form.beta", - "defaultMessage": "!!!Include beta versions", - "file": "src/containers/settings/EditSettingsScreen.js", - "start": { - "line": 66, - "column": 8 - }, - "end": { - "line": 69, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/containers/settings/EditUserScreen.json b/src/i18n/messages/src/containers/settings/EditUserScreen.json deleted file mode 100644 index 70ff29945..000000000 --- a/src/i18n/messages/src/containers/settings/EditUserScreen.json +++ /dev/null @@ -1,119 +0,0 @@ -[ - { - "id": "settings.user.form.firstname", - "defaultMessage": "!!!Firstname", - "file": "src/containers/settings/EditUserScreen.js", - "start": { - "line": 14, - "column": 13 - }, - "end": { - "line": 17, - "column": 3 - } - }, - { - "id": "settings.user.form.lastname", - "defaultMessage": "!!!Lastname", - "file": "src/containers/settings/EditUserScreen.js", - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 21, - "column": 3 - } - }, - { - "id": "settings.user.form.email", - "defaultMessage": "!!!Email", - "file": "src/containers/settings/EditUserScreen.js", - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 25, - "column": 3 - } - }, - { - "id": "settings.user.form.accountType.label", - "defaultMessage": "!!!Account type", - "file": "src/containers/settings/EditUserScreen.js", - "start": { - "line": 26, - "column": 20 - }, - "end": { - "line": 29, - "column": 3 - } - }, - { - "id": "settings.user.form.accountType.individual", - "defaultMessage": "!!!Individual", - "file": "src/containers/settings/EditUserScreen.js", - "start": { - "line": 30, - "column": 25 - }, - "end": { - "line": 33, - "column": 3 - } - }, - { - "id": "settings.user.form.accountType.non-profit", - "defaultMessage": "!!!Non-Profit", - "file": "src/containers/settings/EditUserScreen.js", - "start": { - "line": 34, - "column": 24 - }, - "end": { - "line": 37, - "column": 3 - } - }, - { - "id": "settings.user.form.accountType.company", - "defaultMessage": "!!!Company", - "file": "src/containers/settings/EditUserScreen.js", - "start": { - "line": 38, - "column": 22 - }, - "end": { - "line": 41, - "column": 3 - } - }, - { - "id": "settings.user.form.currentPassword", - "defaultMessage": "!!!Current password", - "file": "src/containers/settings/EditUserScreen.js", - "start": { - "line": 42, - "column": 19 - }, - "end": { - "line": 45, - "column": 3 - } - }, - { - "id": "settings.user.form.newPassword", - "defaultMessage": "!!!New password", - "file": "src/containers/settings/EditUserScreen.js", - "start": { - "line": 46, - "column": 15 - }, - "end": { - "line": 49, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/features/announcements/Component.json b/src/i18n/messages/src/features/announcements/Component.json deleted file mode 100644 index c31c35fc7..000000000 --- a/src/i18n/messages/src/features/announcements/Component.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "id": "feature.announcements.changelog.headline", - "defaultMessage": "!!!What's new in Franz {version}?", - "file": "src/features/announcements/Component.js", - "start": { - "line": 11, - "column": 12 - }, - "end": { - "line": 14, - "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 eb1b66916..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 Franz {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/features/delayApp/Component.json b/src/i18n/messages/src/features/delayApp/Component.json deleted file mode 100644 index bacd9444a..000000000 --- a/src/i18n/messages/src/features/delayApp/Component.json +++ /dev/null @@ -1,41 +0,0 @@ -[ - { - "id": "feature.delayApp.headline", - "defaultMessage": "!!!Please purchase license to skip waiting", - "file": "src/features/delayApp/Component.js", - "start": { - "line": 15, - "column": 12 - }, - "end": { - "line": 18, - "column": 3 - } - }, - { - "id": "feature.delayApp.action", - "defaultMessage": "!!!Get a Franz Supporter License", - "file": "src/features/delayApp/Component.js", - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 22, - "column": 3 - } - }, - { - "id": "feature.delayApp.text", - "defaultMessage": "!!!Franz will continue in {seconds} seconds.", - "file": "src/features/delayApp/Component.js", - "start": { - "line": 23, - "column": 8 - }, - "end": { - "line": 26, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/features/shareFranz/Component.json b/src/i18n/messages/src/features/shareFranz/Component.json deleted file mode 100644 index 34a43d5a0..000000000 --- a/src/i18n/messages/src/features/shareFranz/Component.json +++ /dev/null @@ -1,93 +0,0 @@ -[ - { - "id": "feature.shareFranz.headline", - "defaultMessage": "!!!Franz is better together!", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 15, - "column": 12 - }, - "end": { - "line": 18, - "column": 3 - } - }, - { - "id": "feature.shareFranz.text", - "defaultMessage": "!!!Tell your friends and colleagues how awesome Franz is and help us to spread the word.", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 22, - "column": 3 - } - }, - { - "id": "feature.shareFranz.action.email", - "defaultMessage": "!!!Share as email", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 23, - "column": 16 - }, - "end": { - "line": 26, - "column": 3 - } - }, - { - "id": "feature.shareFranz.action.facebook", - "defaultMessage": "!!!Share on Facebook", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 27, - "column": 19 - }, - "end": { - "line": 30, - "column": 3 - } - }, - { - "id": "feature.shareFranz.action.twitter", - "defaultMessage": "!!!Share on Twitter", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 31, - "column": 18 - }, - "end": { - "line": 34, - "column": 3 - } - }, - { - "id": "feature.shareFranz.shareText.email", - "defaultMessage": "!!! I've added {count} services to Franz! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.meetfranz.com", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 35, - "column": 18 - }, - "end": { - "line": 38, - "column": 3 - } - }, - { - "id": "feature.shareFranz.shareText.twitter", - "defaultMessage": "!!! I've added {count} services to Franz! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.meetfranz.com /cc @FranzMessenger", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 39, - "column": 20 - }, - "end": { - "line": 42, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/features/workspaces/components/CreateWorkspaceForm.json b/src/i18n/messages/src/features/workspaces/components/CreateWorkspaceForm.json deleted file mode 100644 index f62bac42c..000000000 --- a/src/i18n/messages/src/features/workspaces/components/CreateWorkspaceForm.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "id": "settings.workspace.add.form.submitButton", - "defaultMessage": "!!!Create workspace", - "file": "src/features/workspaces/components/CreateWorkspaceForm.js", - "start": { - "line": 13, - "column": 16 - }, - "end": { - "line": 16, - "column": 3 - } - }, - { - "id": "settings.workspace.add.form.name", - "defaultMessage": "!!!Name", - "file": "src/features/workspaces/components/CreateWorkspaceForm.js", - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 20, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/features/workspaces/components/EditWorkspaceForm.json b/src/i18n/messages/src/features/workspaces/components/EditWorkspaceForm.json deleted file mode 100644 index 7b0c3e1ce..000000000 --- a/src/i18n/messages/src/features/workspaces/components/EditWorkspaceForm.json +++ /dev/null @@ -1,67 +0,0 @@ -[ - { - "id": "settings.workspace.form.buttonDelete", - "defaultMessage": "!!!Delete workspace", - "file": "src/features/workspaces/components/EditWorkspaceForm.js", - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 22, - "column": 3 - } - }, - { - "id": "settings.workspace.form.buttonSave", - "defaultMessage": "!!!Save workspace", - "file": "src/features/workspaces/components/EditWorkspaceForm.js", - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 26, - "column": 3 - } - }, - { - "id": "settings.workspace.form.name", - "defaultMessage": "!!!Name", - "file": "src/features/workspaces/components/EditWorkspaceForm.js", - "start": { - "line": 27, - "column": 8 - }, - "end": { - "line": 30, - "column": 3 - } - }, - { - "id": "settings.workspace.form.yourWorkspaces", - "defaultMessage": "!!!Your workspaces", - "file": "src/features/workspaces/components/EditWorkspaceForm.js", - "start": { - "line": 31, - "column": 18 - }, - "end": { - "line": 34, - "column": 3 - } - }, - { - "id": "settings.workspace.form.servicesInWorkspaceHeadline", - "defaultMessage": "!!!Services in this Workspace", - "file": "src/features/workspaces/components/EditWorkspaceForm.js", - "start": { - "line": 35, - "column": 31 - }, - "end": { - "line": 38, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json b/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json deleted file mode 100644 index 9f0935620..000000000 --- a/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json +++ /dev/null @@ -1,106 +0,0 @@ -[ - { - "id": "workspaceDrawer.headline", - "defaultMessage": "!!!Workspaces", - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 19, - "column": 3 - } - }, - { - "id": "workspaceDrawer.allServices", - "defaultMessage": "!!!All services", - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 23, - "column": 3 - } - }, - { - "id": "workspaceDrawer.workspacesSettingsTooltip", - "defaultMessage": "!!!Workspaces settings", - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 27, - "column": 3 - } - }, - { - "id": "workspaceDrawer.workspaceFeatureInfo", - "defaultMessage": "!!!Info about workspace feature", - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "start": { - "line": 28, - "column": 24 - }, - "end": { - "line": 31, - "column": 3 - } - }, - { - "id": "workspaceDrawer.premiumCtaButtonLabel", - "defaultMessage": "!!!Create your first workspace", - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "start": { - "line": 32, - "column": 25 - }, - "end": { - "line": 35, - "column": 3 - } - }, - { - "id": "workspaceDrawer.reactivatePremiumAccountLabel", - "defaultMessage": "!!!Reactivate premium account", - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "start": { - "line": 36, - "column": 28 - }, - "end": { - "line": 39, - "column": 3 - } - }, - { - "id": "workspaceDrawer.addNewWorkspaceLabel", - "defaultMessage": "!!!add new workspace", - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "start": { - "line": 40, - "column": 24 - }, - "end": { - "line": 43, - "column": 3 - } - }, - { - "id": "workspaceDrawer.proFeatureBadge", - "defaultMessage": "!!!Premium feature", - "file": "src/features/workspaces/components/WorkspaceDrawer.js", - "start": { - "line": 44, - "column": 23 - }, - "end": { - "line": 47, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawerItem.json b/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawerItem.json deleted file mode 100644 index 4ff190606..000000000 --- a/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawerItem.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "id": "workspaceDrawer.item.noServicesAddedYet", - "defaultMessage": "!!!No services added yet", - "file": "src/features/workspaces/components/WorkspaceDrawerItem.js", - "start": { - "line": 12, - "column": 22 - }, - "end": { - "line": 15, - "column": 3 - } - }, - { - "id": "workspaceDrawer.item.contextMenuEdit", - "defaultMessage": "!!!edit", - "file": "src/features/workspaces/components/WorkspaceDrawerItem.js", - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 19, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/features/workspaces/components/WorkspaceSwitchingIndicator.json b/src/i18n/messages/src/features/workspaces/components/WorkspaceSwitchingIndicator.json deleted file mode 100644 index 4f3e6d55c..000000000 --- a/src/i18n/messages/src/features/workspaces/components/WorkspaceSwitchingIndicator.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "id": "workspaces.switchingIndicator.switchingTo", - "defaultMessage": "!!!Switching to", - "file": "src/features/workspaces/components/WorkspaceSwitchingIndicator.js", - "start": { - "line": 12, - "column": 15 - }, - "end": { - "line": 15, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json b/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json deleted file mode 100644 index ef8f1bebc..000000000 --- a/src/i18n/messages/src/features/workspaces/components/WorkspacesDashboard.json +++ /dev/null @@ -1,106 +0,0 @@ -[ - { - "id": "settings.workspaces.headline", - "defaultMessage": "!!!Your workspaces", - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 20, - "column": 3 - } - }, - { - "id": "settings.workspaces.noWorkspacesAdded", - "defaultMessage": "!!!You haven't added any workspaces yet.", - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 24, - "column": 3 - } - }, - { - "id": "settings.workspaces.workspacesRequestFailed", - "defaultMessage": "!!!Could not load your workspaces", - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "start": { - "line": 25, - "column": 27 - }, - "end": { - "line": 28, - "column": 3 - } - }, - { - "id": "settings.workspaces.tryReloadWorkspaces", - "defaultMessage": "!!!Try again", - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "start": { - "line": 29, - "column": 23 - }, - "end": { - "line": 32, - "column": 3 - } - }, - { - "id": "settings.workspaces.updatedInfo", - "defaultMessage": "!!!Your changes have been saved", - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "start": { - "line": 33, - "column": 15 - }, - "end": { - "line": 36, - "column": 3 - } - }, - { - "id": "settings.workspaces.deletedInfo", - "defaultMessage": "!!!Workspace has been deleted", - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "start": { - "line": 37, - "column": 15 - }, - "end": { - "line": 40, - "column": 3 - } - }, - { - "id": "settings.workspaces.workspaceFeatureInfo", - "defaultMessage": "!!!Info about workspace feature", - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "start": { - "line": 41, - "column": 24 - }, - "end": { - "line": 44, - "column": 3 - } - }, - { - "id": "settings.workspaces.workspaceFeatureHeadline", - "defaultMessage": "!!!Less is More: Introducing Franz Workspaces", - "file": "src/features/workspaces/components/WorkspacesDashboard.js", - "start": { - "line": 45, - "column": 28 - }, - "end": { - "line": 48, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/helpers/validation-helpers.json b/src/i18n/messages/src/helpers/validation-helpers.json deleted file mode 100644 index 86bfe1500..000000000 --- a/src/i18n/messages/src/helpers/validation-helpers.json +++ /dev/null @@ -1,67 +0,0 @@ -[ - { - "id": "validation.required", - "defaultMessage": "!!!Field is required", - "file": "src/helpers/validation-helpers.js", - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 7, - "column": 3 - } - }, - { - "id": "validation.email", - "defaultMessage": "!!!Email not valid", - "file": "src/helpers/validation-helpers.js", - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 11, - "column": 3 - } - }, - { - "id": "validation.url", - "defaultMessage": "!!!Not a valid URL", - "file": "src/helpers/validation-helpers.js", - "start": { - "line": 12, - "column": 7 - }, - "end": { - "line": 15, - "column": 3 - } - }, - { - "id": "validation.minLength", - "defaultMessage": "!!!Too few characters", - "file": "src/helpers/validation-helpers.js", - "start": { - "line": 16, - "column": 13 - }, - "end": { - "line": 19, - "column": 3 - } - }, - { - "id": "validation.oneRequired", - "defaultMessage": "!!!At least one is required", - "file": "src/helpers/validation-helpers.js", - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 23, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/i18n/messages/src/i18n/globalMessages.json b/src/i18n/messages/src/i18n/globalMessages.json deleted file mode 100644 index 28001614f..000000000 --- a/src/i18n/messages/src/i18n/globalMessages.json +++ /dev/null @@ -1,80 +0,0 @@ -[ - { - "id": "global.api.unhealthy", - "defaultMessage": "!!!Can't connect to Franz Online Services", - "file": "src/i18n/globalMessages.js", - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 7, - "column": 3 - } - }, - { - "id": "global.notConnectedToTheInternet", - "defaultMessage": "!!!You are not connected to the internet.", - "file": "src/i18n/globalMessages.js", - "start": { - "line": 8, - "column": 29 - }, - "end": { - "line": 11, - "column": 3 - } - }, - { - "id": "global.spellchecking.language", - "defaultMessage": "!!!Spell checking language", - "file": "src/i18n/globalMessages.js", - "start": { - "line": 12, - "column": 24 - }, - "end": { - "line": 15, - "column": 3 - } - }, - { - "id": "global.spellchecker.useDefault", - "defaultMessage": "!!!Use System Default ({default})", - "file": "src/i18n/globalMessages.js", - "start": { - "line": 16, - "column": 29 - }, - "end": { - "line": 19, - "column": 3 - } - }, - { - "id": "global.spellchecking.autodetect", - "defaultMessage": "!!!Detect language automatically", - "file": "src/i18n/globalMessages.js", - "start": { - "line": 20, - "column": 34 - }, - "end": { - "line": 23, - "column": 3 - } - }, - { - "id": "global.spellchecking.autodetect.short", - "defaultMessage": "!!!Automatic", - "file": "src/i18n/globalMessages.js", - "start": { - "line": 24, - "column": 39 - }, - "end": { - "line": 27, - "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 deleted file mode 100644 index a2ce34cd4..000000000 --- a/src/i18n/messages/src/lib/Menu.json +++ /dev/null @@ -1,691 +0,0 @@ -[ - { - "id": "menu.edit", - "defaultMessage": "!!!Edit", - "file": "src/lib/Menu.js", - "start": { - "line": 14, - "column": 8 - }, - "end": { - "line": 17, - "column": 3 - } - }, - { - "id": "menu.edit.undo", - "defaultMessage": "!!!Undo", - "file": "src/lib/Menu.js", - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 21, - "column": 3 - } - }, - { - "id": "menu.edit.redo", - "defaultMessage": "!!!Redo", - "file": "src/lib/Menu.js", - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 25, - "column": 3 - } - }, - { - "id": "menu.edit.cut", - "defaultMessage": "!!!Cut", - "file": "src/lib/Menu.js", - "start": { - "line": 26, - "column": 7 - }, - "end": { - "line": 29, - "column": 3 - } - }, - { - "id": "menu.edit.copy", - "defaultMessage": "!!!Copy", - "file": "src/lib/Menu.js", - "start": { - "line": 30, - "column": 8 - }, - "end": { - "line": 33, - "column": 3 - } - }, - { - "id": "menu.edit.paste", - "defaultMessage": "!!!Paste", - "file": "src/lib/Menu.js", - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 37, - "column": 3 - } - }, - { - "id": "menu.edit.pasteAndMatchStyle", - "defaultMessage": "!!!Paste And Match Style", - "file": "src/lib/Menu.js", - "start": { - "line": 38, - "column": 22 - }, - "end": { - "line": 41, - "column": 3 - } - }, - { - "id": "menu.edit.delete", - "defaultMessage": "!!!Delete", - "file": "src/lib/Menu.js", - "start": { - "line": 42, - "column": 10 - }, - "end": { - "line": 45, - "column": 3 - } - }, - { - "id": "menu.edit.selectAll", - "defaultMessage": "!!!Select All", - "file": "src/lib/Menu.js", - "start": { - "line": 46, - "column": 13 - }, - "end": { - "line": 49, - "column": 3 - } - }, - { - "id": "menu.edit.speech", - "defaultMessage": "!!!Speech", - "file": "src/lib/Menu.js", - "start": { - "line": 50, - "column": 10 - }, - "end": { - "line": 53, - "column": 3 - } - }, - { - "id": "menu.edit.startSpeaking", - "defaultMessage": "!!!Start Speaking", - "file": "src/lib/Menu.js", - "start": { - "line": 54, - "column": 17 - }, - "end": { - "line": 57, - "column": 3 - } - }, - { - "id": "menu.edit.stopSpeaking", - "defaultMessage": "!!!Stop Speaking", - "file": "src/lib/Menu.js", - "start": { - "line": 58, - "column": 16 - }, - "end": { - "line": 61, - "column": 3 - } - }, - { - "id": "menu.edit.startDictation", - "defaultMessage": "!!!Start Dictation", - "file": "src/lib/Menu.js", - "start": { - "line": 62, - "column": 18 - }, - "end": { - "line": 65, - "column": 3 - } - }, - { - "id": "menu.edit.emojiSymbols", - "defaultMessage": "!!!Emoji & Symbols", - "file": "src/lib/Menu.js", - "start": { - "line": 66, - "column": 16 - }, - "end": { - "line": 69, - "column": 3 - } - }, - { - "id": "menu.view.resetZoom", - "defaultMessage": "!!!Actual Size", - "file": "src/lib/Menu.js", - "start": { - "line": 70, - "column": 13 - }, - "end": { - "line": 73, - "column": 3 - } - }, - { - "id": "menu.view.zoomIn", - "defaultMessage": "!!!Zoom In", - "file": "src/lib/Menu.js", - "start": { - "line": 74, - "column": 10 - }, - "end": { - "line": 77, - "column": 3 - } - }, - { - "id": "menu.view.zoomOut", - "defaultMessage": "!!!Zoom Out", - "file": "src/lib/Menu.js", - "start": { - "line": 78, - "column": 11 - }, - "end": { - "line": 81, - "column": 3 - } - }, - { - "id": "menu.view.enterFullScreen", - "defaultMessage": "!!!Enter Full Screen", - "file": "src/lib/Menu.js", - "start": { - "line": 82, - "column": 19 - }, - "end": { - "line": 85, - "column": 3 - } - }, - { - "id": "menu.view.exitFullScreen", - "defaultMessage": "!!!Exit Full Screen", - "file": "src/lib/Menu.js", - "start": { - "line": 86, - "column": 18 - }, - "end": { - "line": 89, - "column": 3 - } - }, - { - "id": "menu.view.toggleFullScreen", - "defaultMessage": "!!!Toggle Full Screen", - "file": "src/lib/Menu.js", - "start": { - "line": 90, - "column": 20 - }, - "end": { - "line": 93, - "column": 3 - } - }, - { - "id": "menu.view.toggleDevTools", - "defaultMessage": "!!!Toggle Developer Tools", - "file": "src/lib/Menu.js", - "start": { - "line": 94, - "column": 18 - }, - "end": { - "line": 97, - "column": 3 - } - }, - { - "id": "menu.view.toggleServiceDevTools", - "defaultMessage": "!!!Toggle Service Developer Tools", - "file": "src/lib/Menu.js", - "start": { - "line": 98, - "column": 25 - }, - "end": { - "line": 101, - "column": 3 - } - }, - { - "id": "menu.view.reloadService", - "defaultMessage": "!!!Reload Service", - "file": "src/lib/Menu.js", - "start": { - "line": 102, - "column": 17 - }, - "end": { - "line": 105, - "column": 3 - } - }, - { - "id": "menu.view.reloadFranz", - "defaultMessage": "!!!Reload Franz", - "file": "src/lib/Menu.js", - "start": { - "line": 106, - "column": 15 - }, - "end": { - "line": 109, - "column": 3 - } - }, - { - "id": "menu.window.minimize", - "defaultMessage": "!!!Minimize", - "file": "src/lib/Menu.js", - "start": { - "line": 110, - "column": 12 - }, - "end": { - "line": 113, - "column": 3 - } - }, - { - "id": "menu.window.close", - "defaultMessage": "!!!Close", - "file": "src/lib/Menu.js", - "start": { - "line": 114, - "column": 9 - }, - "end": { - "line": 117, - "column": 3 - } - }, - { - "id": "menu.help.learnMore", - "defaultMessage": "!!!Learn More", - "file": "src/lib/Menu.js", - "start": { - "line": 118, - "column": 13 - }, - "end": { - "line": 121, - "column": 3 - } - }, - { - "id": "menu.help.changelog", - "defaultMessage": "!!!Changelog", - "file": "src/lib/Menu.js", - "start": { - "line": 122, - "column": 13 - }, - "end": { - "line": 125, - "column": 3 - } - }, - { - "id": "menu.help.support", - "defaultMessage": "!!!Support", - "file": "src/lib/Menu.js", - "start": { - "line": 126, - "column": 11 - }, - "end": { - "line": 129, - "column": 3 - } - }, - { - "id": "menu.help.tos", - "defaultMessage": "!!!Terms of Service", - "file": "src/lib/Menu.js", - "start": { - "line": 130, - "column": 7 - }, - "end": { - "line": 133, - "column": 3 - } - }, - { - "id": "menu.help.privacy", - "defaultMessage": "!!!Privacy Statement", - "file": "src/lib/Menu.js", - "start": { - "line": 134, - "column": 11 - }, - "end": { - "line": 137, - "column": 3 - } - }, - { - "id": "menu.file", - "defaultMessage": "!!!File", - "file": "src/lib/Menu.js", - "start": { - "line": 138, - "column": 8 - }, - "end": { - "line": 141, - "column": 3 - } - }, - { - "id": "menu.view", - "defaultMessage": "!!!View", - "file": "src/lib/Menu.js", - "start": { - "line": 142, - "column": 8 - }, - "end": { - "line": 145, - "column": 3 - } - }, - { - "id": "menu.services", - "defaultMessage": "!!!Services", - "file": "src/lib/Menu.js", - "start": { - "line": 146, - "column": 12 - }, - "end": { - "line": 149, - "column": 3 - } - }, - { - "id": "menu.window", - "defaultMessage": "!!!Window", - "file": "src/lib/Menu.js", - "start": { - "line": 150, - "column": 10 - }, - "end": { - "line": 153, - "column": 3 - } - }, - { - "id": "menu.help", - "defaultMessage": "!!!Help", - "file": "src/lib/Menu.js", - "start": { - "line": 154, - "column": 8 - }, - "end": { - "line": 157, - "column": 3 - } - }, - { - "id": "menu.app.about", - "defaultMessage": "!!!About Franz", - "file": "src/lib/Menu.js", - "start": { - "line": 158, - "column": 9 - }, - "end": { - "line": 161, - "column": 3 - } - }, - { - "id": "menu.app.announcement", - "defaultMessage": "!!!What's new?", - "file": "src/lib/Menu.js", - "start": { - "line": 162, - "column": 16 - }, - "end": { - "line": 165, - "column": 3 - } - }, - { - "id": "menu.app.settings", - "defaultMessage": "!!!Settings", - "file": "src/lib/Menu.js", - "start": { - "line": 166, - "column": 12 - }, - "end": { - "line": 169, - "column": 3 - } - }, - { - "id": "menu.app.hide", - "defaultMessage": "!!!Hide", - "file": "src/lib/Menu.js", - "start": { - "line": 170, - "column": 8 - }, - "end": { - "line": 173, - "column": 3 - } - }, - { - "id": "menu.app.hideOthers", - "defaultMessage": "!!!Hide Others", - "file": "src/lib/Menu.js", - "start": { - "line": 174, - "column": 14 - }, - "end": { - "line": 177, - "column": 3 - } - }, - { - "id": "menu.app.unhide", - "defaultMessage": "!!!Unhide", - "file": "src/lib/Menu.js", - "start": { - "line": 178, - "column": 10 - }, - "end": { - "line": 181, - "column": 3 - } - }, - { - "id": "menu.app.quit", - "defaultMessage": "!!!Quit", - "file": "src/lib/Menu.js", - "start": { - "line": 182, - "column": 8 - }, - "end": { - "line": 185, - "column": 3 - } - }, - { - "id": "menu.services.addNewService", - "defaultMessage": "!!!Add New Service...", - "file": "src/lib/Menu.js", - "start": { - "line": 186, - "column": 17 - }, - "end": { - "line": 189, - "column": 3 - } - }, - { - "id": "menu.workspaces.addNewWorkspace", - "defaultMessage": "!!!Add New Workspace...", - "file": "src/lib/Menu.js", - "start": { - "line": 190, - "column": 19 - }, - "end": { - "line": 193, - "column": 3 - } - }, - { - "id": "menu.workspaces.openWorkspaceDrawer", - "defaultMessage": "!!!Open workspace drawer", - "file": "src/lib/Menu.js", - "start": { - "line": 194, - "column": 23 - }, - "end": { - "line": 197, - "column": 3 - } - }, - { - "id": "menu.workspaces.closeWorkspaceDrawer", - "defaultMessage": "!!!Close workspace drawer", - "file": "src/lib/Menu.js", - "start": { - "line": 198, - "column": 24 - }, - "end": { - "line": 201, - "column": 3 - } - }, - { - "id": "menu.services.setNextServiceActive", - "defaultMessage": "!!!Activate next service...", - "file": "src/lib/Menu.js", - "start": { - "line": 202, - "column": 23 - }, - "end": { - "line": 205, - "column": 3 - } - }, - { - "id": "menu.services.activatePreviousService", - "defaultMessage": "!!!Activate previous service...", - "file": "src/lib/Menu.js", - "start": { - "line": 206, - "column": 27 - }, - "end": { - "line": 209, - "column": 3 - } - }, - { - "id": "sidebar.muteApp", - "defaultMessage": "!!!Disable notifications & audio", - "file": "src/lib/Menu.js", - "start": { - "line": 210, - "column": 11 - }, - "end": { - "line": 213, - "column": 3 - } - }, - { - "id": "sidebar.unmuteApp", - "defaultMessage": "!!!Enable notifications & audio", - "file": "src/lib/Menu.js", - "start": { - "line": 214, - "column": 13 - }, - "end": { - "line": 217, - "column": 3 - } - }, - { - "id": "menu.workspaces", - "defaultMessage": "!!!Workspaces", - "file": "src/lib/Menu.js", - "start": { - "line": 218, - "column": 14 - }, - "end": { - "line": 221, - "column": 3 - } - }, - { - "id": "menu.workspaces.defaultWorkspace", - "defaultMessage": "!!!Default", - "file": "src/lib/Menu.js", - "start": { - "line": 222, - "column": 20 - }, - "end": { - "line": 225, - "column": 3 - } - } -] \ No newline at end of file diff --git a/src/index.js b/src/index.js index 05c793d98..3fe996aa7 100644 --- a/src/index.js +++ b/src/index.js @@ -305,6 +305,20 @@ const createWindow = () => { }); }; +// Allow passing command line parameters/switches to electron +// https://electronjs.org/docs/api/chrome-command-line-switches +// used for Kerberos support +// Usage e.g. MACOS +// $ Franz.app/Contents/MacOS/Franz --auth-server-whitelist *.mydomain.com --auth-negotiate-delegate-whitelist *.mydomain.com +const argv = require('minimist')(process.argv.slice(1)); + +if (argv['auth-server-whitelist']) { + app.commandLine.appendSwitch('auth-server-whitelist', argv['auth-server-whitelist']); +} +if (argv['auth-negotiate-delegate-whitelist']) { + app.commandLine.appendSwitch('auth-negotiate-delegate-whitelist', argv['auth-negotiate-delegate-whitelist']); +} + // This method will be called when Electron has finished // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs. diff --git a/src/stores/UserStore.js b/src/stores/UserStore.js index 534690fbb..31555dd5c 100644 --- a/src/stores/UserStore.js +++ b/src/stores/UserStore.js @@ -178,6 +178,7 @@ export default class UserStore extends Store { password, accountType, company, + locale: this.stores.app.locale, }); this.hasCompletedSignup = false; diff --git a/src/stores/lib/Reaction.js b/src/stores/lib/Reaction.js index b123ec01c..f2642908f 100644 --- a/src/stores/lib/Reaction.js +++ b/src/stores/lib/Reaction.js @@ -1,4 +1,3 @@ -// @flow import { autorun } from 'mobx'; export default class Reaction { @@ -15,14 +14,18 @@ export default class Reaction { start() { if (!this.isRunning) { this.dispose = autorun(() => this.reaction()); - this.isRunning = true; + this.isActive = true; } } stop() { if (this.isRunning) { this.dispose(); - this.isRunning = true; + this.isActive = false; } } } + +export const createReactions = reactions => ( + reactions.map(r => new Reaction(r)) +); -- cgit v1.2.3-70-g09d2 From 17f3a22e4193dfcf8dfd5cbd5aa2e812f2cbd6ae Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 8 May 2019 13:57:03 +0200 Subject: fix(Workspaces): Service reordering within workspaces --- src/features/workspaces/store.js | 12 ++++++++++++ src/stores/ServicesStore.js | 11 ++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'src/features/workspaces/store.js') diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index e11513d1f..e0bef8aea 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -57,6 +57,10 @@ export default class WorkspacesStore extends FeatureStore { return !this.isPremiumUpgradeRequired; } + @computed get isAnyWorkspaceActive() { + return !!this.activeWorkspace; + } + // ========== PRIVATE PROPERTIES ========= // _wasDrawerOpenBeforeSettingsRoute = null; @@ -229,6 +233,14 @@ export default class WorkspacesStore extends FeatureStore { this.actions.ui.openSettings({ path: 'workspaces' }); }; + @action reorderServicesOfActiveWorkspace = async ({ oldIndex, newIndex }) => { + const { activeWorkspace } = this; + const { services } = activeWorkspace; + // Move services from the old to the new position + services.splice(newIndex, 0, services.splice(oldIndex, 1)[0]); + await updateWorkspaceRequest.execute(activeWorkspace); + }; + // Reactions _setFeatureEnabledReaction = () => { diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 13f929c2f..d22a943d6 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js @@ -517,7 +517,16 @@ export default class ServicesStore extends Store { this.actions.ui.toggleServiceUpdatedInfoBar({ visible: false }); } - @action _reorder({ oldIndex, newIndex }) { + @action _reorder(params) { + const { workspaces } = this.stores; + if (workspaces.isAnyWorkspaceActive) { + workspaces.reorderServicesOfActiveWorkspace(params); + } else { + this._reorderService(params); + } + } + + @action _reorderService({ oldIndex, newIndex }) { const showDisabledServices = this.stores.settings.all.app.showDisabledServices; const oldEnabledSortIndex = showDisabledServices ? oldIndex : this.all.indexOf(this.enabled[oldIndex]); const newEnabledSortIndex = showDisabledServices ? newIndex : this.all.indexOf(this.enabled[newIndex]); -- cgit v1.2.3-70-g09d2 From 1e38ec5e524c71ae89cd7d4956736494b8c13886 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 8 May 2019 17:02:09 +0200 Subject: fix(Announcements): Fixes issue with rendering announcments in workspaces --- packages/theme/src/themes/dark/index.ts | 2 +- src/actions/service.js | 1 + src/app.js | 3 ++ src/components/layout/AppLayout.js | 5 +-- src/containers/layout/AppLayoutContainer.js | 1 - .../announcements/components/AnnouncementScreen.js | 2 +- src/features/announcements/index.js | 4 +++ src/features/announcements/store.js | 41 +++++++++++----------- src/features/workspaces/store.js | 8 +++-- src/stores/ServicesStore.js | 3 +- 10 files changed, 38 insertions(+), 32 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/packages/theme/src/themes/dark/index.ts b/packages/theme/src/themes/dark/index.ts index d48dbf916..bd9f001e8 100644 --- a/packages/theme/src/themes/dark/index.ts +++ b/packages/theme/src/themes/dark/index.ts @@ -113,7 +113,7 @@ export const workspaces = merge({}, defaultStyles.workspaces, { }); // Announcements -export const announcements = merge({}, defaultStyles.workspaces, { +export const announcements = merge({}, defaultStyles.announcements, { spotlight: { background: legacyStyles.darkThemeGrayDark, }, diff --git a/src/actions/service.js b/src/actions/service.js index ce62560a9..68c62d594 100644 --- a/src/actions/service.js +++ b/src/actions/service.js @@ -4,6 +4,7 @@ import ServiceModel from '../models/Service'; export default { setActive: { serviceId: PropTypes.string.isRequired, + keepActiveRoute: PropTypes.bool, }, blurActive: {}, setActiveNext: {}, diff --git a/src/app.js b/src/app.js index f6092bf60..cb3e37c64 100644 --- a/src/app.js +++ b/src/app.js @@ -43,6 +43,8 @@ import SubscriptionPopupScreen from './containers/subscription/SubscriptionPopup import WorkspacesScreen from './features/workspaces/containers/WorkspacesScreen'; import EditWorkspaceScreen from './features/workspaces/containers/EditWorkspaceScreen'; import { WORKSPACES_ROUTES } from './features/workspaces'; +import AnnouncementScreen from './features/announcements/components/AnnouncementScreen'; +import { ANNOUNCEMENTS_ROUTES } from './features/announcements'; // Add Polyfills smoothScroll.polyfill(); @@ -73,6 +75,7 @@ window.addEventListener('load', () => { + diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index d5febfaf4..fa83842a4 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js @@ -83,7 +83,6 @@ class AppLayout extends Component { areRequiredRequestsLoading: PropTypes.bool.isRequired, darkMode: PropTypes.bool.isRequired, isDelayAppScreenVisible: PropTypes.bool.isRequired, - isAnnouncementVisible: PropTypes.bool.isRequired, }; static defaultProps = { @@ -117,7 +116,6 @@ class AppLayout extends Component { areRequiredRequestsLoading, darkMode, isDelayAppScreenVisible, - isAnnouncementVisible, } = this.props; const { intl } = this.context; @@ -197,12 +195,11 @@ class AppLayout extends Component { {isDelayAppScreenVisible && ()} - {isAnnouncementVisible && ()} {services} + {children}
- {children}
); diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index d2891a6a4..83b3c27da 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js @@ -151,7 +151,6 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e areRequiredRequestsLoading={requests.areRequiredRequestsLoading} darkMode={settings.all.app.darkMode} isDelayAppScreenVisible={delayAppState.isDelayAppScreenVisible} - isAnnouncementVisible={announcementsStore.isAnnouncementVisible} > {React.Children.count(children) > 0 ? children : null} diff --git a/src/features/announcements/components/AnnouncementScreen.js b/src/features/announcements/components/AnnouncementScreen.js index dfce6cdd5..e7c5fe395 100644 --- a/src/features/announcements/components/AnnouncementScreen.js +++ b/src/features/announcements/components/AnnouncementScreen.js @@ -268,7 +268,7 @@ class AnnouncementScreen extends Component {

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

{ - if (!this.areNewsAvailable) return; + const { router } = this.stores; this.targetVersion = targetVersion || this.currentVersion; - this.isAnnouncementVisible = true; - this.actions.service.blurActive(); this._updateSettings({ lastSeenAnnouncementVersion: this.currentVersion, }); - const dispose = reaction( - () => this.stores.services.active, - () => { - this._hideAnnouncement(); - dispose(); - }, - ); - + const targetRoute = `/announcements/${this.targetVersion}`; + if (router.location.pathname !== targetRoute) { + this.stores.router.push(targetRoute); + } gaEvent(GA_CATEGORY_ANNOUNCEMENTS, 'show'); }; - @action _hideAnnouncement() { - this.isAnnouncementVisible = false; - } - // ======= REACTIONS ======== _showAnnouncementToUsersWhoUpdatedApp = () => { const { announcement, isNewUser } = this; - // Check if there is an announcement and on't show announcements to new users + // 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) @@ -140,5 +130,14 @@ export class AnnouncementsStore extends FeatureStore { } else { getAnnouncementRequest.reset(); } + }; + + _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/workspaces/store.js b/src/features/workspaces/store.js index e11513d1f..3d7043413 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -255,13 +255,15 @@ export default class WorkspacesStore extends FeatureStore { _setActiveServiceOnWorkspaceSwitchReaction = () => { if (!this.isFeatureActive) return; if (this.activeWorkspace) { - const services = this.stores.services.allDisplayed; - const activeService = services.find(s => s.isActive); + const activeService = this.stores.services.active; const workspaceServices = this.getWorkspaceServices(this.activeWorkspace); if (workspaceServices.length <= 0) return; const isActiveServiceInWorkspace = workspaceServices.includes(activeService); if (!isActiveServiceInWorkspace) { - this.actions.service.setActive({ serviceId: workspaceServices[0].id }); + this.actions.service.setActive({ + serviceId: workspaceServices[0].id, + keepActiveRoute: true, + }); } } }; diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 13f929c2f..17150a023 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js @@ -291,7 +291,8 @@ export default class ServicesStore extends Store { gaEvent('Service', 'clear cache'); } - @action _setActive({ serviceId }) { + @action _setActive({ serviceId, keepActiveRoute }) { + if (!keepActiveRoute) this.stores.router.push('/'); const service = this.one(serviceId); this.all.forEach((s, index) => { -- cgit v1.2.3-70-g09d2