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
3eefe11a
Commit
3eefe11a
authored
Aug 25, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into riri
parents
563a6e44
feb268d8
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
1176 additions
and
567 deletions
+1176
-567
index.js
src/api/index.js
+5
-1
Images.js
src/assets/Images.js
+2
-1
camera.svg
src/assets/camera.svg
+9
-0
CreateApprovalMatrix.js
src/container/ApprovalMatrix/CreateApprovalMatrix.js
+1
-1
BudgetTahunan.js
src/container/BudgetTahunan.js
+26
-6
BalanceSheet.js
src/container/BudgetTahunan/BalanceSheet.js
+81
-29
FixedAssetsMovement.js
src/container/BudgetTahunan/FixedAssetsMovement.js
+302
-0
TaxPlanning.js
src/container/BudgetTahunan/TaxPlanning.js
+6
-6
ForgotPassword.js
src/container/ForgotPassword.js
+2
-2
Home.js
src/container/Home.js
+4
-4
Login.js
src/container/Login.js
+4
-4
CreateParameter.js
src/container/MasterData/Parameter/CreateParameter.js
+19
-19
Parameter.js
src/container/MasterData/Parameter/Parameter.js
+121
-86
CreatePerusahaan.js
src/container/MasterData/Perusahaan/CreatePerusahaan.js
+3
-3
Perusahaan.js
src/container/MasterData/Perusahaan/Perusahaan.js
+4
-4
VisualPerusahaan.js
src/container/MasterData/Perusahaan/VisualPerusahaan.js
+6
-6
ReportItems.js
src/container/MasterData/ReportItems.js
+167
-133
UnitBisnis.js
src/container/MasterData/UnitBisnis.js
+119
-84
CreateReportItems.js
...container/MasterData/formReportItems/CreateReportItems.js
+14
-10
EditReportItems.js
src/container/MasterData/formReportItems/EditReportItems.js
+10
-10
VisualReportItems.js
...container/MasterData/formReportItems/VisualReportItems.js
+117
-59
CreateUnitBisnis.js
src/container/MasterData/formUnitBisnis/CreateUnitBisnis.js
+39
-18
Profile.js
src/container/Profile.js
+99
-65
ResetPassword.js
src/container/ResetPassword.js
+11
-11
PopUpFailedSave.js
src/library/PopUpFailedSave.js
+2
-2
Upload.js
src/library/Upload.js
+3
-3
No files found.
src/api/index.js
View file @
3eefe11a
...
...
@@ -80,6 +80,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getMenu
=
()
=>
api
.
get
(
'menu/get_menu_hierarki'
)
const
getMenuByRole
=
()
=>
api
.
get
(
'menu/get_menu_hierarki_by_role'
)
const
getMenuByUser
=
()
=>
api
.
get
(
'menu/get_menu'
)
const
getPermission
=
(
body
)
=>
api
.
post
(
'permission/get_permission'
,
body
)
//UNIT BISNIS
const
getUnitBisnis
=
()
=>
api
.
get
(
'business_unit/get_all_business_unit'
)
...
...
@@ -132,6 +133,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getReportItems
=
()
=>
api
.
get
(
'item_report/get_all_item_report'
)
const
getInputType
=
()
=>
api
.
get
(
'type_report/get_all_type_report'
)
const
getReportType
=
()
=>
api
.
get
(
'report/get_all_report'
)
const
getReportTypeBody
=
(
body
)
=>
api
.
post
(
'report/get_all_report'
,
body
)
const
getDetailReportItems
=
(
userId
)
=>
api
.
get
(
`item_report/get_item_report_by_id/
${
userId
}
`
)
const
searchReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/search_item_report'
,
body
)
const
createReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/create_item_report'
,
body
)
...
...
@@ -248,7 +250,9 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getUnitBisnisActive
,
getMenuByUser
,
getDetailUnitBisnis
,
uploadFoto
uploadFoto
,
getReportTypeBody
,
getPermission
}
}
...
...
src/assets/Images.js
View file @
3eefe11a
...
...
@@ -45,7 +45,8 @@ const Images = {
setting
:
require
(
'./logout.png'
),
failedCopy
:
require
(
'./failed-copy.svg'
),
triputraLogo
:
require
(
'./triputra-logo.png'
),
photo
:
require
(
'./photo.svg'
)
photo
:
require
(
'./photo.svg'
),
camera
:
require
(
'./camera.svg'
)
}
...
...
src/assets/camera.svg
0 → 100644
View file @
3eefe11a
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"14"
height=
"13"
viewBox=
"0 0 14 13"
>
<g
fill=
"none"
fill-rule=
"evenodd"
>
<path
d=
"M0 0H24V24H0z"
transform=
"translate(-5 -6)"
/>
<g
transform=
"translate(-5 -6) translate(5 6)"
>
<path
fill=
"#FFF"
d=
"M7.664 0c1.086 0 2 .743 2.259 1.749L11 1.75c1.657 0 3 1.343 3 3v4.5c0 1.657-1.343 3-3 3H3c-1.657 0-3-1.343-3-3v-4.5c0-1.657 1.343-3 3-3l1.074-.001C4.334.743 5.247 0 6.334 0h1.33z"
/>
<circle
cx=
"7"
cy=
"7"
r=
"3"
fill=
"#019CE5"
/>
</g>
</g>
</svg>
src/container/ApprovalMatrix/CreateApprovalMatrix.js
View file @
3eefe11a
...
...
@@ -445,7 +445,7 @@ export default class CreateApprovalMatrix extends Component {
</div> */
}
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
paddingLeft
:
0
}}
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
{
`Created
at :
${
format
(
this
.
state
.
date
,
'dd MMMM yyyy'
,
{
locale
:
localeID
})}
`
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
{
`Created
by :
`
}
<
/Typography
>
{
/* <Typography style={{ fontSize: 11 }}>Diubah : Admin - 21 Jul 2020, 18:45</Typography> */
}
<
/div
>
<
/div
>
...
...
src/container/BudgetTahunan.js
View file @
3eefe11a
...
...
@@ -8,6 +8,7 @@ import Autocomplete from '@material-ui/lab/Autocomplete';
import
{
titleCase
}
from
'../library/Utils'
;
import
ProfitLoss
from
'./BudgetTahunan/ProfitLoss'
;
import
TaxPlanning
from
'./BudgetTahunan/TaxPlanning'
;
import
FixedAssetsMovement
from
'./BudgetTahunan/FixedAssetsMovement'
;
export
default
class
BudgetTahunan
extends
Component
{
constructor
(
props
)
{
...
...
@@ -21,17 +22,22 @@ export default class BudgetTahunan extends Component {
listCompany
:
null
,
company
:
null
,
report_id
:
null
,
visiblePL
:
false
visiblePL
:
false
,
visibleFAM
:
false
}
}
componentDidMount
()
{
this
.
getCompanyActive
()
this
.
getReport
()
}
getReport
()
{
api
.
create
().
getReportType
().
then
(
response
=>
{
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
,
"revisi"
:
this
.
state
.
periode
}
api
.
create
().
getReportTypeBody
(
payload
).
then
(
response
=>
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
...
...
@@ -63,7 +69,7 @@ export default class BudgetTahunan extends Component {
options
:
companyData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
this
.
setState
({
listCompany
:
defaultProps
,
company
:
companyData
[
0
]
})
this
.
setState
({
listCompany
:
defaultProps
,
company
:
companyData
[
0
]
}
,
()
=>
this
.
getReport
()
)
}
else
{
alert
(
response
.
data
.
message
)
}
...
...
@@ -99,6 +105,15 @@ export default class BudgetTahunan extends Component {
visibleFAM
:
false
,
visibleTP
:
true
})
}
else
if
(
item
===
'Fixed Assets Movement'
)
{
this
.
setState
({
visibleBudgetTahunan
:
false
,
visibleBS
:
false
,
visiblePL
:
false
,
visibleCAT
:
false
,
visibleFAM
:
true
,
visibleTP
:
false
})
}
}
...
...
@@ -286,7 +301,7 @@ export default class BudgetTahunan extends Component {
{
this
.
state
.
visibleBS
&&
(
<
BalanceSheet
report_id
=
{
this
.
state
.
report_id
}
company
_id
=
{
this
.
state
.
company
.
company_id
}
company
=
{
this
.
state
.
company
}
onClickClose
=
{()
=>
this
.
setState
({
visibleBS
:
false
,
visibleBudgetTahunan
:
true
})}
/
>
)}
...
...
@@ -294,7 +309,12 @@ export default class BudgetTahunan extends Component {
<
ProfitLoss
/>
)}
{
this
.
state
.
visibleTP
&&
(
<
TaxPlanning
/>
<
TaxPlanning
onClickClose
=
{()
=>
this
.
setState
({
visibleTP
:
false
,
visibleBudgetTahunan
:
true
})}
/
>
)}
{
this
.
state
.
visibleFAM
&&
(
<
FixedAssetsMovement
/>
)}
<
/div
>
);
...
...
src/container/BudgetTahunan/BalanceSheet.js
View file @
3eefe11a
...
...
@@ -26,16 +26,16 @@ export default class BalanceSheet extends Component {
super
(
props
)
this
.
state
=
{
dataTable
:
[
[
"TOTAL ASSETS"
,
"11,247,249"
,
"10,702,196"
],
[
"TOTAL CURRENT ASSETS"
,
"2,647,647"
,
"2,058,898"
],
[
"Cash & Cash Equivalent"
,
"1,464,571"
,
"729,743"
],
[
"Cash & Bank Balance"
,
"938,707"
,
"265,584"
],
[
"Time & Call Deposit"
,
"525,864"
,
"464,159"
],
[
"BI Deposit"
,
""
,
""
],
[
"Marketable Securities"
,
"150,250"
,
"154,500"
],
[
"Notes Receivable"
,
""
,
""
],
[
"Accounts Receivable"
,
"172,031"
,
"97,112"
],
[
"Trade Receivables - Third Party"
,
"142,668"
,
"77,480"
],
//
["TOTAL ASSETS", "11,247,249", "10,702,196"],
//
["TOTAL CURRENT ASSETS", "2,647,647", "2,058,898"],
//
["Cash & Cash Equivalent", "1,464,571", "729,743"],
//
["Cash & Bank Balance", "938,707", "265,584"],
//
["Time & Call Deposit", "525,864", "464,159"],
//
["BI Deposit", "", ""],
//
["Marketable Securities", "150,250", "154,500"],
//
["Notes Receivable", "", ""],
//
["Accounts Receivable", "172,031", "97,112"],
//
["Trade Receivables - Third Party", "142,668", "77,480"],
]
}
}
...
...
@@ -48,10 +48,56 @@ export default class BalanceSheet extends Component {
getItemHierarki
()
{
let
payload
=
{
"report_id"
:
this
.
props
.
report_id
,
"company_id"
:
this
.
props
.
company_id
"company_id"
:
this
.
props
.
company
.
company
_id
}
api
.
create
().
getItemReportHierarki
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
dataTable
=
[]
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
children
.
length
>
0
)
{
dataTable
.
push
([
item
.
level
,
item
.
description
])
item
.
children
.
map
(
i
=>
{
if
(
i
.
children
)
{
if
(
i
.
children
.
length
>
0
)
{
dataTable
.
push
([
i
.
level
,
i
.
description
])
i
.
children
.
map
(
val
=>
{
dataTable
.
push
([
val
.
level
,
val
.
description
])
})
}
else
{
dataTable
.
push
([
i
.
level
,
i
.
description
])
}
}
else
{
dataTable
.
push
([
i
.
level
,
i
.
description
])
}
})
}
else
{
dataTable
.
push
([
item
.
level
,
item
.
description
])
}
})
console
.
log
(
dataTable
);
this
.
setState
({
dataTable
})
}
}
})
}
...
...
@@ -67,6 +113,11 @@ export default class BalanceSheet extends Component {
render
()
{
const
columns
=
[{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
"Account"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
...
...
@@ -78,12 +129,12 @@ export default class BalanceSheet extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
width
:
388
}}
>
{
tableMeta
.
row
Index
==
0
||
tableMeta
.
rowIndex
==
1
?
<
span
style
=
{{
fontSize
:
12
,
fontWeight
:
'bold'
}}
>
{
val
}
<
/span
>
{
tableMeta
.
row
Data
[
0
]
==
0
?
<
span
style
=
{{
fontSize
:
12
,
fontWeight
:
'bold'
}}
>
{
String
(
val
).
toUpperCase
()
}
<
/span
>
:
tableMeta
.
row
Index
==
2
||
tableMeta
.
rowIndex
==
6
||
tableMeta
.
rowIndex
==
7
||
tableMeta
.
rowIndex
==
8
?
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
1
0
}}
>
{
val
}
<
/span>
:
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
2
0
}}
>
{
val
}
<
/span
>
tableMeta
.
row
Data
[
0
]
===
1
?
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
2
0
}}
>
{
val
}
<
/span>
:
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
4
0
}}
>
{
val
}
<
/span
>
}
<
/div
>
)
...
...
@@ -299,7 +350,7 @@ export default class BalanceSheet extends Component {
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
PT
.
XYZ
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
{
this
.
props
.
company
.
company_name
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Periode
:
2021
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
...
...
@@ -316,19 +367,20 @@ export default class BalanceSheet extends Component {
<
/div
>
<
div
className
=
"grid grid-2x"
>
<
div
className
=
"col-1"
>
<
div
style
=
{{
backgroundColor
:
'#019ce5'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
button
type
=
"button"
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
}}
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
<
button
className
=
"button"
type
=
"button"
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
}}
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
<
div
style
=
{{
backgroundColor
:
'#019ce5'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Kembali
<
/Typography
>
<
/
button
>
<
/
div
>
<
/
div
>
<
/
button
>
<
/div
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #354960'
,
marginRight
:
20
}}
>
...
...
src/container/BudgetTahunan/FixedAssetsMovement.js
0 → 100644
View file @
3eefe11a
import
React
,
{
Component
}
from
'react'
;
import
{
Typography
,
Paper
,
createMuiTheme
,
MuiThemeProvider
,
TableCell
,
FormControlLabel
,
TextField
,
Input
}
from
'@material-ui/core'
;
import
MUIDataTable
from
'mui-datatables'
;
import
NumberFormat
from
'react-number-format'
;
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
options
=
ct
.
customOptionsFixedColumn
();
const
style
=
{
position
:
"sticky"
,
left
:
0
,
background
:
"white"
,
zIndex
:
101
,
};
const
style2
=
{
position
:
"sticky"
,
left
:
420
,
background
:
"white"
,
zIndex
:
101
};
export
default
class
FixedAssetsMovement
extends
Component
{
render
()
{
const
columns
=
[{
name
:
"Account"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
key
=
{
columnMeta
.
index
}
style
=
{{
...
style
,
top
:
0
,
zIndex
:
102
,
backgroundColor
:
'#354960'
,
width
:
388
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'left'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
setCellProps
:
()
=>
({
style
}),
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
width
:
388
}}
>
{
tableMeta
.
rowIndex
==
0
||
tableMeta
.
rowIndex
==
1
?
<
span
style
=
{{
fontSize
:
12
,
fontWeight
:
'bold'
}}
>
{
val
}
<
/span
>
:
tableMeta
.
rowIndex
==
2
||
tableMeta
.
rowIndex
==
6
||
tableMeta
.
rowIndex
==
7
||
tableMeta
.
rowIndex
==
8
?
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
10
}}
>
{
val
}
<
/span>
:
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
20
}}
>
{
val
}
<
/span
>
}
<
/div
>
)
}
}
},
{
name
:
"31 Dec 2020 Actual"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
key
=
{
columnMeta
.
index
}
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
102
,
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
setCellProps
:
()
=>
({
style
:
{
position
:
"sticky"
,
left
:
420
,
background
:
"white"
,
zIndex
:
101
}
})
}
},
{
name
:
"January 2021"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
{
tableMeta
.
rowIndex
===
3
||
tableMeta
.
rowIndex
===
4
||
tableMeta
.
rowIndex
===
9
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
// <Input
// value={this.formatValue(value)}
// style={{}}
// inputProps={{
// style: {
// color: "#5198ea",
// fontSize: 12,
// textAlign: 'right'
// }
// }}
// disableUnderline={true}
// inputStyle={{ color: 'red' }}
// />
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
value
}
/
>
}
onChange
=
{
event
=>
updateValue
(
event
.
target
.
value
)}
/
>
<
/div>
:
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
{
value
===
""
?
"-"
:
value
}
<
/span
>
}
<
/div
>
)
}
}
},
{
name
:
"February 2021"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
val
)
=>
{
return
(
<
div
style
=
{{
width
:
96
}}
>
{
val
}
<
/div
>
)
}
}
},
{
name
:
"March 2021"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
val
)
=>
{
return
(
<
div
style
=
{{
width
:
96
}}
>
{
val
}
<
/div
>
)
}
}
},
{
name
:
"April 2021"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
val
)
=>
{
return
(
<
div
style
=
{{
width
:
96
}}
>
{
val
}
<
/div
>
)
}
}
},
{
name
:
"May 2021"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
val
)
=>
{
return
(
<
div
style
=
{{
width
:
96
}}
>
{
val
}
<
/div
>
)
}
}
},
{
name
:
"June 2021"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
val
)
=>
{
return
(
<
div
style
=
{{
width
:
96
}}
>
{
val
}
<
/div
>
)
}
}
},
{
name
:
"31 Dec 2021 Total"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
val
)
=>
{
return
(
<
div
style
=
{{
width
:
96
}}
>
{
val
}
<
/div
>
)
}
}
},
{
name
:
"31 Dec 2022 Total"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
val
)
=>
{
return
(
<
div
style
=
{{
width
:
96
}}
>
{
val
}
<
/div
>
)
}
}
},
{
name
:
"31 Dec 2023 Total"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
val
)
=>
{
return
(
<
div
style
=
{{
width
:
96
}}
>
{
val
}
<
/div
>
)
}
}
}
]
const
dataTable
=
[
[
"COST"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
],
// ["Beginning balance", "11,247,249", "10,702,196"],
// ["Additional FA in MTD", "11,247,249", "10,702,196"],
// ["Revaluation", "11,247,249", "10,702,196"],
// ["Disposal (negative value)", "11,247,249", "10,702,196"],
[
"Control"
,
"-"
,
"-"
],
[
"Accumulated Depreciation (negative value)"
,
"2,647,647"
,
"2,058,898"
],
[
"Control"
,
"-"
,
"-"
],
[
"Gain / (Loss) on Fixed Assets"
,
"-"
,
"-"
],
[
"Control"
,
"-"
,
"-"
],
]
return
(
<
div
style
=
{{
height
:
this
.
props
.
height
,
backgroundColor
:
'#f8f8f8'
,
marginBottom
:
100
,
minHeight
:
1000
}}
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Pengajuan
Budget
Tahunan
<
/Typography
>
<
/div
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Master
Budget
-
Fixed
Assets
Movement
<
/Typography
>
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
PT
.
XYZ
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Periode
:
2021
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
,
width
:
'100%'
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
dataTable
}
columns
=
{
columns
}
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
<
/div
>
<
/div
>
<
div
className
=
"grid grid-2x"
>
<
div
className
=
"col-1"
>
<
div
style
=
{{
backgroundColor
:
'#019ce5'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Kembali
<
/Typography
>
<
/div
>
<
/div
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #354960'
,
marginRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#354960'
,
textAlign
:
'center'
}}
>
Batal
<
/Typography
>
<
/div
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Simpan
<
/Typography
>
<
/div
>
<
/div
>
<
/div
>
<
/Paper
>
<
/div
>
<
/div
>
);
}
}
src/container/BudgetTahunan/TaxPlanning.js
View file @
3eefe11a
...
...
@@ -329,16 +329,16 @@ export default class BalanceSheet extends Component {
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginBottom
:
20
,
paddingRight
:
10
,
paddingLeft
:
10
}}
>
<
div
className
=
"col-1"
>
<
div
style
=
{{
backgroundColor
:
'#019ce5'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'ce
nter'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Kembali
<
/Typography
>
<
div
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
style
=
{{
backgroundColor
:
'#019ce5'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
cursor
:
'poi
nter'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Back
<
/Typography
>
<
/div
>
<
/div
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #354960
'
,
marginRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#354960'
,
textAlign
:
'center'
}}
>
Bata
l
<
/Typography
>
<
div
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #354960'
,
cursor
:
'pointer
'
,
marginRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#354960'
,
textAlign
:
'center'
}}
>
Cance
l
<
/Typography
>
<
/div
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
S
impan
<
/Typography
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
cursor
:
'pointer'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
S
ave
<
/Typography
>
<
/div
>
<
/div
>
<
/div
>
...
...
src/container/ForgotPassword.js
View file @
3eefe11a
...
...
@@ -39,9 +39,9 @@ class ForgotPassword extends Component {
var
isEmail
=
this
.
isEmail
(
this
.
state
.
email
)
if
(
this
.
state
.
email
.
trim
()
==
""
)
{
this
.
setState
({
errorEmail
:
true
,
msgEmail
:
'Email
cannot be empty!
'
})
this
.
setState
({
errorEmail
:
true
,
msgEmail
:
'Email
is required.
'
})
}
else
if
(
!
isEmail
)
{
this
.
setState
({
errorEmail
:
true
,
msgEmail
:
'Email format is not correct
!
'
})
this
.
setState
({
errorEmail
:
true
,
msgEmail
:
'Email format is not correct
.
'
})
}
else
{
this
.
verification
()
}
...
...
src/container/Home.js
View file @
3eefe11a
...
...
@@ -347,7 +347,7 @@ export default function MiniDrawer() {
})
setApplication
(
app
)
setSetting
(
set
)
console
.
log
(
app
);
console
.
log
(
set
);
}
else
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
...
...
@@ -491,7 +491,7 @@ export default function MiniDrawer() {
<
/div
>
<
/div
>
}
{
open
&&
{
open
&&
application
.
length
>
0
&&
<
div
style
=
{{
marginLeft
:
20
,
marginTop
:
10
}}
>
<
Typography
style
=
{{
color
:
'#525355'
,
fontSize
:
14
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Application
<
/Typography
>
<
/div
>
...
...
@@ -539,7 +539,7 @@ export default function MiniDrawer() {
<
/div
>
))}
<
/List
>
{
open
&&
{
open
&&
setting
.
length
>
0
&&
<
div
style
=
{{
marginLeft
:
20
}}
>
<
Typography
style
=
{{
color
:
'#525355'
,
fontSize
:
14
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Setting
<
/Typography
>
<
/div
>
...
...
@@ -588,7 +588,7 @@ export default function MiniDrawer() {
))}
<
/List
>
{
open
&&
<
div
style
=
{{
marginLeft
:
20
,
marginTop
:
5
}}
>
<
div
style
=
{{
marginLeft
:
20
,
marginTop
:
5
,
paddingBottom
:
20
}}
>
<
button
style
=
{{
outline
:
'none'
,
...
...
src/container/Login.js
View file @
3eefe11a
...
...
@@ -65,11 +65,11 @@ class Login extends Component {
validateLogin
()
{
var
isEmail
=
this
.
isEmail
(
this
.
state
.
email
)
if
(
this
.
state
.
email
.
trim
()
==
""
)
{
this
.
setState
({
errorEmail
:
true
,
msgEmail
:
'Email
cannot be empty!
'
})
this
.
setState
({
errorEmail
:
true
,
msgEmail
:
'Email
is required.
'
})
}
else
if
(
!
isEmail
)
{
this
.
setState
({
errorEmail
:
true
,
msgEmail
:
'Email format is not correct
!
'
})
this
.
setState
({
errorEmail
:
true
,
msgEmail
:
'Email format is not correct
.
'
})
}
else
if
(
this
.
state
.
password
.
trim
()
==
""
)
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password
cannot be empty!
'
})
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password
is required.
'
})
}
else
{
this
.
login
()
}
...
...
@@ -102,7 +102,7 @@ class Login extends Component {
}
this
.
props
.
history
.
push
(
'/home/beranda'
)
}
else
{
if
(
response
.
data
.
message
==
'Incorrect
P
assword.'
)
{
if
(
response
.
data
.
message
==
'Incorrect
p
assword.'
)
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
response
.
data
.
message
})
}
else
{
this
.
setState
({
errorEmail
:
true
,
msgEmail
:
response
.
data
.
message
})
...
...
src/container/MasterData/Parameter/CreateParameter.js
View file @
3eefe11a
...
...
@@ -334,25 +334,25 @@ export default class CreateParameter extends Component {
validasi
()
{
if
(
R
.
isNil
(
this
.
state
.
getTypes
))
{
this
.
setState
({
errorGroup
:
true
,
msgErrorGroup
:
'Group is required'
})
this
.
setState
({
errorGroup
:
true
,
msgErrorGroup
:
'Group is required
.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getParameter
))
{
this
.
setState
({
errorParameter
:
true
,
msgErrorParameter
:
'Parameter is required'
})
this
.
setState
({
errorParameter
:
true
,
msgErrorParameter
:
'Parameter is required
.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company is required'
})
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company is required
.
'
})
// } else if (R.isEmpty(this.state.tempData.description)) {
// this.setState({ errorDeskripsi: true, msgErrorDeskripsi: 'Deskripsi tidak boleh kosong' })
// } else if (R.isEmpty(this.state.tempData.value)) {
// this.setState({ errorValue: true, msgErrorValue: 'Value tidak boleh kosong' })
}
else
if
((
!
R
.
isNil
(
this
.
state
.
tempData
.
max_value
)
&&
R
.
isNil
(
this
.
state
.
tempData
.
min_value
))
||
(
!
R
.
isNil
(
this
.
state
.
tempData
.
max_value
)
&&
R
.
isEmpty
(
this
.
state
.
tempData
.
min_value
)))
{
this
.
setState
({
errorMinValue
:
true
,
msgErrorMinValue
:
'Min
Value is required
'
})
this
.
setState
({
errorMinValue
:
true
,
msgErrorMinValue
:
'Min
value is required.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
start_date
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start
Date is required
'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start
date is required.
'
})
// } else if (R.isNil(this.state.tempData.order)) {
// this.setState({ errorOrder: true, msgErrorOrder: 'Order tidak boleh kosong' })
}
else
if
(
!
R
.
isNil
(
this
.
state
.
tempData
.
min_value
)
&&
R
.
isNil
(
this
.
state
.
tempData
.
max_value
))
{
this
.
setState
({
errorMaxValue
:
true
,
msgErrorMaxValue
:
'Max
Value is required
'
})
this
.
setState
({
errorMaxValue
:
true
,
msgErrorMaxValue
:
'Max
value is required.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
end_date
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End
Date is required
'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End
date is required.
'
})
}
else
{
this
.
updateParameter
()
}
...
...
@@ -360,25 +360,25 @@ export default class CreateParameter extends Component {
validasiCreate
()
{
if
(
R
.
isNil
(
this
.
state
.
getTypes
))
{
this
.
setState
({
errorGroup
:
true
,
msgErrorGroup
:
'Group is required'
})
this
.
setState
({
errorGroup
:
true
,
msgErrorGroup
:
'Group is required
.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getParameter
))
{
this
.
setState
({
errorParameter
:
true
,
msgErrorParameter
:
'Parameter is required'
})
this
.
setState
({
errorParameter
:
true
,
msgErrorParameter
:
'Parameter is required
.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Perusahaan is required'
})
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Perusahaan is required
.
'
})
// } else if (R.isEmpty(this.state.description)) {
// this.setState({ errorDeskripsi: true, msgErrorDeskripsi: 'Deskripsi tidak boleh kosong' })
// } else if (R.isNil(this.state.value)) {
// this.setState({ errorValue: true, msgErrorValue: 'Value tidak boleh kosong' })
}
else
if
(
!
R
.
isNil
(
this
.
state
.
maxValue
)
&&
R
.
isNil
(
this
.
state
.
minValue
))
{
this
.
setState
({
errorMinValue
:
true
,
msgErrorMinValue
:
'Min
Value is required
'
})
this
.
setState
({
errorMinValue
:
true
,
msgErrorMinValue
:
'Min
value is required.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start
Date is required
'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start
date is required.
'
})
// } else if (R.isNil(this.state.order)) {
// this.setState({ errorOrder: true, msgErrorOrder: 'Order tidak boleh kosong' })
}
else
if
(
!
R
.
isNil
(
this
.
state
.
minValue
)
&&
R
.
isNil
(
this
.
state
.
maxValue
))
{
this
.
setState
({
errorMaxValue
:
true
,
msgErrorMaxValue
:
'Max
Value is required
'
})
this
.
setState
({
errorMaxValue
:
true
,
msgErrorMaxValue
:
'Max
value is required.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End
Date tidak boleh kosong
'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End
date is required
'
})
}
else
{
this
.
createParameter
()
}
...
...
@@ -614,11 +614,11 @@ export default class CreateParameter extends Component {
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'2
0%'
}}
>
Created
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'2
5%'
}}
>
Created
By
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
:
{
this
.
state
.
tempData
===
null
?
""
:
this
.
state
.
tempData
.
created
}
<
/Typography
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'2
0%'
}}
>
Updated
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'2
5%'
}}
>
Updated
By
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
:
{
this
.
state
.
tempData
===
null
?
""
:
this
.
state
.
tempData
.
updated
===
null
?
""
:
this
.
state
.
tempData
.
updated
}
<
/Typography
>
<
/div
>
<
/div
>
...
...
@@ -958,8 +958,8 @@ export default class CreateParameter extends Component {
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
Created
:
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
Updated
:
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'25%'
}}
>
Created
By
:
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'25%'
}}
>
Updated
By
:
<
/Typography
>
<
/div
>
<
/div
>
...
...
@@ -1101,7 +1101,7 @@ export default class CreateParameter extends Component {
onClick
=
{()
=>
this
.
validasiCreate
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
impan
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
ave
<
/span
>
<
/div
>
<
/button
>
<
/div
>
...
...
src/container/MasterData/Parameter/Parameter.js
View file @
3eefe11a
...
...
@@ -31,13 +31,37 @@ export default class Parameter extends Component {
dataTable
:
[],
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
messageAlert
:
''
,
create
:
false
,
edit
:
false
,
load
:
false
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
componentDidMount
()
{
this
.
getAllParameter
()
this
.
getPermission
()
}
getPermission
()
{
let
payload
=
{
menu
:
"parameters"
}
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
create
:
response
.
data
.
data
.
create
,
edit
:
response
.
data
.
data
.
edit
,
load
:
true
})
}
else
{
this
.
setState
({
load
:
true
})
}
}
})
}
getAllParameter
()
{
...
...
@@ -545,22 +569,24 @@ export default class Parameter 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={()=> console.log(tableMeta)}
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
{
this
.
state
.
edit
&&
(
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
}}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
// onClick={()=> console.log(tableMeta)}
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
)}
<
/div
>
);
}
}
},
{
},
{
name
:
"ID"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
...
...
@@ -571,7 +597,7 @@ export default class Parameter extends Component {
);
}
}
},{
},
{
name
:
"Group"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
...
...
@@ -689,77 +715,86 @@ export default class Parameter extends Component {
<
/Snackbar
>
{
this
.
state
.
visibleParameter
===
true
?
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
118
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
,
}}
>
Parameter
<
/label
>
<
div
style
=
{{
color
:
'white'
,
width
:
'50%'
,
height
:
37
,
display
:
'flex'
,
backgroundColor
:
'white'
,
borderWidth
:
2
,
alignItems
:
'center'
,
borderRadius
:
6
,
paddingLeft
:
5
,
paddingRight
:
5
,
alignSelf
:
'center'
}}
>
<
img
src
=
{
Images
.
searchBlack
}
style
=
{{
marginRight
:
10
}}
/
>
<
InputBase
style
=
{{
width
:
'100%'
}}
placeholder
=
"Search"
value
=
{
this
.
state
.
search
}
onChange
=
{(
e
)
=>
this
.
handleInputChange
(
e
.
target
.
value
)}
inputProps
=
{{
'aria-label'
:
'naked'
}}
/
>
<
/div
>
<
div
style
=
{{
width
:
'30%'
,
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadFile
()}
>
<
img
src
=
{
Images
.
template
}
/
>
<
/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'
,
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
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadDataTable
()}
>
<
img
src
=
{
Images
.
download
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Add'
}
data
-
for
=
"create"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
>
<
img
src
=
{
Images
.
add
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"create"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
state
.
load
&&
(
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
118
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
,
}}
>
Parameter
<
/label
>
<
div
style
=
{{
color
:
'white'
,
width
:
'50%'
,
height
:
37
,
display
:
'flex'
,
backgroundColor
:
'white'
,
borderWidth
:
2
,
alignItems
:
'center'
,
borderRadius
:
6
,
paddingLeft
:
5
,
paddingRight
:
5
,
alignSelf
:
'center'
}}
>
<
img
src
=
{
Images
.
searchBlack
}
style
=
{{
marginRight
:
10
}}
/
>
<
InputBase
style
=
{{
width
:
'100%'
}}
placeholder
=
"Search"
value
=
{
this
.
state
.
search
}
onChange
=
{(
e
)
=>
this
.
handleInputChange
(
e
.
target
.
value
)}
inputProps
=
{{
'aria-label'
:
'naked'
}}
/
>
<
/div
>
<
div
style
=
{{
width
:
'30%'
,
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadFile
()}
>
<
img
src
=
{
Images
.
template
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
state
.
create
&&
(
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
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
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadDataTable
()}
>
<
img
src
=
{
Images
.
download
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
state
.
create
&&
(
<
a
data
-
tip
=
{
'Add New'
}
data
-
for
=
"create"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
,
marginRight
:
20
}}
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
>
<
img
src
=
{
Images
.
add
}
/
>
<
/button
>
<
/a
>
)}
<
ReactTooltip
multiline
=
{
false
}
border
=
{
true
}
id
=
"create"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
<
/div
>
<
/div
>
)}
<
div
style
=
{{
padding
:
25
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
...
...
@@ -796,7 +831,7 @@ export default class Parameter extends Component {
style
=
{{
marginRight
:
20
}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Bata
l
<
/span
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cance
l
<
/span
>
<
/div
>
<
/button
>
<
button
...
...
@@ -805,7 +840,7 @@ export default class Parameter extends Component {
style
=
{{}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
impan
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
ave
<
/span
>
<
/div
>
<
/button
>
<
/div
>
...
...
src/container/MasterData/Perusahaan/CreatePerusahaan.js
View file @
3eefe11a
...
...
@@ -352,7 +352,7 @@ export default class CreatePerusahaan extends Component {
<
Typography
style
=
{{
fontSize
:
11
}}
>
:
{
this
.
state
.
created
}
<
/Typography
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'20%'
}}
>
Edi
ted
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'20%'
}}
>
Upda
ted
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
:
{
this
.
state
.
updated
}
<
/Typography
>
<
/div
>
<
/div
>
...
...
@@ -592,8 +592,8 @@ export default class CreatePerusahaan extends Component {
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
Created
:
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
Edi
ted
:
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
Created
:
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
Upda
ted
:
<
/Typography
>
<
/div
>
<
/div
>
...
...
src/container/MasterData/Perusahaan/Perusahaan.js
View file @
3eefe11a
...
...
@@ -337,7 +337,7 @@ export default class Perusahaan extends Component {
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
download
=
'Template
Perusahaan
.xlsx'
;
a
.
download
=
'Template
Company
.xlsx'
;
a
.
click
();
}
}
...
...
@@ -352,7 +352,7 @@ export default class Perusahaan extends Component {
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
download
=
'
Perusahaan
.xlsx'
;
a
.
download
=
'
Company
.xlsx'
;
a
.
click
();
}
}
...
...
@@ -486,7 +486,7 @@ export default class Perusahaan extends Component {
/
>
<
/div
>
<
div
style
=
{{
width
:
'30%'
,
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
...
...
@@ -649,7 +649,7 @@ export default class Perusahaan extends Component {
{
this
.
state
.
visibleUpload
&&
(
<
div
className
=
"test app-popup-show"
>
<
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
=
"popup-title"
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Upload
File
<
/span
>
...
...
src/container/MasterData/Perusahaan/VisualPerusahaan.js
View file @
3eefe11a
...
...
@@ -107,11 +107,11 @@ export default class VisualPerusahaan extends Component {
<
div
style
=
{{
width
:
'100%'
,
backgroundColor
:
'#354960'
}}
/
>
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
150
}}
>
<
label
style
=
{{
color
:
'white'
,
width
:
'20%'
,
fontSize
:
16
,
paddingTop
:
8
}}
>
Hirarki
Perusahaan
<
/label
>
<
label
style
=
{{
color
:
'white'
,
width
:
'20%'
,
fontSize
:
16
,
paddingTop
:
8
}}
>
Company
Hierarchy
<
/label
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
paddingRight
:
25
,
paddingLeft
:
25
}}
>
<
label
style
=
{{
color
:
'#51c6ea'
,
width
:
'20%'
,
fontSize
:
11
}}
>
Master
Data
/
Perusahaan
/
<
span
style
=
{{
color
:
'white'
,
width
:
'20%'
,
fontSize
:
11
}}
>
Visuali
sasi
<
/span>
<
label
style
=
{{
color
:
'#51c6ea'
,
width
:
'20%'
,
fontSize
:
11
}}
>
Master
Data
/
Company
/
<
span
style
=
{{
color
:
'white'
,
width
:
'20%'
,
fontSize
:
11
}}
>
Visuali
zation
<
/span>
<
/label
>
<
/div
>
<
div
style
=
{{
padding
:
25
,
width
:
'100%'
}}
>
...
...
@@ -127,14 +127,14 @@ export default class VisualPerusahaan extends Component {
<
/div
>
<
div
className
=
"row"
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
15
,
paddingLeft
:
15
,
paddingBottom
:
25
}}
>
<
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
}}
>
Kembali
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Back
<
/span
>
<
/div
>
<
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
}}
>
Bata
l
<
/span
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cance
l
<
/span
>
<
/div
>
<
div
onClick
=
{()
=>
this
.
handleSave
()}
style
=
{{
width
:
102
,
height
:
30
,
marginLeft
:
25
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
,
cursor
:
"pointer"
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
impan
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
ave
<
/span
>
<
/div
>
<
/div
>
<
/div
>
...
...
src/container/MasterData/ReportItems.js
View file @
3eefe11a
...
...
@@ -39,7 +39,10 @@ export default class ReportItems extends Component {
popupError
:
false
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
messageAlert
:
''
,
buttonCreate
:
false
,
buttonEdit
:
false
,
load
:
false
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
...
@@ -452,6 +455,27 @@ export default class ReportItems extends Component {
componentDidMount
()
{
this
.
getData
()
this
.
getPermission
()
}
getPermission
()
{
let
payload
=
{
menu
:
"report items"
}
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
buttonCreate
:
response
.
data
.
data
.
create
,
buttonEdit
:
response
.
data
.
data
.
edit
,
load
:
true
})
}
else
{
this
.
setState
({
load
:
true
})
}
}
})
}
getData
()
{
...
...
@@ -575,7 +599,7 @@ export default class ReportItems extends Component {
api
.
create
().
uploadReportItems
(
this
.
state
.
payload
).
then
(
response
=>
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
alert
(
response
.
data
.
message
)
//
alert(response.data.message)
this
.
getData
()
this
.
setState
({
itemReport
:
true
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
else
{
...
...
@@ -599,17 +623,19 @@ export default class ReportItems extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
}}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
{
this
.
state
.
buttonEdit
&&
(
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
}}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
)}
<
/div
>
);
}
...
...
@@ -755,91 +781,97 @@ export default class ReportItems extends Component {
<
/Snackbar
>
{
this
.
state
.
itemReport
===
true
?
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
118
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
,
}}
>
Master
Data
-
Report
Items
<
/label
>
<
div
style
=
{{
color
:
'white'
,
width
:
'50%'
,
height
:
37
,
display
:
'flex'
,
backgroundColor
:
'white'
,
borderWidth
:
2
,
alignItems
:
'center'
,
borderRadius
:
6
,
paddingLeft
:
5
,
paddingRight
:
5
,
alignSelf
:
'center'
}}
>
<
img
src
=
{
Images
.
searchBlack
}
style
=
{{
marginRight
:
10
}}
/
>
<
InputBase
style
=
{{
width
:
'100%'
}}
placeholder
=
"Search"
value
=
{
this
.
state
.
search
}
onChange
=
{(
e
)
=>
this
.
handleInputChange
(
e
.
target
.
value
)}
inputProps
=
{{
'aria-label'
:
'naked'
}}
/
>
<
/div
>
<
div
style
=
{{
width
:
'30%'
,
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadFile
()}
>
<
img
src
=
{
Images
.
template
}
/
>
<
/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'
,
margin
:
5
}}
onClick
=
{()
=>
null
}
>
<
img
src
=
{
Images
.
upload
}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadDataTable
()}
>
<
img
src
=
{
Images
.
download
}
/
>
<
/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'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visualisasi
:
true
,
itemReport
:
false
})}
>
<
img
src
=
{
Images
.
visualisasi
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"visualisasi"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Add'
}
data
-
for
=
"tambah"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
>
<
img
src
=
{
Images
.
add
}
onClick
=
{()
=>
this
.
setState
({
add
:
true
})}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"tambah"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
state
.
load
&&
(
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
118
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
,
}}
>
Master
Data
-
Report
Items
<
/label
>
<
div
style
=
{{
color
:
'white'
,
width
:
'50%'
,
height
:
37
,
display
:
'flex'
,
backgroundColor
:
'white'
,
borderWidth
:
2
,
alignItems
:
'center'
,
borderRadius
:
6
,
paddingLeft
:
5
,
paddingRight
:
5
,
alignSelf
:
'center'
}}
>
<
img
src
=
{
Images
.
searchBlack
}
style
=
{{
marginRight
:
10
}}
/
>
<
InputBase
style
=
{{
width
:
'100%'
}}
placeholder
=
"Search"
value
=
{
this
.
state
.
search
}
onChange
=
{(
e
)
=>
this
.
handleInputChange
(
e
.
target
.
value
)}
inputProps
=
{{
'aria-label'
:
'naked'
}}
/
>
<
/div
>
<
div
style
=
{{
width
:
'30%'
,
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadFile
()}
>
<
img
src
=
{
Images
.
template
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
state
.
buttonCreate
&&
(
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
null
}
>
<
img
src
=
{
Images
.
upload
}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
/
>
<
/button
>
<
/a
>
)}
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadDataTable
()}
>
<
img
src
=
{
Images
.
download
}
/
>
<
/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'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visualisasi
:
true
,
itemReport
:
false
})}
>
<
img
src
=
{
Images
.
visualisasi
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"visualisasi"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
state
.
buttonCreate
&&
(
<
a
data
-
tip
=
{
'Add New'
}
data
-
for
=
"tambah"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
,
marginRight
:
20
}}
>
<
img
src
=
{
Images
.
add
}
onClick
=
{()
=>
this
.
setState
({
add
:
true
})}
/
>
<
/button
>
<
/a
>
)}
<
ReactTooltip
border
=
{
true
}
id
=
"tambah"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
<
/div
>
<
/div
>
)}
<
div
style
=
{{
padding
:
25
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
...
...
@@ -854,47 +886,49 @@ export default class ReportItems extends Component {
:
this
.
state
.
visualisasi
==
true
?
<
VisualReportItems
buttonCreate
=
{
this
.
state
.
buttonCreate
}
buttonEdit
=
{
this
.
state
.
buttonEdit
}
onClickClose
=
{()
=>
this
.
setState
({
visualisasi
:
false
,
itemReport
:
true
})}
height
=
{
this
.
props
.
height
}
/
>
:
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
150
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
}}
>
Preview
Data
<
/label
>
<
/div
>
<
div
style
=
{{
padding
:
25
}}
>
{
this
.
state
.
dataLoaded
&&
(
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
theme
=
{
getMuiTheme
()}
data
=
{
this
.
state
.
rows
}
columns
=
{
this
.
state
.
cols
}
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
)}
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
width
:
'100%'
,
placeContent
:
'flex-end'
,
padding
:
20
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
itemReport
:
true
})}
style
=
{{
marginRight
:
20
}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Batal
<
/span
>
<
/div
>
<
/button
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
state
.
buttonError
?
this
.
setState
({
popupError
:
true
})
:
this
.
uploadReportItems
()}
style
=
{{}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Simpan
<
/span
>
<
/div
>
<
/button
>
:
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
150
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
}}
>
Preview
Data
<
/label
>
<
/div
>
<
div
style
=
{{
padding
:
25
}}
>
{
this
.
state
.
dataLoaded
&&
(
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
theme
=
{
getMuiTheme
()}
data
=
{
this
.
state
.
rows
}
columns
=
{
this
.
state
.
cols
}
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
)}
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
width
:
'100%'
,
placeContent
:
'flex-end'
,
padding
:
20
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
itemReport
:
true
})}
style
=
{{
marginRight
:
20
}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cancel
<
/span
>
<
/div
>
<
/button
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
state
.
buttonError
?
this
.
setState
({
popupError
:
true
})
:
this
.
uploadReportItems
()}
style
=
{{}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Save
<
/span
>
<
/div
>
<
/button
>
<
/div
>
<
/div
>
<
/div
>
}
{
this
.
state
.
add
&&
(
<
CreateReportItems
...
...
src/container/MasterData/UnitBisnis.js
View file @
3eefe11a
...
...
@@ -39,7 +39,10 @@ export default class UnitBisnis extends Component {
popupError
:
false
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
messageAlert
:
''
,
create
:
false
,
edit
:
false
,
load
:
false
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
...
...
@@ -187,6 +190,29 @@ export default class UnitBisnis extends Component {
componentDidMount
()
{
this
.
getData
()
this
.
getPermission
()
}
getPermission
()
{
let
payload
=
{
menu
:
"business unit"
}
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
create
:
response
.
data
.
data
.
create
,
edit
:
response
.
data
.
data
.
edit
,
load
:
true
})
}
else
{
this
.
setState
({
load
:
true
})
}
}
})
}
getData
()
{
...
...
@@ -336,17 +362,19 @@ export default class UnitBisnis extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
}}
// onClick={() => console.log(tableMeta)}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
{
this
.
state
.
edit
&&
(
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
}}
// onClick={() => console.log(tableMeta)}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
)}
<
/div
>
);
}
...
...
@@ -403,77 +431,84 @@ export default class UnitBisnis extends Component {
<
/Snackbar
>
{
this
.
state
.
visibleUnitBisnis
===
true
?
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
118
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
,
}}
>
Master
Data
-
Business
Unit
<
/label
>
<
div
style
=
{{
color
:
'white'
,
width
:
'50%'
,
height
:
37
,
display
:
'flex'
,
backgroundColor
:
'white'
,
borderWidth
:
2
,
alignItems
:
'center'
,
borderRadius
:
6
,
paddingLeft
:
5
,
paddingRight
:
5
,
alignSelf
:
'center'
}}
>
<
img
src
=
{
Images
.
searchBlack
}
style
=
{{
marginRight
:
10
}}
/
>
<
InputBase
style
=
{{
width
:
'100%'
}}
placeholder
=
"Search"
value
=
{
this
.
state
.
search
}
onChange
=
{(
e
)
=>
this
.
handleInputChange
(
e
.
target
.
value
)}
inputProps
=
{{
'aria-label'
:
'naked'
}}
/
>
<
/div
>
<
div
style
=
{{
width
:
'30%'
,
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadFile
()}
>
<
img
src
=
{
Images
.
template
}
/
>
<
/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'
,
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
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadDataTable
()}
>
<
img
src
=
{
Images
.
download
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Add'
}
data
-
for
=
"create"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
>
<
img
src
=
{
Images
.
add
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"create"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
state
.
load
&&
(
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
118
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
,
}}
>
Master
Data
-
Business
Unit
<
/label
>
<
div
style
=
{{
color
:
'white'
,
width
:
'50%'
,
height
:
37
,
display
:
'flex'
,
backgroundColor
:
'white'
,
borderWidth
:
2
,
alignItems
:
'center'
,
borderRadius
:
6
,
paddingLeft
:
5
,
paddingRight
:
5
,
alignSelf
:
'center'
}}
>
<
img
src
=
{
Images
.
searchBlack
}
style
=
{{
marginRight
:
10
}}
/
>
<
InputBase
style
=
{{
width
:
'100%'
}}
placeholder
=
"Search"
value
=
{
this
.
state
.
search
}
onChange
=
{(
e
)
=>
this
.
handleInputChange
(
e
.
target
.
value
)}
inputProps
=
{{
'aria-label'
:
'naked'
}}
/
>
<
/div
>
<
div
style
=
{{
width
:
'30%'
,
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadFile
()}
>
<
img
src
=
{
Images
.
template
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
state
.
create
&&
(
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
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
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadDataTable
()}
>
<
img
src
=
{
Images
.
download
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
state
.
create
&&
(
<
a
data
-
tip
=
{
'Add New'
}
data
-
for
=
"create"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
,
marginRight
:
20
}}
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
>
<
img
src
=
{
Images
.
add
}
/
>
<
/button
>
<
/a
>
)}
<
ReactTooltip
border
=
{
true
}
id
=
"create"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
<
/div
>
<
/div
>
)}
<
div
style
=
{{
padding
:
25
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
...
...
@@ -510,7 +545,7 @@ export default class UnitBisnis extends Component {
style
=
{{
marginRight
:
20
}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Bata
l
<
/span
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cance
l
<
/span
>
<
/div
>
<
/button
>
<
button
...
...
@@ -519,7 +554,7 @@ export default class UnitBisnis extends Component {
style
=
{{}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
impan
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
ave
<
/span
>
<
/div
>
<
/button
>
<
/div
>
...
...
src/container/MasterData/formReportItems/CreateReportItems.js
View file @
3eefe11a
...
...
@@ -147,32 +147,32 @@ export default class CreateReportItems extends Component {
validasi
()
{
// alert('coba ya')
if
(
R
.
isNil
(
this
.
state
.
reportType
))
{
this
.
setState
({
errorJenisLaporan
:
true
,
msgErrorJenisLaporan
:
'Report type
cannot be empty
.'
})
this
.
setState
({
errorJenisLaporan
:
true
,
msgErrorJenisLaporan
:
'Report type
is required
.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
company
)){
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company
cannot be empty
.'
})
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company
is required
.'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
order
))
{
this
.
setState
({
errorOrder
:
true
,
msgErrorOrder
:
'Order
cannot be empty
.'
})
this
.
setState
({
errorOrder
:
true
,
msgErrorOrder
:
'Order
is required
.'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
description
))
{
this
.
setState
({
errorDesc
:
true
,
msgErrorDesc
:
'Description
cannot be empty
.'
})
this
.
setState
({
errorDesc
:
true
,
msgErrorDesc
:
'Description
is required
.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
InputType
))
{
this
.
setState
({
errorTipeData
:
true
,
msgErrorTipeData
:
'Data type
cannot be empty
'
})
this
.
setState
({
errorTipeData
:
true
,
msgErrorTipeData
:
'Data type
is required.
'
})
}
else
if
(
this
.
state
.
disabledFormula
===
false
&&
R
.
isEmpty
(
this
.
state
.
formula
))
{
this
.
setState
({
errorFormula
:
true
,
msgErrorFormula
:
'Formula
cannot be empty
'
})
this
.
setState
({
errorFormula
:
true
,
msgErrorFormula
:
'Formula
is required.
'
})
}
else
if
(
this
.
state
.
disabledValue
===
false
&&
R
.
isEmpty
(
this
.
state
.
realVal
))
{
this
.
setState
({
errorRV
:
true
,
msgErrorRV
:
'True
Value cannot be empty
'
})
this
.
setState
({
errorRV
:
true
,
msgErrorRV
:
'True
value is required.
'
})
}
else
if
(
this
.
state
.
disabledCondt
===
false
&&
R
.
isEmpty
(
this
.
state
.
condition
))
{
this
.
setState
({
errorCondition
:
true
,
msgErrorCondition
:
'False
Condition cannot be empty
'
})
this
.
setState
({
errorCondition
:
true
,
msgErrorCondition
:
'False
condition is required.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start
Date cannot be empty
'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start
date is required.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End
Date cannot be empty
'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End
date is required.
'
})
}
else
{
this
.
addReportItems
()
...
...
@@ -338,6 +338,10 @@ export default class CreateReportItems extends Component {
})
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
return
(
...
...
src/container/MasterData/formReportItems/EditReportItems.js
View file @
3eefe11a
...
...
@@ -128,25 +128,25 @@ export default class EditReportItems extends Component {
validasi
()
{
// alert('coba ya')
if
(
R
.
isNil
(
this
.
state
.
reportType
)){
this
.
setState
({
errorJenisLaporan
:
true
,
msgErrorJenisLaporan
:
'Report type
cannot be empty
'
})
this
.
setState
({
errorJenisLaporan
:
true
,
msgErrorJenisLaporan
:
'Report type
is required.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
company
)){
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company
cannot be empty
'
})
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company
is required.
'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
tempData
.
order
))
{
this
.
setState
({
errorOrder
:
true
,
msgErrorOrder
:
'Order
cannot be empty
.'
})
this
.
setState
({
errorOrder
:
true
,
msgErrorOrder
:
'Order
is required.
.'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
tempData
.
description
))
{
this
.
setState
({
errorDesc
:
true
,
msgErrorDesc
:
'Description
cannot be empty
.'
})
this
.
setState
({
errorDesc
:
true
,
msgErrorDesc
:
'Description
is required.
.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
InputType
))
{
this
.
setState
({
errorTipeData
:
true
,
msgErrorTipeData
:
'Data type
cannot be empty
'
})
this
.
setState
({
errorTipeData
:
true
,
msgErrorTipeData
:
'Data type
is required.
'
})
}
else
if
((
this
.
state
.
InputType
.
type_report_name
===
'Formula'
&&
R
.
isEmpty
(
this
.
state
.
tempData
.
formula
))
||
(
this
.
state
.
InputType
.
type_report_name
===
'Validation'
&&
R
.
isEmpty
(
this
.
state
.
tempData
.
formula
)))
{
this
.
setState
({
errorFormula
:
true
,
msgErrorFormula
:
'Formula
cannot be empty
'
})
this
.
setState
({
errorFormula
:
true
,
msgErrorFormula
:
'Formula
is required.
'
})
}
else
if
(
this
.
state
.
InputType
.
type_report_name
===
'Validation'
&&
R
.
isEmpty
(
this
.
state
.
tempData
.
condition_it_should_be
))
{
this
.
setState
({
errorRV
:
true
,
msgErrorRV
:
'True
Value cannot be empty
'
})
this
.
setState
({
errorRV
:
true
,
msgErrorRV
:
'True
value is required.
'
})
}
else
if
(
this
.
state
.
InputType
.
type_report_name
===
'Validation'
&&
R
.
isNil
(
this
.
state
.
tempData
.
condition_if_wrong
))
{
this
.
setState
({
errorCondition
:
true
,
msgErrorCondition
:
'False
Condition cannot be empty
'
})
this
.
setState
({
errorCondition
:
true
,
msgErrorCondition
:
'False
condition is required.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
start_date
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start
Date cannot be empty
'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start
date is required.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
end_date
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End
Date cannot be empty
'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End
date is required.
'
})
}
else
{
this
.
updateReportItems
()
}
...
...
src/container/MasterData/formReportItems/VisualReportItems.js
View file @
3eefe11a
import
React
,
{
Component
}
from
'react'
;
import
{
makeStyles
}
from
'@material-ui/core/styles'
;
import
{
TextField
,
List
,
ListSubheader
,
Typography
,
Collapse
}
from
'@material-ui/core'
;
import
{
TextField
,
Snackbar
,
withStyles
}
from
'@material-ui/core'
;
import
MinimizeIcon
from
'@material-ui/icons/Minimize'
;
import
AddIcon
from
'@material-ui/icons/Add'
;
import
RemoveIcon
from
'@material-ui/icons/Remove'
;
...
...
@@ -8,6 +8,7 @@ import Nestable from 'react-nestable';
import
api
from
'../../../api'
;
import
{
titleCase
}
from
'../../../library/Utils'
;
import
Autocomplete
from
'@material-ui/lab/Autocomplete'
;
import
MuiAlert
from
'@material-ui/lab/Alert'
;
const
useStyles
=
makeStyles
((
theme
)
=>
({
root
:
{
...
...
@@ -20,6 +21,8 @@ const useStyles = makeStyles((theme) => ({
},
}));
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
const
type
=
[
{
...
...
@@ -81,7 +84,10 @@ export default class VisualReportItems extends Component {
listReport
:
null
,
report
:
null
,
listCompany
:
null
,
company
:
null
company
:
null
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
}
}
...
...
@@ -93,45 +99,61 @@ export default class VisualReportItems extends Component {
getReportType
()
{
api
.
create
().
getReportType
().
then
((
response
)
=>
{
this
.
getCompanyActive
()
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
reportData
=
data
.
map
((
item
)
=>
{
return
{
report_id
:
item
.
report_id
,
report_name
:
item
.
report_name
,
}
})
let
defaultProps
=
{
options
:
reportData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
report_name
),
};
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
reportData
=
data
.
map
((
item
)
=>
{
return
{
report_id
:
item
.
report_id
,
report_name
:
item
.
report_name
,
}
})
let
defaultProps
=
{
options
:
reportData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
report_name
),
};
this
.
setState
({
listReport
:
defaultProps
,
report
:
reportData
[
0
]
})
this
.
setState
({
listReport
:
defaultProps
,
report
:
reportData
[
0
]
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
alert
(
response
.
data
.
message
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
}
)
}
})
}
getCompanyActive
()
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
companyData
=
data
.
map
((
item
)
=>
{
return
{
company_id
:
item
.
company_id
,
company_name
:
item
.
company_name
,
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
companyData
=
data
.
map
((
item
)
=>
{
return
{
company_id
:
item
.
company_id
,
company_name
:
item
.
company_name
,
}
})
let
defaultProps
=
{
options
:
companyData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
this
.
setState
({
listCompany
:
defaultProps
,
company
:
companyData
[
0
]
},
()
=>
{
this
.
getItemHierarki
()
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
})
let
defaultProps
=
{
options
:
companyData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
this
.
setState
({
listCompany
:
defaultProps
,
company
:
companyData
[
0
]
},
()
=>
{
this
.
getItemHierarki
()
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
alert
(
response
.
data
.
message
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
}
)
}
})
}
...
...
@@ -144,9 +166,17 @@ export default class VisualReportItems extends Component {
api
.
create
().
getItemReportHierarki
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
.
data
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
setState
({
items
:
response
.
data
.
data
})
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
setState
({
items
:
response
.
data
.
data
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
...
...
@@ -186,8 +216,25 @@ export default class VisualReportItems extends Component {
"item_report"
:
this
.
state
.
items
}
api
.
create
().
saveVisualisasiReport
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
);
// if (response.data.status == 'ucces') {
this
.
props
.
onClickClose
()
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
},
()
=>
{
setTimeout
(()
=>
{
this
.
props
.
onClickClose
()
},
1000
);
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
// } else {
// alert(response.data.message)
// }
...
...
@@ -203,18 +250,27 @@ export default class VisualReportItems extends Component {
)
};
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
return
(
<
div
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
<
div
style
=
{{
height
:
this
.
props
.
height
}}
>
<
div
style
=
{{
width
:
'100%'
}}
className
=
{
"main-color"
}
/
>
<
div
style
=
{{
width
:
'100%'
}}
className
=
{
"main-color"
}
/
>
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
118
}}
>
<
label
style
=
{{
color
:
'white'
,
width
:
'20%'
,
fontSize
:
16
,
paddingTop
:
8
}}
>
Data
Visualization
<
/label
>
<
/div
>
<
div
style
=
{{
padding
:
25
,
width
:
'100%'
}}
>
<
div
style
=
{{
width
:
'100%'
,
padding
:
25
,
backgroundColor
:
'white'
,
borderRadius
:
6
,
border
:
'solid 1px #c4c4c4'
}}
>
<
label
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
'16px'
,
fontWeight
:
'bold'
}}
>
Report
Item
Hierarchy
<
/label
>
<
label
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
'16px'
,
fontWeight
:
'bold'
}}
>
Report
s
Item
Hierarchy
<
/label
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
{...
this
.
state
.
listReport
}
...
...
@@ -222,12 +278,12 @@ export default class VisualReportItems extends Component {
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
report
:
newInputValue
},
()
=>
this
.
getItemHierarki
())}
debug
disableClearable
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Report Type"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
width
:
"15%"
,
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Report Type"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
width
:
"15%"
,
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
value
=
{
this
.
state
.
report
}
/
>
...
...
@@ -239,13 +295,13 @@ export default class VisualReportItems extends Component {
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
},
()
=>
this
.
getItemHierarki
())}
debug
disableClearable
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
width
:
"15%"
,
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
width
:
"15%"
,
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
value
=
{
this
.
state
.
company
}
/
>
<
/div
>
...
...
@@ -262,18 +318,20 @@ export default class VisualReportItems extends Component {
<
/div
>
<
div
className
=
"row"
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
15
,
paddingLeft
:
15
,
paddingBottom
:
25
}}
>
<
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
}}
>
Kembali
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Back
<
/span
>
<
/div
>
<
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
}}
>
Batal
<
/span
>
<
/div
>
<
button
onClick
=
{()
=>
this
.
handleSave
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
marginLeft
:
25
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
,
cursor
:
"pointer"
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Simpan
<
/span
>
{
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
>
<
/div
>
<
/button
>
<
/div
>
<
button
onClick
=
{()
=>
this
.
handleSave
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
marginLeft
:
25
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
,
cursor
:
"pointer"
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Save
<
/span
>
<
/div
>
<
/button
>
<
/div
>
)}
<
/div
>
<
/div
>
<
/div
>
...
...
src/container/MasterData/formUnitBisnis/CreateUnitBisnis.js
View file @
3eefe11a
import
React
,
{
Component
}
from
'react'
;
import
{
TextField
,
Typography
}
from
'@material-ui/core'
;
import
{
TextField
,
Typography
,
withStyles
,
Snackbar
}
from
'@material-ui/core'
;
import
*
as
R
from
'ramda'
import
{
DateTimePicker
,
KeyboardDatePicker
,
DatePicker
}
from
"@material-ui/pickers"
;
import
format
from
"date-fns/format"
;
import
Images
from
'../../../assets/Images'
;
import
api
from
'../../../api'
;
import
MuiAlert
from
'@material-ui/lab/Alert'
;
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
export
default
class
CreateUnitBisnis
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
id
:
''
,
status
:
""
,
status
:
""
,
name
:
''
,
startDate
:
''
,
endDate
:
''
,
...
...
@@ -20,7 +24,10 @@ export default class CreateUnitBisnis extends Component {
errorEndDate
:
false
,
msgErrorName
:
""
,
msgErrorStartDate
:
""
,
msgErrorEndDate
:
""
msgErrorEndDate
:
""
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
,
}
}
render
()
{
...
...
@@ -61,9 +68,14 @@ export default class CreateUnitBisnis extends Component {
endDate
:
data
.
end_date
,
status
:
data
.
status
,
created
:
data
.
created
,
updated
:
data
.
updated
===
null
?
""
:
data
.
updated
updated
:
data
.
updated
===
null
?
""
:
data
.
updated
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
...
...
@@ -100,11 +112,11 @@ export default class CreateUnitBisnis extends Component {
validasi
()
{
if
(
R
.
isEmpty
(
this
.
state
.
name
))
{
this
.
setState
({
errorName
:
true
,
msgErrorName
:
'Business
Unit is required
'
})
this
.
setState
({
errorName
:
true
,
msgErrorName
:
'Business
unit is required.
'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start
Date is required
'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start
date is required.
'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
endDate
)
||
this
.
state
.
endDate
===
null
)
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End
Date is required
'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End
date is required.
'
})
}
else
{
let
payload
=
{
"business_unit_id"
:
this
.
state
.
id
,
...
...
@@ -118,11 +130,11 @@ export default class CreateUnitBisnis extends Component {
validasiCreate
()
{
if
(
R
.
isEmpty
(
this
.
state
.
name
))
{
this
.
setState
({
errorName
:
true
,
msgErrorName
:
'Business
Unit is required
'
})
this
.
setState
({
errorName
:
true
,
msgErrorName
:
'Business
unit is required.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start
Date is required
'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start
date is required.
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End
Date is required'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End
date is required.'
})
}
else
{
let
payload
=
{
"business_unit_name"
:
this
.
state
.
name
,
...
...
@@ -133,9 +145,18 @@ export default class CreateUnitBisnis extends Component {
}
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
renderEdit
()
{
return
(
<
div
className
=
"test app-popup-show"
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
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'
}}
>
...
...
@@ -228,11 +249,11 @@ export default class CreateUnitBisnis extends Component {
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'2
0%'
}}
>
Created
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'2
5%'
}}
>
Created
By
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
:
{
this
.
state
.
created
}
<
/Typography
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'2
0%'
}}
>
Updated
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'2
5%'
}}
>
Updated
By
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
:
{
this
.
state
.
updated
}
<
/Typography
>
<
/div
>
<
/div
>
...
...
@@ -301,7 +322,7 @@ export default class CreateUnitBisnis extends Component {
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Bata
l
<
/span
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cance
l
<
/span
>
<
/div
>
<
/button
>
<
/div
>
...
...
@@ -311,7 +332,7 @@ export default class CreateUnitBisnis extends Component {
onClick
=
{()
=>
this
.
validasi
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
impan
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
ave
<
/span
>
<
/div
>
<
/button
>
<
/div
>
...
...
@@ -415,8 +436,8 @@ export default class CreateUnitBisnis extends Component {
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
Created
:
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
Updated
:
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'25%'
}}
>
Created
By
:
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'25%'
}}
>
Updated
By
:
<
/Typography
>
<
/div
>
<
/div
>
...
...
@@ -484,7 +505,7 @@ export default class CreateUnitBisnis extends Component {
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Bata
l
<
/span
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cance
l
<
/span
>
<
/div
>
<
/button
>
<
/div
>
...
...
@@ -494,7 +515,7 @@ export default class CreateUnitBisnis extends Component {
onClick
=
{()
=>
this
.
validasiCreate
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
impan
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
ave
<
/span
>
<
/div
>
<
/button
>
<
/div
>
...
...
src/container/Profile.js
View file @
3eefe11a
...
...
@@ -36,9 +36,9 @@ export default class Profile extends Component {
errorOldPassword
:
false
,
errorPassword
:
false
,
errorConfirmPassword
:
false
,
msgOldPassword
:
'
Terdiri 8 karakter dengan kombinasi angka
.'
,
msgPassword
:
'
Terdiri 8 karakter dengan kombinasi angka
.'
,
msgConfirmPassword
:
'
Terdiri 8 karakter dengan kombinasi angka
.'
,
msgOldPassword
:
'
Consists of 8 characters with a combination of numbers
.'
,
msgPassword
:
'
Consists of 8 characters with a combination of numbers
.'
,
msgConfirmPassword
:
'
Consists of 8 characters with a combination of numbers
.'
,
company
:
[],
listCompany
:
[],
selectedIndex
:
0
,
...
...
@@ -68,41 +68,41 @@ export default class Profile extends Component {
this
.
setState
({
...
data
,
[
e
.
target
.
name
]:
e
.
target
.
value
})
console
.
log
(
e
.
target
.
name
);
if
(
e
.
target
.
name
==
"password"
)
{
this
.
setState
({
errorPassword
:
false
,
msgPassword
:
'
Terdiri 8 karakter dengan kombinasi angka
.'
})
this
.
setState
({
errorPassword
:
false
,
msgPassword
:
'
Consists of 8 characters with a combination of numbers
.'
})
}
else
if
(
e
.
target
.
name
==
"confirmPassword"
)
{
this
.
setState
({
errorConfirmPassword
:
false
,
msgConfirmPassword
:
'
Terdiri 8 karakter dengan kombinasi angka
.'
})
this
.
setState
({
errorConfirmPassword
:
false
,
msgConfirmPassword
:
'
Consists of 8 characters with a combination of numbers
.'
})
}
else
if
(
e
.
target
.
name
==
"oldPassword"
)
{
this
.
setState
({
errorOldPassword
:
false
,
msgOldPassword
:
'
Terdiri 8 karakter dengan kombinasi angka
.'
})
this
.
setState
({
errorOldPassword
:
false
,
msgOldPassword
:
'
Consists of 8 characters with a combination of numbers
.'
})
}
}
validasi
()
{
if
(
this
.
state
.
oldPassword
==
""
)
{
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'
Kata sandi lama harus diisi!
'
})
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'
Old password is required.
'
})
}
else
if
(
this
.
state
.
oldPassword
.
length
<
8
)
{
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'
Kata sandi lama minimal 8 karakter!
'
})
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'
Old password minimum 8 characters.
'
})
}
else
if
(
this
.
isEmail
(
this
.
state
.
oldPassword
))
{
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'
Format kata sandi lama tidak boleh menggunakan email!
'
})
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'
Old password format should not use email.
'
})
}
else
if
(
!
this
.
isRegex
(
this
.
state
.
oldPassword
))
{
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'
Kata sandi lama harus berupa kombinasi karakter, huruf dan angka!
'
})
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'
Old password must be a combination of characters, letters and numbers.
'
})
}
else
if
(
this
.
state
.
password
.
trim
()
==
""
)
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'
Kata sandi baru harus diisi!
'
})
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'
Password is required.
'
})
}
else
if
(
this
.
state
.
password
.
length
<
8
)
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'
Kata sandi baru minimal 8 karakter!
'
})
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'
Password minimum 8 characters.
'
})
}
else
if
(
this
.
isEmail
(
this
.
state
.
password
))
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'
Format kata sandi baru tidak boleh menggunakan email!
'
})
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'
Password format should not use email.
'
})
}
else
if
(
!
this
.
isRegex
(
this
.
state
.
password
))
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'
Kata sandi baru harus berupa kombinasi karakter, huruf dan angka!
'
})
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
:
'
Konfirmasi kata sandi harus diisi!
'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'
Password confirmation is required.
'
})
}
else
if
(
this
.
state
.
confirmPassword
.
length
<
8
)
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'
Konfirmasi kata sandi minimal 8 karakter!
'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'
Password confirmation of at least 8 characters.
'
})
}
else
if
(
this
.
isEmail
(
this
.
state
.
confirmPassword
))
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'
Format konfirmasi kata sandi tidak boleh menggunakan email!
'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'
Password confirmation format should not use email.
'
})
}
else
if
(
!
this
.
isRegex
(
this
.
state
.
confirmPassword
))
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'
Konfirmasi kata sandi harus berupa kombinasi karakter, huruf dan angka!
'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'
Password confirmation must be a combination of characters, letters and numbers.
'
})
}
else
if
(
this
.
state
.
password
!==
this
.
state
.
confirmPassword
)
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'
Konfirmasi kata sandi harus sama dengan kata sandi baru!
'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'
Confirmation password must match the password.
'
})
}
else
{
this
.
confirmPassword
()
}
...
...
@@ -202,40 +202,40 @@ export default class Profile extends Component {
padding
=
20
}
return
(
<
div
>
{
item
.
children
.
length
>
0
&&
(
<
ul
>
{
item
.
children
.
map
((
data
,
index
)
=>
{
return
(
// <li>
<
Collapse
key
=
{
index
}
timeout
=
"auto"
unmountOnExit
in
=
{
item
.
collapse
}
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
,
paddingLeft
:
R
.
isNil
(
data
.
children
)
?
(
padding
+
20
)
:
padding
}}
>
{
R
.
isNil
(
data
.
children
)
?
null
:
data
.
children
.
length
<
1
?
<
div
>
{
item
.
children
.
length
>
0
&&
(
<
ul
>
{
item
.
children
.
map
((
data
,
index
)
=>
{
return
(
// <li>
<
Collapse
key
=
{
index
}
timeout
=
"auto"
unmountOnExit
in
=
{
item
.
collapse
}
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
,
paddingLeft
:
R
.
isNil
(
data
.
children
)
?
(
padding
+
20
)
:
padding
}}
>
{
R
.
isNil
(
data
.
children
)
?
null
:
<
span
onClick
=
{()
=>
this
.
handleCollapse
(
data
)}
style
=
{{
marginLeft
:
7
,
marginRight
:
2
}}
>
{
data
.
collapse
?
<
RemoveIcon
color
=
{
'action'
}
fontSize
=
{
'small'
}
/> : <AddIcon color={'action'} fontSize={'small'} /
>
}
<
/span
>
}
<
span
>
<
CustomCheckbox
checked
=
{
this
.
handleItemChecked
(
data
)}
onChange
=
{()
=>
null
}
/
>
<
/span
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
titleCase
(
data
.
company_name
)}
<
/Typography
>
<
/div
>
{
!
R
.
isNil
(
data
.
children
)
&&
this
.
renderChildren
(
data
,
padding
+
20
)}
<
/Collapse
>
// </li>
)
})}
<
/ul
>
)}
<
/div
>
data
.
children
.
length
<
1
?
null
:
<
span
onClick
=
{()
=>
this
.
handleCollapse
(
data
)}
style
=
{{
marginLeft
:
7
,
marginRight
:
2
}}
>
{
data
.
collapse
?
<
RemoveIcon
color
=
{
'action'
}
fontSize
=
{
'small'
}
/> : <AddIcon color={'action'} fontSize={'small'} /
>
}
<
/span
>
}
<
span
>
<
CustomCheckbox
checked
=
{
this
.
handleItemChecked
(
data
)}
onChange
=
{()
=>
null
}
/
>
<
/span
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
titleCase
(
data
.
company_name
)}
<
/Typography
>
<
/div
>
{
!
R
.
isNil
(
data
.
children
)
&&
this
.
renderChildren
(
data
,
padding
+
20
)}
<
/Collapse
>
// </li>
)
})}
<
/ul
>
)}
<
/div
>
)
}
...
...
@@ -300,13 +300,13 @@ export default class Profile extends Component {
// });
}
async
uploadFoto
(){
async
uploadFoto
()
{
let
formData
=
new
FormData
()
formData
.
append
(
'file'
,
this
.
state
.
pictures
[
0
])
api
.
create
().
uploadFoto
(
formData
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
ok
){
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
uploadVisible
:
false
},
()
=>
{
this
.
getUser
()
...
...
@@ -329,7 +329,7 @@ export default class Profile extends Component {
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
this
.
setState
({
alert
:
false
})
}
render
()
{
...
...
@@ -358,7 +358,11 @@ export default class Profile extends Component {
// onClick={() => console.log(tableMeta)}
onClick
=
{()
=>
this
.
setState
({
uploadVisible
:
true
})}
>
<
img
src
=
{
Images
.
photo
}
/
>
{
/* <img src={Images.photo} /> */
}
<
div
style
=
{{
width
:
93
,
height
:
30
,
objectFit
:
'contain'
,
backgroundColor
:
'#019ce5'
,
borderRadius
:
4
,
display
:
'flex'
,
alignContent
:
'center'
,
justifyContent
:
'center'
}}
>
<
img
src
=
{
Images
.
camera
}
/
>
<
Typography
style
=
{{
color
:
'#ffffff'
,
fontSize
:
11
,
fontFamily
:
'Nunito Sans, sans-serif'
,
alignSelf
:
'center'
,
marginLeft
:
5
}}
>
Ganti
Foto
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
<
/div
>
...
...
@@ -367,8 +371,8 @@ export default class Profile extends Component {
<
div
>
<
AppBar
position
=
"static"
>
<
Tabs
indicatorColor
=
"primary"
value
=
{
this
.
state
.
tab
}
onChange
=
{
this
.
selectTab
}
aria
-
label
=
"simple tabs example"
style
=
{{
backgroundColor
:
'#f8f8f8'
,
borderColor
:
'transparent'
}}
>
<
Tab
label
=
"
KATA SANDI
"
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
11
}}
/
>
<
Tab
label
=
"
OTORISASI PERUSAHAA
N"
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
11
}}
/
>
<
Tab
label
=
"
PASSWORD
"
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
11
}}
/
>
<
Tab
label
=
"
AUTHORIZATIO
N"
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
11
}}
/
>
<
/Tabs
>
<
/AppBar
>
{
this
.
state
.
tab
==
0
?
...
...
@@ -379,16 +383,26 @@ export default class Profile extends Component {
<
div
style
=
{{
padding
:
20
,
marginTop
:
10
,
marginBottom
:
100
}}
>
<
div
style
=
{{
width
:
432
,
borderRadius
:
6
,
boxShadow
:
'0 1px 4px 0 rgba(0, 0, 0, 0.25)'
}}
>
<
div
style
=
{{
width
:
'100%'
,
height
:
64
,
backgroundColor
:
'#354960'
,
display
:
'flex'
,
paddingLeft
:
20
,
borderTopLeftRadius
:
6
,
borderTopRightRadius
:
6
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'13px'
,
color
:
'white'
,
fontWeight
:
'bold'
}}
>
Kata
Sandi
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'13px'
,
color
:
'white'
,
fontWeight
:
'bold'
}}
>
Password
<
/Typography
>
<
/div
>
<
div
style
=
{{
padding
:
20
,
justifyContent
:
'space-between'
}}
>
<
TextField
style
=
{{
width
:
'100%'
}}
inputProps
=
{{
style
:
{
fontSize
:
11
}
}}
inputProps
=
{{
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
id
=
"filled-required"
name
=
{
"oldPassword"
}
type
=
{
this
.
state
.
showPass
?
'text'
:
'password'
}
label
=
"
Kata Sandi Saat Ini
"
label
=
"
Old Password
"
value
=
{
this
.
state
.
oldPassword
}
variant
=
"outlined"
onChange
=
{(
password
)
=>
{
...
...
@@ -411,9 +425,19 @@ export default class Profile extends Component {
/
>
<
TextField
style
=
{{
width
:
'100%'
,
marginTop
:
20
}}
inputProps
=
{{
style
:
{
fontSize
:
11
}
}}
inputProps
=
{{
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
id
=
"filled-required"
label
=
"
Kata Sandi Baru
"
label
=
"
New Password
"
name
=
{
"password"
}
type
=
{
this
.
state
.
showPass2
?
'text'
:
'password'
}
value
=
{
this
.
state
.
password
}
...
...
@@ -438,9 +462,19 @@ export default class Profile extends Component {
/
>
<
TextField
style
=
{{
width
:
'100%'
,
marginTop
:
20
}}
inputProps
=
{{
style
:
{
fontSize
:
11
}
}}
inputProps
=
{{
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
id
=
"filled-required"
label
=
"
Konfirmasi Kata Sandi Baru
"
label
=
"
Confirm Password
"
name
=
{
"confirmPassword"
}
type
=
{
this
.
state
.
showPass3
?
'text'
:
'password'
}
value
=
{
this
.
state
.
confirmPassword
}
...
...
@@ -483,7 +517,7 @@ export default class Profile extends Component {
<
div
style
=
{{
padding
:
20
,
marginTop
:
10
,
marginBottom
:
100
}}
>
<
div
style
=
{{
width
:
432
,
borderRadius
:
6
,
boxShadow
:
'0 1px 4px 0 rgba(0, 0, 0, 0.25)'
}}
>
<
div
style
=
{{
width
:
'100%'
,
height
:
64
,
backgroundColor
:
'#354960'
,
display
:
'flex'
,
paddingLeft
:
20
,
borderTopLeftRadius
:
6
,
borderTopRightRadius
:
6
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'13px'
,
color
:
'white'
,
fontWeight
:
'bold'
}}
>
Otorisasi
Perusahaa
n
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'13px'
,
color
:
'white'
,
fontWeight
:
'bold'
}}
>
Authorizatio
n
<
/Typography
>
<
/div
>
<
div
style
=
{{
padding
:
20
,
overflow
:
'scroll'
,
height
:
'40vh'
}}
>
{
/* <div style={{ display: 'flex' }}>
...
...
src/container/ResetPassword.js
View file @
3eefe11a
...
...
@@ -20,8 +20,8 @@ class ResetPassword extends Component {
showPass2
:
false
,
errorPassword
:
false
,
errorConfirmPassword
:
false
,
msgPassword
:
'Consists of 8 characters with a combination of numbers
!
.'
,
msgConfirmPassword
:
'Consists of 8 characters with a combination of numbers
!
.'
,
msgPassword
:
'Consists of 8 characters with a combination of numbers.'
,
msgConfirmPassword
:
'Consists of 8 characters with a combination of numbers.'
,
userId
:
0
,
alert
:
false
,
tipeAlert
:
''
,
...
...
@@ -65,23 +65,23 @@ class ResetPassword extends Component {
validateReset
()
{
if
(
this
.
state
.
password
.
trim
()
==
""
)
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password
cannot be empty!
'
})
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password
is required
'
})
}
else
if
(
this
.
state
.
password
.
length
<
8
)
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password minimum 8 characters
!
'
})
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password minimum 8 characters
.
'
})
}
else
if
(
this
.
isEmail
(
this
.
state
.
password
))
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password format should not use email
!
'
})
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password format should not use email
.
'
})
}
else
if
(
!
this
.
isRegex
(
this
.
state
.
password
))
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password must be a combination of characters, letters and numbers
!
'
})
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
:
'Confirm password
cannot be empty!
'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Confirm password
is required.
'
})
}
else
if
(
this
.
state
.
confirmPassword
.
length
<
8
)
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Confirm password
of at least 8 characters!
'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Confirm password
minimum 8 characters.
'
})
}
else
if
(
this
.
isEmail
(
this
.
state
.
confirmPassword
))
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Password confirmation format
may not use email!
'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Password confirmation format
should not use email.
'
})
}
else
if
(
!
this
.
isRegex
(
this
.
state
.
confirmPassword
))
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Password confirmation must be a combination of characters, letters and numbers
!
'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Password confirmation must be a combination of characters, letters and numbers
.
'
})
}
else
if
(
this
.
state
.
password
!==
this
.
state
.
confirmPassword
)
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Confirmation password must match the password
!
'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Confirmation password must match the password
.
'
})
}
else
{
this
.
confirmPassword
()
}
...
...
src/library/PopUpFailedSave.js
View file @
3eefe11a
...
...
@@ -12,10 +12,10 @@ export default class PopUpFailedSave extends Component {
<
/div
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'center'
,
marginTop
:
20
}}
>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
14
,
fontWeight
:
'bold'
}}
>
{
`
Maaf, penyimpanan data gagal
.`
}
{
`
Sorry, form save failed
.`
}
<
/span
>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
14
,
fontWeight
:
'bold'
}}
>
{
`
Mohon ulangi beberapa saat lagi
.`
}
{
`
Please try again later
.`
}
<
/span
>
<
/div
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'center'
,
marginTop
:
24
}}
>
...
...
src/library/Upload.js
View file @
3eefe11a
...
...
@@ -70,7 +70,7 @@ class Upload extends Component {
uploadProgress
:
false
,
percentage
:
'0'
})
this
.
setState
({
alertMessage
:
"Unsupported
Media Typ
e"
,
alert
:
true
})
this
.
setState
({
alertMessage
:
"Unsupported
Fil
e"
,
alert
:
true
})
// alert("Unsupported Media Type")
}
}
...
...
@@ -95,11 +95,11 @@ class Upload extends Component {
if
(
this
.
state
.
sizeFile
<
1000
)
{
this
.
props
.
onUpload
()
}
else
{
this
.
setState
({
alertMessage
:
'File
Tidak Boleh Lebih Dari
1MB'
,
alert
:
true
})
this
.
setState
({
alertMessage
:
'File
cannot be more than
1MB'
,
alert
:
true
})
// alert('File Tidak Boleh Lebih Dari 1MB')
}
}
else
{
this
.
setState
({
alertMessage
:
'
File Tidak Mendukung
'
,
alert
:
true
})
this
.
setState
({
alertMessage
:
'
Unsupported File
'
,
alert
:
true
})
// alert('File Tidak Mendukung')
}
}
...
...
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