Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cicer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
meskio
cicer
Commits
3e4fd73f
Unverified
Commit
3e4fd73f
authored
4 years ago
by
meskio
Browse files
Options
Downloads
Patches
Plain Diff
Add confirmation on order deletion
parent
96198d70
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/order/ShowOrder.js
+26
-1
26 additions, 1 deletion
src/order/ShowOrder.js
with
26 additions
and
1 deletion
src/order/ShowOrder.js
+
26
−
1
View file @
3e4fd73f
...
...
@@ -10,6 +10,7 @@ import {
ButtonGroup
,
Spinner
,
Alert
,
Modal
,
}
from
"
react-bootstrap
"
;
import
PurchaseOrder
from
"
./PurchaseOrder
"
;
import
{
printDate
}
from
"
../util
"
;
...
...
@@ -100,6 +101,7 @@ class ShowOrder extends React.Component {
redirect
:
false
,
refetch
:
0
,
error
:
null
,
showDelete
:
false
,
};
}
...
...
@@ -183,7 +185,10 @@ class ShowOrder extends React.Component {
<
LinkContainer
to
=
{
"
/order/edit/
"
+
id
}
>
<
Button
variant
=
"
info
"
>
Modificar
<
/Button
>
<
/LinkContainer
>
<
Button
variant
=
"
danger
"
onClick
=
{()
=>
this
.
delorder
()}
>
<
Button
variant
=
"
danger
"
onClick
=
{()
=>
this
.
setState
({
showDelete
:
true
})}
>
Cancelar
<
/Button
>
<
/ButtonGroup
>
...
...
@@ -193,6 +198,8 @@ class ShowOrder extends React.Component {
const
deadlineStr
=
printDate
(
this
.
state
.
order
.
deadline
,
true
);
const
handleClose
=
()
=>
this
.
setState
({
showDelete
:
false
});
return
(
<
Fetcher
url
=
{
"
/api/order/
"
+
id
}
...
...
@@ -219,6 +226,24 @@ class ShowOrder extends React.Component {
{
this
.
showTransaction
()}
<
ShowOrderResults
order
=
{
this
.
state
.
order
}
/
>
<
Modal
show
=
{
this
.
state
.
showDelete
}
onHide
=
{
handleClose
}
>
<
Modal
.
Header
closeButton
>
<
Modal
.
Title
>
Confirmar
la
elminicacion
<
/Modal.Title
>
<
/Modal.Header
>
<
Modal
.
Body
>
<
p
>
¿
Borrar
permanentemente
el
pedido
{
this
.
state
.
order
.
name
}?
<
/p
>
<
p
>
Si
aceptas
devolvera
el
dinero
a
quien
haya
pedido
productos
.
<
/p
>
<
/Modal.Body
>
<
Modal
.
Footer
>
<
Button
variant
=
"
secondary
"
onClick
=
{
handleClose
}
>
Cancelar
<
/Button
>
<
Button
variant
=
"
danger
"
onClick
=
{()
=>
this
.
delorder
()}
>
Eliminar
<
/Button
>
<
/Modal.Footer
>
<
/Modal
>
<
/Fetcher
>
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment