diff options
author | 2019-09-16 12:46:13 +0200 | |
---|---|---|
committer | 2019-09-16 12:46:13 +0200 | |
commit | bf676f8597e5539c047f42a5716022681e3419c3 (patch) | |
tree | c5795bbc48951fdf643838eaa8f3294dff13dba4 /src/features/workspaces/components | |
parent | Add information about NodeJS version in dev (diff) | |
download | ferdium-app-bf676f8597e5539c047f42a5716022681e3419c3.tar.gz ferdium-app-bf676f8597e5539c047f42a5716022681e3419c3.tar.zst ferdium-app-bf676f8597e5539c047f42a5716022681e3419c3.zip |
Implement #37
Diffstat (limited to 'src/features/workspaces/components')
-rw-r--r-- | src/features/workspaces/components/EditWorkspaceForm.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/features/workspaces/components/EditWorkspaceForm.js b/src/features/workspaces/components/EditWorkspaceForm.js index 82ea1b564..b3551a7b9 100644 --- a/src/features/workspaces/components/EditWorkspaceForm.js +++ b/src/features/workspaces/components/EditWorkspaceForm.js | |||
@@ -13,6 +13,10 @@ import { required } from '../../../helpers/validation-helpers'; | |||
13 | import WorkspaceServiceListItem from './WorkspaceServiceListItem'; | 13 | import WorkspaceServiceListItem from './WorkspaceServiceListItem'; |
14 | import Request from '../../../stores/lib/Request'; | 14 | import Request from '../../../stores/lib/Request'; |
15 | 15 | ||
16 | import { KEEP_WS_LOADED_USID } from '../../../config'; | ||
17 | |||
18 | import Toggle from '../../../components/ui/Toggle'; | ||
19 | |||
16 | const messages = defineMessages({ | 20 | const messages = defineMessages({ |
17 | buttonDelete: { | 21 | buttonDelete: { |
18 | id: 'settings.workspace.form.buttonDelete', | 22 | id: 'settings.workspace.form.buttonDelete', |
@@ -30,6 +34,14 @@ const messages = defineMessages({ | |||
30 | id: 'settings.workspace.form.yourWorkspaces', | 34 | id: 'settings.workspace.form.yourWorkspaces', |
31 | defaultMessage: '!!!Your workspaces', | 35 | defaultMessage: '!!!Your workspaces', |
32 | }, | 36 | }, |
37 | keepLoaded: { | ||
38 | id: 'settings.workspace.form.keepLoaded', | ||
39 | defaultMessage: '!!!Keep this workspace loaded*', | ||
40 | }, | ||
41 | keepLoadedInfo: { | ||
42 | id: 'settings.workspace.form.keepLoadedInfo', | ||
43 | defaultMessage: '!!!*This option will be overwritten by the global "Keep all workspaces loaded" option.', | ||
44 | }, | ||
33 | servicesInWorkspaceHeadline: { | 45 | servicesInWorkspaceHeadline: { |
34 | id: 'settings.workspace.form.servicesInWorkspaceHeadline', | 46 | id: 'settings.workspace.form.servicesInWorkspaceHeadline', |
35 | defaultMessage: '!!!Services in this Workspace', | 47 | defaultMessage: '!!!Services in this Workspace', |
@@ -51,6 +63,9 @@ const styles = () => ({ | |||
51 | serviceList: { | 63 | serviceList: { |
52 | height: 'auto', | 64 | height: 'auto', |
53 | }, | 65 | }, |
66 | keepLoadedInfo: { | ||
67 | marginBottom: '2rem !important', | ||
68 | }, | ||
54 | }); | 69 | }); |
55 | 70 | ||
56 | @injectSheet(styles) @observer | 71 | @injectSheet(styles) @observer |
@@ -88,6 +103,11 @@ class EditWorkspaceForm extends Component { | |||
88 | value: workspace.name, | 103 | value: workspace.name, |
89 | validators: [required], | 104 | validators: [required], |
90 | }, | 105 | }, |
106 | keepLoaded: { | ||
107 | label: intl.formatMessage(messages.keepLoaded), | ||
108 | value: workspace.services.includes(KEEP_WS_LOADED_USID), | ||
109 | default: false, | ||
110 | }, | ||
91 | services: { | 111 | services: { |
92 | value: workspace.services.slice(), | 112 | value: workspace.services.slice(), |
93 | }, | 113 | }, |
@@ -151,6 +171,10 @@ class EditWorkspaceForm extends Component { | |||
151 | <div className="settings__body"> | 171 | <div className="settings__body"> |
152 | <div className={classes.nameInput}> | 172 | <div className={classes.nameInput}> |
153 | <Input {...form.$('name').bind()} /> | 173 | <Input {...form.$('name').bind()} /> |
174 | <Toggle field={form.$('keepLoaded')} /> | ||
175 | <p className={classes.keepLoadedInfo}> | ||
176 | { intl.formatMessage(messages.keepLoadedInfo) } | ||
177 | </p> | ||
154 | </div> | 178 | </div> |
155 | <h2>{intl.formatMessage(messages.servicesInWorkspaceHeadline)}</h2> | 179 | <h2>{intl.formatMessage(messages.servicesInWorkspaceHeadline)}</h2> |
156 | <div className={classes.serviceList}> | 180 | <div className={classes.serviceList}> |