aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/workspaces')
-rw-r--r--src/features/workspaces/api.js12
-rw-r--r--src/features/workspaces/components/CreateWorkspaceForm.js4
-rw-r--r--src/features/workspaces/components/EditWorkspaceForm.js4
-rw-r--r--src/features/workspaces/components/WorkspaceDrawer.js9
-rw-r--r--src/features/workspaces/components/WorkspacesDashboard.js2
-rw-r--r--src/features/workspaces/index.js2
-rw-r--r--src/features/workspaces/store.js19
7 files changed, 20 insertions, 32 deletions
diff --git a/src/features/workspaces/api.js b/src/features/workspaces/api.js
index 0ec20c9ea..30fbd84be 100644
--- a/src/features/workspaces/api.js
+++ b/src/features/workspaces/api.js
@@ -1,14 +1,14 @@
1import { pick } from 'lodash'; 1import { pick } from 'lodash';
2import { sendAuthRequest } from '../../api/utils/auth'; 2import { sendAuthRequest } from '../../api/utils/auth';
3import { API, API_VERSION } from '../../environment';
4import Request from '../../stores/lib/Request'; 3import Request from '../../stores/lib/Request';
5import Workspace from './models/Workspace'; 4import Workspace from './models/Workspace';
5import apiBase from '../../api/apiBase';
6 6
7const debug = require('debug')('Franz:feature:workspaces:api'); 7const debug = require('debug')('Ferdi:feature:workspaces:api');
8 8
9export const workspaceApi = { 9export const workspaceApi = {
10 getUserWorkspaces: async () => { 10 getUserWorkspaces: async () => {
11 const url = `${API}/${API_VERSION}/workspace`; 11 const url = `${apiBase()}/workspace`;
12 debug('getUserWorkspaces GET', url); 12 debug('getUserWorkspaces GET', url);
13 const result = await sendAuthRequest(url, { method: 'GET' }); 13 const result = await sendAuthRequest(url, { method: 'GET' });
14 debug('getUserWorkspaces RESULT', result); 14 debug('getUserWorkspaces RESULT', result);
@@ -18,7 +18,7 @@ export const workspaceApi = {
18 }, 18 },
19 19
20 createWorkspace: async (name) => { 20 createWorkspace: async (name) => {
21 const url = `${API}/${API_VERSION}/workspace`; 21 const url = `${apiBase()}/workspace`;
22 const options = { 22 const options = {
23 method: 'POST', 23 method: 'POST',
24 body: JSON.stringify({ name }), 24 body: JSON.stringify({ name }),
@@ -31,7 +31,7 @@ export const workspaceApi = {
31 }, 31 },
32 32
33 deleteWorkspace: async (workspace) => { 33 deleteWorkspace: async (workspace) => {
34 const url = `${API}/${API_VERSION}/workspace/${workspace.id}`; 34 const url = `${apiBase()}/workspace/${workspace.id}`;
35 debug('deleteWorkspace DELETE', url); 35 debug('deleteWorkspace DELETE', url);
36 const result = await sendAuthRequest(url, { method: 'DELETE' }); 36 const result = await sendAuthRequest(url, { method: 'DELETE' });
37 debug('deleteWorkspace RESULT', result); 37 debug('deleteWorkspace RESULT', result);
@@ -40,7 +40,7 @@ export const workspaceApi = {
40 }, 40 },
41 41
42 updateWorkspace: async (workspace) => { 42 updateWorkspace: async (workspace) => {
43 const url = `${API}/${API_VERSION}/workspace/${workspace.id}`; 43 const url = `${apiBase()}/workspace/${workspace.id}`;
44 const options = { 44 const options = {
45 method: 'PUT', 45 method: 'PUT',
46 body: JSON.stringify(pick(workspace, ['name', 'services'])), 46 body: JSON.stringify(pick(workspace, ['name', 'services'])),
diff --git a/src/features/workspaces/components/CreateWorkspaceForm.js b/src/features/workspaces/components/CreateWorkspaceForm.js
index cddbb2b04..15b97121d 100644
--- a/src/features/workspaces/components/CreateWorkspaceForm.js
+++ b/src/features/workspaces/components/CreateWorkspaceForm.js
@@ -6,8 +6,7 @@ import { Input, Button } from '@meetfranz/forms';
6import injectSheet from 'react-jss'; 6import injectSheet from 'react-jss';
7import Form from '../../../lib/Form'; 7import Form from '../../../lib/Form';
8import { required } from '../../../helpers/validation-helpers'; 8import { required } from '../../../helpers/validation-helpers';
9import { gaEvent } from '../../../lib/analytics'; 9import { workspaceStore } from '../index';
10import { GA_CATEGORY_WORKSPACES, workspaceStore } from '../index';
11 10
12const messages = defineMessages({ 11const messages = defineMessages({
13 submitButton: { 12 submitButton: {
@@ -66,7 +65,6 @@ class CreateWorkspaceForm extends Component {
66 const { onSubmit } = this.props; 65 const { onSubmit } = this.props;
67 const values = f.values(); 66 const values = f.values();
68 onSubmit(values); 67 onSubmit(values);
69 gaEvent(GA_CATEGORY_WORKSPACES, 'create', values.name);
70 }, 68 },
71 }); 69 });
72 } 70 }
diff --git a/src/features/workspaces/components/EditWorkspaceForm.js b/src/features/workspaces/components/EditWorkspaceForm.js
index e602ebd5a..82ea1b564 100644
--- a/src/features/workspaces/components/EditWorkspaceForm.js
+++ b/src/features/workspaces/components/EditWorkspaceForm.js
@@ -12,8 +12,6 @@ import Form from '../../../lib/Form';
12import { required } from '../../../helpers/validation-helpers'; 12import { required } from '../../../helpers/validation-helpers';
13import WorkspaceServiceListItem from './WorkspaceServiceListItem'; 13import WorkspaceServiceListItem from './WorkspaceServiceListItem';
14import Request from '../../../stores/lib/Request'; 14import Request from '../../../stores/lib/Request';
15import { gaEvent } from '../../../lib/analytics';
16import { GA_CATEGORY_WORKSPACES } from '../index';
17 15
18const messages = defineMessages({ 16const messages = defineMessages({
19 buttonDelete: { 17 buttonDelete: {
@@ -103,7 +101,6 @@ class EditWorkspaceForm extends Component {
103 const { onSave } = this.props; 101 const { onSave } = this.props;
104 const values = f.values(); 102 const values = f.values();
105 onSave(values); 103 onSave(values);
106 gaEvent(GA_CATEGORY_WORKSPACES, 'save');
107 }, 104 },
108 onError: async () => {}, 105 onError: async () => {},
109 }); 106 });
@@ -112,7 +109,6 @@ class EditWorkspaceForm extends Component {
112 delete() { 109 delete() {
113 const { onDelete } = this.props; 110 const { onDelete } = this.props;
114 onDelete(); 111 onDelete();
115 gaEvent(GA_CATEGORY_WORKSPACES, 'delete');
116 } 112 }
117 113
118 toggleService(service) { 114 toggleService(service) {
diff --git a/src/features/workspaces/components/WorkspaceDrawer.js b/src/features/workspaces/components/WorkspaceDrawer.js
index e7bc0b157..f4ee89a14 100644
--- a/src/features/workspaces/components/WorkspaceDrawer.js
+++ b/src/features/workspaces/components/WorkspaceDrawer.js
@@ -10,8 +10,7 @@ import ReactTooltip from 'react-tooltip';
10import { mdiPlusBox, mdiSettings } from '@mdi/js'; 10import { mdiPlusBox, mdiSettings } from '@mdi/js';
11import WorkspaceDrawerItem from './WorkspaceDrawerItem'; 11import WorkspaceDrawerItem from './WorkspaceDrawerItem';
12import { workspaceActions } from '../actions'; 12import { workspaceActions } from '../actions';
13import { GA_CATEGORY_WORKSPACES, workspaceStore } from '../index'; 13import { workspaceStore } from '../index';
14import { gaEvent } from '../../../lib/analytics';
15 14
16const messages = defineMessages({ 15const messages = defineMessages({
17 headline: { 16 headline: {
@@ -155,7 +154,6 @@ class WorkspaceDrawer extends Component {
155 className={classes.workspacesSettingsButton} 154 className={classes.workspacesSettingsButton}
156 onClick={() => { 155 onClick={() => {
157 workspaceActions.openWorkspaceSettings(); 156 workspaceActions.openWorkspaceSettings();
158 gaEvent(GA_CATEGORY_WORKSPACES, 'settings', 'drawerHeadline');
159 }} 157 }}
160 data-tip={`${intl.formatMessage(messages.workspacesSettingsTooltip)}`} 158 data-tip={`${intl.formatMessage(messages.workspacesSettingsTooltip)}`}
161 > 159 >
@@ -177,7 +175,6 @@ class WorkspaceDrawer extends Component {
177 icon="mdiStar" 175 icon="mdiStar"
178 onClick={() => { 176 onClick={() => {
179 onUpgradeAccountClick(); 177 onUpgradeAccountClick();
180 gaEvent('User', 'upgrade', 'workspaceDrawer');
181 }} 178 }}
182 /> 179 />
183 ) : ( 180 ) : (
@@ -188,7 +185,6 @@ class WorkspaceDrawer extends Component {
188 icon={mdiPlusBox} 185 icon={mdiPlusBox}
189 onClick={() => { 186 onClick={() => {
190 workspaceActions.openWorkspaceSettings(); 187 workspaceActions.openWorkspaceSettings();
191 gaEvent(GA_CATEGORY_WORKSPACES, 'add', 'drawerPremiumCta');
192 }} 188 }}
193 /> 189 />
194 )} 190 )}
@@ -200,7 +196,6 @@ class WorkspaceDrawer extends Component {
200 onClick={() => { 196 onClick={() => {
201 workspaceActions.deactivate(); 197 workspaceActions.deactivate();
202 workspaceActions.toggleWorkspaceDrawer(); 198 workspaceActions.toggleWorkspaceDrawer();
203 gaEvent(GA_CATEGORY_WORKSPACES, 'switch', 'drawer');
204 }} 199 }}
205 services={getServicesForWorkspace(null)} 200 services={getServicesForWorkspace(null)}
206 isActive={actualWorkspace == null} 201 isActive={actualWorkspace == null}
@@ -214,7 +209,6 @@ class WorkspaceDrawer extends Component {
214 if (actualWorkspace === workspace) return; 209 if (actualWorkspace === workspace) return;
215 workspaceActions.activate({ workspace }); 210 workspaceActions.activate({ workspace });
216 workspaceActions.toggleWorkspaceDrawer(); 211 workspaceActions.toggleWorkspaceDrawer();
217 gaEvent(GA_CATEGORY_WORKSPACES, 'switch', 'drawer');
218 }} 212 }}
219 onContextMenuEditClick={() => workspaceActions.edit({ workspace })} 213 onContextMenuEditClick={() => workspaceActions.edit({ workspace })}
220 services={getServicesForWorkspace(workspace)} 214 services={getServicesForWorkspace(workspace)}
@@ -224,7 +218,6 @@ class WorkspaceDrawer extends Component {
224 className={classes.addNewWorkspaceLabel} 218 className={classes.addNewWorkspaceLabel}
225 onClick={() => { 219 onClick={() => {
226 workspaceActions.openWorkspaceSettings(); 220 workspaceActions.openWorkspaceSettings();
227 gaEvent(GA_CATEGORY_WORKSPACES, 'add', 'drawerAddLabel');
228 }} 221 }}
229 > 222 >
230 <Icon 223 <Icon
diff --git a/src/features/workspaces/components/WorkspacesDashboard.js b/src/features/workspaces/components/WorkspacesDashboard.js
index 70e213912..977b23999 100644
--- a/src/features/workspaces/components/WorkspacesDashboard.js
+++ b/src/features/workspaces/components/WorkspacesDashboard.js
@@ -46,7 +46,7 @@ const messages = defineMessages({
46 }, 46 },
47 workspaceFeatureHeadline: { 47 workspaceFeatureHeadline: {
48 id: 'settings.workspaces.workspaceFeatureHeadline', 48 id: 'settings.workspaces.workspaceFeatureHeadline',
49 defaultMessage: '!!!Less is More: Introducing Franz Workspaces', 49 defaultMessage: '!!!Less is More: Introducing Ferdi Workspaces',
50 }, 50 },
51}); 51});
52 52
diff --git a/src/features/workspaces/index.js b/src/features/workspaces/index.js
index ed3e52096..560b732ab 100644
--- a/src/features/workspaces/index.js
+++ b/src/features/workspaces/index.js
@@ -2,7 +2,7 @@ import { reaction } from 'mobx';
2import WorkspacesStore from './store'; 2import WorkspacesStore from './store';
3import { resetApiRequests } from './api'; 3import { resetApiRequests } from './api';
4 4
5const debug = require('debug')('Franz:feature:workspaces'); 5const debug = require('debug')('Ferdi:feature:workspaces');
6 6
7export const GA_CATEGORY_WORKSPACES = 'Workspaces'; 7export const GA_CATEGORY_WORKSPACES = 'Workspaces';
8export const DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED = false; 8export const DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED = false;
diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js
index 7f41cfc88..da1582a77 100644
--- a/src/features/workspaces/store.js
+++ b/src/features/workspaces/store.js
@@ -17,16 +17,16 @@ import { WORKSPACES_ROUTES } from './index';
17import { createReactions } from '../../stores/lib/Reaction'; 17import { createReactions } from '../../stores/lib/Reaction';
18import { createActionBindings } from '../utils/ActionBinding'; 18import { createActionBindings } from '../utils/ActionBinding';
19 19
20const debug = require('debug')('Franz:feature:workspaces:store'); 20const debug = require('debug')('Ferdi:feature:workspaces:store');
21 21
22export default class WorkspacesStore extends FeatureStore { 22export default class WorkspacesStore extends FeatureStore {
23 @observable isFeatureEnabled = false; 23 @observable isFeatureEnabled = true;
24 24
25 @observable isFeatureActive = false; 25 @observable isFeatureActive = false;
26 26
27 @observable isPremiumFeature = true; 27 @observable isPremiumFeature = false;
28 28
29 @observable isPremiumUpgradeRequired = true; 29 @observable isPremiumUpgradeRequired = false;
30 30
31 @observable activeWorkspace = null; 31 @observable activeWorkspace = null;
32 32
@@ -54,7 +54,8 @@ export default class WorkspacesStore extends FeatureStore {
54 } 54 }
55 55
56 @computed get isUserAllowedToUseFeature() { 56 @computed get isUserAllowedToUseFeature() {
57 return !this.isPremiumUpgradeRequired; 57 return true;
58 // return !this.isPremiumUpgradeRequired;
58 } 59 }
59 60
60 @computed get isAnyWorkspaceActive() { 61 @computed get isAnyWorkspaceActive() {
@@ -258,10 +259,10 @@ export default class WorkspacesStore extends FeatureStore {
258 }; 259 };
259 260
260 _setIsPremiumFeatureReaction = () => { 261 _setIsPremiumFeatureReaction = () => {
261 const { features } = this.stores; 262 // const { features } = this.stores;
262 const { isWorkspaceIncludedInCurrentPlan } = features.features; 263 // const { isWorkspaceIncludedInCurrentPlan } = features.features;
263 this.isPremiumFeature = !isWorkspaceIncludedInCurrentPlan; 264 // this.isPremiumFeature = !isWorkspaceIncludedInCurrentPlan;
264 this.isPremiumUpgradeRequired = !isWorkspaceIncludedInCurrentPlan; 265 // this.isPremiumUpgradeRequired = !isWorkspaceIncludedInCurrentPlan;
265 }; 266 };
266 267
267 _setWorkspaceBeingEditedReaction = () => { 268 _setWorkspaceBeingEditedReaction = () => {