Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Fasilkom UI Open Source Software
Kape
Commits
9bc0926d
Commit
9bc0926d
authored
May 04, 2017
by
Zamil Majdy
Browse files
[#140657435] [#40] [Refactor] Add company page on routes
parent
e1c09d89
Changes
1
Hide whitespace changes
Inline
Side-by-side
assets/js/index.jsx
View file @
9bc0926d
...
...
@@ -5,6 +5,7 @@ import Dashboard from './Dashboard';
import
Login
from
'
./Login
'
;
import
VacancyPage
from
'
./VacancyPage
'
;
import
ProfilePage
from
'
./ProfilePage
'
;
import
CompanyPage
from
'
./CompanyPage
'
;
import
CompanyProfile
from
'
./CompanyProfile
'
;
import
CreateVacancy
from
'
./CreateVacancy
'
;
import
Server
from
'
./lib/Server
'
;
...
...
@@ -73,12 +74,15 @@ export default class App extends React.Component {
replace
({
pathname
:
'
/lowongan
'
});
cb
();
}
else
if
(
App
.
getRole
()
===
'
company
'
)
{
replace
({
pathname
:
'
/lowongan
'
});
cb
();
}
else
if
(
App
.
getRole
()
===
'
admin
'
)
{
replace
({
pathname
:
'
/perusahaan
'
});
cb
();
}
}
replace
({
pathname
:
'
/login
'
});
cb
();
};
render
()
{
const
staff
=
this
.
authorization
([
'
admin
'
]);
const
student
=
this
.
authorization
([
'
admin
'
,
'
student
'
]);
// const supervisor = this.authorization(['admin', 'supervisor']);
const
company
=
this
.
authorization
([
'
admin
'
,
'
company
'
]);
...
...
@@ -89,7 +93,7 @@ export default class App extends React.Component {
return
(
<
Router
history
=
{
browserHistory
}
>
<
Route
path
=
"/login"
component
=
{
Login
}
/>
<
Route
component
=
{
Dashboard
}
onEnter
=
{
this
.
handleAuth
}
>
<
Route
component
=
{
commonUser
(
Dashboard
)
}
onEnter
=
{
this
.
handleAuth
}
>
<
Route
path
=
"/transcript/:id"
component
=
{
company
(
TranscriptPage
)
}
/>
<
Route
path
=
"/lowongan"
component
=
{
commonUser
(
VacancyPage
)
}
/>
<
Route
path
=
"/buat-lowongan"
component
=
{
company
(
CreateVacancy
)
}
/>
...
...
@@ -98,6 +102,7 @@ export default class App extends React.Component {
<
Route
path
=
"/profil"
component
=
{
App
.
getRole
()
===
'
student
'
?
student
(
ProfilePage
)
:
company
(
CompanyProfile
)
}
own
/>
<
Route
path
=
"/mahasiswa/:id"
component
=
{
grownups
(
ProfilePage
)
}
/>
<
Route
path
=
"/perusahaan/:id"
component
=
{
facultyMember
(
CompanyProfile
)
}
/>
<
Route
path
=
"/perusahaan"
component
=
{
staff
(
CompanyPage
)
}
/>
<
Route
path
=
"/transkrip/:id"
component
=
{
facultyMember
(
CompanyProfile
)
}
/>
</
Route
>
<
Route
path
=
"/home"
onEnter
=
{
this
.
handleHome
}
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment