From afed692390713ceebd8c6610d1d93a6a4ac89076 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Thu, 4 Apr 2019 16:16:13 +0200 Subject: fix issues for users that have workspace but downgraded to free --- src/containers/layout/AppLayoutContainer.js | 1 + .../workspaces/components/WorkspaceDrawer.js | 41 ++++++++++---- .../workspaces/components/WorkspacesDashboard.js | 62 +++++++++++----------- src/i18n/locales/defaultMessages.json | 13 +++++ src/i18n/locales/en-US.json | 3 +- .../workspaces/components/WorkspaceDrawer.json | 13 +++++ 6 files changed, 90 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 4329c3097..52d4e0c27 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js @@ -90,6 +90,7 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e getServicesForWorkspace={workspace => ( workspace ? workspace.services.map(id => services.one(id).name) : services.all.map(s => s.name) )} + onUpgradeAccountClick={() => openSettings({ path: 'user' })} /> ); diff --git a/src/features/workspaces/components/WorkspaceDrawer.js b/src/features/workspaces/components/WorkspaceDrawer.js index 3602da792..baf59a1fb 100644 --- a/src/features/workspaces/components/WorkspaceDrawer.js +++ b/src/features/workspaces/components/WorkspaceDrawer.js @@ -33,6 +33,10 @@ const messages = defineMessages({ id: 'workspaceDrawer.premiumCtaButtonLabel', defaultMessage: '!!!Create your first workspace', }, + reactivatePremiumAccount: { + id: 'workspaceDrawer.reactivatePremiumAccountLabel', + defaultMessage: '!!!Reactivate premium account', + }, }); const styles = theme => ({ @@ -77,6 +81,7 @@ class WorkspaceDrawer extends Component { static propTypes = { classes: PropTypes.object.isRequired, getServicesForWorkspace: PropTypes.func.isRequired, + onUpgradeAccountClick: PropTypes.func.isRequired, }; static contextTypes = { @@ -91,6 +96,7 @@ class WorkspaceDrawer extends Component { const { classes, getServicesForWorkspace, + onUpgradeAccountClick, } = this.props; const { intl } = this.context; const { @@ -119,19 +125,32 @@ class WorkspaceDrawer extends Component { /> - {!workspaceStore.userHasWorkspaces ? ( + {workspaceStore.isPremiumUpgradeRequired ? (
-
) : (
diff --git a/src/features/workspaces/components/WorkspacesDashboard.js b/src/features/workspaces/components/WorkspacesDashboard.js index a0a34c778..18813e267 100644 --- a/src/features/workspaces/components/WorkspacesDashboard.js +++ b/src/features/workspaces/components/WorkspacesDashboard.js @@ -147,38 +147,38 @@ class WorkspacesDashboard extends Component { onSubmit={onCreateWorkspaceSubmit} />
+ {getUserWorkspacesRequest.isExecuting ? ( + + ) : ( + + {/* ===== Workspace could not be loaded error ===== */} + {getUserWorkspacesRequest.error ? ( + + {intl.formatMessage(messages.workspacesRequestFailed)} + + ) : ( + + {/* ===== Workspaces list ===== */} + + {workspaces.map(workspace => ( + onWorkspaceClick(w)} + /> + ))} + +
+ )} +
+ )} - {getUserWorkspacesRequest.isExecuting ? ( - - ) : ( - - {/* ===== Workspace could not be loaded error ===== */} - {getUserWorkspacesRequest.error ? ( - - {intl.formatMessage(messages.workspacesRequestFailed)} - - ) : ( - - {/* ===== Workspaces list ===== */} - - {workspaces.map(workspace => ( - onWorkspaceClick(w)} - /> - ))} - -
- )} -
- )} ); diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 500053377..ec519bad5 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json @@ -3386,6 +3386,19 @@ "column": 25, "line": 32 } + }, + { + "defaultMessage": "!!!Reactivate your premium account!", + "end": { + "column": 3, + "line": 39 + }, + "file": "src/features/workspaces/components/WorkspaceDrawer.js", + "id": "workspaceDrawer.reactivatePremiumAccountLabel", + "start": { + "column": 28, + "line": 36 + } } ], "path": "src/features/workspaces/components/WorkspaceDrawer.json" diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 9770ff0d5..ed5d5e345 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -311,6 +311,7 @@ "workspaceDrawer.headline": "Workspaces", "workspaceDrawer.item.noServicesAddedYet": "No services added yet", "workspaceDrawer.premiumCtaButtonLabel": "Create your first workspace", + "workspaceDrawer.reactivatePremiumAccountLabel": "Reactivate premium account", "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 acd304253..37bae262a 100644 --- a/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json +++ b/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json @@ -63,5 +63,18 @@ "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 + } } ] \ No newline at end of file -- cgit v1.2.3-54-g00ecf