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

[SELS-TASK-32] [FE] - Admin Dashboard Page #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Miguel21Monacillo
Copy link
Collaborator

Asana

[Commands]

  • npm start

[Pre-conditions]

  1. After running the command , you will redirect to front page
  2. Go to /admin/dashboard

[Expected Output]

  • Show Admin Dashboard
  • Click Categories and Category List will show
  • Click Student List and User List will show
  • URL must show the category ID when clicking edit and delete

[Screenshots]

Admin Dashboard

Student List

Categories

Add

Edit

Delete

const AdminDashboard = () => {
return (
<>
<title>Dashboard</title>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it Admin | Dashboard

@@ -27,7 +28,7 @@ const CategoryListPage = () => {
return (
<>
<title>Categories</title>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it Admin | Categories

<span className="text-blue-500 cursor-pointer">
{' '}
{user.first_name}{' '}
</span>{' '}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all {' '} that are unnecessary.

Comment on lines 11 to 13
ForbiddenException,

} from '@nestjs/common';
import { CategoriesService } from './categories.service';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you revert this change. it's not necessary.

Comment on lines 52 to 72
<Link to={{pathname: `/admin/category/${category.id}/addword`}}>
<button
type="button"
className="px-[5px] underline decoration-sky-500 hover:bg-sky-500"
>
Add Words
</button>
</button> </Link>
<Link to={{pathname: `/admin/category/${category.id}/edit`}}>
<button
type="button"
className="px-[5px] underline decoration-yellow-500 hover:bg-yellow-700"
>
Edit
</button>
</button> </Link>
<Link to={{pathname: `/admin/category/${category.id}/delete`}}>
<button
type="button"
className="px-[5px] underline decoration-red-500 hover:bg-red-500"
>
Delete
</button>
</button> </Link>
Copy link
Collaborator

@escbooster12-dev escbooster12-dev Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -22,6 +25,9 @@ const Main: React.FC = () => {
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/admin/users-list" element={<AdminUserPage />} />
<Route path="/student/category/:id/" element={<LessonAnswerPage />} />
<Route path="/admin/dashboard" element={<AdminDashboard/>} />
<Route path="/admin/categories" element={<CategoryListPage/>} />
<Route path="/admin/category/:id/addword" element={<AddWordPage/>} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use kebab case for routes

Suggested change
<Route path="/admin/category/:id/addword" element={<AddWordPage/>} />
<Route path="/admin/category/:id/add-word" element={<AddWordPage/>} />

interface NavbarProps {
title: string;
}
const AdminNavbar: React.FC<NavbarProps> = ({ title }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const AdminNavbar: React.FC<NavbarProps> = ({ title }) => {
const AdminNavbar = ({ title } : NavbarProps) => {

Comment on lines 1 to 2
import UserProfile from '../user.png';
import users from '../../dummydata';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use path alias

@Miguel21Monacillo Miguel21Monacillo changed the title [SELS-TASK] [FE]- Admin Dashboard Page [SELS-TASK-32] [FE] - Admin Dashboard Page Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants