From f0e9a9ef3190408394187f9ddb01c00a6c002340 Mon Sep 17 00:00:00 2001
From: "M. Reza Qorib" <rezaqorib96@gmail.com>
Date: Wed, 24 May 2017 14:25:33 +0700
Subject: [PATCH] Edit vacancyList

---
 assets/js/components/VacancyList.jsx | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/assets/js/components/VacancyList.jsx b/assets/js/components/VacancyList.jsx
index 9aef483e..39df62af 100644
--- a/assets/js/components/VacancyList.jsx
+++ b/assets/js/components/VacancyList.jsx
@@ -65,7 +65,7 @@ export default class VacancyList extends React.Component {
         ),
       );
     }
-    if (this.props.user.role === 'admin' || this.props.user.role === 'supervisor') {
+    if ((this.props.user.role === 'admin' && this.props.user.data.supervisor != null) || this.props.user.role === 'supervisor') {
       return this.state.vacancies.map(vacancy => (
         <AdminVacancy
           key={vacancy.id}
@@ -88,12 +88,12 @@ export default class VacancyList extends React.Component {
   }
 
   companyHeader() {
-    if (this.props.user.role === 'company') {
+    if (this.props.user.role === 'admin' || this.props.user.role === 'company') {
       return (
-        <Grid textAlign="center" style={{ paddingTop: '10px' }}>
+        <div>
           <Button size="tiny" as={Link} to="/pelamar" icon="eye" labelPosition="left" color="facebook" content="Lihat Semua Pendaftar" />
           <Button size="tiny" as={Link} to="/buat-lowongan" icon="add" labelPosition="left" content="Tambah Lowongan Baru" color="teal" />
-        </Grid>
+        </div>
       );
     }
 
@@ -103,7 +103,12 @@ export default class VacancyList extends React.Component {
   render = () => (
     <div>
       <Grid container columns="eleven" doubling>
-        { this.companyHeader() }
+        <Grid textAlign="center" style={{ paddingTop: '10px' }}>
+          { this.companyHeader() }<br />
+          {(this.props.user.role === 'admin' || this.props.user.role === 'supervisor') &&
+          <Button size="tiny" as={Link} to="/rekap" icon="dashboard" labelPosition="left" color="facebook" content="Rekap Pendaftaran" />
+          }
+        </Grid>
         <Item.Group relaxed style={{ width: '100%' }}>
           { this.generateVacancies() }
         </Item.Group>
-- 
GitLab