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
2800628e
Commit
2800628e
authored
Aug 28, 2020
by
Rifka Kurnia Irfiana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update permission approval matrix
parent
3da9297e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
63 deletions
+117
-63
ApprovalMatrix.js
src/container/ApprovalMatrix/ApprovalMatrix.js
+93
-57
CreateApprovalMatrix.js
src/container/ApprovalMatrix/CreateApprovalMatrix.js
+11
-3
EditApprovalMatrix.js
src/container/ApprovalMatrix/EditApprovalMatrix.js
+11
-3
VisualisasiAM.js
src/container/ApprovalMatrix/VisualisasiAM.js
+2
-0
No files found.
src/container/ApprovalMatrix/ApprovalMatrix.js
View file @
2800628e
...
...
@@ -37,7 +37,10 @@ export default class ApprovalMatrix extends Component {
cols
:
null
,
rows
:
null
,
dataLoaded
:
false
,
popupError
:
false
popupError
:
false
,
btncreate
:
false
,
btnedit
:
false
,
load
:
false
,
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
...
...
@@ -264,6 +267,29 @@ export default class ApprovalMatrix extends Component {
componentDidMount
()
{
this
.
getData
()
this
.
getPermission
()
}
getPermission
()
{
let
payload
=
{
menu
:
"approval matrix"
}
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
btncreate
:
response
.
data
.
data
.
create
,
btnedit
:
response
.
data
.
data
.
edit
,
load
:
true
})
}
else
{
this
.
setState
({
load
:
true
})
}
}
})
}
getData
()
{
...
...
@@ -427,17 +453,19 @@ export default class ApprovalMatrix extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
}}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
// onClick={() => this.setState({ visibleEdit: true })}
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
{
this
.
state
.
btnedit
&&
(
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
}}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
// onClick={() => this.setState({ visibleEdit: true })}
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
)}
<
/div
>
);
}
...
...
@@ -519,6 +547,7 @@ export default class ApprovalMatrix extends Component {
return
(
<
div
>
{
this
.
state
.
visibleAM
===
true
?
this
.
state
.
load
&&
(
<
div
style
=
{{
height
:
this
.
props
.
height
}}
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
...
...
@@ -555,21 +584,23 @@ export default class ApprovalMatrix extends Component {
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
marginLeft
:
16
,
padding
:
0
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
>
<
img
src
=
{
Images
.
upload
}
/
>
<
/button
>
<
/a
>
{
this
.
state
.
btncreate
&&
(
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
marginLeft
:
16
,
padding
:
0
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
>
<
img
src
=
{
Images
.
upload
}
/
>
<
/button
>
<
/a
>
)}
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
...
...
@@ -587,37 +618,39 @@ export default class ApprovalMatrix extends Component {
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Visualization'
}
data
-
for
=
"visualisasi"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
marginLeft
:
16
,
padding
:
0
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleVisual
:
true
,
visibleAM
:
false
})}
>
<
img
src
=
{
Images
.
visualisasi
}
/
>
<
/button
>
<
/a
>
<
a
data
-
tip
=
{
'Visualization'
}
data
-
for
=
"visualisasi"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
marginLeft
:
16
,
padding
:
0
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleVisual
:
true
,
visibleAM
:
false
})}
>
<
img
src
=
{
Images
.
visualisasi
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"visualisasi"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Add'
}
data
-
for
=
"create"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
marginLeft
:
16
,
padding
:
0
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
>
<
img
src
=
{
Images
.
add
}
/
>
<
/button
>
<
/a
>
{
this
.
state
.
btncreate
&&
(
<
a
data
-
tip
=
{
'Add'
}
data
-
for
=
"create"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
marginLeft
:
16
,
padding
:
0
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
>
<
img
src
=
{
Images
.
add
}
/
>
<
/button
>
<
/a
>
)}
<
ReactTooltip
border
=
{
true
}
id
=
"create"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
<
/div
>
...
...
@@ -633,9 +666,12 @@ export default class ApprovalMatrix extends Component {
<
/div
>
<
/div
>
<
/div
>
)
:
this
.
state
.
visibleVisual
==
true
?
<
VisualisasiAM
btncreate
=
{
this
.
state
.
btncreate
}
btnedit
=
{
this
.
state
.
btnedit
}
onClickClose
=
{()
=>
this
.
setState
({
visibleVisual
:
false
,
visibleAM
:
true
})}
height
=
{
this
.
props
.
height
}
updateVAM
=
{
this
.
updateVAM
.
bind
(
this
)}
...
...
src/container/ApprovalMatrix/CreateApprovalMatrix.js
View file @
2800628e
...
...
@@ -269,11 +269,19 @@ export default class CreateApprovalMatrix extends Component {
style
=
{{
width
:
'100%'
}}
id
=
"order"
label
=
"Order"
type
=
{
"number"
}
value
=
{
this
.
state
.
order
}
//
type={"number"}
value
=
{
this
.
state
.
order
===
null
?
''
:
this
.
state
.
order
}
error
=
{
this
.
state
.
errorOrder
}
helperText
=
{
this
.
state
.
msgErrOrder
}
onChange
=
{(
e
)
=>
this
.
setState
({
order
:
e
.
target
.
value
},
()
=>
this
.
clearError
())}
// onChange={(e) => this.setState({ order: e.target.value }, () => this.clearError())}
onChange
=
{(
e
)
=>
{
let
coba
=
String
(
e
.
target
.
value
).
replace
(
/
[^\d]
/g
,
''
);
this
.
setState
({
order
:
coba
},
()
=>
this
.
clearError
())}
// this.handleChange(coba, 'value')}
}
inputProps
=
{{
style
:
{
fontSize
:
11
...
...
src/container/ApprovalMatrix/EditApprovalMatrix.js
View file @
2800628e
...
...
@@ -288,11 +288,19 @@ export default class EditApprovalMatrix extends Component {
style
=
{{
width
:
'100%'
}}
id
=
"order"
label
=
"Order"
type
=
{
"number"
}
value
=
{
this
.
state
.
order
}
//
type={"number"}
value
=
{
this
.
state
.
order
===
null
?
''
:
this
.
state
.
order
}
error
=
{
this
.
state
.
errorOrder
}
helperText
=
{
this
.
state
.
msgErrOrder
}
onChange
=
{(
e
)
=>
this
.
setState
({
order
:
e
.
target
.
value
},
()
=>
this
.
clearError
())}
// onChange={(e) => this.setState({ order: e.target.value }, () => this.clearError())}
onChange
=
{(
e
)
=>
{
let
coba
=
String
(
e
.
target
.
value
).
replace
(
/
[^\d]
/g
,
''
);
this
.
setState
({
order
:
coba
},
()
=>
this
.
clearError
())}
// this.handleChange(coba, 'value')}
}
inputProps
=
{{
style
:
{
fontSize
:
11
...
...
src/container/ApprovalMatrix/VisualisasiAM.js
View file @
2800628e
...
...
@@ -204,6 +204,7 @@ export default class VisualisasiAM extends Component {
<
div
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
style
=
{{
width
:
102
,
height
:
30
,
marginLeft
:
25
,
backgroundColor
:
'dodgerblue'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
,
cursor
:
"pointer"
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Back
<
/span
>
<
/div
>
{
this
.
props
.
buttonEdit
&&
(
<
div
className
=
"row"
style
=
{{
float
:
'right'
,
marginRight
:
25
}}
>
<
div
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
,
cursor
:
"pointer"
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cancel
<
/span
>
...
...
@@ -212,6 +213,7 @@ export default class VisualisasiAM extends Component {
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Save
<
/span
>
<
/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