🐛 fix(headerComponent): reformat code to improve readability and consistency
🔨 refactor(AdminPage/index.tsx): reorganize imports and remove unused imports for better code organization and maintainability 🐛 fix(AdminPage/index.tsx): fix import statement for Header component to resolve import error 🚀 feat(AdminPage/index.tsx): add support for filtering user list based on input value to improve user experience 🔨 refactor(AdminPage/index.tsx): clean up code formatting and indentation for improved readability 🐛 fix(AdminPage/index.tsx): fix missing closing tags and correct JSX syntax errors ✨ feat(AdminPage/index.tsx): add support for user management actions such as filtering, adding, editing, and deleting users 📝 chore(AdminPage/index.tsx): update comments and remove unused code for better code organization 🎨 style: refactor user management UI to improve readability and maintainability 🔧 chore: update user management UI to use UserManagementModal and ConfirmationModal components for edit and delete functionality respectively 🐛 fix(PageComponent/index.tsx): fix formatting of proOptions object to improve readability and maintain consistency
This commit is contained in:
parent
1da3a7d260
commit
f9e3d0f57b
3 changed files with 253 additions and 248 deletions
|
|
@ -37,7 +37,7 @@ export default function Header(): JSX.Element {
|
||||||
logout();
|
logout();
|
||||||
navigate("/login");
|
navigate("/login");
|
||||||
}}
|
}}
|
||||||
className="text-sm font-medium text-muted-foreground transition-colors hover:text-primary cursor-pointer mx-5"
|
className="mx-5 cursor-pointer text-sm font-medium text-muted-foreground transition-colors hover:text-primary"
|
||||||
>
|
>
|
||||||
Sign out
|
Sign out
|
||||||
</a>
|
</a>
|
||||||
|
|
@ -48,7 +48,7 @@ export default function Header(): JSX.Element {
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate("/");
|
navigate("/");
|
||||||
}}
|
}}
|
||||||
className="text-sm font-medium text-muted-foreground transition-colors hover:text-primary cursor-pointer"
|
className="cursor-pointer text-sm font-medium text-muted-foreground transition-colors hover:text-primary"
|
||||||
>
|
>
|
||||||
Home
|
Home
|
||||||
</a>
|
</a>
|
||||||
|
|
@ -59,7 +59,7 @@ export default function Header(): JSX.Element {
|
||||||
location.pathname !== "/admin" &&
|
location.pathname !== "/admin" &&
|
||||||
location.pathname !== `/flow/${tabId}` && (
|
location.pathname !== `/flow/${tabId}` && (
|
||||||
<a
|
<a
|
||||||
className="text-sm font-medium text-muted-foreground transition-colors hover:text-primary cursor-pointer"
|
className="cursor-pointer text-sm font-medium text-muted-foreground transition-colors hover:text-primary"
|
||||||
onClick={() => navigate("/admin")}
|
onClick={() => navigate("/admin")}
|
||||||
>
|
>
|
||||||
Admin page
|
Admin page
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { useContext, useEffect, useRef, useState } from "react";
|
||||||
import PaginatorComponent from "../../components/PaginatorComponent";
|
import PaginatorComponent from "../../components/PaginatorComponent";
|
||||||
import ShadTooltip from "../../components/ShadTooltipComponent";
|
import ShadTooltip from "../../components/ShadTooltipComponent";
|
||||||
import IconComponent from "../../components/genericIconComponent";
|
import IconComponent from "../../components/genericIconComponent";
|
||||||
|
import Header from "../../components/headerComponent";
|
||||||
import { Button } from "../../components/ui/button";
|
import { Button } from "../../components/ui/button";
|
||||||
import { Checkbox } from "../../components/ui/checkbox";
|
import { Checkbox } from "../../components/ui/checkbox";
|
||||||
import { Input } from "../../components/ui/input";
|
import { Input } from "../../components/ui/input";
|
||||||
|
|
@ -25,9 +26,8 @@ import {
|
||||||
} from "../../controllers/API";
|
} from "../../controllers/API";
|
||||||
import ConfirmationModal from "../../modals/ConfirmationModal";
|
import ConfirmationModal from "../../modals/ConfirmationModal";
|
||||||
import UserManagementModal from "../../modals/UserManagementModal";
|
import UserManagementModal from "../../modals/UserManagementModal";
|
||||||
import { UserInputType } from "../../types/components";
|
|
||||||
import Header from "../../components/headerComponent";
|
|
||||||
import { Users } from "../../types/api";
|
import { Users } from "../../types/api";
|
||||||
|
import { UserInputType } from "../../types/components";
|
||||||
|
|
||||||
export default function AdminPage() {
|
export default function AdminPage() {
|
||||||
const [inputValue, setInputValue] = useState("");
|
const [inputValue, setInputValue] = useState("");
|
||||||
|
|
@ -280,7 +280,8 @@ export default function AdminPage() {
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
{!loadingUsers && (
|
{!loadingUsers && (
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{filterUserList.map((user:UserInputType, index) => (
|
{filterUserList.map(
|
||||||
|
(user: UserInputType, index) => (
|
||||||
<TableRow key={index}>
|
<TableRow key={index}>
|
||||||
<TableCell className="truncate py-2 font-medium">
|
<TableCell className="truncate py-2 font-medium">
|
||||||
<ShadTooltip content={user.id}>
|
<ShadTooltip content={user.id}>
|
||||||
|
|
@ -396,7 +397,10 @@ export default function AdminPage() {
|
||||||
handleDeleteUser(user);
|
handleDeleteUser(user);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ShadTooltip content="Delete" side="top">
|
<ShadTooltip
|
||||||
|
content="Delete"
|
||||||
|
side="top"
|
||||||
|
>
|
||||||
<IconComponent
|
<IconComponent
|
||||||
name="Trash2"
|
name="Trash2"
|
||||||
className="ml-2 h-4 w-4 cursor-pointer"
|
className="ml-2 h-4 w-4 cursor-pointer"
|
||||||
|
|
@ -406,7 +410,8 @@ export default function AdminPage() {
|
||||||
</div>
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
))}
|
)
|
||||||
|
)}
|
||||||
</TableBody>
|
</TableBody>
|
||||||
)}
|
)}
|
||||||
</Table>
|
</Table>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue