feat: enhance Jira analytics with caching and force refresh
- Updated `getJiraAnalytics` to accept a `forceRefresh` parameter for optional cache bypass. - Modified `getProjectAnalytics` to check the cache and return cached data unless forced to refresh. - Adjusted `loadAnalytics` in `useJiraAnalytics` to trigger a forced refresh on manual updates. - Improved UI in `JiraDashboardPageClient` to indicate when data is served from cache.
This commit is contained in:
@@ -154,13 +154,20 @@ export function JiraDashboardPageClient({ initialJiraConfig }: JiraDashboardPage
|
||||
))}
|
||||
</div>
|
||||
|
||||
<Button
|
||||
onClick={refreshAnalytics}
|
||||
disabled={isLoading}
|
||||
variant="secondary"
|
||||
>
|
||||
{isLoading ? '🔄 Actualisation...' : '🔄 Actualiser'}
|
||||
</Button>
|
||||
<div className="flex items-center gap-2">
|
||||
{analytics && (
|
||||
<div className="text-xs text-[var(--muted-foreground)] px-2 py-1 bg-[var(--card)] border border-[var(--border)] rounded">
|
||||
💾 Données en cache
|
||||
</div>
|
||||
)}
|
||||
<Button
|
||||
onClick={refreshAnalytics}
|
||||
disabled={isLoading}
|
||||
variant="secondary"
|
||||
>
|
||||
{isLoading ? '🔄 Actualisation...' : '🔄 Actualiser'}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user