Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
03d79925
Commit
03d79925
authored
Sep 07, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rifka' into 'master'
update pop up delete See merge request
!251
parents
ffa7a76b
8b585179
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
84 deletions
+64
-84
ApprovalMatrix.js
src/container/ApprovalMatrix/ApprovalMatrix.js
+35
-30
PopUpDeleteAM.js
src/container/ApprovalMatrix/PopUpDeleteAM.js
+29
-54
No files found.
src/container/ApprovalMatrix/ApprovalMatrix.js
View file @
03d79925
...
@@ -11,7 +11,7 @@ import UploadFile from "../../library/Upload";
...
@@ -11,7 +11,7 @@ import UploadFile from "../../library/Upload";
import
CreateApprovalMatrix
from
"./CreateApprovalMatrix"
;
import
CreateApprovalMatrix
from
"./CreateApprovalMatrix"
;
import
EditApprovalMatrix
from
"./EditApprovalMatrix"
;
import
EditApprovalMatrix
from
"./EditApprovalMatrix"
;
import
VisualisasiAM
from
"./VisualisasiAM"
;
import
VisualisasiAM
from
"./VisualisasiAM"
;
import
PopUpDelete
from
"./PopUpDelete
"
;
import
PopUpDelete
AM
from
"./PopUpDeleteAM
"
;
import
PopUpFailedSave
from
"../../library/PopUpFailedSave"
;
import
PopUpFailedSave
from
"../../library/PopUpFailedSave"
;
import
api
from
"../../api"
;
import
api
from
"../../api"
;
import
Constant
from
'../../library/Constant'
;
import
Constant
from
'../../library/Constant'
;
...
@@ -581,34 +581,39 @@ export default class ApprovalMatrix extends Component {
...
@@ -581,34 +581,39 @@ export default class ApprovalMatrix extends Component {
sort
:
false
,
sort
:
false
,
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
this
.
state
.
btnedit
&&
(
{
this
.
state
.
btnedit
&&
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
button
<
a
data
-
tip
=
{
'Edit'
}
data
-
for
=
"edit"
>
style
=
{{
<
button
backgroundColor
:
'transparent'
,
style
=
{{
cursor
:
'pointer'
,
backgroundColor
:
'transparent'
,
borderColor
:
'transparent'
cursor
:
'pointer'
,
}}
borderColor
:
'transparent'
,
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
marginRight
:
15
// onClick={() => this.setState({ visibleEdit: true })}
}}
>
// onClick={() => console.log(tableMeta)}
<
img
src
=
{
Images
.
editCopy
}
/
>
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
<
/button
>
>
)}
<
img
src
=
{
Images
.
editCopy
}
/
>
{
this
.
state
.
btnedit
&&
(
<
/button
>
<
button
<
/a
>
style
=
{{
<
ReactTooltip
border
=
{
true
}
id
=
"edit"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
backgroundColor
:
'transparent'
,
<
a
data
-
tip
=
{
'Delete'
}
data
-
for
=
"delete"
>
cursor
:
'pointer'
,
<
button
borderColor
:
'transparent'
,
style
=
{{
marginLeft
:
10
backgroundColor
:
'transparent'
,
}}
cursor
:
'pointer'
,
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'delete'
)}
borderColor
:
'transparent'
,
>
}}
<
img
src
=
{
Images
.
delete
}
/
>
// onClick={() => console.log(tableMeta)}
<
/button
>
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'delete'
)}
)}
>
<
/div
>
<
img
src
=
{
Images
.
delete
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"delete"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
)
);
);
}
}
}
}
...
@@ -874,7 +879,7 @@ export default class ApprovalMatrix extends Component {
...
@@ -874,7 +879,7 @@ export default class ApprovalMatrix extends Component {
/
>
/
>
)}
)}
{
this
.
state
.
popupDel
&&
(
{
this
.
state
.
popupDel
&&
(
<
PopUpDelete
<
PopUpDelete
AM
type
=
{
"delete"
}
type
=
{
"delete"
}
onClickClose
=
{()
=>
this
.
setState
({
popupDel
:
false
})}
onClickClose
=
{()
=>
this
.
setState
({
popupDel
:
false
})}
data
=
{
this
.
state
.
rowData
}
data
=
{
this
.
state
.
rowData
}
...
...
src/container/ApprovalMatrix/PopUpDelete.js
→
src/container/ApprovalMatrix/PopUpDelete
AM
.js
View file @
03d79925
...
@@ -4,7 +4,7 @@ import { Typography } from '@material-ui/core';
...
@@ -4,7 +4,7 @@ import { Typography } from '@material-ui/core';
import
api
from
"../../api"
;
import
api
from
"../../api"
;
import
Constant
from
'../../library/Constant'
;
import
Constant
from
'../../library/Constant'
;
export
default
class
PopUpDelete
extends
Component
{
export
default
class
PopUpDelete
AM
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
...
@@ -51,36 +51,7 @@ export default class PopUpDelete extends Component {
...
@@ -51,36 +51,7 @@ export default class PopUpDelete extends Component {
})
})
}
}
// hapus(){
onClickDelete
()
{
// this.setState({ popupDel: false })
// api.create().deleteAM(this.state.id).then(response => {
// console.log(response.data)
// if (response.data) {
// if (response.ok) {
// if (response.data.status == 'success') {
// // this.getData()
// this.props.getList()
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
// if (response.data.message.includes("Token")) {
// setTimeout(() => {
// localStorage.removeItem(Constant.TOKEN)
// window.location.reload();
// }, 1000);
// }
// })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
// }
// })
// }
hapus
()
{
if
(
this
.
props
.
type
==
'delete'
)
{
if
(
this
.
props
.
type
==
'delete'
)
{
let
payload
=
this
.
state
.
id
let
payload
=
this
.
state
.
id
this
.
props
.
deleteAM
(
payload
)
this
.
props
.
deleteAM
(
payload
)
...
@@ -90,32 +61,36 @@ export default class PopUpDelete extends Component {
...
@@ -90,32 +61,36 @@ export default class PopUpDelete extends Component {
render
()
{
render
()
{
return
(
return
(
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
,
padding
:
50
}}
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
,
paddingTop
:
20
}}
>
<
img
src
=
{
Images
.
failed
Copy
}
/
>
<
img
src
=
{
Images
.
failed
}
/
>
<
/div
>
<
/div
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'center'
,
marginTop
:
20
}}
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'center'
,
marginTop
:
20
,
paddingBottom
:
20
}}
>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
14
,
fontWeight
:
'bold'
}}
>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
14
,
fontWeight
:
'bold'
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Delete
{
this
.
state
.
getTypes
}
-
{
this
.
state
.
getApprovedBy
}
?
Delete
{
this
.
state
.
getTypes
}
-
{
this
.
state
.
getApprovedBy
}?
<
/span
>
<
/span
>
{
/* <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Please try again later.`}
</span> */
}
<
/div
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
,
marginTop
:
24
}}
>
<
div
className
=
"border-top grid grid-2x"
style
=
{{
height
:
56
,
backgroundColor
:
'#f5f5f5'
,
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
button
<
div
className
=
"column-1"
style
=
{{
alignSelf
:
'center'
}}
>
className
=
{
"btn-save"
}
<
button
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
type
=
"button"
>
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
<
span
style
=
{{
color
:
'white'
}}
>
Cancel
<
/span
>
>
<
/button
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
button
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cancel
<
/span
>
className
=
{
"btn-save"
}
<
/div
>
style
=
{{
marginLeft
:
50
}}
<
/button
>
onClick
=
{()
=>
this
.
hapus
()}
<
/div
>
>
<
div
className
=
"column-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
alignItems
:
'center'
}}
>
<
span
style
=
{{
color
:
'white'
}}
>
Delete
<
/span
>
<
button
<
/button
>
type
=
"button"
onClick
=
{()
=>
this
.
onClickDelete
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Delete
<
/span
>
<
/div
>
<
/button
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
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