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
dc310d2c
Commit
dc310d2c
authored
Sep 01, 2020
by
Rifka Kurnia Irfiana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update apprv matrix
parent
21ce0aae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
16 deletions
+21
-16
ApprovalMatrix.js
src/container/ApprovalMatrix/ApprovalMatrix.js
+11
-5
CreateApprovalMatrix.js
src/container/ApprovalMatrix/CreateApprovalMatrix.js
+5
-6
EditApprovalMatrix.js
src/container/ApprovalMatrix/EditApprovalMatrix.js
+5
-5
No files found.
src/container/ApprovalMatrix/ApprovalMatrix.js
View file @
dc310d2c
...
@@ -39,6 +39,9 @@ export default class ApprovalMatrix extends Component {
...
@@ -39,6 +39,9 @@ export default class ApprovalMatrix extends Component {
rows
:
null
,
rows
:
null
,
dataLoaded
:
false
,
dataLoaded
:
false
,
popupError
:
false
,
popupError
:
false
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
,
btncreate
:
false
,
btncreate
:
false
,
btnedit
:
false
,
btnedit
:
false
,
load
:
false
,
load
:
false
,
...
@@ -75,10 +78,11 @@ export default class ApprovalMatrix extends Component {
...
@@ -75,10 +78,11 @@ export default class ApprovalMatrix extends Component {
this
.
setState
({
payload
:
body
,
buttonError
:
false
})
this
.
setState
({
payload
:
body
,
buttonError
:
false
})
api
.
create
().
checkUploadAM
(
body
).
then
(
response
=>
{
api
.
create
().
checkUploadAM
(
body
).
then
(
response
=>
{
// console.log(response.data)
// console.log(response.data)
let
dataRow
=
[]
if
(
response
.
data
){
if
(
response
.
data
){
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
dataRow
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
dataRow
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
return
[
return
[
index
+
1
,
index
+
1
,
item
.
approval_type_name
,
item
.
approval_type_name
,
...
@@ -91,7 +95,7 @@ export default class ApprovalMatrix extends Component {
...
@@ -91,7 +95,7 @@ export default class ApprovalMatrix extends Component {
]
]
})
})
let
columns
=
[
let
columns
=
[
"
ID
"
,
"
Data
"
,
{
{
name
:
"Approval Type"
,
name
:
"Approval Type"
,
options
:
{
options
:
{
...
@@ -257,7 +261,7 @@ export default class ApprovalMatrix extends Component {
...
@@ -257,7 +261,7 @@ export default class ApprovalMatrix extends Component {
rows
:
dataRow
rows
:
dataRow
});
});
}
else
{
}
else
{
this
.
setState
({
dataLoaded
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Token"
))
{
if
(
response
.
data
.
message
.
includes
(
"Token"
))
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
localStorage
.
removeItem
(
Constant
.
TOKEN
)
...
@@ -267,7 +271,7 @@ export default class ApprovalMatrix extends Component {
...
@@ -267,7 +271,7 @@ export default class ApprovalMatrix extends Component {
})
})
}
}
}
else
{
}
else
{
this
.
setState
({
dataLoaded
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
}
else
{
}
else
{
this
.
setState
({
this
.
setState
({
...
@@ -303,6 +307,8 @@ export default class ApprovalMatrix extends Component {
...
@@ -303,6 +307,8 @@ export default class ApprovalMatrix extends Component {
load
:
true
load
:
true
})
})
}
}
}
else
{
this
.
setState
({
load
:
true
})
}
}
})
})
}
}
...
@@ -820,7 +826,7 @@ export default class ApprovalMatrix extends Component {
...
@@ -820,7 +826,7 @@ export default class ApprovalMatrix extends Component {
{
this
.
state
.
visibleUpload
&&
(
{
this
.
state
.
visibleUpload
&&
(
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
}}
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
}}
>
<
div
className
=
"popup-panel grid grid-2x
"
style
=
{{
backgroundColor
:
'#51c6ea'
,
height
:
64
,
borderTopRightRadius
:
8
,
borderTopLeftRadius
:
8
}}
>
<
div
className
=
"popup-panel grid grid-2x
main-color"
style
=
{{
height
:
64
,
borderTopRightRadius
:
8
,
borderTopLeftRadius
:
8
}}
>
<
div
className
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
className
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
className
=
"popup-title"
>
<
div
className
=
"popup-title"
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Upload
File
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Upload
File
<
/span
>
...
...
src/container/ApprovalMatrix/CreateApprovalMatrix.js
View file @
dc310d2c
...
@@ -215,12 +215,11 @@ export default class CreateApprovalMatrix extends Component {
...
@@ -215,12 +215,11 @@ export default class CreateApprovalMatrix extends Component {
this
.
setState
({
errorOrder
:
true
,
msgErrOrder
:
'Order Cannot be Empty.'
})
this
.
setState
({
errorOrder
:
true
,
msgErrOrder
:
'Order Cannot be Empty.'
})
}
}
else
if
(
R
.
isNil
(
this
.
state
.
userId
))
{
else
if
(
R
.
isNil
(
this
.
state
.
userId
))
{
// return alert("Pemberi Persetujuan tidak boleh kosong");
this
.
setState
({
errorApproved
:
true
,
msgErrApproved
:
'Approver Name Cannot be Empty.'
})
this
.
setState
({
errorApproved
:
true
,
msgErrApproved
:
'Approver Name Cannot be Empty.'
})
}
}
else
if
(
R
.
isNil
(
this
.
state
.
operatorId
))
{
//
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.' })
}
//
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Valid From Cannot be Empty.'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Valid From Cannot be Empty.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
...
@@ -389,8 +388,8 @@ export default class CreateApprovalMatrix extends Component {
...
@@ -389,8 +388,8 @@ export default class CreateApprovalMatrix extends Component {
<
TextField
{...
params
}
<
TextField
{...
params
}
label
=
"Operator"
label
=
"Operator"
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
error
=
{
this
.
state
.
errorOperator
}
//
error={this.state.errorOperator}
helperText
=
{
this
.
state
.
msgErrOperator
}
//
helperText={this.state.msgErrOperator}
InputLabelProps
=
{{
InputLabelProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
...
...
src/container/ApprovalMatrix/EditApprovalMatrix.js
View file @
dc310d2c
...
@@ -257,9 +257,9 @@ export default class EditApprovalMatrix extends Component {
...
@@ -257,9 +257,9 @@ export default class EditApprovalMatrix extends Component {
else
if
(
R
.
isNil
(
this
.
state
.
getApprovedBy
))
{
else
if
(
R
.
isNil
(
this
.
state
.
getApprovedBy
))
{
this
.
setState
({
errorApproved
:
true
,
msgErrApproved
:
'Approver Name Cannot be Empty.'
})
this
.
setState
({
errorApproved
:
true
,
msgErrApproved
:
'Approver Name Cannot be Empty.'
})
}
}
else
if
(
R
.
isNil
(
this
.
state
.
getOperators
))
{
//
else if (R.isNil(this.state.getOperators)) {
this
.
setState
({
errorOperator
:
true
,
msgErrOperator
:
'Operator Cannot be Empty.'
})
//
this.setState({ errorOperator: true, msgErrOperator: 'Operator Cannot be Empty.' })
}
//
}
else
if
(
R
.
isEmpty
(
this
.
state
.
startDate
))
{
else
if
(
R
.
isEmpty
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Valid From Cannot be Empty.'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Valid From Cannot be Empty.'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
endDate
))
{
}
else
if
(
R
.
isEmpty
(
this
.
state
.
endDate
))
{
...
@@ -429,8 +429,8 @@ export default class EditApprovalMatrix extends Component {
...
@@ -429,8 +429,8 @@ export default class EditApprovalMatrix extends Component {
<
TextField
{...
params
}
<
TextField
{...
params
}
label
=
"Operator"
label
=
"Operator"
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
error
=
{
this
.
state
.
errorOperator
}
//
error={this.state.errorOperator}
helperText
=
{
this
.
state
.
msgErrOperator
}
//
helperText={this.state.msgErrOperator}
InputLabelProps
=
{{
InputLabelProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
...
...
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