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
fefcdcaf
Commit
fefcdcaf
authored
Sep 07, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'syadziy' into 'master'
Syadziy See merge request
!252
parents
03d79925
48587179
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
454 additions
and
89 deletions
+454
-89
index.js
src/api/index.js
+3
-1
EmailVerification.js
src/container/EmailVerification.js
+4
-0
ForgotPassword.js
src/container/ForgotPassword.js
+4
-0
CreatePerusahaan.js
src/container/MasterData/Perusahaan/CreatePerusahaan.js
+21
-7
Perusahaan.js
src/container/MasterData/Perusahaan/Perusahaan.js
+6
-1
ReportItems.js
src/container/MasterData/ReportItems.js
+215
-71
CreateReportItems.js
...container/MasterData/formReportItems/CreateReportItems.js
+98
-3
EditReportItems.js
src/container/MasterData/formReportItems/EditReportItems.js
+99
-2
Profile.js
src/container/Profile.js
+1
-1
ResetPassword.js
src/container/ResetPassword.js
+1
-1
SetPassword.js
src/container/SetPassword.js
+2
-2
No files found.
src/api/index.js
View file @
fefcdcaf
...
...
@@ -143,6 +143,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getItemReportHierarki
=
(
body
)
=>
api
.
post
(
'item_report/get_item_report_hierarki'
,
body
)
const
saveVisualisasiReport
=
(
body
)
=>
api
.
post
(
'item_report/save_visualization'
,
body
)
const
getReportParent
=
(
body
)
=>
api
.
post
(
'item_report/get_parent_item_report'
,
body
)
const
deleteReportItems
=
(
id
)
=>
api
.
post
(
`item_report/delete_item_report/
${
id
}
`
)
//PARAMETER
const
getAllParameter
=
()
=>
api
.
get
(
'/setting/get_all_setting'
)
...
...
@@ -271,7 +272,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
deleteAttachment
,
getDetailReportMB
,
deleteUnitBisnis
,
deleteParameter
deleteParameter
,
deleteReportItems
}
}
...
...
src/container/EmailVerification.js
View file @
fefcdcaf
...
...
@@ -12,6 +12,10 @@ class EmailVerification extends Component {
}
}
componentDidMount
(){
console
.
log
(
"forgot-password"
)
}
handleChange
(
e
)
{
let
data
=
this
.
state
this
.
setState
({...
data
,
[
e
.
target
.
name
]
:
e
.
target
.
value
})
...
...
src/container/ForgotPassword.js
View file @
fefcdcaf
...
...
@@ -22,6 +22,10 @@ class ForgotPassword extends Component {
}
}
componentDidMount
(){
console
.
log
(
"forgot-password"
)
}
handleChange
(
e
)
{
let
data
=
this
.
state
this
.
setState
({...
data
,
[
e
.
target
.
name
]
:
e
.
target
.
value
})
...
...
src/container/MasterData/Perusahaan/CreatePerusahaan.js
View file @
fefcdcaf
...
...
@@ -53,12 +53,12 @@ export default class CreatePerusahaan extends Component {
}
componentDidMount
()
{
this
.
getCompanyActive
()
this
.
getAllUnitBisnis
()
if
(
this
.
props
.
type
===
'edit'
)
{
this
.
getDetailPerusahaan
()
// console.log(this.props.data);
}
else
{
this
.
getCompanyActive
()
this
.
getAllUnitBisnis
()
let
date
=
format
(
new
Date
,
'yyyy-MM-dd'
)
// console.log(date);
this
.
setState
({
...
...
@@ -86,7 +86,12 @@ export default class CreatePerusahaan extends Component {
totalReport
:
response
.
data
.
data
.
total_report
,
created
:
response
.
data
.
data
.
created
,
updated
:
response
.
data
.
data
.
updated
===
null
?
""
:
response
.
data
.
data
.
updated
},
()
=>
this
.
getAllUnitBisnis
(),
this
.
getCompanyActive
())
},
()
=>
{
// setTimeout(() => {
this
.
getAllUnitBisnis
()
this
.
getCompanyActive
()
// }, 1000);
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Token"
))
{
...
...
@@ -107,6 +112,7 @@ export default class CreatePerusahaan extends Component {
}
getCompanyActive
()
{
console
.
log
(
this
.
state
.
company
)
if
(
this
.
state
.
company
!==
null
)
{
console
.
log
(
this
.
state
.
company
)
let
payload
=
{
...
...
@@ -118,12 +124,20 @@ export default class CreatePerusahaan extends Component {
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
let
perusahaanData
=
data
.
map
((
item
)
=>
{
return
{
company_id
:
item
.
company_id
,
company_name
:
item
.
company_name
let
currentIndex
=
null
let
perusahaanData
=
data
.
map
((
item
,
index
)
=>
{
if
(
this
.
state
.
companyID
!==
item
.
company_id
)
{
return
{
company_id
:
item
.
company_id
,
company_name
:
item
.
company_name
}
}
else
{
currentIndex
=
index
}
})
if
(
currentIndex
!==
null
)
{
perusahaanData
.
splice
(
currentIndex
,
1
)
}
let
index
=
perusahaanData
.
sort
((
a
,
b
)
=>
a
.
company_id
-
b
.
company_id
).
findIndex
((
val
)
=>
val
.
company_id
==
this
.
state
.
parentID
)
let
typeProps
=
{
options
:
perusahaanData
,
...
...
src/container/MasterData/Perusahaan/Perusahaan.js
View file @
fefcdcaf
...
...
@@ -498,7 +498,12 @@ export default class Perusahaan extends Component {
// onClick={() => this.setState({ visibleEdit: true, data: tableMeta.rowData })}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
!
tableMeta
.
rowData
[
2
].
includes
(
"TIA"
)
?
<
img
src
=
{
Images
.
editCopy
}
/>
:
null
}
<
/div
>
<
/button
>
)}
<
/div
>
...
...
src/container/MasterData/ReportItems.js
View file @
fefcdcaf
...
...
@@ -13,6 +13,7 @@ import api from "../../api";
import
ReactTooltip
from
"react-tooltip"
;
import
PopUpFailedSave
from
"../../library/PopUpFailedSave"
;
import
Constant
from
"../../library/Constant"
;
import
PopUpDelete
from
"../../library/PopUpDelete"
;
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
...
...
@@ -44,7 +45,9 @@ export default class ReportItems extends Component {
buttonCreate
:
false
,
buttonEdit
:
false
,
load
:
false
,
judul
:
''
judul
:
''
,
reportNameDelete
:
''
,
visibleDelete
:
false
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
...
@@ -75,8 +78,11 @@ export default class ReportItems extends Component {
formula
:
item
[
8
],
condition_it_should_be
:
item
[
9
]
===
undefined
?
null
:
item
[
9
],
condition_if_wrong
:
item
[
10
]
===
undefined
?
null
:
item
[
10
],
start_date
:
item
[
11
],
end_date
:
item
[
12
],
kpi_type
:
item
[
11
]
===
undefined
?
""
:
item
[
11
],
max_ach
:
item
[
12
]
===
undefined
?
""
:
item
[
12
],
formula_ytd
:
item
[
13
]
===
undefined
?
""
:
item
[
13
],
start_date
:
item
[
14
],
end_date
:
item
[
15
],
})
}
})
...
...
@@ -110,6 +116,9 @@ export default class ReportItems extends Component {
item
.
formula
,
item
.
condition_it_should_be
,
item
.
condition_if_wrong
,
item
.
kpi_type
,
item
.
max_ach
,
item
.
formula_ytd
,
item
.
start_date
,
item
.
end_date
,
item
.
error
...
...
@@ -121,16 +130,16 @@ export default class ReportItems extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
1
3
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
3
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'report'
))
if
(
tableMeta
.
rowData
[
1
6
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'report'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
1
3
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
3
][
check
].
message
}
data
-
for
=
"reportname"
>
{
tableMeta
.
rowData
[
1
6
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
6
][
check
].
message
}
data
-
for
=
"reportname"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
...
...
@@ -146,16 +155,16 @@ export default class ReportItems extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
1
3
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
3
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'company'
))
if
(
tableMeta
.
rowData
[
1
6
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'company'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
1
3
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
3
][
check
].
message
}
data
-
for
=
"companyname"
>
{
tableMeta
.
rowData
[
1
6
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
6
][
check
].
message
}
data
-
for
=
"companyname"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
...
...
@@ -171,16 +180,16 @@ export default class ReportItems extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
1
3
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
3
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'orders'
))
if
(
tableMeta
.
rowData
[
1
6
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'orders'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
1
3
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
3
][
check
].
message
}
data
-
for
=
"order"
>
{
tableMeta
.
rowData
[
1
6
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
6
][
check
].
message
}
data
-
for
=
"order"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
...
...
@@ -196,16 +205,16 @@ export default class ReportItems extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
1
3
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
3
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'description'
))
if
(
tableMeta
.
rowData
[
1
6
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'description'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
1
3
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
3
][
check
].
message
}
data
-
for
=
"desc"
>
{
tableMeta
.
rowData
[
1
6
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
6
][
check
].
message
}
data
-
for
=
"desc"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
...
...
@@ -221,16 +230,16 @@ export default class ReportItems extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
1
3
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
3
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'parent'
))
if
(
tableMeta
.
rowData
[
1
6
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'parent'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
1
3
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
3
][
check
].
message
}
data
-
for
=
"parents"
>
{
tableMeta
.
rowData
[
1
6
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
6
][
check
].
message
}
data
-
for
=
"parents"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
...
...
@@ -246,16 +255,16 @@ export default class ReportItems extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
1
3
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
3
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'uom'
))
if
(
tableMeta
.
rowData
[
1
6
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'uom'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
1
3
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
3
][
check
].
message
}
data
-
for
=
"uoms"
>
{
tableMeta
.
rowData
[
1
6
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
6
][
check
].
message
}
data
-
for
=
"uoms"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
...
...
@@ -271,16 +280,16 @@ export default class ReportItems extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
1
3
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
3
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'weight'
))
if
(
tableMeta
.
rowData
[
1
6
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'weight'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
1
3
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
3
][
check
].
message
}
data
-
for
=
"weights"
>
{
tableMeta
.
rowData
[
1
6
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
6
][
check
].
message
}
data
-
for
=
"weights"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
...
...
@@ -296,16 +305,16 @@ export default class ReportItems extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
1
3
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
3
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'type_report'
))
if
(
tableMeta
.
rowData
[
1
6
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'type_report'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
1
3
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
3
][
check
].
message
}
data
-
for
=
"datatype"
>
{
tableMeta
.
rowData
[
1
6
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
6
][
check
].
message
}
data
-
for
=
"datatype"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
...
...
@@ -321,16 +330,16 @@ export default class ReportItems extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
1
3
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
3
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'formula'
))
if
(
tableMeta
.
rowData
[
1
6
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'formula'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
1
3
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
3
][
check
].
message
}
data
-
for
=
"formulas"
>
{
tableMeta
.
rowData
[
1
6
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
6
][
check
].
message
}
data
-
for
=
"formulas"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
...
...
@@ -346,16 +355,16 @@ export default class ReportItems extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
1
3
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
3
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'condition_it_should_be'
))
if
(
tableMeta
.
rowData
[
1
6
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'condition_it_should_be'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
1
3
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
3
][
check
].
message
}
data
-
for
=
"values"
>
{
tableMeta
.
rowData
[
1
6
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
6
][
check
].
message
}
data
-
for
=
"values"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
...
...
@@ -371,16 +380,16 @@ export default class ReportItems extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
1
3
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
3
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'condition_if_wrong'
))
if
(
tableMeta
.
rowData
[
1
6
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'condition_if_wrong'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
1
3
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
3
][
check
].
message
}
data
-
for
=
"conditions"
>
{
tableMeta
.
rowData
[
1
6
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
6
][
check
].
message
}
data
-
for
=
"conditions"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
...
...
@@ -391,21 +400,96 @@ export default class ReportItems extends Component {
}
}
},
{
name
:
"KPI Type"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
16
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
16
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'kpi_type'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
16
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
16
][
check
].
message
}
data
-
for
=
"kpi_type"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
}
<
ReactTooltip
border
=
{
true
}
id
=
"kpi_type"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
);
}
}
},
{
name
:
"Max Achievement"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
16
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
16
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'max_ach'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
16
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
16
][
check
].
message
}
data
-
for
=
"max_ach"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
}
<
ReactTooltip
border
=
{
true
}
id
=
"max_ach"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
);
}
}
},
{
name
:
"Formula YTD"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
16
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
16
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'formula_ytd'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
16
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
16
][
check
].
message
}
data
-
for
=
"formula_ytd"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
}
<
ReactTooltip
border
=
{
true
}
id
=
"formula_ytd"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
);
}
}
},
{
name
:
"Valid From"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
1
3
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
3
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'start_date'
))
if
(
tableMeta
.
rowData
[
1
6
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'start_date'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
1
3
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
3
][
check
].
message
}
data
-
for
=
"startdate"
>
{
tableMeta
.
rowData
[
1
6
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
6
][
check
].
message
}
data
-
for
=
"startdate"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
...
...
@@ -421,16 +505,16 @@ export default class ReportItems extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
1
3
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
3
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'end_date'
))
if
(
tableMeta
.
rowData
[
1
6
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
1
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'end_date'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
1
3
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
3
][
check
].
message
}
data
-
for
=
"enddate"
>
{
tableMeta
.
rowData
[
1
6
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
1
6
][
check
].
message
}
data
-
for
=
"enddate"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"-"
:
val
}
<
/span
>
...
...
@@ -535,12 +619,46 @@ export default class ReportItems extends Component {
})
}
deleteReport
(
payload
)
{
console
.
log
(
payload
);
let
id
=
String
(
payload
[
1
])
api
.
create
().
deleteReportItems
(
id
).
then
(
response
=>
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
getData
()
this
.
setState
({
visibleDelete
:
false
,
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'
})
}
})
}
openPopUp
(
index
,
type
)
{
if
(
type
===
'edit'
)
{
this
.
setState
({
rowData
:
index
,
edit
:
true
})
}
else
if
(
type
===
'delete'
)
{
this
.
setState
({
rowData
:
index
,
reportNameDelete
:
"["
+
String
(
index
[
2
])
+
" - "
+
String
(
index
[
3
])
+
" - "
+
String
(
index
[
5
])
+
"]"
,
visibleDelete
:
true
})
}
else
{
this
.
setState
({
add
:
true
...
...
@@ -704,21 +822,39 @@ export default class ReportItems extends Component {
sort
:
false
,
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
this
.
state
.
buttonEdit
&&
(
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
}}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
this
.
state
.
buttonEdit
&&
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
a
data
-
tip
=
{
'Edit'
}
data
-
for
=
"edit"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
}}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
)}
<
/div
>
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"edit"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Delete'
}
data
-
for
=
"delete"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
marginLeft
:
15
}}
// onClick={() => console.log(tableMeta)}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'delete'
)}
>
<
img
src
=
{
Images
.
delete
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"delete"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
)
);
}
}
...
...
@@ -920,7 +1056,7 @@ export default class ReportItems extends Component {
<
img
src
=
{
Images
.
download
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"
visualisasi
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"
download
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Visualization'
}
data
-
for
=
"visualisasi"
>
<
button
style
=
{{
...
...
@@ -934,7 +1070,7 @@ export default class ReportItems extends Component {
<
img
src
=
{
Images
.
visualisasi
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"
tambah
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"
visualisasi
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
state
.
buttonCreate
&&
(
<
a
data
-
tip
=
{
'Add New'
}
data
-
for
=
"tambah"
>
<
button
...
...
@@ -1069,6 +1205,14 @@ export default class ReportItems extends Component {
<
/div
>
<
/div
>
)}
{
this
.
state
.
visibleDelete
&&
(
<
PopUpDelete
rowData
=
{
this
.
state
.
rowData
}
name
=
{
this
.
state
.
reportNameDelete
}
onClickClose
=
{()
=>
this
.
setState
({
visibleDelete
:
false
})}
onClickDelete
=
{
this
.
deleteReport
.
bind
(
this
)}
/
>
)}
<
/div
>
);
}
...
...
src/container/MasterData/formReportItems/CreateReportItems.js
View file @
fefcdcaf
...
...
@@ -60,8 +60,13 @@ export default class CreateReportItems extends Component {
options
:
[
'WARNING'
,
'STOPPER'
],
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
messageAlert
:
''
,
kpiType
:
[
'HIG'
,
'HIB'
],
maxAch
:
[
'50%'
,
'100%'
,
'Unlimited'
],
formulaYtd
:
[
'SUM'
,
'AVG'
,
'MIN'
,
'MAX'
],
kpiTypeValue
:
null
,
maxAchValue
:
null
,
formulaYTDValue
:
null
}
}
...
...
@@ -194,6 +199,9 @@ export default class CreateReportItems extends Component {
"weight"
:
this
.
state
.
weight
,
"condition_if_wrong"
:
this
.
state
.
condition
,
"condition_it_should_be"
:
this
.
state
.
realVal
,
"type_kpi"
:
this
.
state
.
kpiTypeValue
,
"max_ach"
:
this
.
state
.
maxAchValue
,
"formula_ytd"
:
this
.
state
.
formulaYTDValue
,
"start_date"
:
this
.
state
.
startDate
,
"end_date"
:
this
.
state
.
endDate
}
...
...
@@ -442,7 +450,10 @@ export default class CreateReportItems extends Component {
<
Autocomplete
{...
this
.
state
.
listReportType
}
id
=
"reportType"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
reportType
:
newInputValue
},
()
=>
this
.
clearMessage
())}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
reportType
:
newInputValue
},
()
=>
{
newInputValue
==
null
||
(
newInputValue
.
report_name
!==
'CAT'
)
?
this
.
setState
({
kpiTypeValue
:
null
,
maxAchValue
:
null
,
formulaYTDValue
:
null
},
()
=>
this
.
clearMessage
())
:
this
.
clearMessage
();
})}
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
...
...
@@ -778,6 +789,90 @@ export default class CreateReportItems extends Component {
<
/div
>
<
/div
>
{
this
.
state
.
reportType
!==
null
&&
(
this
.
state
.
reportType
.
report_name
===
'CAT'
&&
(
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px"
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"column-1"
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
value
=
{
this
.
state
.
kpiTypeValue
}
id
=
"kpiType"
onChange
=
{(
event
,
newValue
)
=>
{
this
.
setState
({
kpiTypeValue
:
newValue
},
()
=>
this
.
clearMessage
());
}}
options
=
{
this
.
state
.
kpiType
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"KPI Type"
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
}
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
/>
<
/div
>
<
/div
>
<
div
className
=
"column-2"
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
value
=
{
this
.
state
.
maxAchValue
}
id
=
"maxAch"
onChange
=
{(
event
,
newValue
)
=>
{
this
.
setState
({
maxAchValue
:
newValue
},
()
=>
this
.
clearMessage
());
}}
options
=
{
this
.
state
.
maxAch
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Max Achievement"
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
}
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
/>
<
/div
>
<
/div
>
<
/div
>
))}
{
this
.
state
.
reportType
!==
null
&&
(
this
.
state
.
reportType
.
report_name
===
'CAT'
&&
(
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px"
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"column-1"
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
value
=
{
this
.
state
.
formulaYTDValue
}
id
=
"formulaYTD"
onChange
=
{(
event
,
newValue
)
=>
{
this
.
setState
({
formulaYTDValue
:
newValue
},
()
=>
this
.
clearMessage
());
}}
options
=
{
this
.
state
.
formulaYtd
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Formula YTD"
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
}
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
/>
<
/div
>
<
/div
>
<
/div
>
))}
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px"
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"column-1"
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
...
...
src/container/MasterData/formReportItems/EditReportItems.js
View file @
fefcdcaf
...
...
@@ -62,7 +62,13 @@ export default class EditReportItems extends Component {
options
:
[
'WARNING'
,
'STOPPER'
],
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
messageAlert
:
''
,
kpiType
:
[
'HIG'
,
'HIB'
],
maxAch
:
[
'50%'
,
'100%'
,
'Unlimited'
],
formulaYtd
:
[
'SUM'
,
'AVG'
,
'MIN'
,
'MAX'
],
kpiTypeValue
:
null
,
maxAchValue
:
null
,
formulaYTDValue
:
null
}
}
...
...
@@ -169,6 +175,9 @@ export default class EditReportItems extends Component {
"weight"
:
this
.
state
.
tempData
.
weight
==
null
?
""
:
this
.
state
.
tempData
.
weight
,
"condition_if_wrong"
:
this
.
state
.
tempData
.
condition_if_wrong
,
"condition_it_should_be"
:
this
.
state
.
tempData
.
condition_it_should_be
,
"type_kpi"
:
this
.
state
.
tempData
.
kpi_type
,
"max_ach"
:
this
.
state
.
tempData
.
max_ach
,
"formula_ytd"
:
this
.
state
.
tempData
.
formula_ytd
,
"start_date"
:
this
.
state
.
tempData
.
start_date
,
"end_date"
:
this
.
state
.
tempData
.
end_date
}
...
...
@@ -456,7 +465,10 @@ export default class EditReportItems extends Component {
<
Autocomplete
{...
this
.
state
.
listReportType
}
id
=
"reportType"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
reportType
:
newInputValue
},
()
=>
this
.
getParent
(),
this
.
clearMessage
()
)}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
reportType
:
newInputValue
},
()
=>
newInputValue
==
null
||
(
newInputValue
.
report_name
!==
'CAT'
)
?
this
.
setState
({
tempData
:
{
...
this
.
state
.
tempData
,
kpi_type
:
null
,
max_ach
:
null
,
formula_ytd
:
null
}
},
()
=>
this
.
getParent
(),
this
.
clearMessage
())
:
this
.
getParent
(),
this
.
clearMessage
()
)}
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
...
...
@@ -760,6 +772,91 @@ export default class EditReportItems extends Component {
<
/div
>
<
/div
>
<
/div
>
{
this
.
state
.
reportType
!==
null
&&
(
this
.
state
.
reportType
.
report_name
===
'CAT'
&&
(
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px"
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"column-1"
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
value
=
{
this
.
state
.
tempData
===
null
?
""
:
this
.
state
.
tempData
.
kpi_type
}
id
=
"kpiType"
onChange
=
{(
event
,
newValue
)
=>
{
this
.
setState
({
tempData
:
{
...
this
.
state
.
tempData
,
kpi_type
:
newValue
}
},
()
=>
this
.
clearMessage
());
}}
options
=
{
this
.
state
.
kpiType
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"KPI Type"
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
}
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
/>
<
/div
>
<
/div
>
<
div
className
=
"column-2"
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
value
=
{
this
.
state
.
tempData
===
null
?
""
:
this
.
state
.
tempData
.
max_ach
}
id
=
"maxAch"
onChange
=
{(
event
,
newValue
)
=>
{
this
.
setState
({
tempData
:
{
...
this
.
state
.
tempData
,
max_ach
:
newValue
}
},
()
=>
this
.
clearMessage
());
}}
options
=
{
this
.
state
.
maxAch
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Max Achievement"
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
}
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
/>
<
/div
>
<
/div
>
<
/div
>
))}
{
this
.
state
.
reportType
!==
null
&&
(
this
.
state
.
reportType
.
report_name
===
'CAT'
&&
(
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px"
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"column-1"
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
value
=
{
this
.
state
.
tempData
===
null
?
""
:
this
.
state
.
tempData
.
formula_ytd
}
id
=
"kpiType"
onChange
=
{(
event
,
newValue
)
=>
{
this
.
setState
({
tempData
:
{
...
this
.
state
.
tempData
,
formula_ytd
:
newValue
}
},
()
=>
this
.
clearMessage
());
}}
options
=
{
this
.
state
.
formulaYtd
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Formula YTD"
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
}
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
/>
<
/div
>
<
/div
>
<
/div
>
))}
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px"
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"column-1"
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
...
...
src/container/Profile.js
View file @
fefcdcaf
...
...
@@ -94,7 +94,7 @@ export default class Profile extends Component {
}
else
if
(
!
this
.
isRegex
(
this
.
state
.
password
))
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password Must be a Combination of Characters, Letters and Numbers.'
})
}
else
if
(
this
.
state
.
confirmPassword
.
trim
()
==
""
)
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'
Password Confirmation
Cannot be Empty.'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'
Repeat Password
Cannot be Empty.'
})
}
else
if
(
this
.
state
.
password
!==
this
.
state
.
confirmPassword
)
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Password Does Not Match.'
})
}
else
{
...
...
src/container/ResetPassword.js
View file @
fefcdcaf
...
...
@@ -190,7 +190,7 @@ class ResetPassword extends Component {
}}
/
>
<
Button
name
=
"submit"
variant
=
"contained"
disabled
=
{
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
true
:
false
}
onClick
=
{()
=>
this
.
validateReset
()}
style
=
{{
marginTop
:
5
0
,
width
:
'100%'
,
height
:
35
,
borderRadius
:
4
,
color
:
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
'#4b4b4b'
:
'#fff'
,
backgroundColor
:
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
'#d8d8d8'
:
'#51c6ea'
}}
>
<
Button
name
=
"submit"
variant
=
"contained"
disabled
=
{
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
true
:
false
}
onClick
=
{()
=>
this
.
validateReset
()}
style
=
{{
marginTop
:
6
0
,
width
:
'100%'
,
height
:
35
,
borderRadius
:
4
,
color
:
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
'#4b4b4b'
:
'#fff'
,
backgroundColor
:
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
'#d8d8d8'
:
'#51c6ea'
}}
>
<
Typography
style
=
{{
fontSize
:
12
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Reset
Password
<
/Typography
>
<
/Button
>
<
/div
>
...
...
src/container/SetPassword.js
View file @
fefcdcaf
...
...
@@ -76,7 +76,7 @@ class SetPassword extends Component {
}
else
if
(
!
this
.
isRegex
(
this
.
state
.
password
))
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Invalid password. Must using combination of characters, letters and numbers.'
})
}
else
if
(
this
.
state
.
confirmPassword
.
trim
()
==
""
)
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'
Password Confirmation
Cannot be Empty.'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'
Repeat Password
Cannot be Empty.'
})
}
else
if
(
this
.
state
.
password
!==
this
.
state
.
confirmPassword
)
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'The password and password confirmation do not match.'
})
}
else
{
...
...
@@ -190,7 +190,7 @@ class SetPassword extends Component {
}}
/
>
<
Button
name
=
"submit"
variant
=
"contained"
disabled
=
{
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
true
:
false
}
onClick
=
{()
=>
this
.
validateReset
()}
style
=
{{
marginTop
:
5
0
,
width
:
'100%'
,
height
:
35
,
borderRadius
:
4
,
color
:
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
'#4b4b4b'
:
'#fff'
,
backgroundColor
:
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
'#d8d8d8'
:
'#51c6ea'
}}
>
<
Button
name
=
"submit"
variant
=
"contained"
disabled
=
{
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
true
:
false
}
onClick
=
{()
=>
this
.
validateReset
()}
style
=
{{
marginTop
:
6
0
,
width
:
'100%'
,
height
:
35
,
borderRadius
:
4
,
color
:
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
'#4b4b4b'
:
'#fff'
,
backgroundColor
:
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
'#d8d8d8'
:
'#51c6ea'
}}
>
<
Typography
style
=
{{
fontSize
:
12
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Next
<
/Typography
>
<
/Button
>
<
/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