Fakultas Ilmu Komputer UI

Commit 99eeb065 authored by ISNAINI NURUL KHASANAH's avatar ISNAINI NURUL KHASANAH
Browse files

1906336984 50 Menambahkan kolom major di halaman rekap pendaftaran

parent 69150d42
......@@ -7,6 +7,7 @@ import ApplicationList from './components/ApplicationList';
const cols = [
{ key: 'StudentName', label: 'Nama' },
{ key: 'StudentID', label: 'NPM' },
{ key: 'Major', label: 'Major' },
{ key: 'Perusahaan', label: 'Perusahaan' },
{ key: 'Posisi', label: 'Posisi' },
{ key: 'Status', label: 'Status' },
......
......@@ -23,9 +23,10 @@ export default class ApplicationList extends React.Component {
generateRows() {
return this.props.items.map(item =>
(
<Table.Row key={`${item.npm}_${item.company}_${item.position}_${item.status}_row`}>
<Table.Row key={`${item.npm}_${item.major}_${item.company}_${item.position}_${item.status}_row`}>
<Table.Cell key={`${item.name}_name`}> {item.name} </Table.Cell>
<Table.Cell key={`${item.name}_npm`}> {item.npm} </Table.Cell>
<Table.Cell key={`${item.name}_major`}> {item.major} </Table.Cell>
<Table.Cell key={`${item.name}_company`}>
{item.company_name}
</Table.Cell>
......
......@@ -65,6 +65,7 @@ class SupervisorStudentApplicationSerializer(serializers.ModelSerializer):
return {
'name' : instance.student.full_name,
'npm' : instance.student.npm,
'major' : instance.student.major,
'vacancy_name' : instance.vacancy.name,
'company_name' : instance.vacancy.company.name,
'status' : status_map[instance.status]
......@@ -72,8 +73,8 @@ class SupervisorStudentApplicationSerializer(serializers.ModelSerializer):
class Meta:
model = Application
fields = ['name', 'npm', 'vacancy_name', 'company_name', 'status']
read_only_fields = ['name', 'npm', 'vacancy_name', 'company_name', 'status']
fields = ['name', 'npm', 'major', 'vacancy_name', 'company_name', 'status']
read_only_fields = ['name', 'npm', 'major', 'vacancy_name', 'company_name', 'status']
class VacancyApplicationSerializer(serializers.ModelSerializer):
vacancy = VacancySerializer()
......
......@@ -382,7 +382,16 @@ class CompanyListsTests(APITestCase):
url = '/api/companies/' + str(new_company.pk) + '/applications/' + str(new_vacancy.pk) + '/by_vacancy/?status=5'
response = self.client.get(url, format='json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
def test_company_application_list_with_major(self):
new_user = User.objects.create_user('dummy.company4', 'dummy.company4@company.com', 'lalala123')
new_company = Company.objects.create(user=new_user, description="lalala", status=Company.VERIFIED, logo=None, address=None)
self.client.force_authenticate(new_user)
url = '/api/companies/' + str(new_company.pk) + '/applications/?major=0'
response = self.client.get(url, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
class SupervisorStudentApplicationTests(APITestCase):
def test_list_student_application(self):
......
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