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
0029c985
Commit
0029c985
authored
Sep 06, 2020
by
Rifka Kurnia Irfiana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete approval matrix
parent
3e4aeeeb
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
197 additions
and
17 deletions
+197
-17
index.js
src/api/index.js
+2
-0
ApprovalMatrix.js
src/container/ApprovalMatrix/ApprovalMatrix.js
+70
-16
CreateApprovalMatrix.js
src/container/ApprovalMatrix/CreateApprovalMatrix.js
+1
-1
PopUpDelete.js
src/container/ApprovalMatrix/PopUpDelete.js
+124
-0
No files found.
src/api/index.js
View file @
0029c985
...
...
@@ -117,6 +117,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
updateVAM
=
(
body
)
=>
api
.
post
(
'/approval_matrix/visual_approval_matrix'
,
body
)
const
checkUploadAM
=
(
body
)
=>
api
.
post
(
'/approval_matrix/check_import_approval_matrix'
,
body
)
const
uploadAM
=
(
body
)
=>
api
.
post
(
'approval_matrix/import_approval_matrix'
,
body
)
const
deleteAM
=
(
id
)
=>
api
.
post
(
`approval_matrix/delete_approval_matrix/
${
id
}
`
)
//User
const
getUser
=
()
=>
api
.
get
(
'user/get_all_user'
)
...
...
@@ -213,6 +214,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
updateVAM
,
checkUploadAM
,
uploadAM
,
deleteAM
,
getUser
,
getDetailUser
,
searchUser
,
...
...
src/container/ApprovalMatrix/ApprovalMatrix.js
View file @
0029c985
This diff is collapsed.
Click to expand it.
src/container/ApprovalMatrix/CreateApprovalMatrix.js
View file @
0029c985
...
...
@@ -218,7 +218,7 @@ export default class CreateApprovalMatrix extends Component {
this
.
setState
({
errorApproved
:
true
,
msgErrApproved
:
'Approver Name Cannot be Empty.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
operatorId
))
{
this
.
setState
({
errorOperator
:
true
,
msgErrOperator
:
'Operator Cannot be Empty.'
})
this
.
setState
({
errorOperator
:
true
,
msgErrOperator
:
'Operator Cannot be Empty.
Please Choose - Option
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Valid From Cannot be Empty.'
})
...
...
src/container/ApprovalMatrix/PopUpDelete.js
0 → 100644
View file @
0029c985
import
React
,
{
Component
}
from
'react'
;
import
Images
from
'../../assets/Images'
;
import
{
Typography
}
from
'@material-ui/core'
;
import
api
from
"../../api"
;
import
Constant
from
'../../library/Constant'
;
export
default
class
PopUpDelete
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
id
:
''
,
getApprovedBy
:
null
,
getTypes
:
null
,
}
}
componentDidMount
()
{
if
(
this
.
props
.
type
===
'delete'
)
{
this
.
getDetailAM
()
}
}
getDetailAM
()
{
api
.
create
().
getDetailAM
(
this
.
props
.
data
[
1
]).
then
(
response
=>
{
console
.
log
(
response
.
data
)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
data
=
response
.
data
.
data
this
.
setState
({
id
:
data
.
approval_matrix_id
,
getTypes
:
data
.
approval_type_name
,
getApprovedBy
:
data
.
fullname
})
}
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
.
problem
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
// hapus(){
// 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'
)
{
let
payload
=
this
.
state
.
id
this
.
props
.
deleteAM
(
payload
)
}
}
render
()
{
return
(
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
,
padding
:
50
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
img
src
=
{
Images
.
failedCopy
}
/
>
<
/div
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'center'
,
marginTop
:
20
}}
>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
14
,
fontWeight
:
'bold'
}}
>
Delete
{
this
.
state
.
getTypes
}
-
{
this
.
state
.
getApprovedBy
}
?
<
/span
>
{
/* <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Please try again later.`}
</span> */
}
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
,
marginTop
:
24
}}
>
<
button
className
=
{
"btn-save"
}
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
<
span
style
=
{{
color
:
'white'
}}
>
Cancel
<
/span
>
<
/button
>
<
button
className
=
{
"btn-save"
}
style
=
{{
marginLeft
:
50
}}
onClick
=
{()
=>
this
.
hapus
()}
>
<
span
style
=
{{
color
:
'white'
}}
>
Delete
<
/span
>
<
/button
>
<
/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