diff options
Diffstat (limited to 'src/containers')
-rw-r--r-- | src/containers/auth/AuthLayoutContainer.js | 38 | ||||
-rw-r--r-- | src/containers/auth/ImportScreen.js | 5 | ||||
-rw-r--r-- | src/containers/auth/InviteScreen.js | 5 | ||||
-rw-r--r-- | src/containers/auth/LoginScreen.js | 5 | ||||
-rw-r--r-- | src/containers/auth/PasswordScreen.js | 5 | ||||
-rw-r--r-- | src/containers/auth/PricingScreen.js | 5 | ||||
-rw-r--r-- | src/containers/auth/SignupScreen.js | 5 | ||||
-rw-r--r-- | src/containers/auth/WelcomeScreen.js | 5 | ||||
-rw-r--r-- | src/containers/layout/AppLayoutContainer.js | 21 | ||||
-rw-r--r-- | src/containers/settings/AccountScreen.js | 56 | ||||
-rw-r--r-- | src/containers/settings/EditServiceScreen.js | 45 | ||||
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 21 | ||||
-rw-r--r-- | src/containers/settings/EditUserScreen.js | 49 | ||||
-rw-r--r-- | src/containers/settings/InviteScreen.js | 6 | ||||
-rw-r--r-- | src/containers/settings/RecipesScreen.js | 6 | ||||
-rw-r--r-- | src/containers/settings/ServicesScreen.js | 5 | ||||
-rw-r--r-- | src/containers/settings/SettingsWindow.js | 2 | ||||
-rw-r--r-- | src/containers/settings/TeamScreen.js | 57 | ||||
-rw-r--r-- | src/containers/subscription/SubscriptionFormScreen.js | 39 |
19 files changed, 188 insertions, 192 deletions
diff --git a/src/containers/auth/AuthLayoutContainer.js b/src/containers/auth/AuthLayoutContainer.js index 762929dc6..e63f40c06 100644 --- a/src/containers/auth/AuthLayoutContainer.js +++ b/src/containers/auth/AuthLayoutContainer.js | |||
@@ -1,6 +1,8 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { inject, observer } from 'mobx-react'; | 3 | import { inject, observer } from 'mobx-react'; |
4 | import { ThemeProvider } from 'react-jss'; | ||
5 | import { theme } from '@meetfranz/theme'; | ||
4 | 6 | ||
5 | import AuthLayout from '../../components/auth/AuthLayout'; | 7 | import AuthLayout from '../../components/auth/AuthLayout'; |
6 | import AppStore from '../../stores/AppStore'; | 8 | import AppStore from '../../stores/AppStore'; |
@@ -21,30 +23,38 @@ export default @inject('stores', 'actions') @observer class AuthLayoutContainer | |||
21 | const { | 23 | const { |
22 | stores, actions, children, location, | 24 | stores, actions, children, location, |
23 | } = this.props; | 25 | } = this.props; |
24 | const { app, features, globalError } = stores; | 26 | const { |
27 | app, features, globalError, settings, | ||
28 | } = stores; | ||
25 | 29 | ||
26 | const isLoadingBaseFeatures = features.defaultFeaturesRequest.isExecuting | 30 | const isLoadingBaseFeatures = features.defaultFeaturesRequest.isExecuting |
27 | && !features.defaultFeaturesRequest.wasExecuted; | 31 | && !features.defaultFeaturesRequest.wasExecuted; |
28 | 32 | ||
33 | const themeType = theme(settings.app.darkMode ? 'dark' : 'default'); | ||
34 | |||
29 | if (isLoadingBaseFeatures) { | 35 | if (isLoadingBaseFeatures) { |
30 | return ( | 36 | return ( |
31 | <AppLoader /> | 37 | <ThemeProvider theme={theme(themeType)}> |
38 | <AppLoader /> | ||
39 | </ThemeProvider> | ||
32 | ); | 40 | ); |
33 | } | 41 | } |
34 | 42 | ||
35 | return ( | 43 | return ( |
36 | <AuthLayout | 44 | <ThemeProvider theme={theme(themeType)}> |
37 | error={globalError.response} | 45 | <AuthLayout |
38 | pathname={location.pathname} | 46 | error={globalError.response} |
39 | isOnline={app.isOnline} | 47 | pathname={location.pathname} |
40 | isAPIHealthy={!app.healthCheckRequest.isError} | 48 | isOnline={app.isOnline} |
41 | retryHealthCheck={actions.app.healthCheck} | 49 | isAPIHealthy={!app.healthCheckRequest.isError} |
42 | isHealthCheckLoading={app.healthCheckRequest.isExecuting} | 50 | retryHealthCheck={actions.app.healthCheck} |
43 | isFullScreen={app.isFullScreen} | 51 | isHealthCheckLoading={app.healthCheckRequest.isExecuting} |
44 | darkMode={app.isSystemDarkModeEnabled} | 52 | isFullScreen={app.isFullScreen} |
45 | > | 53 | darkMode={app.isSystemDarkModeEnabled} |
46 | {children} | 54 | > |
47 | </AuthLayout> | 55 | {children} |
56 | </AuthLayout> | ||
57 | </ThemeProvider> | ||
48 | ); | 58 | ); |
49 | } | 59 | } |
50 | } | 60 | } |
diff --git a/src/containers/auth/ImportScreen.js b/src/containers/auth/ImportScreen.js index fc46f8b54..4a93891d6 100644 --- a/src/containers/auth/ImportScreen.js +++ b/src/containers/auth/ImportScreen.js | |||
@@ -3,13 +3,8 @@ import PropTypes from 'prop-types'; | |||
3 | import { inject, observer } from 'mobx-react'; | 3 | import { inject, observer } from 'mobx-react'; |
4 | import Import from '../../components/auth/Import'; | 4 | import Import from '../../components/auth/Import'; |
5 | import UserStore from '../../stores/UserStore'; | 5 | import UserStore from '../../stores/UserStore'; |
6 | import { gaPage } from '../../lib/analytics'; | ||
7 | 6 | ||
8 | export default @inject('stores', 'actions') @observer class ImportScreen extends Component { | 7 | export default @inject('stores', 'actions') @observer class ImportScreen extends Component { |
9 | componentDidMount() { | ||
10 | gaPage('Auth/Import'); | ||
11 | } | ||
12 | |||
13 | render() { | 8 | render() { |
14 | const { actions, stores } = this.props; | 9 | const { actions, stores } = this.props; |
15 | 10 | ||
diff --git a/src/containers/auth/InviteScreen.js b/src/containers/auth/InviteScreen.js index 26bf97038..66afaf7e1 100644 --- a/src/containers/auth/InviteScreen.js +++ b/src/containers/auth/InviteScreen.js | |||
@@ -2,13 +2,8 @@ import React, { Component } from 'react'; | |||
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { inject, observer } from 'mobx-react'; | 3 | import { inject, observer } from 'mobx-react'; |
4 | import Invite from '../../components/auth/Invite'; | 4 | import Invite from '../../components/auth/Invite'; |
5 | import { gaPage } from '../../lib/analytics'; | ||
6 | 5 | ||
7 | export default @inject('stores', 'actions') @observer class InviteScreen extends Component { | 6 | export default @inject('stores', 'actions') @observer class InviteScreen extends Component { |
8 | componentDidMount() { | ||
9 | gaPage('Auth/Invite'); | ||
10 | } | ||
11 | |||
12 | render() { | 7 | render() { |
13 | const { actions } = this.props; | 8 | const { actions } = this.props; |
14 | 9 | ||
diff --git a/src/containers/auth/LoginScreen.js b/src/containers/auth/LoginScreen.js index 865bd38f8..e5ee10785 100644 --- a/src/containers/auth/LoginScreen.js +++ b/src/containers/auth/LoginScreen.js | |||
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types'; | |||
3 | import { inject, observer } from 'mobx-react'; | 3 | import { inject, observer } from 'mobx-react'; |
4 | import Login from '../../components/auth/Login'; | 4 | import Login from '../../components/auth/Login'; |
5 | import UserStore from '../../stores/UserStore'; | 5 | import UserStore from '../../stores/UserStore'; |
6 | import { gaPage } from '../../lib/analytics'; | ||
7 | 6 | ||
8 | import { globalError as globalErrorPropType } from '../../prop-types'; | 7 | import { globalError as globalErrorPropType } from '../../prop-types'; |
9 | 8 | ||
@@ -12,10 +11,6 @@ export default @inject('stores', 'actions') @observer class LoginScreen extends | |||
12 | error: globalErrorPropType.isRequired, | 11 | error: globalErrorPropType.isRequired, |
13 | }; | 12 | }; |
14 | 13 | ||
15 | componentDidMount() { | ||
16 | gaPage('Auth/Login'); | ||
17 | } | ||
18 | |||
19 | render() { | 14 | render() { |
20 | const { actions, stores, error } = this.props; | 15 | const { actions, stores, error } = this.props; |
21 | return ( | 16 | return ( |
diff --git a/src/containers/auth/PasswordScreen.js b/src/containers/auth/PasswordScreen.js index 236fd2031..5b238860e 100644 --- a/src/containers/auth/PasswordScreen.js +++ b/src/containers/auth/PasswordScreen.js | |||
@@ -3,13 +3,8 @@ import PropTypes from 'prop-types'; | |||
3 | import { inject, observer } from 'mobx-react'; | 3 | import { inject, observer } from 'mobx-react'; |
4 | import Password from '../../components/auth/Password'; | 4 | import Password from '../../components/auth/Password'; |
5 | import UserStore from '../../stores/UserStore'; | 5 | import UserStore from '../../stores/UserStore'; |
6 | import { gaPage } from '../../lib/analytics'; | ||
7 | 6 | ||
8 | export default @inject('stores', 'actions') @observer class PasswordScreen extends Component { | 7 | export default @inject('stores', 'actions') @observer class PasswordScreen extends Component { |
9 | componentDidMount() { | ||
10 | gaPage('Auth/Password Retrieve'); | ||
11 | } | ||
12 | |||
13 | render() { | 8 | render() { |
14 | const { actions, stores } = this.props; | 9 | const { actions, stores } = this.props; |
15 | 10 | ||
diff --git a/src/containers/auth/PricingScreen.js b/src/containers/auth/PricingScreen.js index 34b512e15..8d179a170 100644 --- a/src/containers/auth/PricingScreen.js +++ b/src/containers/auth/PricingScreen.js | |||
@@ -6,7 +6,6 @@ import { RouterStore } from 'mobx-react-router'; | |||
6 | import Pricing from '../../components/auth/Pricing'; | 6 | import Pricing from '../../components/auth/Pricing'; |
7 | import UserStore from '../../stores/UserStore'; | 7 | import UserStore from '../../stores/UserStore'; |
8 | import PaymentStore from '../../stores/PaymentStore'; | 8 | import PaymentStore from '../../stores/PaymentStore'; |
9 | import { gaPage } from '../../lib/analytics'; | ||
10 | 9 | ||
11 | import { globalError as globalErrorPropType } from '../../prop-types'; | 10 | import { globalError as globalErrorPropType } from '../../prop-types'; |
12 | 11 | ||
@@ -15,10 +14,6 @@ export default @inject('stores', 'actions') @observer class PricingScreen extend | |||
15 | error: globalErrorPropType.isRequired, | 14 | error: globalErrorPropType.isRequired, |
16 | }; | 15 | }; |
17 | 16 | ||
18 | componentDidMount() { | ||
19 | gaPage('Auth/Pricing'); | ||
20 | } | ||
21 | |||
22 | render() { | 17 | render() { |
23 | const { actions, stores, error } = this.props; | 18 | const { actions, stores, error } = this.props; |
24 | 19 | ||
diff --git a/src/containers/auth/SignupScreen.js b/src/containers/auth/SignupScreen.js index caf75de90..efc7ea4c1 100644 --- a/src/containers/auth/SignupScreen.js +++ b/src/containers/auth/SignupScreen.js | |||
@@ -4,7 +4,6 @@ import { inject, observer } from 'mobx-react'; | |||
4 | 4 | ||
5 | import Signup from '../../components/auth/Signup'; | 5 | import Signup from '../../components/auth/Signup'; |
6 | import UserStore from '../../stores/UserStore'; | 6 | import UserStore from '../../stores/UserStore'; |
7 | import { gaPage } from '../../lib/analytics'; | ||
8 | 7 | ||
9 | import { globalError as globalErrorPropType } from '../../prop-types'; | 8 | import { globalError as globalErrorPropType } from '../../prop-types'; |
10 | 9 | ||
@@ -13,10 +12,6 @@ export default @inject('stores', 'actions') @observer class SignupScreen extends | |||
13 | error: globalErrorPropType.isRequired, | 12 | error: globalErrorPropType.isRequired, |
14 | }; | 13 | }; |
15 | 14 | ||
16 | componentDidMount() { | ||
17 | gaPage('Auth/Signup'); | ||
18 | } | ||
19 | |||
20 | render() { | 15 | render() { |
21 | const { actions, stores, error } = this.props; | 16 | const { actions, stores, error } = this.props; |
22 | return ( | 17 | return ( |
diff --git a/src/containers/auth/WelcomeScreen.js b/src/containers/auth/WelcomeScreen.js index 2c120f81c..75182345a 100644 --- a/src/containers/auth/WelcomeScreen.js +++ b/src/containers/auth/WelcomeScreen.js | |||
@@ -5,13 +5,8 @@ import { inject, observer } from 'mobx-react'; | |||
5 | import Welcome from '../../components/auth/Welcome'; | 5 | import Welcome from '../../components/auth/Welcome'; |
6 | import UserStore from '../../stores/UserStore'; | 6 | import UserStore from '../../stores/UserStore'; |
7 | import RecipePreviewsStore from '../../stores/RecipePreviewsStore'; | 7 | import RecipePreviewsStore from '../../stores/RecipePreviewsStore'; |
8 | import { gaPage } from '../../lib/analytics'; | ||
9 | 8 | ||
10 | export default @inject('stores', 'actions') @observer class LoginScreen extends Component { | 9 | export default @inject('stores', 'actions') @observer class LoginScreen extends Component { |
11 | componentDidMount() { | ||
12 | gaPage('Auth/Welcome'); | ||
13 | } | ||
14 | |||
15 | render() { | 10 | render() { |
16 | const { user, recipePreviews } = this.props.stores; | 11 | const { user, recipePreviews } = this.props.stores; |
17 | 12 | ||
diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 749912c59..d2891a6a4 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js | |||
@@ -20,6 +20,10 @@ import Services from '../../components/services/content/Services'; | |||
20 | import AppLoader from '../../components/ui/AppLoader'; | 20 | import AppLoader from '../../components/ui/AppLoader'; |
21 | 21 | ||
22 | import { state as delayAppState } from '../../features/delayApp'; | 22 | import { state as delayAppState } from '../../features/delayApp'; |
23 | import { workspaceActions } from '../../features/workspaces/actions'; | ||
24 | import WorkspaceDrawer from '../../features/workspaces/components/WorkspaceDrawer'; | ||
25 | import { workspaceStore } from '../../features/workspaces'; | ||
26 | import { announcementsStore } from '../../features/announcements'; | ||
23 | 27 | ||
24 | export default @inject('stores', 'actions') @observer class AppLayoutContainer extends Component { | 28 | export default @inject('stores', 'actions') @observer class AppLayoutContainer extends Component { |
25 | static defaultProps = { | 29 | static defaultProps = { |
@@ -42,6 +46,7 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e | |||
42 | setActive, | 46 | setActive, |
43 | handleIPCMessage, | 47 | handleIPCMessage, |
44 | setWebviewReference, | 48 | setWebviewReference, |
49 | detachService, | ||
45 | openWindow, | 50 | openWindow, |
46 | reorder, | 51 | reorder, |
47 | reload, | 52 | reload, |
@@ -81,6 +86,15 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e | |||
81 | ); | 86 | ); |
82 | } | 87 | } |
83 | 88 | ||
89 | const workspacesDrawer = ( | ||
90 | <WorkspaceDrawer | ||
91 | getServicesForWorkspace={workspace => ( | ||
92 | workspace ? workspaceStore.getWorkspaceServices(workspace).map(s => s.name) : services.all.map(s => s.name) | ||
93 | )} | ||
94 | onUpgradeAccountClick={() => openSettings({ path: 'user' })} | ||
95 | /> | ||
96 | ); | ||
97 | |||
84 | const sidebar = ( | 98 | const sidebar = ( |
85 | <Sidebar | 99 | <Sidebar |
86 | services={services.allDisplayed} | 100 | services={services.allDisplayed} |
@@ -95,6 +109,8 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e | |||
95 | deleteService={deleteService} | 109 | deleteService={deleteService} |
96 | updateService={updateService} | 110 | updateService={updateService} |
97 | toggleMuteApp={toggleMuteApp} | 111 | toggleMuteApp={toggleMuteApp} |
112 | toggleWorkspaceDrawer={workspaceActions.toggleWorkspaceDrawer} | ||
113 | isWorkspaceDrawerOpen={workspaceStore.isWorkspaceDrawerOpen} | ||
98 | showMessageBadgeWhenMutedSetting={settings.all.app.showMessageBadgeWhenMuted} | 114 | showMessageBadgeWhenMutedSetting={settings.all.app.showMessageBadgeWhenMuted} |
99 | showMessageBadgesEvenWhenMuted={ui.showMessageBadgesEvenWhenMuted} | 115 | showMessageBadgesEvenWhenMuted={ui.showMessageBadgesEvenWhenMuted} |
100 | /> | 116 | /> |
@@ -105,6 +121,7 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e | |||
105 | services={services.allDisplayedUnordered} | 121 | services={services.allDisplayedUnordered} |
106 | handleIPCMessage={handleIPCMessage} | 122 | handleIPCMessage={handleIPCMessage} |
107 | setWebviewReference={setWebviewReference} | 123 | setWebviewReference={setWebviewReference} |
124 | detachService={detachService} | ||
108 | openWindow={openWindow} | 125 | openWindow={openWindow} |
109 | reload={reload} | 126 | reload={reload} |
110 | openSettings={openSettings} | 127 | openSettings={openSettings} |
@@ -119,7 +136,9 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e | |||
119 | isOnline={app.isOnline} | 136 | isOnline={app.isOnline} |
120 | showServicesUpdatedInfoBar={ui.showServicesUpdatedInfoBar} | 137 | showServicesUpdatedInfoBar={ui.showServicesUpdatedInfoBar} |
121 | appUpdateIsDownloaded={app.updateStatus === app.updateStatusTypes.DOWNLOADED} | 138 | appUpdateIsDownloaded={app.updateStatus === app.updateStatusTypes.DOWNLOADED} |
139 | nextAppReleaseVersion={app.nextAppReleaseVersion} | ||
122 | sidebar={sidebar} | 140 | sidebar={sidebar} |
141 | workspacesDrawer={workspacesDrawer} | ||
123 | services={servicesContainer} | 142 | services={servicesContainer} |
124 | news={news.latest} | 143 | news={news.latest} |
125 | removeNewsItem={hide} | 144 | removeNewsItem={hide} |
@@ -132,6 +151,7 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e | |||
132 | areRequiredRequestsLoading={requests.areRequiredRequestsLoading} | 151 | areRequiredRequestsLoading={requests.areRequiredRequestsLoading} |
133 | darkMode={settings.all.app.darkMode} | 152 | darkMode={settings.all.app.darkMode} |
134 | isDelayAppScreenVisible={delayAppState.isDelayAppScreenVisible} | 153 | isDelayAppScreenVisible={delayAppState.isDelayAppScreenVisible} |
154 | isAnnouncementVisible={announcementsStore.isAnnouncementVisible} | ||
135 | > | 155 | > |
136 | {React.Children.count(children) > 0 ? children : null} | 156 | {React.Children.count(children) > 0 ? children : null} |
137 | </AppLayout> | 157 | </AppLayout> |
@@ -160,6 +180,7 @@ AppLayoutContainer.wrappedComponent.propTypes = { | |||
160 | toggleAudio: PropTypes.func.isRequired, | 180 | toggleAudio: PropTypes.func.isRequired, |
161 | handleIPCMessage: PropTypes.func.isRequired, | 181 | handleIPCMessage: PropTypes.func.isRequired, |
162 | setWebviewReference: PropTypes.func.isRequired, | 182 | setWebviewReference: PropTypes.func.isRequired, |
183 | detachService: PropTypes.func.isRequired, | ||
163 | openWindow: PropTypes.func.isRequired, | 184 | openWindow: PropTypes.func.isRequired, |
164 | reloadUpdatedServices: PropTypes.func.isRequired, | 185 | reloadUpdatedServices: PropTypes.func.isRequired, |
165 | updateService: PropTypes.func.isRequired, | 186 | updateService: PropTypes.func.isRequired, |
diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js index d681d5226..b3f967353 100644 --- a/src/containers/settings/AccountScreen.js +++ b/src/containers/settings/AccountScreen.js | |||
@@ -1,4 +1,3 @@ | |||
1 | import { remote } from 'electron'; | ||
2 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
3 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
4 | import { inject, observer } from 'mobx-react'; | 3 | import { inject, observer } from 'mobx-react'; |
@@ -6,92 +5,55 @@ import { inject, observer } from 'mobx-react'; | |||
6 | import PaymentStore from '../../stores/PaymentStore'; | 5 | import PaymentStore from '../../stores/PaymentStore'; |
7 | import UserStore from '../../stores/UserStore'; | 6 | import UserStore from '../../stores/UserStore'; |
8 | import AppStore from '../../stores/AppStore'; | 7 | import AppStore from '../../stores/AppStore'; |
9 | import { gaPage } from '../../lib/analytics'; | ||
10 | 8 | ||
11 | import AccountDashboard from '../../components/settings/account/AccountDashboard'; | 9 | import AccountDashboard from '../../components/settings/account/AccountDashboard'; |
12 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 10 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
13 | 11 | import { WEBSITE } from '../../environment'; | |
14 | const { BrowserWindow } = remote; | ||
15 | 12 | ||
16 | export default @inject('stores', 'actions') @observer class AccountScreen extends Component { | 13 | export default @inject('stores', 'actions') @observer class AccountScreen extends Component { |
17 | componentWillMount() { | ||
18 | const { | ||
19 | user, | ||
20 | } = this.props.stores; | ||
21 | |||
22 | user.getUserInfoRequest.invalidate({ immediately: true }); | ||
23 | } | ||
24 | |||
25 | componentDidMount() { | ||
26 | gaPage('Settings/Account Dashboard'); | ||
27 | } | ||
28 | |||
29 | onCloseWindow() { | 14 | onCloseWindow() { |
30 | const { user, payment } = this.props.stores; | 15 | const { user } = this.props.stores; |
31 | user.getUserInfoRequest.invalidate({ immediately: true }); | 16 | user.getUserInfoRequest.invalidate({ immediately: true }); |
32 | payment.ordersDataRequest.invalidate({ immediately: true }); | ||
33 | } | 17 | } |
34 | 18 | ||
35 | reloadData() { | 19 | reloadData() { |
36 | const { user, payment } = this.props.stores; | 20 | const { user, payment } = this.props.stores; |
37 | 21 | ||
38 | user.getUserInfoRequest.reload(); | 22 | user.getUserInfoRequest.reload(); |
39 | payment.ordersDataRequest.reload(); | ||
40 | payment.plansRequest.reload(); | 23 | payment.plansRequest.reload(); |
41 | } | 24 | } |
42 | 25 | ||
43 | async handlePaymentDashboard() { | 26 | handleWebsiteLink(route) { |
44 | const { actions, stores } = this.props; | 27 | const { actions, stores } = this.props; |
45 | 28 | ||
46 | actions.payment.createDashboardUrl(); | 29 | const url = `${WEBSITE}${route}?authToken=${stores.user.authToken}&utm_source=app&utm_medium=account_dashboard`; |
47 | 30 | console.log(url); | |
48 | const dashboard = await stores.payment.createDashboardUrlRequest; | ||
49 | |||
50 | if (dashboard.url) { | ||
51 | const paymentWindow = new BrowserWindow({ | ||
52 | title: '🔒 Franz Subscription Dashboard', | ||
53 | parent: remote.getCurrentWindow(), | ||
54 | modal: false, | ||
55 | width: 900, | ||
56 | minWidth: 600, | ||
57 | webPreferences: { | ||
58 | nodeIntegration: false, | ||
59 | }, | ||
60 | }); | ||
61 | paymentWindow.loadURL(dashboard.url); | ||
62 | 31 | ||
63 | paymentWindow.on('closed', () => { | 32 | actions.app.openExternalUrl({ url }); |
64 | this.onCloseWindow(); | ||
65 | }); | ||
66 | } | ||
67 | } | 33 | } |
68 | 34 | ||
69 | render() { | 35 | render() { |
70 | const { user, payment } = this.props.stores; | 36 | const { user, payment } = this.props.stores; |
71 | const { openExternalUrl } = this.props.actions.app; | ||
72 | const { user: userActions } = this.props.actions; | 37 | const { user: userActions } = this.props.actions; |
73 | 38 | ||
74 | const isLoadingUserInfo = user.getUserInfoRequest.isExecuting; | 39 | const isLoadingUserInfo = user.getUserInfoRequest.isExecuting; |
75 | const isLoadingOrdersInfo = payment.ordersDataRequest.isExecuting; | ||
76 | const isLoadingPlans = payment.plansRequest.isExecuting; | 40 | const isLoadingPlans = payment.plansRequest.isExecuting; |
77 | 41 | ||
78 | return ( | 42 | return ( |
79 | <ErrorBoundary> | 43 | <ErrorBoundary> |
80 | <AccountDashboard | 44 | <AccountDashboard |
81 | user={user.data} | 45 | user={user.data} |
82 | orders={payment.orders} | ||
83 | isLoading={isLoadingUserInfo} | 46 | isLoading={isLoadingUserInfo} |
84 | isLoadingOrdersInfo={isLoadingOrdersInfo} | ||
85 | isLoadingPlans={isLoadingPlans} | 47 | isLoadingPlans={isLoadingPlans} |
86 | userInfoRequestFailed={user.getUserInfoRequest.wasExecuted && user.getUserInfoRequest.isError} | 48 | userInfoRequestFailed={user.getUserInfoRequest.wasExecuted && user.getUserInfoRequest.isError} |
87 | retryUserInfoRequest={() => this.reloadData()} | 49 | retryUserInfoRequest={() => this.reloadData()} |
88 | isCreatingPaymentDashboardUrl={payment.createDashboardUrlRequest.isExecuting} | ||
89 | openDashboard={price => this.handlePaymentDashboard(price)} | ||
90 | openExternalUrl={url => openExternalUrl({ url })} | ||
91 | onCloseSubscriptionWindow={() => this.onCloseWindow()} | 50 | onCloseSubscriptionWindow={() => this.onCloseWindow()} |
92 | deleteAccount={userActions.delete} | 51 | deleteAccount={userActions.delete} |
93 | isLoadingDeleteAccount={user.deleteAccountRequest.isExecuting} | 52 | isLoadingDeleteAccount={user.deleteAccountRequest.isExecuting} |
94 | isDeleteAccountSuccessful={user.deleteAccountRequest.wasExecuted && !user.deleteAccountRequest.isError} | 53 | isDeleteAccountSuccessful={user.deleteAccountRequest.wasExecuted && !user.deleteAccountRequest.isError} |
54 | openEditAccount={() => this.handleWebsiteLink('/user/profile')} | ||
55 | openBilling={() => this.handleWebsiteLink('/user/billing')} | ||
56 | openInvoices={() => this.handleWebsiteLink('/user/invoices')} | ||
95 | /> | 57 | /> |
96 | </ErrorBoundary> | 58 | </ErrorBoundary> |
97 | ); | 59 | ); |
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js index b46908344..870ca4ecd 100644 --- a/src/containers/settings/EditServiceScreen.js +++ b/src/containers/settings/EditServiceScreen.js | |||
@@ -9,7 +9,6 @@ import ServicesStore from '../../stores/ServicesStore'; | |||
9 | import SettingsStore from '../../stores/SettingsStore'; | 9 | import SettingsStore from '../../stores/SettingsStore'; |
10 | import FeaturesStore from '../../stores/FeaturesStore'; | 10 | import FeaturesStore from '../../stores/FeaturesStore'; |
11 | import Form from '../../lib/Form'; | 11 | import Form from '../../lib/Form'; |
12 | import { gaPage } from '../../lib/analytics'; | ||
13 | 12 | ||
14 | import ServiceError from '../../components/settings/services/ServiceError'; | 13 | import ServiceError from '../../components/settings/services/ServiceError'; |
15 | import EditServiceForm from '../../components/settings/services/EditServiceForm'; | 14 | import EditServiceForm from '../../components/settings/services/EditServiceForm'; |
@@ -19,9 +18,12 @@ import { required, url, oneRequired } from '../../helpers/validation-helpers'; | |||
19 | import { getSelectOptions } from '../../helpers/i18n-helpers'; | 18 | import { getSelectOptions } from '../../helpers/i18n-helpers'; |
20 | 19 | ||
21 | import { config as proxyFeature } from '../../features/serviceProxy'; | 20 | import { config as proxyFeature } from '../../features/serviceProxy'; |
21 | import { config as spellcheckerFeature } from '../../features/spellchecker'; | ||
22 | 22 | ||
23 | import { SPELLCHECKER_LOCALES } from '../../i18n/languages'; | 23 | import { SPELLCHECKER_LOCALES } from '../../i18n/languages'; |
24 | 24 | ||
25 | import globalMessages from '../../i18n/globalMessages'; | ||
26 | |||
25 | const messages = defineMessages({ | 27 | const messages = defineMessages({ |
26 | name: { | 28 | name: { |
27 | id: 'settings.service.form.name', | 29 | id: 'settings.service.form.name', |
@@ -83,14 +85,6 @@ const messages = defineMessages({ | |||
83 | id: 'settings.service.form.proxy.password', | 85 | id: 'settings.service.form.proxy.password', |
84 | defaultMessage: '!!!Password', | 86 | defaultMessage: '!!!Password', |
85 | }, | 87 | }, |
86 | spellcheckerLanguage: { | ||
87 | id: 'settings.service.form.spellcheckerLanguage', | ||
88 | defaultMessage: '!!!Spell checking Language', | ||
89 | }, | ||
90 | spellcheckerSystemDefault: { | ||
91 | id: 'settings.service.form.spellcheckerLanguage.default', | ||
92 | defaultMessage: '!!!Use System Default ({default})', | ||
93 | }, | ||
94 | }); | 88 | }); |
95 | 89 | ||
96 | export default @inject('stores', 'actions') @observer class EditServiceScreen extends Component { | 90 | export default @inject('stores', 'actions') @observer class EditServiceScreen extends Component { |
@@ -98,10 +92,6 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
98 | intl: intlShape, | 92 | intl: intlShape, |
99 | }; | 93 | }; |
100 | 94 | ||
101 | componentDidMount() { | ||
102 | gaPage('Settings/Service/Edit'); | ||
103 | } | ||
104 | |||
105 | onSubmit(data) { | 95 | onSubmit(data) { |
106 | const { action } = this.props.router.params; | 96 | const { action } = this.props.router.params; |
107 | const { recipes, services } = this.props.stores; | 97 | const { recipes, services } = this.props.stores; |
@@ -118,12 +108,26 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
118 | } | 108 | } |
119 | 109 | ||
120 | prepareForm(recipe, service, proxy) { | 110 | prepareForm(recipe, service, proxy) { |
111 | const { | ||
112 | intl, | ||
113 | } = this.context; | ||
114 | |||
115 | const { | ||
116 | stores, | ||
117 | } = this.props; | ||
118 | |||
119 | let defaultSpellcheckerLanguage = SPELLCHECKER_LOCALES[stores.settings.app.spellcheckerLanguage]; | ||
120 | |||
121 | if (stores.settings.app.spellcheckerLanguage === 'automatic') { | ||
122 | defaultSpellcheckerLanguage = intl.formatMessage(globalMessages.spellcheckerAutomaticDetectionShort); | ||
123 | } | ||
124 | |||
121 | const spellcheckerLanguage = getSelectOptions({ | 125 | const spellcheckerLanguage = getSelectOptions({ |
122 | locales: SPELLCHECKER_LOCALES, | 126 | locales: SPELLCHECKER_LOCALES, |
123 | resetToDefaultText: this.context.intl.formatMessage(messages.spellcheckerSystemDefault, { default: SPELLCHECKER_LOCALES[this.props.stores.settings.app.spellcheckerLanguage] }), | 127 | resetToDefaultText: intl.formatMessage(globalMessages.spellcheckerSystemDefault, { default: defaultSpellcheckerLanguage }), |
128 | automaticDetectionText: stores.settings.app.spellcheckerLanguage !== 'automatic' ? intl.formatMessage(globalMessages.spellcheckerAutomaticDetection) : '', | ||
124 | }); | 129 | }); |
125 | 130 | ||
126 | const { intl } = this.context; | ||
127 | const config = { | 131 | const config = { |
128 | fields: { | 132 | fields: { |
129 | name: { | 133 | name: { |
@@ -160,13 +164,13 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
160 | isDarkModeEnabled: { | 164 | isDarkModeEnabled: { |
161 | label: intl.formatMessage(messages.enableDarkMode), | 165 | label: intl.formatMessage(messages.enableDarkMode), |
162 | value: service.isDarkModeEnabled, | 166 | value: service.isDarkModeEnabled, |
163 | default: this.props.stores.settings.app.darkMode, | 167 | default: stores.settings.app.darkMode, |
164 | }, | 168 | }, |
165 | spellcheckerLanguage: { | 169 | spellcheckerLanguage: { |
166 | label: intl.formatMessage(messages.spellcheckerLanguage), | 170 | label: intl.formatMessage(globalMessages.spellcheckerLanguage), |
167 | value: service.spellcheckerLanguage, | 171 | value: service.spellcheckerLanguage, |
168 | options: spellcheckerLanguage, | 172 | options: spellcheckerLanguage, |
169 | disabled: !this.props.stores.settings.app.enableSpellchecking, | 173 | disabled: !stores.settings.app.enableSpellchecking, |
170 | }, | 174 | }, |
171 | }, | 175 | }, |
172 | }; | 176 | }; |
@@ -220,7 +224,7 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
220 | } | 224 | } |
221 | 225 | ||
222 | if (proxy.isEnabled) { | 226 | if (proxy.isEnabled) { |
223 | const serviceProxyConfig = this.props.stores.settings.proxy[service.id] || {}; | 227 | const serviceProxyConfig = stores.settings.proxy[service.id] || {}; |
224 | 228 | ||
225 | Object.assign(config.fields, { | 229 | Object.assign(config.fields, { |
226 | proxy: { | 230 | proxy: { |
@@ -326,7 +330,8 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
326 | onSubmit={d => this.onSubmit(d)} | 330 | onSubmit={d => this.onSubmit(d)} |
327 | onDelete={() => this.deleteService()} | 331 | onDelete={() => this.deleteService()} |
328 | isProxyFeatureEnabled={proxyFeature.isEnabled} | 332 | isProxyFeatureEnabled={proxyFeature.isEnabled} |
329 | isProxyFeaturePremiumFeature={proxyFeature.isPremium} | 333 | isProxyPremiumFeature={proxyFeature.isPremium} |
334 | isSpellcheckerPremiumFeature={spellcheckerFeature.isPremium} | ||
330 | /> | 335 | /> |
331 | </ErrorBoundary> | 336 | </ErrorBoundary> |
332 | ); | 337 | ); |
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index f1706a721..97c1fa3b1 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -8,16 +8,16 @@ import SettingsStore from '../../stores/SettingsStore'; | |||
8 | import UserStore from '../../stores/UserStore'; | 8 | import UserStore from '../../stores/UserStore'; |
9 | import Form from '../../lib/Form'; | 9 | import Form from '../../lib/Form'; |
10 | import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; | 10 | import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; |
11 | import { gaPage } from '../../lib/analytics'; | ||
12 | import { DEFAULT_APP_SETTINGS } from '../../config'; | 11 | import { DEFAULT_APP_SETTINGS } from '../../config'; |
13 | import { config as spellcheckerConfig } from '../../features/spellchecker'; | 12 | import { config as spellcheckerConfig } from '../../features/spellchecker'; |
14 | 13 | ||
15 | import { getSelectOptions } from '../../helpers/i18n-helpers'; | 14 | import { getSelectOptions } from '../../helpers/i18n-helpers'; |
16 | 15 | ||
17 | |||
18 | import EditSettingsForm from '../../components/settings/settings/EditSettingsForm'; | 16 | import EditSettingsForm from '../../components/settings/settings/EditSettingsForm'; |
19 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 17 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
20 | 18 | ||
19 | import globalMessages from '../../i18n/globalMessages'; | ||
20 | |||
21 | const messages = defineMessages({ | 21 | const messages = defineMessages({ |
22 | autoLaunchOnStart: { | 22 | autoLaunchOnStart: { |
23 | id: 'settings.app.form.autoLaunchOnStart', | 23 | id: 'settings.app.form.autoLaunchOnStart', |
@@ -63,10 +63,6 @@ const messages = defineMessages({ | |||
63 | id: 'settings.app.form.enableGPUAcceleration', | 63 | id: 'settings.app.form.enableGPUAcceleration', |
64 | defaultMessage: '!!!Enable GPU Acceleration', | 64 | defaultMessage: '!!!Enable GPU Acceleration', |
65 | }, | 65 | }, |
66 | spellcheckerLanguage: { | ||
67 | id: 'settings.app.form.spellcheckerLanguage', | ||
68 | defaultMessage: '!!!Language for spell checking', | ||
69 | }, | ||
70 | beta: { | 66 | beta: { |
71 | id: 'settings.app.form.beta', | 67 | id: 'settings.app.form.beta', |
72 | defaultMessage: '!!!Include beta versions', | 68 | defaultMessage: '!!!Include beta versions', |
@@ -78,10 +74,6 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
78 | intl: intlShape, | 74 | intl: intlShape, |
79 | }; | 75 | }; |
80 | 76 | ||
81 | componentDidMount() { | ||
82 | gaPage('Settings/App'); | ||
83 | } | ||
84 | |||
85 | onSubmit(settingsData) { | 77 | onSubmit(settingsData) { |
86 | const { app, settings, user } = this.props.actions; | 78 | const { app, settings, user } = this.props.actions; |
87 | 79 | ||
@@ -125,6 +117,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
125 | 117 | ||
126 | const spellcheckingLanguages = getSelectOptions({ | 118 | const spellcheckingLanguages = getSelectOptions({ |
127 | locales: SPELLCHECKER_LOCALES, | 119 | locales: SPELLCHECKER_LOCALES, |
120 | automaticDetectionText: this.context.intl.formatMessage(globalMessages.spellcheckerAutomaticDetection), | ||
128 | }); | 121 | }); |
129 | 122 | ||
130 | const config = { | 123 | const config = { |
@@ -166,11 +159,11 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
166 | }, | 159 | }, |
167 | enableSpellchecking: { | 160 | enableSpellchecking: { |
168 | label: intl.formatMessage(messages.enableSpellchecking), | 161 | label: intl.formatMessage(messages.enableSpellchecking), |
169 | value: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremiumFeature ? false : settings.all.app.enableSpellchecking, | 162 | value: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremium ? false : settings.all.app.enableSpellchecking, |
170 | default: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremiumFeature ? false : DEFAULT_APP_SETTINGS.enableSpellchecking, | 163 | default: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremium ? false : DEFAULT_APP_SETTINGS.enableSpellchecking, |
171 | }, | 164 | }, |
172 | spellcheckerLanguage: { | 165 | spellcheckerLanguage: { |
173 | label: intl.formatMessage(messages.spellcheckerLanguage), | 166 | label: intl.formatMessage(globalMessages.spellcheckerLanguage), |
174 | value: settings.all.app.spellcheckerLanguage, | 167 | value: settings.all.app.spellcheckerLanguage, |
175 | options: spellcheckingLanguages, | 168 | options: spellcheckingLanguages, |
176 | default: DEFAULT_APP_SETTINGS.spellcheckerLanguage, | 169 | default: DEFAULT_APP_SETTINGS.spellcheckerLanguage, |
@@ -230,7 +223,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
230 | cacheSize={cacheSize} | 223 | cacheSize={cacheSize} |
231 | isClearingAllCache={isClearingAllCache} | 224 | isClearingAllCache={isClearingAllCache} |
232 | onClearAllCache={clearAllCache} | 225 | onClearAllCache={clearAllCache} |
233 | isSpellcheckerPremiumFeature={spellcheckerConfig.isPremiumFeature} | 226 | isSpellcheckerPremiumFeature={spellcheckerConfig.isPremium} |
234 | /> | 227 | /> |
235 | </ErrorBoundary> | 228 | </ErrorBoundary> |
236 | ); | 229 | ); |
diff --git a/src/containers/settings/EditUserScreen.js b/src/containers/settings/EditUserScreen.js index 3d35effc5..81f689400 100644 --- a/src/containers/settings/EditUserScreen.js +++ b/src/containers/settings/EditUserScreen.js | |||
@@ -9,7 +9,6 @@ import EditUserForm from '../../components/settings/user/EditUserForm'; | |||
9 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 9 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
10 | 10 | ||
11 | import { required, email, minLength } from '../../helpers/validation-helpers'; | 11 | import { required, email, minLength } from '../../helpers/validation-helpers'; |
12 | import { gaPage } from '../../lib/analytics'; | ||
13 | 12 | ||
14 | const messages = defineMessages({ | 13 | const messages = defineMessages({ |
15 | firstname: { | 14 | firstname: { |
@@ -24,23 +23,21 @@ const messages = defineMessages({ | |||
24 | id: 'settings.user.form.email', | 23 | id: 'settings.user.form.email', |
25 | defaultMessage: '!!!Email', | 24 | defaultMessage: '!!!Email', |
26 | }, | 25 | }, |
27 | accountType: { | 26 | accountTypeLabel: { |
28 | label: { | 27 | id: 'settings.user.form.accountType.label', |
29 | id: 'settings.user.form.accountType.label', | 28 | defaultMessage: '!!!Account type', |
30 | defaultMessage: '!!!Account type', | 29 | }, |
31 | }, | 30 | accountTypeIndividual: { |
32 | individual: { | 31 | id: 'settings.user.form.accountType.individual', |
33 | id: 'settings.user.form.accountType.individual', | 32 | defaultMessage: '!!!Individual', |
34 | defaultMessage: '!!!Individual', | 33 | }, |
35 | }, | 34 | accountTypeNonProfit: { |
36 | nonProfit: { | 35 | id: 'settings.user.form.accountType.non-profit', |
37 | id: 'settings.user.form.accountType.non-profit', | 36 | defaultMessage: '!!!Non-Profit', |
38 | defaultMessage: '!!!Non-Profit', | 37 | }, |
39 | }, | 38 | accountTypeCompany: { |
40 | company: { | 39 | id: 'settings.user.form.accountType.company', |
41 | id: 'settings.user.form.accountType.company', | 40 | defaultMessage: '!!!Company', |
42 | defaultMessage: '!!!Company', | ||
43 | }, | ||
44 | }, | 41 | }, |
45 | currentPassword: { | 42 | currentPassword: { |
46 | id: 'settings.user.form.currentPassword', | 43 | id: 'settings.user.form.currentPassword', |
@@ -57,10 +54,6 @@ export default @inject('stores', 'actions') @observer class EditUserScreen exten | |||
57 | intl: intlShape, | 54 | intl: intlShape, |
58 | }; | 55 | }; |
59 | 56 | ||
60 | componentDidMount() { | ||
61 | gaPage('Settings/Account/Edit'); | ||
62 | } | ||
63 | |||
64 | componentWillUnmount() { | 57 | componentWillUnmount() { |
65 | this.props.actions.user.resetStatus(); | 58 | this.props.actions.user.resetStatus(); |
66 | } | 59 | } |
@@ -99,21 +92,21 @@ export default @inject('stores', 'actions') @observer class EditUserScreen exten | |||
99 | accountType: { | 92 | accountType: { |
100 | value: user.accountType, | 93 | value: user.accountType, |
101 | validators: [required], | 94 | validators: [required], |
102 | label: intl.formatMessage(messages.accountType.label), | 95 | label: intl.formatMessage(messages.accountTypeLabel), |
103 | options: [{ | 96 | options: [{ |
104 | value: 'individual', | 97 | value: 'individual', |
105 | label: intl.formatMessage(messages.accountType.individual), | 98 | label: intl.formatMessage(messages.accountTypeIndividual), |
106 | }, { | 99 | }, { |
107 | value: 'non-profit', | 100 | value: 'non-profit', |
108 | label: intl.formatMessage(messages.accountType.nonProfit), | 101 | label: intl.formatMessage(messages.accountTypeNonProfit), |
109 | }, { | 102 | }, { |
110 | value: 'company', | 103 | value: 'company', |
111 | label: intl.formatMessage(messages.accountType.company), | 104 | label: intl.formatMessage(messages.accountTypeCompany), |
112 | }], | 105 | }], |
113 | }, | 106 | }, |
114 | organization: { | 107 | organization: { |
115 | label: intl.formatMessage(messages.accountType.company), | 108 | label: intl.formatMessage(messages.accountTypeCompany), |
116 | placeholder: intl.formatMessage(messages.accountType.company), | 109 | placeholder: intl.formatMessage(messages.accountTypeCompany), |
117 | value: user.organization, | 110 | value: user.organization, |
118 | }, | 111 | }, |
119 | oldPassword: { | 112 | oldPassword: { |
diff --git a/src/containers/settings/InviteScreen.js b/src/containers/settings/InviteScreen.js index cd36610e4..cc36849e8 100644 --- a/src/containers/settings/InviteScreen.js +++ b/src/containers/settings/InviteScreen.js | |||
@@ -5,13 +5,7 @@ import { inject, observer } from 'mobx-react'; | |||
5 | import Invite from '../../components/auth/Invite'; | 5 | import Invite from '../../components/auth/Invite'; |
6 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 6 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
7 | 7 | ||
8 | import { gaPage } from '../../lib/analytics'; | ||
9 | |||
10 | export default @inject('stores', 'actions') @observer class InviteScreen extends Component { | 8 | export default @inject('stores', 'actions') @observer class InviteScreen extends Component { |
11 | componentDidMount() { | ||
12 | gaPage('Settings/Invite'); | ||
13 | } | ||
14 | |||
15 | componentWillUnmount() { | 9 | componentWillUnmount() { |
16 | this.props.stores.user.inviteRequest.reset(); | 10 | this.props.stores.user.inviteRequest.reset(); |
17 | } | 11 | } |
diff --git a/src/containers/settings/RecipesScreen.js b/src/containers/settings/RecipesScreen.js index b3d758c87..eda5ae54c 100644 --- a/src/containers/settings/RecipesScreen.js +++ b/src/containers/settings/RecipesScreen.js | |||
@@ -7,7 +7,6 @@ import RecipePreviewsStore from '../../stores/RecipePreviewsStore'; | |||
7 | import RecipeStore from '../../stores/RecipesStore'; | 7 | import RecipeStore from '../../stores/RecipesStore'; |
8 | import ServiceStore from '../../stores/ServicesStore'; | 8 | import ServiceStore from '../../stores/ServicesStore'; |
9 | import UserStore from '../../stores/UserStore'; | 9 | import UserStore from '../../stores/UserStore'; |
10 | import { gaPage } from '../../lib/analytics'; | ||
11 | 10 | ||
12 | import RecipesDashboard from '../../components/settings/recipes/RecipesDashboard'; | 11 | import RecipesDashboard from '../../components/settings/recipes/RecipesDashboard'; |
13 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 12 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
@@ -33,20 +32,15 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend | |||
33 | autorunDisposer = null; | 32 | autorunDisposer = null; |
34 | 33 | ||
35 | componentDidMount() { | 34 | componentDidMount() { |
36 | gaPage('Settings/Recipe Dashboard/Featured'); | ||
37 | |||
38 | this.autorunDisposer = autorun(() => { | 35 | this.autorunDisposer = autorun(() => { |
39 | const { filter } = this.props.params; | 36 | const { filter } = this.props.params; |
40 | const { currentFilter } = this.state; | 37 | const { currentFilter } = this.state; |
41 | 38 | ||
42 | if (filter === 'all' && currentFilter !== 'all') { | 39 | if (filter === 'all' && currentFilter !== 'all') { |
43 | gaPage('Settings/Recipe Dashboard/All'); | ||
44 | this.setState({ currentFilter: 'all' }); | 40 | this.setState({ currentFilter: 'all' }); |
45 | } else if (filter === 'featured' && currentFilter !== 'featured') { | 41 | } else if (filter === 'featured' && currentFilter !== 'featured') { |
46 | gaPage('Settings/Recipe Dashboard/Featured'); | ||
47 | this.setState({ currentFilter: 'featured' }); | 42 | this.setState({ currentFilter: 'featured' }); |
48 | } else if (filter === 'dev' && currentFilter !== 'dev') { | 43 | } else if (filter === 'dev' && currentFilter !== 'dev') { |
49 | gaPage('Settings/Recipe Dashboard/Dev'); | ||
50 | this.setState({ currentFilter: 'dev' }); | 44 | this.setState({ currentFilter: 'dev' }); |
51 | } | 45 | } |
52 | }); | 46 | }); |
diff --git a/src/containers/settings/ServicesScreen.js b/src/containers/settings/ServicesScreen.js index b70a5506e..a501bf530 100644 --- a/src/containers/settings/ServicesScreen.js +++ b/src/containers/settings/ServicesScreen.js | |||
@@ -6,16 +6,11 @@ import { RouterStore } from 'mobx-react-router'; | |||
6 | // import RecipePreviewsStore from '../../stores/RecipePreviewsStore'; | 6 | // import RecipePreviewsStore from '../../stores/RecipePreviewsStore'; |
7 | import UserStore from '../../stores/UserStore'; | 7 | import UserStore from '../../stores/UserStore'; |
8 | import ServiceStore from '../../stores/ServicesStore'; | 8 | import ServiceStore from '../../stores/ServicesStore'; |
9 | import { gaPage } from '../../lib/analytics'; | ||
10 | 9 | ||
11 | import ServicesDashboard from '../../components/settings/services/ServicesDashboard'; | 10 | import ServicesDashboard from '../../components/settings/services/ServicesDashboard'; |
12 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 11 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
13 | 12 | ||
14 | export default @inject('stores', 'actions') @observer class ServicesScreen extends Component { | 13 | export default @inject('stores', 'actions') @observer class ServicesScreen extends Component { |
15 | componentDidMount() { | ||
16 | gaPage('Settings/Service Dashboard'); | ||
17 | } | ||
18 | |||
19 | componentWillUnmount() { | 14 | componentWillUnmount() { |
20 | this.props.actions.service.resetFilter(); | 15 | this.props.actions.service.resetFilter(); |
21 | this.props.actions.service.resetStatus(); | 16 | this.props.actions.service.resetStatus(); |
diff --git a/src/containers/settings/SettingsWindow.js b/src/containers/settings/SettingsWindow.js index 6d9e0ee77..663b9e2e4 100644 --- a/src/containers/settings/SettingsWindow.js +++ b/src/containers/settings/SettingsWindow.js | |||
@@ -7,6 +7,7 @@ import ServicesStore from '../../stores/ServicesStore'; | |||
7 | import Layout from '../../components/settings/SettingsLayout'; | 7 | import Layout from '../../components/settings/SettingsLayout'; |
8 | import Navigation from '../../components/settings/navigation/SettingsNavigation'; | 8 | import Navigation from '../../components/settings/navigation/SettingsNavigation'; |
9 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 9 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
10 | import { workspaceStore } from '../../features/workspaces'; | ||
10 | 11 | ||
11 | export default @inject('stores', 'actions') @observer class SettingsContainer extends Component { | 12 | export default @inject('stores', 'actions') @observer class SettingsContainer extends Component { |
12 | render() { | 13 | render() { |
@@ -16,6 +17,7 @@ export default @inject('stores', 'actions') @observer class SettingsContainer ex | |||
16 | const navigation = ( | 17 | const navigation = ( |
17 | <Navigation | 18 | <Navigation |
18 | serviceCount={stores.services.all.length} | 19 | serviceCount={stores.services.all.length} |
20 | workspaceCount={workspaceStore.workspaces.length} | ||
19 | /> | 21 | /> |
20 | ); | 22 | ); |
21 | 23 | ||
diff --git a/src/containers/settings/TeamScreen.js b/src/containers/settings/TeamScreen.js new file mode 100644 index 000000000..c69d5ad08 --- /dev/null +++ b/src/containers/settings/TeamScreen.js | |||
@@ -0,0 +1,57 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { inject, observer } from 'mobx-react'; | ||
4 | |||
5 | import UserStore from '../../stores/UserStore'; | ||
6 | import AppStore from '../../stores/AppStore'; | ||
7 | |||
8 | import TeamDashboard from '../../components/settings/team/TeamDashboard'; | ||
9 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | ||
10 | import { WEBSITE } from '../../environment'; | ||
11 | |||
12 | export default @inject('stores', 'actions') @observer class TeamScreen extends Component { | ||
13 | handleWebsiteLink(route) { | ||
14 | const { actions, stores } = this.props; | ||
15 | |||
16 | const url = `${WEBSITE}${route}?authToken=${stores.user.authToken}&utm_source=app&utm_medium=account_dashboard`; | ||
17 | console.log(url); | ||
18 | |||
19 | actions.app.openExternalUrl({ url }); | ||
20 | } | ||
21 | |||
22 | render() { | ||
23 | const { user } = this.props.stores; | ||
24 | |||
25 | const isLoadingUserInfo = user.getUserInfoRequest.isExecuting; | ||
26 | |||
27 | return ( | ||
28 | <ErrorBoundary> | ||
29 | <TeamDashboard | ||
30 | isLoading={isLoadingUserInfo} | ||
31 | userInfoRequestFailed={user.getUserInfoRequest.wasExecuted && user.getUserInfoRequest.isError} | ||
32 | retryUserInfoRequest={() => this.reloadData()} | ||
33 | openTeamManagement={() => this.handleWebsiteLink('/user/team')} | ||
34 | /> | ||
35 | </ErrorBoundary> | ||
36 | ); | ||
37 | } | ||
38 | } | ||
39 | |||
40 | TeamScreen.wrappedComponent.propTypes = { | ||
41 | stores: PropTypes.shape({ | ||
42 | user: PropTypes.instanceOf(UserStore).isRequired, | ||
43 | app: PropTypes.instanceOf(AppStore).isRequired, | ||
44 | }).isRequired, | ||
45 | actions: PropTypes.shape({ | ||
46 | payment: PropTypes.shape({ | ||
47 | createDashboardUrl: PropTypes.func.isRequired, | ||
48 | }).isRequired, | ||
49 | app: PropTypes.shape({ | ||
50 | openExternalUrl: PropTypes.func.isRequired, | ||
51 | }).isRequired, | ||
52 | user: PropTypes.shape({ | ||
53 | update: PropTypes.func.isRequired, | ||
54 | delete: PropTypes.func.isRequired, | ||
55 | }).isRequired, | ||
56 | }).isRequired, | ||
57 | }; | ||
diff --git a/src/containers/subscription/SubscriptionFormScreen.js b/src/containers/subscription/SubscriptionFormScreen.js index 3eb7b6255..cb67ee7f2 100644 --- a/src/containers/subscription/SubscriptionFormScreen.js +++ b/src/containers/subscription/SubscriptionFormScreen.js | |||
@@ -43,26 +43,31 @@ export default @inject('stores', 'actions') @observer class SubscriptionFormScre | |||
43 | }); | 43 | }); |
44 | 44 | ||
45 | const hostedPage = await stores.payment.createHostedPageRequest; | 45 | const hostedPage = await stores.payment.createHostedPageRequest; |
46 | const url = `file://${__dirname}/../../index.html#/payment/${encodeURIComponent(hostedPage.url)}`; | ||
47 | 46 | ||
48 | if (hostedPage.url) { | 47 | if (hostedPage.url) { |
49 | const paymentWindow = new BrowserWindow({ | 48 | if (hostedPage.legacyCheckoutFlow) { |
50 | parent: remote.getCurrentWindow(), | 49 | const paymentWindow = new BrowserWindow({ |
51 | modal: true, | 50 | parent: remote.getCurrentWindow(), |
52 | title: '🔒 Franz Supporter License', | 51 | modal: true, |
53 | width: 600, | 52 | title: '🔒 Franz Supporter License', |
54 | height: window.innerHeight - 100, | 53 | width: 600, |
55 | maxWidth: 600, | 54 | height: window.innerHeight - 100, |
56 | minWidth: 600, | 55 | maxWidth: 600, |
57 | webPreferences: { | 56 | minWidth: 600, |
58 | nodeIntegration: true, | 57 | webPreferences: { |
59 | }, | 58 | nodeIntegration: true, |
60 | }); | 59 | }, |
61 | paymentWindow.loadURL(url); | 60 | }); |
61 | paymentWindow.loadURL(`file://${__dirname}/../../index.html#/payment/${encodeURIComponent(hostedPage.url)}`); | ||
62 | 62 | ||
63 | paymentWindow.on('closed', () => { | 63 | paymentWindow.on('closed', () => { |
64 | onCloseWindow(); | 64 | onCloseWindow(); |
65 | }); | 65 | }); |
66 | } else { | ||
67 | actions.app.openExternalUrl({ | ||
68 | url: hostedPage.url, | ||
69 | }); | ||
70 | } | ||
66 | } | 71 | } |
67 | } | 72 | } |
68 | 73 | ||