Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
Kape
Commits
3e4a0349
Commit
3e4a0349
authored
Dec 06, 2019
by
Yumna Pratista Tastaftian
Browse files
1606836976 190
parent
d687ecd6
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
assets/js/EditProfile.jsx
View file @
3e4a0349
...
...
@@ -54,6 +54,7 @@ export default class EditProfile extends ProfileHandler {
awards
:
''
,
projects
:
''
,
certification
:
''
,
sertifikat
:
''
,
languages
:
''
,
seminar
:
''
,
interests
:
''
,
...
...
@@ -117,6 +118,7 @@ export default class EditProfile extends ProfileHandler {
awards
:
data
.
awards
,
projects
:
data
.
projects
,
certification
:
data
.
certification
,
sertifikat
:
data
.
sertifikat
,
languages
:
data
.
languages
,
seminar
:
data
.
seminar
,
interests
:
data
.
interests
,
...
...
@@ -452,6 +454,93 @@ export default class EditProfile extends ProfileHandler {
<
label
htmlFor
=
"latest_work_desc"
>
Latest Working Experience Description
</
label
>
<
input
onChange
=
{
this
.
handleChange
}
placeholder
=
{
this
.
state
.
latest_work_desc
===
null
?
'
Evaluate weekly assignment for 15 students
'
:
this
.
state
.
latest_work_desc
}
defaultValue
=
{
this
.
state
.
latest_work_desc
===
null
?
null
:
this
.
state
.
latest_work_desc
}
name
=
"latest_work_desc"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"awards"
>
Awards and Achievements
</
label
>
<
input
onChange
=
{
this
.
handleChange
}
placeholder
=
{
this
.
state
.
awards
===
null
?
'
Juara 2 UIUX Gemastik 2019
'
:
this
.
state
.
awards
}
defaultValue
=
{
this
.
state
.
awards
===
null
?
null
:
this
.
state
.
awards
}
name
=
"awards"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"projects"
>
Projects
</
label
>
<
input
onChange
=
{
this
.
handleChange
}
placeholder
=
{
this
.
state
.
projects
===
null
?
'
Ow-Jek - Android Mobile Project
'
:
this
.
state
.
projects
}
defaultValue
=
{
this
.
state
.
projects
===
null
?
null
:
this
.
state
.
projects
}
name
=
"projects"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"certification"
>
Sertifikasi
</
label
>
<
input
onChange
=
{
this
.
handleChange
}
placeholder
=
{
this
.
state
.
certification
===
null
?
'
TOEFL
'
:
this
.
state
.
certification
}
defaultValue
=
{
this
.
state
.
certification
===
null
?
null
:
this
.
state
.
certification
}
name
=
"certification"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"sertifikat"
>
Sertifikat
</
label
>
<
input
onChange
=
{
this
.
handleFile
}
placeholder
=
"Sertifikat"
name
=
"pdf_sertifikat"
type
=
"File"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"languages"
>
Bahasa yang dikuasai
</
label
>
<
input
onChange
=
{
this
.
handleChange
}
placeholder
=
{
this
.
state
.
languages
===
null
?
'
Indonesia
'
:
this
.
state
.
languages
}
defaultValue
=
{
this
.
state
.
languages
===
null
?
null
:
this
.
state
.
languages
}
name
=
"languages"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
input
onChange
=
{
this
.
handleChange
}
placeholder
=
{
...
...
assets/js/ProfilePage.jsx
View file @
3e4a0349
...
...
@@ -291,10 +291,10 @@ export default class ProfilePage extends ProfileHandler {
render
()
{
const
sertifikat_exists
=
this
.
state
.
sertifikat
;
let
sertifikat_state
;
if
(
sertifikat_exists
)
{
sertifikat_state
=
<
p
>
Sertifikat sudah ada
</
p
>;
}
else
{
if
(
sertifikat_exists
==
''
)
{
sertifikat_state
=
<
p
>
Sertifikat belum ada
</
p
>;
}
else
{
sertifikat_state
=
<
p
>
Sertifikat sudah ada
</
p
>;
}
const
defaultPicture
=
'
https://semantic-ui.com/images/wireframe/square-image.png
'
;
return
(
...
...
@@ -487,6 +487,110 @@ export default class ProfilePage extends ProfileHandler {
</
Grid
.
Column
>
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
<
Icon
name
=
"hand peace outline"
size
=
"big"
/>
</
Grid
.
Column
>
<
Grid
.
Column
width
=
{
13
}
>
<
p
>
{
'
'
}
{
this
.
state
.
volunteer
||
'
N/A
'
}
{
'
'
}
</
p
>
</
Grid
.
Column
>
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
<
Icon
name
=
"trophy"
size
=
"big"
/>
</
Grid
.
Column
>
<
Grid
.
Column
width
=
{
13
}
>
<
p
>
{
'
'
}
{
this
.
state
.
awards
||
'
Awards belum ditambahkan
'
}
{
'
'
}
</
p
>
</
Grid
.
Column
>
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
<
Icon
name
=
"certificate"
size
=
"big"
/>
</
Grid
.
Column
>
<
Grid
.
Column
width
=
{
13
}
>
{
sertifikat_state
}
</
Grid
.
Column
>
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
<
Icon
name
=
"folder open"
size
=
"big"
/>
</
Grid
.
Column
>
<
Grid
.
Column
width
=
{
13
}
>
<
p
>
{
'
'
}
{
this
.
state
.
projects
||
'
Projects belum ditambahkan
'
}
{
'
'
}
</
p
>
</
Grid
.
Column
>
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
<
Icon
name
=
"certificate"
size
=
"big"
/>
</
Grid
.
Column
>
<
Grid
.
Column
width
=
{
13
}
>
<
p
>
{
'
'
}
{
this
.
state
.
certification
||
'
N/A
'
}
{
'
'
}
</
p
>
</
Grid
.
Column
>
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
<
Icon
name
=
"comment"
size
=
"big"
/>
</
Grid
.
Column
>
<
Grid
.
Column
width
=
{
13
}
>
<
p
>
{
'
'
}
{
this
.
state
.
languages
||
'
N/A
'
}
{
'
'
}
</
p
>
</
Grid
.
Column
>
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
<
Icon
name
=
"slideshare"
size
=
"big"
/>
</
Grid
.
Column
>
<
Grid
.
Column
width
=
{
13
}
>
<
p
>
{
'
'
}
{
this
.
state
.
seminar
||
'
Seminar dan Training kosong
'
}
{
'
'
}
</
p
>
</
Grid
.
Column
>
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
...
...
assets/js/__test__/ProfilePage-test.jsx
View file @
3e4a0349
...
...
@@ -30,6 +30,7 @@ const studentUserVerified = {
npm
:
1406543593
,
resume
:
null
,
phone_number
:
null
,
sertifikat
:
'
ada
'
,
bookmarked_vacancies
:
[
3
,
],
...
...
@@ -41,8 +42,9 @@ const studentUserVerified = {
},
};
describe
(
'
Sertifikat
'
,
()
=>
{
it
(
'
render sertifikat
'
,
()
=>
{
describe
(
'
Sertifikat doesnt exists
'
,
()
=>
{
it
(
'
render sertifikat doesnt exists
'
,
()
=>
{
studentUserVerified
.
data
.
sertifikat
=
null
;
const
sertifikat
=
ReactTestUtils
.
renderIntoDocument
(
<
p
>
Sertifikat belum ada
</
p
>,
);
...
...
@@ -50,6 +52,15 @@ describe('Sertifikat', () => {
});
});
describe
(
'
Sertifikat exists
'
,
()
=>
{
it
(
'
render sertifikat exists
'
,
()
=>
{
const
sertifikat
=
ReactTestUtils
.
renderIntoDocument
(
<
p
>
Sertifikat sudah ada
</
p
>,
);
expect
(
sertifikat
).
to
.
exist
;
});
});
describe
(
'
ProfilePage
'
,
()
=>
{
it
(
'
renders without problem
'
,
()
=>
{
fetchMock
.
get
(
'
*
'
,
response
);
...
...
core/views/accounts/student.py
View file @
3e4a0349
...
...
@@ -91,6 +91,7 @@ class StudentViewSet(viewsets.ModelViewSet):
if
request
.
data
[
key
].
content_type
==
'application/pdf'
:
user
.
sertifikat
=
request
.
data
[
key
]
user
.
save
()
print
(
'HEHE TERSIMPAN SERTIFIKAT'
)
return
Response
({},
status
=
status
.
HTTP_200_OK
)
else
:
return
Response
({},
status
=
status
.
HTTP_415_UNSUPPORTED_MEDIA_TYPE
)
...
...
package-lock.json
0 → 100755
View file @
3e4a0349
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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