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
ppl-fasilkom-ui
2021
Kelas D
PT Gizi Sehat - Dietela
Dietela Mobile
Commits
95530f9f
Commit
95530f9f
authored
May 17, 2021
by
Doan Andreas Nathanael
Browse files
[CHORES] integrate client list admin with navigation
parent
db4889a7
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/app/schema.ts
View file @
95530f9f
...
...
@@ -4,6 +4,7 @@ import {
unpaidClientNavigation
,
clientNavigation
,
nutritionistNavigation
,
adminNavigation
,
}
from
'
constants/navigation
'
;
import
{
UserRole
,
AuthUserResponse
}
from
'
services/auth/models
'
;
import
{
TransactionStatus
}
from
'
services/payment/models
'
;
...
...
@@ -33,6 +34,12 @@ export const getNavigation = (
navigation
:
nutritionistNavigation
,
};
}
if
(
user
.
role
===
UserRole
.
ADMIN
)
{
return
{
initialRoute
:
ROUTES
.
clientListForAdmin
,
navigation
:
adminNavigation
,
};
}
}
return
{
initialRoute
:
ROUTES
.
initial
,
...
...
src/constants/navigation.ts
View file @
95530f9f
...
...
@@ -29,6 +29,7 @@ import {
ClientProfile
,
ClientProfileForAdmin
,
ProfileDietRecommendation
,
ClientListAdmin
,
}
from
'
scenes
'
;
import
{
FC
}
from
'
react
'
;
...
...
@@ -175,7 +176,12 @@ export const nutritionistNavigation: NavRoute[] = [
export
const
adminNavigation
:
NavRoute
[]
=
[
{
name
:
ROUTES
.
clientProfile
,
name
:
ROUTES
.
clientListForAdmin
,
component
:
ClientListAdmin
,
header
:
'
List Klien
'
,
},
{
name
:
ROUTES
.
clientProfileAdmin
,
component
:
ClientProfileForAdmin
,
header
:
'
Profil Klien
'
,
},
...
...
src/constants/routes.ts
View file @
95530f9f
...
...
@@ -31,3 +31,9 @@ export const clientDietReportNutritionist = `${nutritionist}/client-diet-report`
export
const
clientChatNutritionist
=
`
${
nutritionist
}
/client-chat`
;
export
const
profileDietRecommendation
=
`
${
clientProfileNutritionist
}
/recommendation`
;
const
admin
=
'
admin
'
;
export
const
clientListForAdmin
=
`
${
admin
}
/client-list`
;
export
const
clientProfileAdmin
=
`
${
admin
}
/client-profile`
;
export
const
clientDietReportAdmin
=
`
${
admin
}
/client-diet-report`
;
export
const
clientChatAdmin
=
`
${
admin
}
/client-chat`
;
src/scenes/index.ts
View file @
95530f9f
...
...
@@ -21,5 +21,7 @@ export { default as PaymentResult } from './payment/PaymentResult';
export
{
default
as
ClientListNutritionist
}
from
'
./nutritionist/ClientListNutritionist
'
;
export
{
default
as
ClientListAdmin
}
from
'
./admin/ClientListAdmin
'
;
export
{
default
as
ClientProfile
}
from
'
./profile/ClientProfile
'
;
export
{
default
as
ClientProfileForAdmin
}
from
'
./profile/ClientProfileForAdmin
'
;
Write
Preview
Supports
Markdown
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