diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-04-16 11:48:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-16 11:48:04 +0200 |
commit | 65c6a5709a5f2acd527ade8dd01031f8dea654c9 (patch) | |
tree | 8a49a5e84333fab64dee113da0608e45fdb7ddc1 | |
parent | Fix linting issue (diff) | |
parent | increase app opens to show share franz overlay (diff) | |
download | ferdium-app-65c6a5709a5f2acd527ade8dd01031f8dea654c9.tar.gz ferdium-app-65c6a5709a5f2acd527ade8dd01031f8dea654c9.tar.zst ferdium-app-65c6a5709a5f2acd527ade8dd01031f8dea654c9.zip |
Merge branch 'develop' into chore/streamline-dashboard
-rw-r--r-- | src/config.js | 3 | ||||
-rw-r--r-- | src/features/shareFranz/index.js | 2 | ||||
-rw-r--r-- | src/features/workspaces/components/EditWorkspaceForm.js | 41 | ||||
-rw-r--r-- | src/features/workspaces/components/WorkspacesDashboard.js | 38 | ||||
-rw-r--r-- | src/i18n/locales/defaultMessages.json | 26 | ||||
-rw-r--r-- | src/i18n/messages/src/features/workspaces/components/EditWorkspaceForm.json | 26 | ||||
-rw-r--r-- | src/lib/analytics.js | 20 | ||||
-rw-r--r-- | src/stores/ServicesStore.js | 4 |
8 files changed, 136 insertions, 24 deletions
diff --git a/src/config.js b/src/config.js index 92d456896..5bc318545 100644 --- a/src/config.js +++ b/src/config.js | |||
@@ -9,6 +9,7 @@ const app = process.type === 'renderer' ? electron.remote.app : electron.app; | |||
9 | const systemPreferences = process.type === 'renderer' ? electron.remote.systemPreferences : electron.systemPreferences; | 9 | const systemPreferences = process.type === 'renderer' ? electron.remote.systemPreferences : electron.systemPreferences; |
10 | 10 | ||
11 | export const CHECK_INTERVAL = ms('1h'); // How often should we perform checks | 11 | export const CHECK_INTERVAL = ms('1h'); // How often should we perform checks |
12 | |||
12 | export const LOCAL_API = 'http://localhost:3000'; | 13 | export const LOCAL_API = 'http://localhost:3000'; |
13 | export const DEV_API = 'https://dev.franzinfra.com'; | 14 | export const DEV_API = 'https://dev.franzinfra.com'; |
14 | export const LIVE_API = 'https://api.franzinfra.com'; | 15 | export const LIVE_API = 'https://api.franzinfra.com'; |
@@ -21,6 +22,8 @@ export const LOCAL_API_WEBSITE = 'http://localhost:3333'; | |||
21 | export const DEV_API_WEBSITE = 'https://meetfranz.com'; | 22 | export const DEV_API_WEBSITE = 'https://meetfranz.com'; |
22 | export const LIVE_API_WEBSITE = 'https://meetfranz.com'; | 23 | export const LIVE_API_WEBSITE = 'https://meetfranz.com'; |
23 | 24 | ||
25 | export const STATS_API = 'https://stats.franzinfra.com'; | ||
26 | |||
24 | export const GA_ID = !isDevMode ? 'UA-74126766-10' : 'UA-74126766-12'; | 27 | export const GA_ID = !isDevMode ? 'UA-74126766-10' : 'UA-74126766-12'; |
25 | 28 | ||
26 | export const DEFAULT_APP_SETTINGS = { | 29 | export const DEFAULT_APP_SETTINGS = { |
diff --git a/src/features/shareFranz/index.js b/src/features/shareFranz/index.js index 3a8ec95d3..87deacef4 100644 --- a/src/features/shareFranz/index.js +++ b/src/features/shareFranz/index.js | |||
@@ -35,7 +35,7 @@ export default function initialize(stores) { | |||
35 | () => stores.user.isLoggedIn, | 35 | () => stores.user.isLoggedIn, |
36 | () => { | 36 | () => { |
37 | setTimeout(() => { | 37 | setTimeout(() => { |
38 | if (stores.settings.stats.appStarts % 30 === 0) { | 38 | if (stores.settings.stats.appStarts % 50 === 0) { |
39 | if (delayAppState.isDelayAppScreenVisible) { | 39 | if (delayAppState.isDelayAppScreenVisible) { |
40 | debug('Delaying share modal by 5 minutes'); | 40 | debug('Delaying share modal by 5 minutes'); |
41 | setTimeout(() => showModal(), ms('5m')); | 41 | setTimeout(() => showModal(), ms('5m')); |
diff --git a/src/features/workspaces/components/EditWorkspaceForm.js b/src/features/workspaces/components/EditWorkspaceForm.js index bba4485ff..e602ebd5a 100644 --- a/src/features/workspaces/components/EditWorkspaceForm.js +++ b/src/features/workspaces/components/EditWorkspaceForm.js | |||
@@ -1,4 +1,4 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component, Fragment } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, intlShape } from 'react-intl'; |
@@ -36,6 +36,14 @@ const messages = defineMessages({ | |||
36 | id: 'settings.workspace.form.servicesInWorkspaceHeadline', | 36 | id: 'settings.workspace.form.servicesInWorkspaceHeadline', |
37 | defaultMessage: '!!!Services in this Workspace', | 37 | defaultMessage: '!!!Services in this Workspace', |
38 | }, | 38 | }, |
39 | noServicesAdded: { | ||
40 | id: 'settings.services.noServicesAdded', | ||
41 | defaultMessage: '!!!You haven\'t added any services yet.', | ||
42 | }, | ||
43 | discoverServices: { | ||
44 | id: 'settings.services.discoverServices', | ||
45 | defaultMessage: '!!!Discover services', | ||
46 | }, | ||
39 | }); | 47 | }); |
40 | 48 | ||
41 | const styles = () => ({ | 49 | const styles = () => ({ |
@@ -150,14 +158,29 @@ class EditWorkspaceForm extends Component { | |||
150 | </div> | 158 | </div> |
151 | <h2>{intl.formatMessage(messages.servicesInWorkspaceHeadline)}</h2> | 159 | <h2>{intl.formatMessage(messages.servicesInWorkspaceHeadline)}</h2> |
152 | <div className={classes.serviceList}> | 160 | <div className={classes.serviceList}> |
153 | {services.map(s => ( | 161 | {services.length === 0 ? ( |
154 | <WorkspaceServiceListItem | 162 | <div className="align-middle settings__empty-state"> |
155 | key={s.id} | 163 | {/* ===== Empty state ===== */} |
156 | service={s} | 164 | <p className="settings__empty-text"> |
157 | isInWorkspace={workspaceServices.includes(s.id)} | 165 | <span className="emoji"> |
158 | onToggle={() => this.toggleService(s)} | 166 | <img src="./assets/images/emoji/sad.png" alt="" /> |
159 | /> | 167 | </span> |
160 | ))} | 168 | {intl.formatMessage(messages.noServicesAdded)} |
169 | </p> | ||
170 | <Link to="/settings/recipes" className="button">{intl.formatMessage(messages.discoverServices)}</Link> | ||
171 | </div> | ||
172 | ) : ( | ||
173 | <Fragment> | ||
174 | {services.map(s => ( | ||
175 | <WorkspaceServiceListItem | ||
176 | key={s.id} | ||
177 | service={s} | ||
178 | isInWorkspace={workspaceServices.includes(s.id)} | ||
179 | onToggle={() => this.toggleService(s)} | ||
180 | /> | ||
181 | ))} | ||
182 | </Fragment> | ||
183 | )} | ||
161 | </div> | 184 | </div> |
162 | </div> | 185 | </div> |
163 | <div className="settings__controls"> | 186 | <div className="settings__controls"> |
diff --git a/src/features/workspaces/components/WorkspacesDashboard.js b/src/features/workspaces/components/WorkspacesDashboard.js index dd4381a15..09c98ab8c 100644 --- a/src/features/workspaces/components/WorkspacesDashboard.js +++ b/src/features/workspaces/components/WorkspacesDashboard.js | |||
@@ -170,18 +170,32 @@ class WorkspacesDashboard extends Component { | |||
170 | {intl.formatMessage(messages.workspacesRequestFailed)} | 170 | {intl.formatMessage(messages.workspacesRequestFailed)} |
171 | </Infobox> | 171 | </Infobox> |
172 | ) : ( | 172 | ) : ( |
173 | <table className={classes.table}> | 173 | <Fragment> |
174 | {/* ===== Workspaces list ===== */} | 174 | {workspaces.length === 0 ? ( |
175 | <tbody> | 175 | <div className="align-middle settings__empty-state"> |
176 | {workspaces.map(workspace => ( | 176 | {/* ===== Workspaces empty state ===== */} |
177 | <WorkspaceItem | 177 | <p className="settings__empty-text"> |
178 | key={workspace.id} | 178 | <span className="emoji"> |
179 | workspace={workspace} | 179 | <img src="./assets/images/emoji/sad.png" alt="" /> |
180 | onItemClick={w => onWorkspaceClick(w)} | 180 | </span> |
181 | /> | 181 | {intl.formatMessage(messages.noServicesAdded)} |
182 | ))} | 182 | </p> |
183 | </tbody> | 183 | </div> |
184 | </table> | 184 | ) : ( |
185 | <table className={classes.table}> | ||
186 | {/* ===== Workspaces list ===== */} | ||
187 | <tbody> | ||
188 | {workspaces.map(workspace => ( | ||
189 | <WorkspaceItem | ||
190 | key={workspace.id} | ||
191 | workspace={workspace} | ||
192 | onItemClick={w => onWorkspaceClick(w)} | ||
193 | /> | ||
194 | ))} | ||
195 | </tbody> | ||
196 | </table> | ||
197 | )} | ||
198 | </Fragment> | ||
185 | )} | 199 | )} |
186 | </Fragment> | 200 | </Fragment> |
187 | )} | 201 | )} |
diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 712434a8b..f0a687b0f 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json | |||
@@ -3443,6 +3443,32 @@ | |||
3443 | "column": 31, | 3443 | "column": 31, |
3444 | "line": 35 | 3444 | "line": 35 |
3445 | } | 3445 | } |
3446 | }, | ||
3447 | { | ||
3448 | "defaultMessage": "!!!You haven't added any services yet.", | ||
3449 | "end": { | ||
3450 | "column": 3, | ||
3451 | "line": 42 | ||
3452 | }, | ||
3453 | "file": "src/features/workspaces/components/EditWorkspaceForm.js", | ||
3454 | "id": "settings.services.noServicesAdded", | ||
3455 | "start": { | ||
3456 | "column": 19, | ||
3457 | "line": 39 | ||
3458 | } | ||
3459 | }, | ||
3460 | { | ||
3461 | "defaultMessage": "!!!Discover services", | ||
3462 | "end": { | ||
3463 | "column": 3, | ||
3464 | "line": 46 | ||
3465 | }, | ||
3466 | "file": "src/features/workspaces/components/EditWorkspaceForm.js", | ||
3467 | "id": "settings.services.discoverServices", | ||
3468 | "start": { | ||
3469 | "column": 20, | ||
3470 | "line": 43 | ||
3471 | } | ||
3446 | } | 3472 | } |
3447 | ], | 3473 | ], |
3448 | "path": "src/features/workspaces/components/EditWorkspaceForm.json" | 3474 | "path": "src/features/workspaces/components/EditWorkspaceForm.json" |
diff --git a/src/i18n/messages/src/features/workspaces/components/EditWorkspaceForm.json b/src/i18n/messages/src/features/workspaces/components/EditWorkspaceForm.json index 7b0c3e1ce..20ed99f8d 100644 --- a/src/i18n/messages/src/features/workspaces/components/EditWorkspaceForm.json +++ b/src/i18n/messages/src/features/workspaces/components/EditWorkspaceForm.json | |||
@@ -63,5 +63,31 @@ | |||
63 | "line": 38, | 63 | "line": 38, |
64 | "column": 3 | 64 | "column": 3 |
65 | } | 65 | } |
66 | }, | ||
67 | { | ||
68 | "id": "settings.services.noServicesAdded", | ||
69 | "defaultMessage": "!!!You haven't added any services yet.", | ||
70 | "file": "src/features/workspaces/components/EditWorkspaceForm.js", | ||
71 | "start": { | ||
72 | "line": 39, | ||
73 | "column": 19 | ||
74 | }, | ||
75 | "end": { | ||
76 | "line": 42, | ||
77 | "column": 3 | ||
78 | } | ||
79 | }, | ||
80 | { | ||
81 | "id": "settings.services.discoverServices", | ||
82 | "defaultMessage": "!!!Discover services", | ||
83 | "file": "src/features/workspaces/components/EditWorkspaceForm.js", | ||
84 | "start": { | ||
85 | "line": 43, | ||
86 | "column": 20 | ||
87 | }, | ||
88 | "end": { | ||
89 | "line": 46, | ||
90 | "column": 3 | ||
91 | } | ||
66 | } | 92 | } |
67 | ] \ No newline at end of file | 93 | ] \ No newline at end of file |
diff --git a/src/lib/analytics.js b/src/lib/analytics.js index e7daa9d06..663aafe22 100644 --- a/src/lib/analytics.js +++ b/src/lib/analytics.js | |||
@@ -1,5 +1,8 @@ | |||
1 | import { remote } from 'electron'; | 1 | import { remote } from 'electron'; |
2 | import { GA_ID } from '../config'; | 2 | import querystring from 'querystring'; |
3 | |||
4 | import { GA_ID, STATS_API } from '../config'; | ||
5 | import { isDevMode } from '../environment'; | ||
3 | 6 | ||
4 | const debug = require('debug')('Franz:Analytics'); | 7 | const debug = require('debug')('Franz:Analytics'); |
5 | 8 | ||
@@ -35,3 +38,18 @@ export function gaEvent(category, action, label) { | |||
35 | ga('send', 'event', category, action, label); | 38 | ga('send', 'event', category, action, label); |
36 | debug('GA track event', category, action, label); | 39 | debug('GA track event', category, action, label); |
37 | } | 40 | } |
41 | |||
42 | export function statsEvent(key, value) { | ||
43 | const params = { | ||
44 | key, | ||
45 | value, | ||
46 | platform: process.platform, | ||
47 | version: remote.app.getVersion(), | ||
48 | }; | ||
49 | |||
50 | debug('Send Franz stats event', params); | ||
51 | |||
52 | if (!isDevMode) { | ||
53 | window.fetch(`${STATS_API}/event/?${querystring.stringify(params)}`); | ||
54 | } | ||
55 | } | ||
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index d04fdd0c5..13f929c2f 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -11,7 +11,7 @@ import Store from './lib/Store'; | |||
11 | import Request from './lib/Request'; | 11 | import Request from './lib/Request'; |
12 | import CachedRequest from './lib/CachedRequest'; | 12 | import CachedRequest from './lib/CachedRequest'; |
13 | import { matchRoute } from '../helpers/routing-helpers'; | 13 | import { matchRoute } from '../helpers/routing-helpers'; |
14 | import { gaEvent } from '../lib/analytics'; | 14 | import { gaEvent, statsEvent } from '../lib/analytics'; |
15 | import { workspaceStore } from '../features/workspaces'; | 15 | import { workspaceStore } from '../features/workspaces'; |
16 | 16 | ||
17 | const debug = require('debug')('Franz:ServiceStore'); | 17 | const debug = require('debug')('Franz:ServiceStore'); |
@@ -299,6 +299,8 @@ export default class ServicesStore extends Store { | |||
299 | }); | 299 | }); |
300 | service.isActive = true; | 300 | service.isActive = true; |
301 | 301 | ||
302 | statsEvent('activate-service', service.recipe.id); | ||
303 | |||
302 | this._focusActiveService(); | 304 | this._focusActiveService(); |
303 | } | 305 | } |
304 | 306 | ||