feat: integrate Jira configuration into Header and layout
- Added `JiraConfigProvider` to `layout.tsx` for server-side Jira configuration retrieval. - Updated `Header.tsx` to conditionally display a link to the Jira dashboard with the project key if Jira is configured. - Enhanced user experience by integrating Jira settings into the main application layout.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Card, CardContent } from '@/components/ui/Card';
|
||||
import { TaskStats } from '@/lib/types';
|
||||
import { useTheme } from '@/contexts/ThemeContext';
|
||||
import { useJiraConfig } from '@/contexts/JiraConfigContext';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import Link from 'next/link';
|
||||
|
||||
@@ -13,6 +14,7 @@ interface HeaderProps {
|
||||
|
||||
export function Header({ title = "TowerControl", subtitle = "Task Management", stats, syncing = false }: HeaderProps) {
|
||||
const { theme, toggleTheme } = useTheme();
|
||||
const { isConfigured: isJiraConfigured, config: jiraConfig } = useJiraConfig();
|
||||
const pathname = usePathname();
|
||||
|
||||
// Fonction pour déterminer si un lien est actif
|
||||
@@ -82,6 +84,14 @@ export function Header({ title = "TowerControl", subtitle = "Task Management", s
|
||||
>
|
||||
Tags
|
||||
</Link>
|
||||
{isJiraConfigured && (
|
||||
<Link
|
||||
href="/jira-dashboard"
|
||||
className={getLinkClasses('/jira-dashboard')}
|
||||
>
|
||||
Jira ({jiraConfig?.projectKey})
|
||||
</Link>
|
||||
)}
|
||||
<Link
|
||||
href="/settings"
|
||||
className={getLinkClasses('/settings')}
|
||||
|
||||
Reference in New Issue
Block a user