Fakultas Ilmu Komputer UI

Commit 62a0b0b4 authored by Muhammad Fauzan Fikri's avatar Muhammad Fauzan Fikri
Browse files

Merge branch '1506688802-173' into 'master'

1506688802 173

See merge request !215
parents 42c6d382 cdfa1270
Pipeline #26549 passed with stages
in 16 minutes and 34 seconds
...@@ -64,6 +64,7 @@ export default class EditProfile extends React.Component { ...@@ -64,6 +64,7 @@ export default class EditProfile extends React.Component {
linkedin_url: '', linkedin_url: '',
hackerrank_url: '', hackerrank_url: '',
student_gpa: 0.0, student_gpa: 0.0,
student_toefl: 0,
website_url: '', website_url: '',
latest_work: '', latest_work: '',
latest_work_desc: '', latest_work_desc: '',
...@@ -104,6 +105,7 @@ export default class EditProfile extends React.Component { ...@@ -104,6 +105,7 @@ export default class EditProfile extends React.Component {
linkedin_url: data.linkedin_url, linkedin_url: data.linkedin_url,
hackerrank_url: data.hackerrank_url, hackerrank_url: data.hackerrank_url,
student_gpa: data.student_gpa, student_gpa: data.student_gpa,
student_toefl: data.student_toefl,
website_url: data.website_url, website_url: data.website_url,
latest_work: data.latest_work, latest_work: data.latest_work,
latest_work_desc: data.latest_work_desc, latest_work_desc: data.latest_work_desc,
...@@ -617,6 +619,25 @@ export default class EditProfile extends React.Component { ...@@ -617,6 +619,25 @@ export default class EditProfile extends React.Component {
name="student_gpa" name="student_gpa"
/> />
</Form.Field> </Form.Field>
<Form.Field>
<label htmlFor="student_toefl">TOEFL</label>
<input
onChange={this.handleChange}
placeholder={
this.state.student_toefl === null
? '400'
: this.state.student_toefl
}
defaultValue={
this.state.student_toefl === null
? null
: this.state.student_toefl
}
name="student_toefl"
/>
</Form.Field>
<Form.Field> <Form.Field>
<label htmlFor="dependants">Dependants</label> <label htmlFor="dependants">Dependants</label>
<input <input
......
...@@ -86,6 +86,7 @@ export default class ProfilePage extends React.Component { ...@@ -86,6 +86,7 @@ export default class ProfilePage extends React.Component {
hackerrank_url: '', hackerrank_url: '',
self_description: '', self_description: '',
student_gpa: 0.0, student_gpa: 0.0,
student_toefl: 0,
website_url: '', website_url: '',
latest_work: '', latest_work: '',
latest_work_desc: '', latest_work_desc: '',
...@@ -150,6 +151,7 @@ export default class ProfilePage extends React.Component { ...@@ -150,6 +151,7 @@ export default class ProfilePage extends React.Component {
hackerrank_url: data.hackerrank_url, hackerrank_url: data.hackerrank_url,
self_description: data.self_description, self_description: data.self_description,
student_gpa: data.student_gpa, student_gpa: data.student_gpa,
student_toefl: data.student_toefl,
website_url: data.website_url, website_url: data.website_url,
latest_work: data.latest_work, latest_work: data.latest_work,
alamat: data.alamat, alamat: data.alamat,
...@@ -694,6 +696,23 @@ export default class ProfilePage extends React.Component { ...@@ -694,6 +696,23 @@ export default class ProfilePage extends React.Component {
name="student_gpa" name="student_gpa"
/> />
</Form.Field> </Form.Field>
<Form.Field>
<label htmlFor="student_toefl">TOEFL</label>
<input
onChange={this.handleChange}
placeholder={
this.state.student_toefl === null
? '400'
: this.state.student_toefl
}
defaultValue={
this.state.student_toefl === null
? null
: this.state.student_toefl
}
name="student_toefl"
/>
</Form.Field>
<Form.Field> <Form.Field>
<label htmlFor="dependants">Dependants</label> <label htmlFor="dependants">Dependants</label>
<input <input
...@@ -910,6 +929,21 @@ export default class ProfilePage extends React.Component { ...@@ -910,6 +929,21 @@ export default class ProfilePage extends React.Component {
</Grid> </Grid>
</Segment> </Segment>
<Segment basic vertical>
<Grid>
<Grid.Column width={2}>
<Icon name="pencil alternate" size="big" />
</Grid.Column>
<Grid.Column width={13}>
<p href={this.state.student_toefl}>
{' '}
{this.state.student_toefl || 'N/A'}
{' '}
</p>
</Grid.Column>
</Grid>
</Segment>
<Segment basic vertical> <Segment basic vertical>
<Grid> <Grid>
<Grid.Column width={2}> <Grid.Column width={2}>
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-11-16 08:22 # Generated by Django 1.11.17 on 2019-12-03 03:38
from __future__ import unicode_literals from __future__ import unicode_literals
import core.lib.validators import core.lib.validators
...@@ -34,12 +34,12 @@ class Migration(migrations.Migration): ...@@ -34,12 +34,12 @@ class Migration(migrations.Migration):
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('updated', models.DateTimeField(auto_now=True)), ('updated', models.DateTimeField(auto_now=True)),
('description', models.TextField()), ('description', models.TextField()),
('status', models.IntegerField(default=0)), ('status', models.IntegerField(default=0, validators=[django.core.validators.MaxValueValidator(2), django.core.validators.MinValueValidator(0)])),
('logo', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_company_logo_file_path, validators=[core.lib.validators.validate_image_file_extension])), ('logo', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_company_logo_file_path, validators=[core.lib.validators.validate_image_file_extension])),
('address', models.CharField(blank=True, max_length=1000, null=True)), ('address', models.CharField(blank=True, max_length=1000, null=True)),
('category', models.CharField(default=b'Belum ada kategori perusahaan', max_length=140)), ('category', models.CharField(default='Belum ada kategori perusahaan', max_length=140)),
('size', models.CharField(blank=True, default=0, max_length=10, null=True)), ('size', models.CharField(blank=True, default=0, max_length=10, null=True)),
('website', models.CharField(default=b'Belum ada link website', max_length=100)), ('website', models.CharField(default='Belum ada link website', max_length=100)),
('linkedin_url', models.URLField(blank=True, null=True)), ('linkedin_url', models.URLField(blank=True, null=True)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
], ],
...@@ -52,7 +52,7 @@ class Migration(migrations.Migration): ...@@ -52,7 +52,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('title', models.CharField(blank=True, default=b'', max_length=100)), ('title', models.CharField(blank=True, default='', max_length=100)),
('content', models.TextField()), ('content', models.TextField()),
('companyId', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='core.Company')), ('companyId', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='core.Company')),
], ],
...@@ -64,7 +64,7 @@ class Migration(migrations.Migration): ...@@ -64,7 +64,7 @@ class Migration(migrations.Migration):
name='Recommendation', name='Recommendation',
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('content', models.TextField()), ('content', models.TextField(blank=True)),
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('updated', models.DateTimeField(auto_now=True)), ('updated', models.DateTimeField(auto_now=True)),
], ],
...@@ -79,16 +79,16 @@ class Migration(migrations.Migration): ...@@ -79,16 +79,16 @@ class Migration(migrations.Migration):
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('updated', models.DateTimeField(auto_now=True)), ('updated', models.DateTimeField(auto_now=True)),
('npm', models.IntegerField(unique=True, validators=[core.lib.validators.validate_npm])), ('npm', models.IntegerField(unique=True, validators=[core.lib.validators.validate_npm])),
('resume', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_resume_file_path, validators=[django.core.validators.FileExtensionValidator([b'pdf'])])), ('resume', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_resume_file_path, validators=[django.core.validators.FileExtensionValidator(['pdf'])])),
('sertifikat', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_sertifikat_file_path, validators=[core.lib.validators.validate_document_file_extension])), ('sertifikat', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_sertifikat_file_path, validators=[core.lib.validators.validate_document_file_extension])),
('phone_number', models.CharField(blank=True, db_index=True, max_length=100, null=True, validators=[django.core.validators.RegexValidator(b'^0\\d{1,11}$')])), ('phone_number', models.CharField(blank=True, db_index=True, max_length=100, null=True, validators=[django.core.validators.RegexValidator('^0\\d{1,11}$')])),
('gender', models.CharField(blank=True, max_length=30, null=True)), ('gender', models.CharField(blank=True, max_length=30, null=True)),
('birth_place', models.CharField(blank=True, max_length=30, null=True)), ('birth_place', models.CharField(blank=True, max_length=30, null=True)),
('birth_date', models.DateField(blank=True, null=True)), ('birth_date', models.DateField(blank=True, null=True)),
('major', models.CharField(blank=True, max_length=30, null=True)), ('major', models.CharField(blank=True, max_length=30, null=True)),
('batch', models.CharField(blank=True, max_length=4, null=True)), ('batch', models.CharField(blank=True, max_length=4, null=True)),
('show_transcript', models.BooleanField(default=False)), ('show_transcript', models.BooleanField(default=False)),
('photo', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_photo_file_path, validators=[django.core.validators.FileExtensionValidator([b'jpg', b'jpeg', b'png'])])), ('photo', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_photo_file_path, validators=[django.core.validators.FileExtensionValidator(['jpg', 'jpeg', 'png'])])),
('self_description', models.CharField(blank=True, db_index=True, max_length=500, null=True)), ('self_description', models.CharField(blank=True, db_index=True, max_length=500, null=True)),
('portfolio_link', models.URLField(blank=True, null=True)), ('portfolio_link', models.URLField(blank=True, null=True)),
('linkedin_url', models.URLField(blank=True, null=True)), ('linkedin_url', models.URLField(blank=True, null=True)),
...@@ -104,9 +104,10 @@ class Migration(migrations.Migration): ...@@ -104,9 +104,10 @@ class Migration(migrations.Migration):
('github_url', models.URLField(blank=True, null=True)), ('github_url', models.URLField(blank=True, null=True)),
('gitlab_url', models.URLField(blank=True, null=True)), ('gitlab_url', models.URLField(blank=True, null=True)),
('intro', models.CharField(blank=True, max_length=50, null=True)), ('intro', models.CharField(blank=True, max_length=50, null=True)),
('expected_salary', models.CharField(blank=True, max_length=10, null=True, validators=[django.core.validators.RegexValidator(b'^\\d{0,10}$')])), ('expected_salary', models.CharField(blank=True, max_length=10, null=True, validators=[django.core.validators.RegexValidator('^\\d{0,10}$')])),
('job_seeking_status', models.CharField(blank=True, max_length=30, null=True)), ('job_seeking_status', models.CharField(blank=True, max_length=30, null=True)),
('student_gpa', models.FloatField(blank=True, db_column=b'student_gpa', default=1.0, null=True, validators=[core.lib.validators.validate_student_gpa])), ('student_gpa', models.FloatField(blank=True, db_column='student_gpa', default=1.0, null=True, validators=[core.lib.validators.validate_student_gpa])),
('student_toefl', models.CharField(blank=True, max_length=3, null=True)),
('volunteer', models.CharField(blank=True, max_length=100, null=True)), ('volunteer', models.CharField(blank=True, max_length=100, null=True)),
('awards', models.CharField(blank=True, max_length=100, null=True)), ('awards', models.CharField(blank=True, max_length=100, null=True)),
('projects', models.CharField(blank=True, max_length=100, null=True)), ('projects', models.CharField(blank=True, max_length=100, null=True)),
...@@ -114,7 +115,7 @@ class Migration(migrations.Migration): ...@@ -114,7 +115,7 @@ class Migration(migrations.Migration):
('languages', 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)), ('seminar', models.CharField(blank=True, max_length=100, null=True)),
('interests', models.CharField(blank=True, max_length=100, null=True)), ('interests', models.CharField(blank=True, max_length=100, null=True)),
('dependants', models.IntegerField(blank=True, db_column=b'dependants', default=0, null=True)), ('dependants', models.IntegerField(blank=True, db_column='dependants', default=0, null=True)),
], ],
options={ options={
'ordering': ['-updated'], 'ordering': ['-updated'],
...@@ -174,7 +175,7 @@ class Migration(migrations.Migration): ...@@ -174,7 +175,7 @@ class Migration(migrations.Migration):
name='ReasonRejected', name='ReasonRejected',
fields=[ fields=[
('application', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='core.Application')), ('application', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='core.Application')),
('reason', models.TextField(default=b'Tidak memenuhi kualifikasi perusahaan.')), ('reason', models.TextField(default='Tidak memenuhi kualifikasi perusahaan.')),
], ],
), ),
migrations.AddField( migrations.AddField(
...@@ -200,12 +201,12 @@ class Migration(migrations.Migration): ...@@ -200,12 +201,12 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='recommendation', model_name='recommendation',
name='recommendation_giver', name='recommendation_giver',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='giver', to='core.Student'), field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='giver', to='core.Student'),
), ),
migrations.AddField( migrations.AddField(
model_name='recommendation', model_name='recommendation',
name='recommendation_receiver', name='recommendation_receiver',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='receiver', to='core.Student'), field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='receiver', to='core.Student'),
), ),
migrations.AddField( migrations.AddField(
model_name='feedback', model_name='feedback',
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-12-01 10:01
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='company',
name='status',
field=models.IntegerField(default=0, validators=[django.core.validators.MaxValueValidator(2), django.core.validators.MinValueValidator(0)]),
),
migrations.AlterField(
model_name='recommendation',
name='content',
field=models.TextField(blank=True),
),
migrations.AlterField(
model_name='recommendation',
name='recommendation_giver',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='giver', to='core.Student'),
),
migrations.AlterField(
model_name='recommendation',
name='recommendation_receiver',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='receiver', to='core.Student'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-12-03 03:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='student',
name='student_toefl',
field=models.IntegerField(blank=True, db_column='toefl', default=0, null=True),
),
]
...@@ -111,6 +111,7 @@ class Student(models.Model): ...@@ -111,6 +111,7 @@ class Student(models.Model):
job_seeking_status = models.CharField(max_length=30, blank=True, null=True) job_seeking_status = models.CharField(max_length=30, blank=True, null=True)
student_gpa = models.FloatField(db_column='student_gpa', default=1.0, blank=True, null=True, student_gpa = models.FloatField(db_column='student_gpa', default=1.0, blank=True, null=True,
validators=[validate_student_gpa]) validators=[validate_student_gpa])
student_toefl = models.IntegerField(db_column='toefl', default=0, blank=True, null=True)
volunteer = models.CharField(max_length=100, blank=True, null=True) volunteer = models.CharField(max_length=100, blank=True, null=True)
awards = models.CharField(max_length=100, blank=True, null=True) awards = models.CharField(max_length=100, blank=True, null=True)
projects = models.CharField(max_length=100, blank=True, null=True) projects = models.CharField(max_length=100, blank=True, null=True)
......
...@@ -26,7 +26,7 @@ class StudentSerializer(serializers.ModelSerializer): ...@@ -26,7 +26,7 @@ class StudentSerializer(serializers.ModelSerializer):
'work_experience', 'latest_work', 'latest_work_desc', 'read_no', 'volunteer', 'job_seeking_status', 'work_experience', 'latest_work', 'latest_work_desc', 'read_no', 'volunteer', 'job_seeking_status',
'skills', 'expected_salary', 'skills', 'expected_salary',
'self_description', 'github_url', 'gitlab_url', 'awards', 'certification', 'languages', 'seminar', 'self_description', 'github_url', 'gitlab_url', 'awards', 'certification', 'languages', 'seminar',
'interests', 'alamat', 'projects', 'dependants'] 'interests', 'alamat', 'projects', 'dependants', 'student_toefl']
@staticmethod @staticmethod
def get_accepted_no(obj): def get_accepted_no(obj):
...@@ -66,6 +66,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer): ...@@ -66,6 +66,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
'job_seeking_status': instance.job_seeking_status, 'job_seeking_status': instance.job_seeking_status,
'website_url': instance.website_url, 'website_url': instance.website_url,
'student_gpa': instance.student_gpa, 'student_gpa': instance.student_gpa,
'student_toefl':instance.student_toefl,
'volunteer': instance.volunteer, 'volunteer': instance.volunteer,
'linkedin_url': instance.linkedin_url, 'linkedin_url': instance.linkedin_url,
'hackerrank_url': instance.hackerrank_url, 'hackerrank_url': instance.hackerrank_url,
...@@ -118,6 +119,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer): ...@@ -118,6 +119,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
'job_seeking_status', instance.job_seeking_status) 'job_seeking_status', instance.job_seeking_status)
instance.student_gpa = validated_data.get( instance.student_gpa = validated_data.get(
'student_gpa', instance.student_gpa) 'student_gpa', instance.student_gpa)
instance.student_toefl = validated_data.get('student_toefl', instance.student_toefl)
instance.website_url = validated_data.get( instance.website_url = validated_data.get(
'website_url', instance.website_url) 'website_url', instance.website_url)
instance.skills = validated_data.get('skills', instance.skills) instance.skills = validated_data.get('skills', instance.skills)
...@@ -155,7 +157,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer): ...@@ -155,7 +157,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
'work_experience', 'latest_work', 'latest_work_desc', 'volunteer', 'job_seeking_status', 'skills', 'work_experience', 'latest_work', 'latest_work_desc', 'volunteer', 'job_seeking_status', 'skills',
'expected_salary', 'expected_salary',
'self_description', 'github_url', 'gitlab_url', 'awards', 'certification', 'languages', 'seminar', 'self_description', 'github_url', 'gitlab_url', 'awards', 'certification', 'languages', 'seminar',
'interests', 'alamat', 'projects', 'dependants'] 'interests', 'alamat', 'projects', 'dependants', 'student_toefl']
class CompanyUpdateSerializer(serializers.ModelSerializer): class CompanyUpdateSerializer(serializers.ModelSerializer):
......
...@@ -394,6 +394,15 @@ class ProfileUpdateTests(APITestCase): ...@@ -394,6 +394,15 @@ class ProfileUpdateTests(APITestCase):
response = self.client.patch(url, {'GPA': "this is not a valid input"}, format='multipart') response = self.client.patch(url, {'GPA': "this is not a valid input"}, format='multipart')
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED) self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
url = '/api/students/' + str(student_id) + "/profile/"
response = self.client.patch(url, {'TOEFL': 0}, format='multipart')
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
self.assertEqual(response.data.get('student_toefl'), 0)
url = '/api/students/' + str(student_id) + "/profile/"
response = self.client.patch(url, {'student_toefl': 'this is not valid input'}, format='multipart')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
url = '/api/students/' + str(student_id) + '/profile/' url = '/api/students/' + str(student_id) + '/profile/'
response = self.client.patch(url, {'volunteer': 'Ketua BEM UI - 2020'}, format='multipart') response = self.client.patch(url, {'volunteer': 'Ketua BEM UI - 2020'}, format='multipart')
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED) 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