Fakultas Ilmu Komputer UI

Commit 564b1d6c authored by Tyagita Larasati's avatar Tyagita Larasati
Browse files

1606918616 48

parent 5e2995b0
......@@ -34,11 +34,13 @@ export default class ProfilePage extends React.Component {
intro: '',
job_seeking_status: '',
volunteer: '',
skills: '',
form: {
picture: '',
email: '',
phone_number: '',
region: '',
skills: '',
resume: '',
show_transcript: '',
volunteer: '',
......@@ -99,6 +101,7 @@ export default class ProfilePage extends React.Component {
website_url: data.website_url,
latest_work: data.latest_work,
latest_work_desc: data.latest_work_desc,
skills: data.skills,
});
if (this.props.route.own) {
const newSession = this.props.user.data;
......@@ -222,6 +225,10 @@ export default class ProfilePage extends React.Component {
<label htmlFor="region">Region</label>
<input onChange={this.handleChange} placeholder="Indonesia" name="region" />
</Form.Field>
<Form.Field>
<label htmlFor="skills">Skills</label>
<input onChange={this.handleChange} placeholder="Isi sesuai dengan keahlian anda" name="skills"/>
</Form.Field>
<Form.Field>
<label htmlFor="latest_work">Latest Working Experience</label>
<input onChange={this.handleChange} placeholder="Teaching Asssistant at Fasilkom UI" name="latest_work" />
......@@ -384,7 +391,16 @@ export default class ProfilePage extends React.Component {
</Grid.Column>
</Grid>
</Segment>
<Segment basic vertical>
<Grid>
<Grid.Column width={2}>
<Icon name="cogs" size="big" />
</Grid.Column>
<Grid.Column width={13}>
<p> {this.state.skills || 'Skills belum ditambahkan'} </p>
</Grid.Column>
</Grid>
</Segment>
<Segment basic vertical>
<Grid>
<Grid.Column width={2}>
......
......@@ -30,7 +30,7 @@ describe('ProfilePage', () => {
birth_date: '1995-02-24',
major: null,
batch: null,
show_resume: false,
show_resume: false,
bookmarked_vacancies: [
3,
2,
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-10-10 15:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0044_merge_20191010_2105'),
]
operations = [
migrations.AddField(
model_name='student',
name='skills',
field=models.CharField(blank=True, max_length=50, null=True),
),
]
......@@ -78,6 +78,7 @@ class Student(models.Model):
linkedin_url = models.URLField(max_length=200,blank=True, null=True)
website_url = models.URLField(max_length=200,blank=True, null=True)
region = models.CharField(max_length=30, blank=True, null=True)
skills = models.CharField(max_length=50, blank=True, null=True)
recommendations = models.CharField(max_length=500, blank=True, null=True)
ui_ux_portofolio = models.FileField(upload_to=get_student_ui_ux_portofolio_file_path, null=True, blank=True, validators=[validate_document_file_extension])
latest_work = models.CharField(max_length=100, blank=True, null=True)
......
......@@ -21,7 +21,7 @@ class StudentSerializer(serializers.ModelSerializer):
model = Student
fields = ['id', 'name', 'user', 'npm', 'resume', 'phone_number', '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']
'latest_work', 'latest_work_desc','read_no', 'volunteer','job_seeking_status', 'skills']
def get_accepted_no(self, obj):
apps = Application.objects.filter(student=obj, status=4)
......@@ -60,6 +60,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
'recommendations': instance.recommendations,
'latest_work': instance.latest_work,
'latest_work_desc': instance.latest_work_desc,
'skills': instance.skills,
}
def update(self, instance, validated_data):
......@@ -75,6 +76,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
instance.job_seeking_status = validated_data.get('job_seeking_status', instance.job_seeking_status)
instance.student_gpa = validated_data.get('student_gpa', instance.student_gpa)
instance.website_url = validated_data.get('website_url', instance.website_url)
instance.skills = validated_data.get('skills', instance.skills)
instance.recommendations = validated_data.get('recommendations', instance.recommendations)
instance.latest_work = validated_data.get('latest_work', instance.latest_work)
instance.latest_work_desc = validated_data.get('latest_work_desc', instance.latest_work_desc)
......@@ -85,7 +87,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',
'recommendations', 'latest_work', 'latest_work_desc', 'volunteer','job_seeking_status']
'recommendations', 'latest_work', 'latest_work_desc', 'volunteer','job_seeking_status', 'skills']
class CompanyUpdateSerializer(serializers.ModelSerializer):
......
......@@ -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, {'skills': 'Java, Python'}, format='multipart')
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
self.assertEqual(response.data.get('skills'), 'Java, Python')
url = '/api/students/' + str(student_id) + "/profile/"
response = self.client.patch(url, {'email': 'saasdasd'}, format='multipart')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment