Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update navigation for Level 2 access #536

Open
wants to merge 2 commits into
base: update-navigation-509
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/Components/FeatureLevelCheckboxes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function FeatureLevelCheckboxes({
toaster(resp.message, ToastState.success);
const user = await fetchUser();
setUser(user);
navigate('/admin-dashboard');
navigate('/admins');
};

return (
Expand Down
97 changes: 35 additions & 62 deletions frontend/src/Components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import Brand from './Brand';
import {
AcademicCapIcon,
ArchiveBoxIcon,
BookOpenIcon,
BuildingStorefrontIcon,
ChevronDoubleLeftIcon,
ChevronDoubleRightIcon,
HomeIcon,
TrophyIcon,
UsersIcon,
ArrowRightEndOnRectangleIcon,
SunIcon,
MoonIcon,
UserCircleIcon,
DocumentTextIcon,
FolderOpenIcon,
CloudIcon,
RectangleStackIcon
} from '@heroicons/react/24/solid';
Expand Down Expand Up @@ -72,24 +69,6 @@ export default function Navbar({
{user && isAdministrator(user) ? (
<>
{/* admin view */}
<li className="mt-16">
<Link to="/admin-dashboard">
<ULIComponent icon={HomeIcon} />
Dashboard
</Link>
</li>
<li>
<Link to="/student-management">
<ULIComponent icon={AcademicCapIcon} />
Students
</Link>
</li>
<li>
<Link to="/admin-management">
<ULIComponent icon={UsersIcon} />
Admins
</Link>
</li>
{hasFeature(
user,
FeatureAccess.OpenContentAccess
Expand All @@ -105,31 +84,49 @@ export default function Navbar({
</li>
</>
)}
<li>
<Link to="/resources-management">
<ULIComponent icon={ArchiveBoxIcon} />
Resources
</Link>
</li>
{hasFeature(
user,
FeatureAccess.ProviderAccess
) && (
<>
<li className="mt-16">
<Link to="/student-activity">
<ULIComponent icon={HomeIcon} />
Student Activity
</Link>
</li>
<li>
<Link to="/provider-platform-management">
<Link to="/students">
<ULIComponent
icon={CloudIcon}
icon={AcademicCapIcon}
/>
Students
</Link>
</li>
<li>
<Link to="/admins">
<ULIComponent
icon={UsersIcon}
/>
Platforms
Admins
</Link>
</li>
<li className="">
<Link to="/course-catalog-admin">
<li>
<Link to="/facilities">
<ULIComponent
icon={FolderOpenIcon}
icon={
BuildingStorefrontIcon
}
/>
Course Catalog
Facilities
</Link>
</li>
<li>
<Link to="/learning-platforms">
<ULIComponent
icon={CloudIcon}
/>
Learning Platforms
</Link>
</li>
</>
Expand All @@ -147,30 +144,16 @@ export default function Navbar({
</Link>
</li>
)}
<li>
<Link to="/facilities-management">
<ULIComponent
icon={BuildingStorefrontIcon}
/>
Facilities
</Link>
</li>
</>
) : (
<>
{/* student view */}
<li className="mt-16">
<Link to="/student-dashboard">
<ULIComponent icon={HomeIcon} />
Dashboard
</Link>
</li>
{hasFeature(
user,
FeatureAccess.ProviderAccess
) && (
<>
<li>
<li className="mt-16">
<Link to="/my-courses">
<ULIComponent
icon={RectangleStackIcon}
Expand All @@ -179,19 +162,9 @@ export default function Navbar({
</Link>
</li>
<li>
<Link to="/course-catalog">
<ULIComponent
icon={FolderOpenIcon}
/>
Course Catalog
</Link>
</li>
<li>
<Link to="/my-progress">
<ULIComponent
icon={TrophyIcon}
/>{' '}
My Progress
<Link to="/my-learning">
<ULIComponent icon={HomeIcon} />
My Learning
</Link>
</li>
</>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/VideoEmbedViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function VideoViewer() {
<PrimaryButton
onClick={() => navigate('/authcallback')}
>
Back to Dashboard
Back to My Learning
</PrimaryButton>
</div>
) : (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/AdminManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export default function AdminManagement() {
return (
<div>
<div className="flex flex-col space-y-6 overflow-x-auto rounded-lg p-4 px-8">
<h1>Admin Management</h1>
<h1>Admins</h1>
<div className="flex justify-between">
<div className="flex flex-row gap-x-2">
<SearchBar
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/FacilityManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default function FacilityManagement() {
return (
<>
<div className="px-8 py-4 flex flex-col justify-center gap-4">
<h1>Facility Management</h1>
<h1>Facilities</h1>
<div className="flex flex-row justify-between">
<div>
{/* TO DO: this is where SEARCH and SORT will go */}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/Pages/ProviderPlatformManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default function ProviderPlatformManagement() {
return (
<div>
<div className="px-8 py-4">
<h1>Provider Platforms</h1>
<h1>Learning Platforms</h1>
<div className="flex flex-row justify-between">
<div>
{/* TO DO: this is where SEARCH and SORT will go */}
Expand Down Expand Up @@ -184,7 +184,7 @@ export default function ProviderPlatformManagement() {
})
) : (
<tr>
<td>No provider platforms</td>
<td>No learning platforms</td>
</tr>
)}
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/StudentDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function StudentDashboard() {
if (!user) {
return;
} else if (isAdministrator(user)) {
navigate('/admin-dashboard');
navigate('/admins');
return;
}
const { data, error, isLoading } = useSWR<
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/StudentManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default function StudentManagement() {
return (
<div>
<div className="flex flex-col space-y-6 overflow-x-auto rounded-lg p-4 px-8">
<h1>Student Management</h1>
<h1>Students</h1>
<div className="flex justify-between">
<div className="flex flex-row gap-x-2">
<SearchBar
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/Unauthorized.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function UnauthorizedNotFound({ which }: { which: string }) {
window.location.href = '/authcallback';
}}
>
Dashboard
My Learning
</button>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/Welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function Welcome() {
</li>
) : (
<li>
<Link to={'/authcallback'}>Dashboard</Link>
<Link to={'/authcallback'}>My Learning</Link>
</li>
)}
</ul>
Expand Down
64 changes: 24 additions & 40 deletions frontend/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import ProviderPlatformManagement from '@/Pages/ProviderPlatformManagement';
import { AuthProvider } from '@/Context/AuthContext';
import Consent from '@/Pages/Auth/Consent';
import MyCourses from '@/Pages/MyCourses';
import MyProgress from '@/Pages/MyProgress';
import CourseCatalog from '@/Pages/CourseCatalog';
import ProviderUserManagement from '@/Pages/ProviderUserManagement';
import Error from '@/Pages/Error';
Expand Down Expand Up @@ -128,10 +127,10 @@ const router = createBrowserRouter([
loader: checkRole
},
{
path: 'student-dashboard',
path: 'my-learning',
element: <StudentDashboard />,
loader: getOpenContentProviders,
handle: { title: 'Dashboard', path: ['dashboard'] }
handle: { title: 'My Learning', path: ['my-learning'] }
},
{
path: 'consent',
Expand Down Expand Up @@ -228,22 +227,6 @@ const router = createBrowserRouter([
title: 'My Courses',
path: ['my-courses']
}
},
{
path: 'my-progress',
element: <MyProgress />,
handle: {
title: 'My Progress',
path: ['my-progress']
}
},
{
path: 'course-catalog',
element: <CourseCatalog />,
handle: {
title: 'Course Catalog',
path: ['course-catalog']
}
}
]
},
Expand Down Expand Up @@ -286,30 +269,30 @@ const router = createBrowserRouter([
loader: getFacilities,
children: [
{
path: 'admin-dashboard',
path: 'student-activity',
element: <AdminDashboard />,
errorElement: <Error />,
handle: {
title: 'Admin Dashboard',
path: ['admin-dashboard']
title: 'Student Activity',
path: ['student-activity']
}
},
{
path: 'student-management',
path: 'students',
element: <StudentManagement />,
errorElement: <Error />,
handle: {
title: 'Student Management',
path: ['student-management']
title: 'Students',
path: ['students']
}
},
{
path: 'admin-management',
path: 'admins',
element: <AdminManagement />,
errorElement: <Error />,
handle: {
title: 'Admin Management',
path: ['admin-management']
title: 'Admins',
path: ['admins']
}
},
{
Expand All @@ -331,24 +314,33 @@ const router = createBrowserRouter([
errorElement: <Error />,
children: [
{
path: 'provider-platform-management',
path: 'learning-platforms',
element: <ProviderPlatformManagement />,
handle: {
title: 'Provider Platform Management',
path: ['provider-platform-management']
title: 'Learning Platforms',
path: ['learning-platforms']
}
// Student Activity, Learning Platforms, Students, Admins, and Facilities should be the only things that appear in the left-hand nav for Admins.
},
{
path: 'provider-users/:id',
element: <ProviderUserManagement />,
handle: {
title: 'Provider User Management',
title: 'Provider User',
path: [
'provider-platforms',
':provider_platform_name'
]
}
},
{
path: 'facilities',
element: <FacilityManagement />,
handle: {
title: 'Facilities',
path: ['facilities']
}
},
{
path: 'course-catalog-admin',
element: <CourseCatalog />,
Expand All @@ -359,14 +351,6 @@ const router = createBrowserRouter([
}
]
},
{
path: 'facilities-management',
element: <FacilityManagement />,
handle: {
title: 'Facilities Management',
path: ['facilities-management']
}
},
{
path: '',
element: (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface User {
}
export const providerRoutes = [
'provider-user-management',
'provider-platform-management',
'learning-platforms',
'my-courses',
'course-catalogue',
'course-catalog-admin'
Expand Down
Loading
Loading