Fakultas Ilmu Komputer UI

Commit 9d0e2faa authored by Fannyah Dita Cahya's avatar Fannyah Dita Cahya
Browse files

1606918414 122

parent d9bd4388
......@@ -55,6 +55,7 @@ export default class ProfilePage extends React.Component {
latest_work_desc: '',
github_url: '',
awards: '',
certification: '',
languages: '',
seminar: '',
},
......@@ -72,6 +73,7 @@ export default class ProfilePage extends React.Component {
latest_work_desc: '',
github_url: '',
awards: '',
certification: '',
languages: '',
seminar: '',
};
......@@ -124,6 +126,7 @@ export default class ProfilePage extends React.Component {
skills: data.skills,
github_url: data.github_url,
awards: data.awards,
certification: data.certification,
languages: data.languages,
seminar: data.seminar,
});
......@@ -362,6 +365,15 @@ export default class ProfilePage extends React.Component {
name="awards"
/>
</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="languages">Bahasa yang dikuasai</label>
<input
......
......@@ -55,6 +55,7 @@ export default class ProfilePage extends React.Component {
latest_work_desc: '',
github_url: '',
awards: '',
certification: '',
languages: '',
seminar: '',
},
......@@ -72,6 +73,7 @@ export default class ProfilePage extends React.Component {
latest_work_desc: '',
github_url: '',
awards: '',
certification: '',
languages: '',
semimar: '',
};
......@@ -124,6 +126,7 @@ export default class ProfilePage extends React.Component {
skills: data.skills,
github_url: data.github_url,
awards: data.awards,
certification: data.certification,
languages: data.languages,
seminar: data.seminar,
});
......@@ -362,6 +365,14 @@ export default class ProfilePage extends React.Component {
name="awards"
/>
</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="seminar">Seminar dan Training</label>
<input
......@@ -656,6 +667,17 @@ export default class ProfilePage extends React.Component {
</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}>
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-11-14 06:42
# Generated by Django 1.11.17 on 2019-11-14 07:37
from __future__ import unicode_literals
import core.lib.validators
......@@ -93,6 +93,7 @@ class Migration(migrations.Migration):
('student_gpa', models.FloatField(blank=True, db_column=b'student_gpa', default=1.0, null=True)),
('volunteer', models.CharField(blank=True, max_length=100, null=True)),
('awards', models.CharField(blank=True, max_length=100, null=True)),
('certification', models.CharField(blank=True, max_length=100, null=True)),
('languages', models.CharField(blank=True, max_length=100, null=True)),
('seminar', models.CharField(blank=True, max_length=100, null=True)),
],
......@@ -106,7 +107,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True)),
('updated', models.DateTimeField(auto_now=True)),
('nip', models.IntegerField(unique=True, validators=[django.core.validators.MinValueValidator(100000000), django.core.validators.MaxValueValidator(9999999999)])),
('nip', models.IntegerField(unique=True, validators=[django.core.validators.MinValueValidator(100000000), django.core.validators.MaxValueValidator(9999999999L)])),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
......
......@@ -101,6 +101,7 @@ class Student(models.Model):
student_gpa = models.FloatField(db_column='student_gpa', default=1.0, blank=True, null=True)
volunteer = models.CharField(max_length=100, blank=True, null=True)
awards = models.CharField(max_length=100, blank=True, null=True)
certification = models.CharField(max_length=100, blank=True, null=True)
languages = models.CharField(max_length= 100, blank=True, null=True)
seminar = models.CharField(max_length=100, blank=True, null=True)
......
......@@ -22,7 +22,7 @@ class StudentSerializer(serializers.ModelSerializer):
fields = ['id', 'name', 'user', 'npm', 'resume', 'phone_number', 'gender', 'birth_place', 'birth_date', 'major', 'batch',
'show_transcript', 'photo', 'accepted_no', 'linkedin_url', 'hackerrank_url', 'region', 'intro', 'portfolio_link', 'website_url', 'student_gpa', 'age', 'recommendations',
'work_experience', 'latest_work', 'latest_work_desc', 'read_no', 'volunteer', 'job_seeking_status', 'skills', 'expected_salary',
'self_description', 'github_url', 'awards', 'languages', 'seminar']
'self_description', 'github_url', 'awards', 'certification', 'languages', 'seminar']
def get_accepted_no(self, obj):
apps = Application.objects.filter(student=obj, status=4)
......@@ -70,6 +70,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
'skills': instance.skills,
'github_url': instance.github_url,
'awards' : instance.awards,
'certification' : instance.certification,
'languages' : instance.languages,
'seminar' : instance.seminar
}
......@@ -116,6 +117,8 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
'github_url', instance.github_url)
instance.awards = validated_data.get(
'awards', instance.awards)
instance.certification = validated_data.get(
'certification', instance.certification)
instance.languages = validated_data.get(
'languages', instance.languages)
instance.seminar = validated_data.get(
......@@ -128,7 +131,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
model = Student
fields = ['resume', 'email', 'phone_number', 'gender', 'photo', 'show_transcript', 'linkedin_url', 'hackerrank_url', 'region', 'intro', 'portfolio_link', 'website_url', 'student_gpa',
'recommendations', 'work_experience', 'latest_work', 'latest_work_desc', 'volunteer', 'job_seeking_status', 'skills', 'expected_salary',
'self_description', 'github_url', 'awards', 'languages', 'seminar']
'self_description', 'github_url', 'awards', 'certification', 'languages', 'seminar']
class CompanyUpdateSerializer(serializers.ModelSerializer):
......
......@@ -213,6 +213,11 @@ class ProfileUpdateTests(APITestCase):
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
self.assertEqual(response.data.get('awards'), 'Juara 2 UIUX Gemastik 2019')
url = '/api/students/' + str(student_id) + "/profile/"
response = self.client.patch(url, {'certification': 'TOEFL'}, format='multipart')
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
self.assertEqual(response.data.get('certification'), 'TOEFL')
url = '/api/students/' + str(student_id) + "/profile/"
response = self.client.patch(url, {'languages': 'Indonesia, Inggris'}, format='multipart')
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
......
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