diff options
author | vantezzen <properly@protonmail.com> | 2019-09-13 17:59:46 +0200 |
---|---|---|
committer | vantezzen <properly@protonmail.com> | 2019-09-13 17:59:46 +0200 |
commit | fb095e4984210ec63c5834d6762dec43457dbc57 (patch) | |
tree | a2c8b353313cb363a56722687e110c6f80f4b791 /src/features | |
parent | Use ferdi namespace on debugger (diff) | |
parent | Update CHANGELOG.md (diff) | |
download | ferdium-app-fb095e4984210ec63c5834d6762dec43457dbc57.tar.gz ferdium-app-fb095e4984210ec63c5834d6762dec43457dbc57.tar.zst ferdium-app-fb095e4984210ec63c5834d6762dec43457dbc57.zip |
Merge branch 'master' of https://github.com/meetfranz/franz into meetfranz-master
Diffstat (limited to 'src/features')
-rw-r--r-- | src/features/todos/components/TodosWebview.js | 60 | ||||
-rw-r--r-- | src/features/todos/store.js | 6 | ||||
-rw-r--r-- | src/features/workspaces/actions.js | 1 | ||||
-rw-r--r-- | src/features/workspaces/index.js | 1 | ||||
-rw-r--r-- | src/features/workspaces/store.js | 5 |
5 files changed, 13 insertions, 60 deletions
diff --git a/src/features/todos/components/TodosWebview.js b/src/features/todos/components/TodosWebview.js index 7fe9d354b..d4271dba0 100644 --- a/src/features/todos/components/TodosWebview.js +++ b/src/features/todos/components/TodosWebview.js | |||
@@ -6,16 +6,11 @@ import Webview from 'react-electron-web-view'; | |||
6 | import { Icon } from '@meetfranz/ui'; | 6 | import { Icon } from '@meetfranz/ui'; |
7 | import { defineMessages, intlShape } from 'react-intl'; | 7 | import { defineMessages, intlShape } from 'react-intl'; |
8 | 8 | ||
9 | import { mdiChevronRight, mdiCheckAll } from '@mdi/js'; | 9 | import { mdiCheckAll } from '@mdi/js'; |
10 | import * as environment from '../../../environment'; | 10 | import * as environment from '../../../environment'; |
11 | import Appear from '../../../components/ui/effects/Appear'; | 11 | import Appear from '../../../components/ui/effects/Appear'; |
12 | import UpgradeButton from '../../../components/ui/UpgradeButton'; | 12 | import UpgradeButton from '../../../components/ui/UpgradeButton'; |
13 | 13 | ||
14 | import SettingsStore from '../../../stores/SettingsStore'; | ||
15 | |||
16 | const OPEN_TODOS_BUTTON_SIZE = 45; | ||
17 | const CLOSE_TODOS_BUTTON_SIZE = 35; | ||
18 | |||
19 | const messages = defineMessages({ | 14 | const messages = defineMessages({ |
20 | premiumInfo: { | 15 | premiumInfo: { |
21 | id: 'feature.todos.premium.info', | 16 | id: 'feature.todos.premium.info', |
@@ -63,50 +58,6 @@ const styles = theme => ({ | |||
63 | background: theme.todos.dragIndicator.background, | 58 | background: theme.todos.dragIndicator.background, |
64 | 59 | ||
65 | }, | 60 | }, |
66 | openTodosButton: { | ||
67 | width: OPEN_TODOS_BUTTON_SIZE, | ||
68 | height: OPEN_TODOS_BUTTON_SIZE, | ||
69 | background: theme.todos.toggleButton.background, | ||
70 | position: 'absolute', | ||
71 | bottom: 120, | ||
72 | right: props => (props.width + (props.isVisible ? -OPEN_TODOS_BUTTON_SIZE / 2 : 0)), | ||
73 | borderRadius: OPEN_TODOS_BUTTON_SIZE / 2, | ||
74 | opacity: props => (props.isVisible ? 0 : 1), | ||
75 | transition: 'right 0.5s', | ||
76 | zIndex: 600, | ||
77 | display: 'flex', | ||
78 | alignItems: 'center', | ||
79 | justifyContent: 'center', | ||
80 | boxShadow: [0, 0, 10, theme.todos.toggleButton.shadowColor], | ||
81 | |||
82 | borderTopRightRadius: props => (props.isVisible ? null : 0), | ||
83 | borderBottomRightRadius: props => (props.isVisible ? null : 0), | ||
84 | |||
85 | '& svg': { | ||
86 | fill: theme.todos.toggleButton.textColor, | ||
87 | transition: 'all 0.5s', | ||
88 | }, | ||
89 | }, | ||
90 | closeTodosButton: { | ||
91 | width: CLOSE_TODOS_BUTTON_SIZE, | ||
92 | height: CLOSE_TODOS_BUTTON_SIZE, | ||
93 | background: theme.todos.toggleButton.background, | ||
94 | position: 'absolute', | ||
95 | bottom: 120, | ||
96 | right: ({ width }) => (width + -CLOSE_TODOS_BUTTON_SIZE / 2), | ||
97 | borderRadius: CLOSE_TODOS_BUTTON_SIZE / 2, | ||
98 | opacity: ({ isTodosIncludedInCurrentPlan }) => (!isTodosIncludedInCurrentPlan ? 1 : 0), | ||
99 | transition: 'opacity 0.5s', | ||
100 | zIndex: 600, | ||
101 | display: 'flex', | ||
102 | alignItems: 'center', | ||
103 | justifyContent: 'center', | ||
104 | boxShadow: [0, 0, 10, theme.todos.toggleButton.shadowColor], | ||
105 | |||
106 | '& svg': { | ||
107 | fill: theme.todos.toggleButton.textColor, | ||
108 | }, | ||
109 | }, | ||
110 | premiumContainer: { | 61 | premiumContainer: { |
111 | display: 'flex', | 62 | display: 'flex', |
112 | flexDirection: 'column', | 63 | flexDirection: 'column', |
@@ -134,7 +85,6 @@ class TodosWebview extends Component { | |||
134 | static propTypes = { | 85 | static propTypes = { |
135 | classes: PropTypes.object.isRequired, | 86 | classes: PropTypes.object.isRequired, |
136 | isVisible: PropTypes.bool.isRequired, | 87 | isVisible: PropTypes.bool.isRequired, |
137 | togglePanel: PropTypes.func.isRequired, | ||
138 | handleClientMessage: PropTypes.func.isRequired, | 88 | handleClientMessage: PropTypes.func.isRequired, |
139 | setTodosWebview: PropTypes.func.isRequired, | 89 | setTodosWebview: PropTypes.func.isRequired, |
140 | resize: PropTypes.func.isRequired, | 90 | resize: PropTypes.func.isRequired, |
@@ -233,7 +183,6 @@ class TodosWebview extends Component { | |||
233 | const { | 183 | const { |
234 | classes, | 184 | classes, |
235 | isVisible, | 185 | isVisible, |
236 | togglePanel, | ||
237 | isTodosIncludedInCurrentPlan, | 186 | isTodosIncludedInCurrentPlan, |
238 | stores, | 187 | stores, |
239 | } = this.props; | 188 | } = this.props; |
@@ -253,13 +202,6 @@ class TodosWebview extends Component { | |||
253 | onMouseUp={() => this.stopResize()} | 202 | onMouseUp={() => this.stopResize()} |
254 | ref={(node) => { this.node = node; }} | 203 | ref={(node) => { this.node = node; }} |
255 | > | 204 | > |
256 | <button | ||
257 | onClick={() => togglePanel()} | ||
258 | className={isVisible ? classes.closeTodosButton : classes.openTodosButton} | ||
259 | type="button" | ||
260 | > | ||
261 | <Icon icon={isVisible ? mdiChevronRight : mdiCheckAll} size={2} /> | ||
262 | </button> | ||
263 | <div | 205 | <div |
264 | className={classes.resizeHandler} | 206 | className={classes.resizeHandler} |
265 | style={Object.assign({ left: delta }, isDragging ? { width: 600, marginLeft: -200 } : {})} // This hack is required as resizing with webviews beneath behaves quite bad | 207 | style={Object.assign({ left: delta }, isDragging ? { width: 600, marginLeft: -200 } : {})} // This hack is required as resizing with webviews beneath behaves quite bad |
diff --git a/src/features/todos/store.js b/src/features/todos/store.js index 70818f9b8..d507237d1 100644 --- a/src/features/todos/store.js +++ b/src/features/todos/store.js | |||
@@ -33,7 +33,7 @@ export default class TodoStore extends FeatureStore { | |||
33 | 33 | ||
34 | @computed get isTodosPanelForceHidden() { | 34 | @computed get isTodosPanelForceHidden() { |
35 | const { isAnnouncementShown } = this.stores.announcements; | 35 | const { isAnnouncementShown } = this.stores.announcements; |
36 | return delayAppState.isDelayAppScreenVisible || !this.settings.isFeatureEnabledByUser || isAnnouncementShown; | 36 | return delayAppState.isDelayAppScreenVisible || !this.isFeatureEnabledByUser || isAnnouncementShown; |
37 | } | 37 | } |
38 | 38 | ||
39 | @computed get isTodosPanelVisible() { | 39 | @computed get isTodosPanelVisible() { |
@@ -41,6 +41,10 @@ export default class TodoStore extends FeatureStore { | |||
41 | return this.settings.isTodosPanelVisible; | 41 | return this.settings.isTodosPanelVisible; |
42 | } | 42 | } |
43 | 43 | ||
44 | @computed get isFeatureEnabledByUser() { | ||
45 | return this.settings.isFeatureEnabledByUser; | ||
46 | } | ||
47 | |||
44 | @computed get settings() { | 48 | @computed get settings() { |
45 | return localStorage.getItem('todos') || {}; | 49 | return localStorage.getItem('todos') || {}; |
46 | } | 50 | } |
diff --git a/src/features/workspaces/actions.js b/src/features/workspaces/actions.js index a85f8f57f..5b5db422e 100644 --- a/src/features/workspaces/actions.js +++ b/src/features/workspaces/actions.js | |||
@@ -21,6 +21,7 @@ export const workspaceActions = createActionsFromDefinitions({ | |||
21 | deactivate: {}, | 21 | deactivate: {}, |
22 | toggleWorkspaceDrawer: {}, | 22 | toggleWorkspaceDrawer: {}, |
23 | openWorkspaceSettings: {}, | 23 | openWorkspaceSettings: {}, |
24 | toggleKeepAllWorkspacesLoadedSetting: {}, | ||
24 | }, PropTypes.checkPropTypes); | 25 | }, PropTypes.checkPropTypes); |
25 | 26 | ||
26 | export default workspaceActions; | 27 | export default workspaceActions; |
diff --git a/src/features/workspaces/index.js b/src/features/workspaces/index.js index 1947053df..560b732ab 100644 --- a/src/features/workspaces/index.js +++ b/src/features/workspaces/index.js | |||
@@ -5,6 +5,7 @@ import { resetApiRequests } from './api'; | |||
5 | const debug = require('debug')('Ferdi:feature:workspaces'); | 5 | const debug = require('debug')('Ferdi:feature:workspaces'); |
6 | 6 | ||
7 | export const GA_CATEGORY_WORKSPACES = 'Workspaces'; | 7 | export const GA_CATEGORY_WORKSPACES = 'Workspaces'; |
8 | export const DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED = false; | ||
8 | 9 | ||
9 | export const workspaceStore = new WorkspacesStore(); | 10 | export const workspaceStore = new WorkspacesStore(); |
10 | 11 | ||
diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 1ad136a13..da1582a77 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js | |||
@@ -98,6 +98,7 @@ export default class WorkspacesStore extends FeatureStore { | |||
98 | [workspaceActions.update, this._update], | 98 | [workspaceActions.update, this._update], |
99 | [workspaceActions.activate, this._setActiveWorkspace], | 99 | [workspaceActions.activate, this._setActiveWorkspace], |
100 | [workspaceActions.deactivate, this._deactivateActiveWorkspace], | 100 | [workspaceActions.deactivate, this._deactivateActiveWorkspace], |
101 | [workspaceActions.toggleKeepAllWorkspacesLoadedSetting, this._toggleKeepAllWorkspacesLoadedSetting], | ||
101 | ]); | 102 | ]); |
102 | this._allActions = this._freeUserActions.concat(this._premiumUserActions); | 103 | this._allActions = this._freeUserActions.concat(this._premiumUserActions); |
103 | this._registerActions(this._allActions); | 104 | this._registerActions(this._allActions); |
@@ -246,6 +247,10 @@ export default class WorkspacesStore extends FeatureStore { | |||
246 | await updateWorkspaceRequest.execute(activeWorkspace); | 247 | await updateWorkspaceRequest.execute(activeWorkspace); |
247 | }; | 248 | }; |
248 | 249 | ||
250 | _toggleKeepAllWorkspacesLoadedSetting = async () => { | ||
251 | this._updateSettings({ keepAllWorkspacesLoaded: !this.settings.keepAllWorkspacesLoaded }); | ||
252 | }; | ||
253 | |||
249 | // Reactions | 254 | // Reactions |
250 | 255 | ||
251 | _setFeatureEnabledReaction = () => { | 256 | _setFeatureEnabledReaction = () => { |