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
6983a559
Commit
6983a559
authored
Oct 01, 2020
by
Rifka Kurnia Irfiana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ubah ui docmanag
parent
005ff046
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
19 deletions
+47
-19
CreateManagementDoc.js
src/container/DocumentManagement/CreateManagementDoc.js
+29
-11
EditManagementDoc.js
src/container/DocumentManagement/EditManagementDoc.js
+16
-6
Upload.js
src/library/Upload.js
+2
-2
No files found.
src/container/DocumentManagement/CreateManagementDoc.js
View file @
6983a559
...
@@ -45,7 +45,8 @@ export default class CreateManagementDoc extends Component {
...
@@ -45,7 +45,8 @@ export default class CreateManagementDoc extends Component {
fileType
:
''
,
fileType
:
''
,
konfirmasi
:
false
,
konfirmasi
:
false
,
docId
:
''
,
docId
:
''
,
sizeUpload
:
"1"
sizeUpload
:
"1"
,
disabledPeriode
:
false
}
}
}
}
...
@@ -72,10 +73,12 @@ export default class CreateManagementDoc extends Component {
...
@@ -72,10 +73,12 @@ export default class CreateManagementDoc extends Component {
this
.
setState
({
this
.
setState
({
sizeUpload
:
"1"
sizeUpload
:
"1"
})
})
}
else
}
else
{
this
.
setState
({
this
.
setState
({
sizeUpload
:
response
.
data
.
data
[
0
].
value
sizeUpload
:
response
.
data
.
data
[
0
].
value
})
})
}
// sizeUpload: response.data.data[0] ? response.data.data[0].value === undefined ? "1" : response.data.data[0].value : "1"
console
.
log
(
this
.
state
.
sizeUpload
)
console
.
log
(
this
.
state
.
sizeUpload
)
}
}
}
}
...
@@ -235,7 +238,7 @@ export default class CreateManagementDoc extends Component {
...
@@ -235,7 +238,7 @@ export default class CreateManagementDoc extends Component {
}
}
validasi
()
{
validasi
()
{
if
(
String
(
this
.
props
.
name
).
includes
(
'Manual Book TIA'
)
){
if
(
this
.
state
.
disabledPeriode
===
true
){
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company Cannot be Empty'
})
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getDocument
))
{
}
else
if
(
R
.
isNil
(
this
.
state
.
getDocument
))
{
...
@@ -254,6 +257,12 @@ export default class CreateManagementDoc extends Component {
...
@@ -254,6 +257,12 @@ export default class CreateManagementDoc extends Component {
this
.
setState
({
formData
},
()
=>
{
this
.
setState
({
formData
},
()
=>
{
this
.
props
.
createDocument
(
this
.
state
.
formData
,
this
.
props
.
setting_id
,
this
.
props
.
name
)
this
.
props
.
createDocument
(
this
.
state
.
formData
,
this
.
props
.
setting_id
,
this
.
props
.
name
)
})
})
var
object
=
{};
formData
.
forEach
(
function
(
value
,
key
){
object
[
key
]
=
value
;
});
var
json
=
JSON
.
stringify
(
object
);
console
.
log
(
object
)
}
}
}
else
{
}
else
{
...
@@ -341,7 +350,12 @@ export default class CreateManagementDoc extends Component {
...
@@ -341,7 +350,12 @@ export default class CreateManagementDoc extends Component {
// debug
// debug
clearOnEscape
clearOnEscape
id
=
"tipe"
id
=
"tipe"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getDocument
:
newInputValue
},
()
=>
this
.
clearMessage
())}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getDocument
:
newInputValue
},
()
=>
newInputValue
===
null
?
this
.
setState
({
disabledPeriode
:
false
})
:
newInputValue
.
document_category_name
===
'Manual Book TIA 4.0'
?
this
.
setState
({
disabledPeriode
:
true
},
()
=>
this
.
clearMessage
())
:
this
.
setState
({
disabledPeriode
:
false
},
()
=>
this
.
clearMessage
())
)}
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
<
TextField
{...
params
}
error
=
{
this
.
state
.
errorDocument
}
error
=
{
this
.
state
.
errorDocument
}
...
@@ -353,7 +367,8 @@ export default class CreateManagementDoc extends Component {
...
@@ -353,7 +367,8 @@ export default class CreateManagementDoc extends Component {
/
>
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
{
String
(
this
.
props
.
name
).
includes
(
'Manual Book TIA'
)
?
false
:
(
{
/* {String(this.props.name).includes('Manual Book TIA') ? false : ( */
}
{
this
.
state
.
disabledPeriode
===
false
?
<
div
className
=
"column-1"
>
<
div
className
=
"column-1"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
<
Autocomplete
...
@@ -374,8 +389,10 @@ export default class CreateManagementDoc extends Component {
...
@@ -374,8 +389,10 @@ export default class CreateManagementDoc extends Component {
/
>
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)}
// )}
{
String
(
this
.
props
.
name
).
includes
(
'Manual Book TIA'
)
?
false
:
(
// {String(this.props.name).includes('Manual Book TIA') ? false : (
:
true
}
{
this
.
state
.
disabledPeriode
===
false
?
<
div
className
=
"column-2"
>
<
div
className
=
"column-2"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
<
Autocomplete
...
@@ -396,7 +413,8 @@ export default class CreateManagementDoc extends Component {
...
@@ -396,7 +413,8 @@ export default class CreateManagementDoc extends Component {
/
>
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)}
// )}
:
true
}
<
/div
>
<
/div
>
<
div
style
=
{{
paddingLeft
:
30
,
paddingRight
:
30
,
paddingTop
:
10
}}
>
<
div
style
=
{{
paddingLeft
:
30
,
paddingRight
:
30
,
paddingTop
:
10
}}
>
<
UploadFile
<
UploadFile
...
...
src/container/DocumentManagement/EditManagementDoc.js
View file @
6983a559
...
@@ -49,7 +49,8 @@ export default class EditManagementDoc extends Component {
...
@@ -49,7 +49,8 @@ export default class EditManagementDoc extends Component {
document_size
:
0
,
document_size
:
0
,
loadUpload
:
false
,
loadUpload
:
false
,
sizeUpload
:
"1"
,
sizeUpload
:
"1"
,
name
:
''
name
:
''
,
disabledPeriode
:
false
}
}
}
}
...
@@ -379,7 +380,12 @@ export default class EditManagementDoc extends Component {
...
@@ -379,7 +380,12 @@ export default class EditManagementDoc extends Component {
// debug
// debug
clearOnEscape
clearOnEscape
id
=
"tipe"
id
=
"tipe"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getDocument
:
newInputValue
},
()
=>
this
.
clearMessage
())}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getDocument
:
newInputValue
},
()
=>
newInputValue
===
null
?
this
.
setState
({
disabledPeriode
:
false
})
:
newInputValue
.
document_category_name
===
'Manual Book TIA 4.0'
?
this
.
setState
({
disabledPeriode
:
true
},
()
=>
this
.
clearMessage
())
:
this
.
setState
({
disabledPeriode
:
false
},
()
=>
this
.
clearMessage
())
)}
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
<
TextField
{...
params
}
error
=
{
this
.
state
.
errorDocument
}
error
=
{
this
.
state
.
errorDocument
}
...
@@ -391,7 +397,8 @@ export default class EditManagementDoc extends Component {
...
@@ -391,7 +397,8 @@ export default class EditManagementDoc extends Component {
/
>
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
{
String
(
this
.
state
.
name
).
includes
(
'Manual Book TIA'
)
?
false
:
(
{
this
.
state
.
disabledPeriode
===
false
?
// {String(this.state.name).includes('Manual Book TIA') ? false : (
<
div
className
=
"column-1"
>
<
div
className
=
"column-1"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
<
Autocomplete
...
@@ -412,8 +419,10 @@ export default class EditManagementDoc extends Component {
...
@@ -412,8 +419,10 @@ export default class EditManagementDoc extends Component {
/
>
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)}
// )}
{
String
(
this
.
state
.
name
).
includes
(
'Manual Book TIA'
)
?
false
:
(
:
true
}
{
this
.
state
.
disabledPeriode
===
false
?
// {String(this.state.name).includes('Manual Book TIA') ? false : (
<
div
className
=
"column-2"
>
<
div
className
=
"column-2"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
<
Autocomplete
...
@@ -434,7 +443,8 @@ export default class EditManagementDoc extends Component {
...
@@ -434,7 +443,8 @@ export default class EditManagementDoc extends Component {
/
>
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)}
// )}
:
true
}
<
/div
>
<
/div
>
<
div
style
=
{{
paddingLeft
:
30
,
paddingRight
:
30
,
paddingTop
:
10
}}
>
<
div
style
=
{{
paddingLeft
:
30
,
paddingRight
:
30
,
paddingTop
:
10
}}
>
{
this
.
state
.
loadUpload
&&
(
{
this
.
state
.
loadUpload
&&
(
...
...
src/library/Upload.js
View file @
6983a559
...
@@ -61,7 +61,7 @@ class Upload extends Component {
...
@@ -61,7 +61,7 @@ class Upload extends Component {
if
(
this
.
props
.
intent
===
'management'
)
{
if
(
this
.
props
.
intent
===
'management'
)
{
if
(
acceptedFiles
)
{
if
(
acceptedFiles
)
{
if
(
this
.
props
.
acceptedFiles
.
includes
(
fileType
))
{
if
(
this
.
props
.
acceptedFiles
.
includes
(
fileType
))
{
if
((
acceptedFiles
[
0
].
size
/
1000
).
toFixed
(
0
)
<
(
this
.
state
.
sizeUpload
*
1000
))
{
if
((
acceptedFiles
[
0
].
size
/
1000
).
toFixed
(
0
)
<
(
this
.
props
.
sizeUpload
*
1000
))
{
this
.
setState
({
this
.
setState
({
file
:
acceptedFiles
[
0
],
file
:
acceptedFiles
[
0
],
typeFile
:
fileType
,
typeFile
:
fileType
,
...
@@ -74,7 +74,7 @@ class Upload extends Component {
...
@@ -74,7 +74,7 @@ class Upload extends Component {
})
})
this
.
props
.
onHandle
(
acceptedFiles
[
0
])
this
.
props
.
onHandle
(
acceptedFiles
[
0
])
}
else
{
}
else
{
this
.
setState
({
alertMessage
:
`The file is too large. Allowed maximum size is
${
this
.
state
.
sizeUpload
}
MB`
,
alert
:
true
})
this
.
setState
({
alertMessage
:
`The file is too large. Allowed maximum size is
${
this
.
props
.
sizeUpload
}
MB`
,
alert
:
true
})
// alert('File Tidak Boleh Lebih Dari 1MB')
// alert('File Tidak Boleh Lebih Dari 1MB')
}
}
}
else
{
}
else
{
...
...
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