diff options
author | 2021-12-14 15:26:06 +0100 | |
---|---|---|
committer | 2021-12-14 15:26:06 +0100 | |
commit | fa7b41da04f8d5fa8b6c8bd6d3edafa7c02a91ee (patch) | |
tree | 221e65a83ebca96edf7c3faf0c683e888f4866fe /src | |
parent | Set error to null on Request reset (diff) | |
download | ferdium-app-fa7b41da04f8d5fa8b6c8bd6d3edafa7c02a91ee.tar.gz ferdium-app-fa7b41da04f8d5fa8b6c8bd6d3edafa7c02a91ee.tar.zst ferdium-app-fa7b41da04f8d5fa8b6c8bd6d3edafa7c02a91ee.zip |
Add visual feedback on updateWorkspaceRequest error
Diffstat (limited to 'src')
-rw-r--r-- | src/features/workspaces/components/EditWorkspaceForm.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/features/workspaces/components/EditWorkspaceForm.js b/src/features/workspaces/components/EditWorkspaceForm.js index e8bd9d60c..406059795 100644 --- a/src/features/workspaces/components/EditWorkspaceForm.js +++ b/src/features/workspaces/components/EditWorkspaceForm.js | |||
@@ -5,6 +5,7 @@ import { defineMessages, injectIntl } from 'react-intl'; | |||
5 | import { Link } from 'react-router'; | 5 | import { Link } from 'react-router'; |
6 | import injectSheet from 'react-jss'; | 6 | import injectSheet from 'react-jss'; |
7 | 7 | ||
8 | import { Infobox } from '../../../components/ui/infobox/index'; | ||
8 | import { Input } from '../../../components/ui/input/index'; | 9 | import { Input } from '../../../components/ui/input/index'; |
9 | import { Button } from '../../../components/ui/button/index'; | 10 | import { Button } from '../../../components/ui/button/index'; |
10 | import Workspace from '../models/Workspace'; | 11 | import Workspace from '../models/Workspace'; |
@@ -92,7 +93,8 @@ class EditWorkspaceForm extends Component { | |||
92 | } | 93 | } |
93 | 94 | ||
94 | prepareWorkspaceForm(workspace) { | 95 | prepareWorkspaceForm(workspace) { |
95 | const { intl } = this.props; | 96 | const { intl, updateWorkspaceRequest } = this.props; |
97 | updateWorkspaceRequest.reset(); | ||
96 | return new Form({ | 98 | return new Form({ |
97 | fields: { | 99 | fields: { |
98 | name: { | 100 | name: { |
@@ -165,6 +167,14 @@ class EditWorkspaceForm extends Component { | |||
165 | <span className="settings__header-item">{workspace.name}</span> | 167 | <span className="settings__header-item">{workspace.name}</span> |
166 | </div> | 168 | </div> |
167 | <div className="settings__body"> | 169 | <div className="settings__body"> |
170 | {updateWorkspaceRequest.error && ( | ||
171 | <Infobox | ||
172 | icon="alert" | ||
173 | type="danger" | ||
174 | > | ||
175 | Error while saving workspace | ||
176 | </Infobox> | ||
177 | )} | ||
168 | <div className={classes.nameInput}> | 178 | <div className={classes.nameInput}> |
169 | <Input {...form.$('name').bind()} /> | 179 | <Input {...form.$('name').bind()} /> |
170 | <Toggle field={form.$('keepLoaded')} /> | 180 | <Toggle field={form.$('keepLoaded')} /> |