diff options
author | 2021-09-13 14:45:46 +0200 | |
---|---|---|
committer | 2021-09-13 14:45:46 +0200 | |
commit | 537697a6e9757f118d09d9e76362ba1ff617e2c6 (patch) | |
tree | bc55447115e385137684e84697a8c15d2199b8d5 /src/features/workspaces/components/EditWorkspaceForm.js | |
parent | Bumped up version to: 5.6.3-nightly.0 [skip ci] (diff) | |
download | ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.tar.gz ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.tar.zst ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.zip |
chore: upgrade intl dependencies (#1920)
Diffstat (limited to 'src/features/workspaces/components/EditWorkspaceForm.js')
-rw-r--r-- | src/features/workspaces/components/EditWorkspaceForm.js | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/features/workspaces/components/EditWorkspaceForm.js b/src/features/workspaces/components/EditWorkspaceForm.js index c97d4bd9c..cae95e9ed 100644 --- a/src/features/workspaces/components/EditWorkspaceForm.js +++ b/src/features/workspaces/components/EditWorkspaceForm.js | |||
@@ -1,7 +1,7 @@ | |||
1 | import React, { Component, Fragment } from 'react'; | 1 | import React, { Component, Fragment } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, injectIntl } from 'react-intl'; |
5 | import { Link } from 'react-router'; | 5 | import { Link } from 'react-router'; |
6 | import { Input, Button } from '@meetfranz/forms'; | 6 | import { Input, Button } from '@meetfranz/forms'; |
7 | import injectSheet from 'react-jss'; | 7 | import injectSheet from 'react-jss'; |
@@ -20,40 +20,40 @@ import Toggle from '../../../components/ui/Toggle'; | |||
20 | const messages = defineMessages({ | 20 | const messages = defineMessages({ |
21 | buttonDelete: { | 21 | buttonDelete: { |
22 | id: 'settings.workspace.form.buttonDelete', | 22 | id: 'settings.workspace.form.buttonDelete', |
23 | defaultMessage: '!!!Delete workspace', | 23 | defaultMessage: 'Delete workspace', |
24 | }, | 24 | }, |
25 | buttonSave: { | 25 | buttonSave: { |
26 | id: 'settings.workspace.form.buttonSave', | 26 | id: 'settings.workspace.form.buttonSave', |
27 | defaultMessage: '!!!Save workspace', | 27 | defaultMessage: 'Save workspace', |
28 | }, | 28 | }, |
29 | name: { | 29 | name: { |
30 | id: 'settings.workspace.form.name', | 30 | id: 'settings.workspace.form.name', |
31 | defaultMessage: '!!!Name', | 31 | defaultMessage: 'Name', |
32 | }, | 32 | }, |
33 | yourWorkspaces: { | 33 | yourWorkspaces: { |
34 | id: 'settings.workspace.form.yourWorkspaces', | 34 | id: 'settings.workspace.form.yourWorkspaces', |
35 | defaultMessage: '!!!Your workspaces', | 35 | defaultMessage: 'Your workspaces', |
36 | }, | 36 | }, |
37 | keepLoaded: { | 37 | keepLoaded: { |
38 | id: 'settings.workspace.form.keepLoaded', | 38 | id: 'settings.workspace.form.keepLoaded', |
39 | defaultMessage: '!!!Keep this workspace loaded*', | 39 | defaultMessage: 'Keep this workspace loaded*', |
40 | }, | 40 | }, |
41 | keepLoadedInfo: { | 41 | keepLoadedInfo: { |
42 | id: 'settings.workspace.form.keepLoadedInfo', | 42 | id: 'settings.workspace.form.keepLoadedInfo', |
43 | defaultMessage: | 43 | defaultMessage: |
44 | '!!!*This option will be overwritten by the global "Keep all workspaces loaded" option.', | 44 | '*This option will be overwritten by the global "Keep all workspaces loaded" option.', |
45 | }, | 45 | }, |
46 | servicesInWorkspaceHeadline: { | 46 | servicesInWorkspaceHeadline: { |
47 | id: 'settings.workspace.form.servicesInWorkspaceHeadline', | 47 | id: 'settings.workspace.form.servicesInWorkspaceHeadline', |
48 | defaultMessage: '!!!Services in this Workspace', | 48 | defaultMessage: 'Services in this Workspace', |
49 | }, | 49 | }, |
50 | noServicesAdded: { | 50 | noServicesAdded: { |
51 | id: 'settings.services.noServicesAdded', | 51 | id: 'settings.services.noServicesAdded', |
52 | defaultMessage: '!!!Start by adding a service.', | 52 | defaultMessage: 'Start by adding a service.', |
53 | }, | 53 | }, |
54 | discoverServices: { | 54 | discoverServices: { |
55 | id: 'settings.services.discoverServices', | 55 | id: 'settings.services.discoverServices', |
56 | defaultMessage: '!!!Discover services', | 56 | defaultMessage: 'Discover services', |
57 | }, | 57 | }, |
58 | }); | 58 | }); |
59 | 59 | ||
@@ -72,10 +72,6 @@ const styles = () => ({ | |||
72 | @injectSheet(styles) | 72 | @injectSheet(styles) |
73 | @observer | 73 | @observer |
74 | class EditWorkspaceForm extends Component { | 74 | class EditWorkspaceForm extends Component { |
75 | static contextTypes = { | ||
76 | intl: intlShape, | ||
77 | }; | ||
78 | |||
79 | static propTypes = { | 75 | static propTypes = { |
80 | classes: PropTypes.object.isRequired, | 76 | classes: PropTypes.object.isRequired, |
81 | onDelete: PropTypes.func.isRequired, | 77 | onDelete: PropTypes.func.isRequired, |
@@ -97,7 +93,7 @@ class EditWorkspaceForm extends Component { | |||
97 | } | 93 | } |
98 | 94 | ||
99 | prepareWorkspaceForm(workspace) { | 95 | prepareWorkspaceForm(workspace) { |
100 | const { intl } = this.context; | 96 | const { intl } = this.props; |
101 | return new Form({ | 97 | return new Form({ |
102 | fields: { | 98 | fields: { |
103 | name: { | 99 | name: { |
@@ -120,7 +116,7 @@ class EditWorkspaceForm extends Component { | |||
120 | 116 | ||
121 | save(form) { | 117 | save(form) { |
122 | form.submit({ | 118 | form.submit({ |
123 | onSuccess: async (f) => { | 119 | onSuccess: async f => { |
124 | const { onSave } = this.props; | 120 | const { onSave } = this.props; |
125 | const values = f.values(); | 121 | const values = f.values(); |
126 | onSave(values); | 122 | onSave(values); |
@@ -146,7 +142,7 @@ class EditWorkspaceForm extends Component { | |||
146 | } | 142 | } |
147 | 143 | ||
148 | render() { | 144 | render() { |
149 | const { intl } = this.context; | 145 | const { intl } = this.props; |
150 | const { | 146 | const { |
151 | classes, | 147 | classes, |
152 | workspace, | 148 | workspace, |
@@ -194,7 +190,7 @@ class EditWorkspaceForm extends Component { | |||
194 | </div> | 190 | </div> |
195 | ) : ( | 191 | ) : ( |
196 | <> | 192 | <> |
197 | {services.map((s) => ( | 193 | {services.map(s => ( |
198 | <WorkspaceServiceListItem | 194 | <WorkspaceServiceListItem |
199 | key={s.id} | 195 | key={s.id} |
200 | service={s} | 196 | service={s} |
@@ -233,4 +229,4 @@ class EditWorkspaceForm extends Component { | |||
233 | } | 229 | } |
234 | } | 230 | } |
235 | 231 | ||
236 | export default EditWorkspaceForm; | 232 | export default injectIntl(EditWorkspaceForm); |