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
92e9e0de
Commit
92e9e0de
authored
Aug 19, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkbox
parent
cafd8bd4
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
239 additions
and
154 deletions
+239
-154
AddUser.js
src/container/Otorisasi/User/AddUser.js
+124
-89
EditUser.js
src/container/Otorisasi/User/EditUser.js
+82
-50
UserRole.js
src/container/Otorisasi/UserRole.js
+2
-1
Profile.js
src/container/Profile.js
+31
-14
No files found.
src/container/Otorisasi/User/AddUser.js
View file @
92e9e0de
This diff is collapsed.
Click to expand it.
src/container/Otorisasi/User/EditUser.js
View file @
92e9e0de
This diff is collapsed.
Click to expand it.
src/container/Otorisasi/UserRole.js
View file @
92e9e0de
...
@@ -100,6 +100,7 @@ class UserRole extends Component {
...
@@ -100,6 +100,7 @@ class UserRole extends Component {
name
:
"Action"
,
name
:
"Action"
,
options
:
{
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
console
.
log
(
tableMeta
);
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
button
<
button
...
@@ -112,7 +113,7 @@ class UserRole extends Component {
...
@@ -112,7 +113,7 @@ class UserRole extends Component {
onClick
=
{()
=>
this
.
setState
({
edit
:
true
,
indexData
:
tableMeta
.
rowData
[
1
]
})}
onClick
=
{()
=>
this
.
setState
({
edit
:
true
,
indexData
:
tableMeta
.
rowData
[
1
]
})}
>
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
4
]
===
"Aktif"
?
{
tableMeta
.
rowData
[
2
]
!==
"superadmin"
&&
tableMeta
.
rowData
[
4
]
===
"Aktif"
?
<
img
src
=
{
Images
.
editCopy
}
/>
:
<
img
src
=
{
Images
.
editCopy
}
/>
:
null
null
}
}
...
...
src/container/Profile.js
View file @
92e9e0de
...
@@ -253,18 +253,8 @@ export default class Profile extends Component {
...
@@ -253,18 +253,8 @@ export default class Profile extends Component {
};
};
async
onDrop
(
pictureFiles
)
{
async
onDrop
(
pictureFiles
)
{
let
formData
=
new
FormData
()
console
.
log
(
pictureFiles
);
formData
.
append
(
'file'
,
pictureFiles
[
0
])
this
.
setState
({
pictures
:
pictureFiles
})
let
response
=
await
api
.
create
().
uploadFoto
(
formData
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
uploadVisible
:
false
},
()
=>
{
alert
(
response
.
data
.
message
)
this
.
getUser
()
window
.
location
.
reload
()
})
}
}
// console.log(response);
// console.log(response);
// console.log(pictureFiles);
// console.log(pictureFiles);
// console.log(pictureDataURLs);
// console.log(pictureDataURLs);
...
@@ -273,6 +263,23 @@ export default class Profile extends Component {
...
@@ -273,6 +263,23 @@ export default class Profile extends Component {
// });
// });
}
}
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
.
data
.
status
===
"success"
)
{
this
.
setState
({
uploadVisible
:
false
},
()
=>
{
alert
(
response
.
data
.
message
)
this
.
getUser
()
window
.
location
.
reload
()
})
}
}
})
}
render
()
{
render
()
{
return
(
return
(
<
div
style
=
{{
height
:
this
.
props
.
height
,
backgroundColor
:
'#f8f8f8'
,
marginBottom
:
100
,
minHeight
:
1000
}}
>
<
div
style
=
{{
height
:
this
.
props
.
height
,
backgroundColor
:
'#f8f8f8'
,
marginBottom
:
100
,
minHeight
:
1000
}}
>
...
@@ -487,11 +494,21 @@ export default class Profile extends Component {
...
@@ -487,11 +494,21 @@ export default class Profile extends Component {
<
/div
>
<
/div
>
<
ImageUploader
<
ImageUploader
withIcon
=
{
true
}
withIcon
=
{
true
}
buttonText
=
'Choose images'
withPreview
buttonText
=
'Pilih Gambar'
onChange
=
{
this
.
onDrop
}
onChange
=
{
this
.
onDrop
}
imgExtension
=
{[
'.jpg'
,
'.gif'
,
'.png'
,
'.gif'
,
'.jpeg'
]}
imgExtension
=
{[
'.jpg'
,
'.gif'
,
'.png'
,
'.gif'
,
'.jpeg'
]}
maxFileSize
=
{
5242880
}
maxFileSize
=
{
1000000
}
label
=
{
"Max file size: 1 Mb, accepted: jpg or png"
}
/
>
/
>
{
this
.
state
.
pictures
.
length
>
0
?
<
div
style
=
{{
display
:
'grid'
,
margin
:
20
}}
>
<
div
style
=
{{
justifySelf
:
'center'
}}
>
<
span
className
=
"main-color"
style
=
{{
color
:
'#fff'
,
padding
:
20
,
paddingBottom
:
10
,
paddingTop
:
10
,
borderRadius
:
15
,
cursor
:
'pointer'
}}
onClick
=
{()
=>
this
.
uploadFoto
()}
>
Upload
Foto
<
/span
>
<
/div
>
<
/div> : nul
l
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)}
)}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment