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
d68cdc58
Commit
d68cdc58
authored
Oct 11, 2019
by
Fannyah Dita Cahya
Browse files
1606918414 44
parent
927a10a3
Changes
17
Hide whitespace changes
Inline
Side-by-side
assets/js/ProfilePage.jsx
View file @
d68cdc58
...
...
@@ -23,6 +23,7 @@ export default class ProfilePage extends React.Component {
major
:
''
,
batch
:
''
,
email
:
''
,
gender
:
''
,
region
:
''
,
cityOfBirth
:
''
,
dateOfBirth
:
''
,
...
...
@@ -39,6 +40,7 @@ export default class ProfilePage extends React.Component {
picture
:
''
,
email
:
''
,
phone_number
:
''
,
gender
:
''
,
region
:
''
,
skills
:
''
,
resume
:
''
,
...
...
@@ -82,6 +84,7 @@ export default class ProfilePage extends React.Component {
major
:
data
.
major
,
batch
:
data
.
batch
,
email
:
data
.
user
.
email
,
gender
:
data
.
gender
,
region
:
data
.
region
,
cityOfBirth
:
data
.
birth_place
,
dateOfBirth
:
this
.
parseIndonesianDateFormat
(
data
.
birth_date
),
...
...
@@ -174,6 +177,12 @@ export default class ProfilePage extends React.Component {
this
.
setState
({
form
,
show_transcript
:
d
.
checked
});
};
handleRadioGender
=
(
e
,
{
value
})
=>
{
const
form
=
this
.
state
.
form
;
form
.
gender
=
value
;
this
.
setState
({
form
})
}
handleRadio
=
(
e
,
{
value
})
=>
{
const
form
=
this
.
state
.
form
;
form
.
job_seeking_status
=
value
;
...
...
@@ -189,7 +198,7 @@ export default class ProfilePage extends React.Component {
gotoStudentTranscript
=
()
=>
this
.
gotoLink
(
`transkrip/
${
this
.
state
.
id
}
`
);
updateForm
(
show
)
{
updateForm
(
show
){
if
(
show
)
{
return
(
<
Segment
className
=
"profile-form"
>
...
...
@@ -223,6 +232,21 @@ export default class ProfilePage extends React.Component {
name
=
"phone_number"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"gender"
>
Jenis Kelamin
</
label
>
<
Form
.
Radio
label
=
"Perempuan"
name
=
'gender'
value
=
"Perempuan"
onClick
=
{
this
.
handleRadioGender
}
/>
<
Form
.
Radio
label
=
"Laki-laki"
name
=
'gender'
value
=
"Laki-laki"
onClick
=
{
this
.
handleRadioGender
}
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"linkedin_url"
>
URL Profile LinkedIn
</
label
>
<
input
...
...
@@ -384,6 +408,17 @@ export default class ProfilePage extends React.Component {
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
<
Icon
name
=
"venus mars"
size
=
"big"
/>
</
Grid
.
Column
>
<
Grid
.
Column
width
=
{
13
}
>
<
p
>
{
this
.
state
.
gender
||
'
N/A
'
}
</
p
>
</
Grid
.
Column
>
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
...
...
core/migrations/0018_student_gender.py
0 → 100644
View file @
d68cdc58
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2019-10-05 22:28
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0017_merge_20191006_0134'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'student'
,
name
=
'gender'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
),
),
]
core/migrations/0020_merge_20191006_1058.py
0 → 100644
View file @
d68cdc58
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-10-06 03:58
from
__future__
import
unicode_literals
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0018_student_gender'
),
(
'core'
,
'0019_merge_20191006_0852'
),
]
operations
=
[
]
core/migrations/0021_merge_20191006_1217.py
0 → 100644
View file @
d68cdc58
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-10-06 05:17
from
__future__
import
unicode_literals
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0017_vacancy_amount'
),
(
'core'
,
'0020_merge_20191006_1058'
),
]
operations
=
[
]
core/migrations/0048_merge_20191011_1143.py
0 → 100644
View file @
d68cdc58
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-10-11 04:43
from
__future__
import
unicode_literals
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0047_merge_20191011_0029'
),
(
'core'
,
'0021_merge_20191006_1217'
),
]
operations
=
[
]
core/migrations/0049_auto_20191011_1403.py
0 → 100644
View file @
d68cdc58
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-10-11 07:03
from
__future__
import
unicode_literals
import
django.core.validators
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0048_merge_20191011_1143'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'student'
,
name
=
'phone_number'
,
field
=
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
max_length
=
100
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
b
'^0
\\
d{1,11}$'
)]),
),
]
core/models/accounts.py
View file @
d68cdc58
...
...
@@ -65,7 +65,8 @@ class Student(models.Model):
user
=
models
.
OneToOneField
(
User
)
npm
=
models
.
IntegerField
(
validators
=
[
validate_npm
],
unique
=
True
)
resume
=
models
.
FileField
(
upload_to
=
get_student_resume_file_path
,
null
=
True
,
blank
=
True
,
validators
=
[
validate_document_file_extension
])
phone_number
=
models
.
CharField
(
max_length
=
12
,
blank
=
True
,
db_index
=
True
,
null
=
True
,
validators
=
[
RegexValidator
(
r
'^0\d{1,11}$'
)])
phone_number
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
db_index
=
True
,
null
=
True
,
validators
=
[
RegexValidator
(
r
'^0\d{1,11}$'
)])
gender
=
models
.
CharField
(
max_length
=
30
,
blank
=
True
,
null
=
True
)
bookmarked_vacancies
=
models
.
ManyToManyField
(
'core.Vacancy'
,
related_name
=
"bookmarked_vacancies"
,
blank
=
True
)
applied_vacancies
=
models
.
ManyToManyField
(
'core.Vacancy'
,
related_name
=
"applied_vacancies"
,
blank
=
True
,
through
=
'core.Application'
)
...
...
core/serializers/accounts.py
View file @
d68cdc58
...
...
@@ -19,7 +19,7 @@ class StudentSerializer(serializers.ModelSerializer):
class
Meta
:
model
=
Student
fields
=
[
'id'
,
'name'
,
'user'
,
'npm'
,
'resume'
,
'phone_number'
,
'birth_place'
,
'birth_date'
,
'major'
,
'batch'
,
\
fields
=
[
'id'
,
'name'
,
'user'
,
'npm'
,
'resume'
,
'phone_number'
,
'gender'
,
'birth_place'
,
'birth_date'
,
'major'
,
'batch'
,
\
'show_transcript'
,
'photo'
,
'accepted_no'
,
'linkedin_url'
,
'region'
,
'intro'
,
'website_url'
,
'student_gpa'
,
'age'
,
'recommendations'
,
'latest_work'
,
'latest_work_desc'
,
'read_no'
,
'volunteer'
,
'job_seeking_status'
,
'skills'
]
...
...
@@ -48,6 +48,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
'resume'
:
resume
,
'email'
:
instance
.
user
.
email
,
'phone_number'
:
instance
.
phone_number
,
'gender'
:
instance
.
gender
,
'region'
:
instance
.
region
,
'photo'
:
photo
,
'show_transcript'
:
instance
.
show_transcript
,
...
...
@@ -67,6 +68,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
instance
.
resume
=
validated_data
.
get
(
'resume'
,
instance
.
resume
)
instance
.
show_transcript
=
validated_data
.
get
(
'show_transcript'
,
instance
.
show_transcript
)
instance
.
phone_number
=
validated_data
.
get
(
'phone_number'
,
instance
.
phone_number
)
instance
.
gender
=
validated_data
.
get
(
'gender'
,
instance
.
gender
)
instance
.
region
=
validated_data
.
get
(
'region'
,
instance
.
region
)
instance
.
photo
=
validated_data
.
get
(
'photo'
,
instance
.
photo
)
instance
.
user
.
email
=
validated_data
.
get
(
'email'
,
instance
.
user
.
email
)
...
...
@@ -86,7 +88,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
class
Meta
:
model
=
Student
fields
=
[
'resume'
,
'email'
,
'phone_number'
,
'photo'
,
'show_transcript'
,
'linkedin_url'
,
'region'
,
'intro'
,
'website_url'
,
'student_gpa'
,
fields
=
[
'resume'
,
'email'
,
'phone_number'
,
'gender'
,
'photo'
,
'show_transcript'
,
'linkedin_url'
,
'region'
,
'intro'
,
'website_url'
,
'student_gpa'
,
'recommendations'
,
'latest_work'
,
'latest_work_desc'
,
'volunteer'
,
'job_seeking_status'
,
'skills'
]
...
...
core/tests/test_accounts.py
View file @
d68cdc58
...
...
@@ -166,6 +166,11 @@ class ProfileUpdateTests(APITestCase):
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
self
.
assertEqual
(
response
.
data
.
get
(
'region'
),
'Indonesia'
)
url
=
'/api/students/'
+
str
(
student_id
)
+
"/profile/"
response
=
self
.
client
.
patch
(
url
,
{
'gender'
:
'Perempuan'
},
format
=
'multipart'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
self
.
assertEqual
(
response
.
data
.
get
(
'gender'
),
'Perempuan'
)
url
=
'/api/students/'
+
str
(
student_id
)
+
"/profile/"
response
=
self
.
client
.
patch
(
url
,
{
'skills'
:
'Java, Python'
},
format
=
'multipart'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
...
...
@@ -177,7 +182,7 @@ class ProfileUpdateTests(APITestCase):
url
=
'/api/students/'
+
str
(
student_id
)
+
"/profile/"
response
=
self
.
client
.
patch
(
url
,
{
'phone_number'
:
'````'
},
format
=
'multipart'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_400_BAD_REQUEST
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_400_BAD_REQUEST
)
url
=
'/api/students/123123123/profile/'
response
=
self
.
client
.
patch
(
url
,
{
'phone_number'
:
'08123123123'
},
format
=
'multipart'
)
...
...
kape/files/student-ui-ux-portofolio/5c47cd64-24c0-4990-b711-d7acc96f7771.pdf
0 → 100644
View file @
d68cdc58
File added
kape/files/student-ui-ux-portofolio/656ca24e-026f-49d6-b3de-e7c7adf6a11d.pdf
0 → 100644
View file @
d68cdc58
File added
kape/files/student-ui-ux-portofolio/7478963b-0bee-45d0-8002-04bd6017855b.pdf
0 → 100644
View file @
d68cdc58
File added
kape/files/student-ui-ux-portofolio/90529b47-9cce-4b7a-a5fd-ae73c0c4811f.pdf
0 → 100644
View file @
d68cdc58
File added
kape/files/student-ui-ux-portofolio/9625ea87-621e-4731-ad1b-1d76b3b8f256.pdf
0 → 100644
View file @
d68cdc58
File added
kape/files/student-ui-ux-portofolio/ced55294-ce3e-49bc-acc5-c093f7f9a53a.pdf
0 → 100644
View file @
d68cdc58
File added
kape/files/student-ui-ux-portofolio/e13e05b1-75a8-46b9-abd1-50673083d44a.pdf
0 → 100644
View file @
d68cdc58
File added
kape/files/student-ui-ux-portofolio/ec5b8e8b-1d6a-430a-b04d-f1bf183572a2.pdf
0 → 100644
View file @
d68cdc58
File added
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