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
430da4df
Commit
430da4df
authored
Aug 20, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'syadziy' into 'master'
Syadziy See merge request
!137
parents
c2ff51bc
eb027dde
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
130 additions
and
73 deletions
+130
-73
CreatePerusahaan.js
src/container/MasterData/Perusahaan/CreatePerusahaan.js
+25
-13
Perusahaan.js
src/container/MasterData/Perusahaan/Perusahaan.js
+73
-58
AddUser.js
src/container/Otorisasi/User/AddUser.js
+16
-1
EditUser.js
src/container/Otorisasi/User/EditUser.js
+16
-1
No files found.
src/container/MasterData/Perusahaan/CreatePerusahaan.js
View file @
430da4df
...
...
@@ -121,7 +121,7 @@ export default class CreatePerusahaan extends Component {
options
:
typeData
,
getOptionLabel
:
(
option
)
=>
option
.
business_unit_name
,
};
this
.
setState
({
types
:
typeProps
,
typeData
:
response
.
data
.
data
,
getTypes
:
index
==
-
1
?
typeData
[
0
]
:
typeData
[
index
]
})
this
.
setState
({
types
:
typeProps
,
typeData
:
response
.
data
.
data
,
getTypes
:
index
==
-
1
?
null
:
typeData
[
index
]
})
}
else
{
alert
(
response
.
data
.
message
)
}
...
...
@@ -175,19 +175,21 @@ export default class CreatePerusahaan extends Component {
errorSD
:
false
,
errorED
:
false
,
errorJL
:
false
,
errorUB
:
false
,
msgErrorNP
:
''
,
msgErrorPC
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
msgErrorJL
:
''
,
msgErrorUB
:
''
})
}
validasiEdit
()
{
if
(
R
.
isEmpty
(
this
.
state
.
company
))
{
this
.
setState
({
errorNP
:
true
,
msgErrorNP
:
'Nama perusahaan harus diisi'
})
// } else if (R.isEmpty(this.state.totalReport
)) {
// this.setState({ errorJL: true, msgErrorJL: 'Total Report harus diisi' })
}
else
if
(
R
.
isNil
(
this
.
state
.
getTypes
))
{
this
.
setState
({
errorUB
:
true
,
msgErrorUB
:
'Unit Bisnis harus diisi'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorSD
:
true
,
msgErrorSD
:
'Start Date tidak boleh kosong'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
...
...
@@ -210,7 +212,7 @@ export default class CreatePerusahaan extends Component {
validasi
()
{
if
(
R
.
isEmpty
(
this
.
state
.
company
))
{
this
.
setState
({
errorNP
:
true
,
msgErrorNP
:
'Nama perusahaan harus diisi'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
t
ypes
))
{
}
else
if
(
R
.
isNil
(
this
.
state
.
getT
ypes
))
{
this
.
setState
({
errorUB
:
true
,
msgErrorUB
:
'Unit Bisnis harus diisi'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorSD
:
true
,
msgErrorSD
:
'Start Date tidak boleh kosong'
})
...
...
@@ -218,9 +220,11 @@ export default class CreatePerusahaan extends Component {
this
.
setState
({
errorED
:
true
,
msgErrorED
:
'End Date tidak boleh kosong'
})
}
else
if
(
!
R
.
isEmpty
(
this
.
state
.
startDate
)
&&
!
R
.
isEmpty
(
this
.
state
.
endDate
)
&&
(
this
.
state
.
startDate
>
this
.
state
.
endDate
))
{
return
alert
(
"Masa Berlaku Tidak Boleh Kurang Dari Tanggal Mulai"
)
}
else
if
(
R
.
isEmpty
(
this
.
state
.
totalReport
))
{
this
.
setState
({
errorJL
:
true
,
msgErrorJL
:
'Total Report harus diisi'
})
}
else
{
}
// else if (R.isEmpty(this.state.totalReport)) {
// this.setState({ errorJL: true, msgErrorJL: 'Total Report harus diisi' })
// }
else
{
let
payload
=
{
"company_name"
:
this
.
state
.
company
,
"parent"
:
this
.
state
.
getPerusahaan
==
null
?
null
:
this
.
state
.
getPerusahaan
.
company_id
,
...
...
@@ -283,8 +287,17 @@ export default class CreatePerusahaan extends Component {
{...
this
.
state
.
types
}
debug
id
=
"tipe"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getTypes
:
newInputValue
})}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
label
=
"Unit Bisnis"
/>
}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getTypes
:
newInputValue
},
()
=>
this
.
clearError
())}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
label
=
"Unit Bisnis"
error
=
{
this
.
state
.
errorUB
}
helperText
=
{
this
.
state
.
msgErrorUB
}
/
>
}
value
=
{
this
.
state
.
getTypes
}
/
>
<
/div
>
...
...
@@ -511,14 +524,13 @@ export default class CreatePerusahaan extends Component {
{...
this
.
state
.
types
}
debug
id
=
"tipe"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getTypes
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getTypes
:
newInputValue
}
,
()
=>
this
.
clearError
()
)}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Unit Bisnis"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
error
=
{
this
.
state
.
errorUB
}
helperText
=
{
this
.
state
.
msgErrorUB
}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
...
...
@@ -652,7 +664,7 @@ export default class CreatePerusahaan extends Component {
style
=
{{
padding
:
0
,
margin
:
0
,
width
:
'100%'
}}
/
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
{
/*
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
id="report"
...
...
@@ -674,7 +686,7 @@ export default class CreatePerusahaan extends Component {
onChange={(e) => this.setState({ totalReport: e.target.value }, () => this.clearError())}
>
</TextField>
<
/div
>
</div>
*/
}
<
/div
>
<
/div
>
...
...
src/container/MasterData/Perusahaan/Perusahaan.js
View file @
430da4df
...
...
@@ -446,7 +446,7 @@ export default class Perusahaan extends Component {
{
this
.
state
.
visiblePerusahaan
===
true
?
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
150
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
}}
>
Master
Data
-
Perusahaan
<
/label
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
,
}}
>
Master
Data
-
Perusahaan
<
/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
...
...
@@ -457,7 +457,8 @@ export default class Perusahaan extends Component {
inputProps
=
{{
'aria-label'
:
'naked'
}}
/
>
<
/div
>
<
div
style
=
{{
width
:
'20%'
,
justifyContent
:
'space-around'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
div
style
=
{{
width
:
'30%'
,
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
...
...
@@ -469,6 +470,9 @@ export default class Perusahaan extends Component {
>
<
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'
,
...
...
@@ -480,6 +484,9 @@ export default class Perusahaan extends Component {
>
<
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'
,
...
...
@@ -491,6 +498,9 @@ export default class Perusahaan extends Component {
>
<
img
src
=
{
Images
.
download
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Visualisasi'
}
data
-
for
=
"visual"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
...
...
@@ -502,6 +512,9 @@ export default class Perusahaan extends Component {
>
<
img
src
=
{
Images
.
visualisasi
}
onClick
=
{()
=>
this
.
setState
({
visibleVisual
:
true
,
visiblePerusahaan
:
false
})}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"visual"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Tambah'
}
data
-
for
=
"create"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
...
...
@@ -513,6 +526,8 @@ export default class Perusahaan extends Component {
>
<
img
src
=
{
Images
.
add
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"create"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
<
/div
>
<
div
style
=
{{
padding
:
25
}}
>
...
...
@@ -626,7 +641,7 @@ export default class Perusahaan extends Component {
type
=
{
this
.
state
.
uploadStatus
}
percentage
=
{
this
.
state
.
percentage
}
result
=
{
this
.
state
.
result
}
acceptedFiles
=
{[
"
pdf
"
]}
acceptedFiles
=
{[
"
xsls
"
]}
onHandle
=
{(
dt
)
=>
{
this
.
fileHandler
(
dt
)
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
...
...
src/container/Otorisasi/User/AddUser.js
View file @
430da4df
...
...
@@ -134,6 +134,21 @@ export default class AddUser extends Component {
}
}
clearError
()
{
this
.
setState
({
errorFullname
:
false
,
errorEmail
:
false
,
errorRoleName
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
msgErrorFN
:
''
,
msgErrorEM
:
''
,
msgErrorRN
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
})
}
isEmail
(
email
)
{
const
re
=
/^
(([^
<>()
\[\]\\
.,;:
\s
@"
]
+
(\.[^
<>()
\[\]\\
.,;:
\s
@"
]
+
)
*
)
|
(
".+"
))
@
((\[[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}\])
|
(([
a-zA-Z
\-
0-9
]
+
\.)
+
[
a-zA-Z
]{2,}))
$/
;
return
re
.
test
(
String
(
email
).
toLowerCase
());
...
...
@@ -498,7 +513,7 @@ export default class AddUser extends Component {
<
Autocomplete
{...
this
.
state
.
listRole
}
id
=
"role"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
role
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
role
:
newInputValue
}
,
()
=>
this
.
clearError
()
)}
debug
renderInput
=
{(
params
)
=>
<
TextField
...
...
src/container/Otorisasi/User/EditUser.js
View file @
430da4df
...
...
@@ -121,6 +121,21 @@ export default class EditUser extends Component {
}
}
clearError
()
{
this
.
setState
({
errorFullname
:
false
,
errorEmail
:
false
,
errorRoleName
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
msgErrorFN
:
''
,
msgErrorEM
:
''
,
msgErrorRN
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
})
}
getDetailUser
()
{
api
.
create
().
getDetailUser
(
this
.
state
.
paramsId
).
then
((
response
)
=>
{
this
.
getRole
()
...
...
@@ -497,7 +512,7 @@ export default class EditUser extends Component {
<
Autocomplete
{...
this
.
state
.
listRole
}
id
=
"role"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
role
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
role
:
newInputValue
}
,
()
=>
this
.
clearError
()
)}
debug
renderInput
=
{(
params
)
=>
<
TextField
...
...
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