feat: Implement project search functionality and task management features
- Added search functionality to the Project List page, allowing users to filter projects by name, WP, plot, or investment number. - Created a new Project Tasks page to manage tasks across all projects, including filtering by status and priority. - Implemented task status updates and deletion functionality. - Added a new Task Template Edit page for modifying existing task templates. - Enhanced Task Template Form to include a description field and loading state during submission. - Updated UI components for better user experience, including badges for task status and priority. - Introduced new database queries for managing contracts and projects, including fetching tasks related to projects. - Added migrations to the database for new columns and improved data handling.
This commit is contained in:
@@ -9,6 +9,7 @@ const Badge = ({
|
||||
const variants = {
|
||||
default: "bg-gray-100 text-gray-800",
|
||||
primary: "bg-blue-100 text-blue-800",
|
||||
secondary: "bg-gray-200 text-gray-700",
|
||||
success: "bg-green-100 text-green-800",
|
||||
warning: "bg-yellow-100 text-yellow-800",
|
||||
danger: "bg-red-100 text-red-800",
|
||||
|
||||
@@ -33,13 +33,13 @@ const Button = forwardRef(
|
||||
<button
|
||||
ref={ref}
|
||||
className={`
|
||||
inline-flex items-center justify-center rounded-lg font-medium transition-colors
|
||||
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
|
||||
disabled:opacity-50 disabled:cursor-not-allowed
|
||||
${buttonVariants[variant]}
|
||||
${buttonSizes[size]}
|
||||
${className}
|
||||
`}
|
||||
inline-flex items-center justify-center rounded-lg font-medium transition-colors
|
||||
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
|
||||
disabled:opacity-50 disabled:cursor-not-allowed
|
||||
${buttonVariants[variant]}
|
||||
${buttonSizes[size]}
|
||||
${className}
|
||||
`}
|
||||
disabled={disabled}
|
||||
{...props}
|
||||
>
|
||||
|
||||
@@ -5,16 +5,19 @@ import { usePathname } from "next/navigation";
|
||||
|
||||
const Navigation = () => {
|
||||
const pathname = usePathname();
|
||||
|
||||
const isActive = (path) => {
|
||||
if (path === "/") return pathname === "/";
|
||||
return pathname.startsWith(path);
|
||||
// Exact match for paths
|
||||
if (pathname === path) return true;
|
||||
// For nested paths, ensure we match the full path segment
|
||||
if (pathname.startsWith(path + "/")) return true;
|
||||
return false;
|
||||
};
|
||||
|
||||
const navItems = [
|
||||
{ href: "/", label: "Dashboard" },
|
||||
{ href: "/projects", label: "Projects" },
|
||||
{ href: "/tasks/templates", label: "Task Templates" },
|
||||
{ href: "/tasks", label: "Project Tasks" },
|
||||
{ href: "/contracts", label: "Contracts" },
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user