Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
inventory-frontend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Jira
Jira
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
coding-brunch-hh
inventory-frontend
Commits
3cf2f8cd
Commit
3cf2f8cd
authored
Aug 07, 2018
by
Martin Fahl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes behaviour for submitting with empty name
parent
036dc8a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
src/components/AddDialog/AddDialog.js
src/components/AddDialog/AddDialog.js
+0
-2
src/container/AddDialogContainer/AddDialogContainer.js
src/container/AddDialogContainer/AddDialogContainer.js
+8
-4
No files found.
src/components/AddDialog/AddDialog.js
View file @
3cf2f8cd
...
...
@@ -32,8 +32,6 @@ const AddDialog = ({ name, quantity, isOpen, handleClose, handleCancel, handleAd
/
>
<
/Grid
>
<
/Grid
>
<
/form
>
<
/DialogContent
>
<
DialogActions
>
...
...
src/container/AddDialogContainer/AddDialogContainer.js
View file @
3cf2f8cd
...
...
@@ -26,6 +26,13 @@ const getNewQuantity = createSelector(
}
)
const
handleAdd
=
(
name
,
quantity
,
dispatch
)
=>
{
if
(
name
!==
""
)
{
dispatch
(
closeAddDialog
());
dispatch
(
addItem
(
name
,
quantity
))
}
}
const
mapStateToProps
=
state
=>
({
isOpen
:
getIsOpen
(
state
),
name
:
getNewName
(
state
),
...
...
@@ -35,10 +42,7 @@ const mapStateToProps = state => ({
const
mapDispatchToProps
=
(
dispatch
)
=>
({
handleClose
:
()
=>
dispatch
(
closeAddDialog
()),
handleCancel
:
()
=>
dispatch
(
closeAddDialog
()),
handleAdd
:
(
name
,
quantity
)
=>
{
dispatch
(
closeAddDialog
());
dispatch
(
addItem
(
name
,
quantity
))
},
handleAdd
:
(
name
,
quantity
)
=>
handleAdd
(
name
,
quantity
,
dispatch
),
updateName
:
event
=>
dispatch
(
updateAddDialogName
(
event
.
target
.
value
)),
updateQuantity
:
event
=>
dispatch
(
updateAddDialogQuantity
(
Number
(
event
.
target
.
value
)))
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment