Skip to content

Commit 70c5a50

Browse files
ismoilovdevmlclaude
andcommitted
Fix TypeScript type errors
- Fix job.project_id to job.project in Overview component - Remove setGitlabUrl and setGitlabToken from useConfigLoader (credentials now in DB) - Update useConfigLoader documentation - All TypeScript checks passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 95ed923 commit 70c5a50

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/components/Overview.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ export default function Overview() {
263263
) : (
264264
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3">
265265
{filteredJobs.map((job) => {
266-
const project = projects.find(p => p.id === job.project_id);
267266
return (
268267
<div
269268
key={job.id}
@@ -282,7 +281,7 @@ export default function Overview() {
282281
</div>
283282
<div className="flex-1 min-w-0">
284283
<h3 className={`font-medium text-sm truncate ${textPrimary}`}>{job.name}</h3>
285-
<p className={`text-xs truncate ${textSecondary}`}>{project?.name || 'Unknown'}</p>
284+
<p className={`text-xs truncate ${textSecondary}`}>{job.project?.name || 'Unknown'}</p>
286285
</div>
287286
</div>
288287
<div className={`flex items-center justify-between text-xs ${textSecondary}`}>

src/hooks/useConfigLoader.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import axios from 'axios';
55
/**
66
* Global config loader hook
77
* Loads configuration from database on mount and updates Zustand store
8+
* Note: GitLab URL and Token are now stored in database, not in Zustand
89
*/
910
export function useConfigLoader() {
1011
const {
11-
setGitlabUrl,
12-
setGitlabToken,
1312
setAutoRefresh,
1413
setRefreshInterval,
1514
setNotifyPipelineFailures,
@@ -23,9 +22,7 @@ export function useConfigLoader() {
2322
const response = await axios.get('/api/config');
2423
const config = response.data;
2524

26-
// Update Zustand store with database config
27-
if (config.url) setGitlabUrl(config.url);
28-
if (config.token) setGitlabToken(config.token);
25+
// Update Zustand store with database config (excluding url/token which are in DB)
2926
if (typeof config.autoRefresh === 'boolean') setAutoRefresh(config.autoRefresh);
3027
if (typeof config.refreshInterval === 'number') setRefreshInterval(config.refreshInterval);
3128
if (typeof config.notifyPipelineFailures === 'boolean') setNotifyPipelineFailures(config.notifyPipelineFailures);
@@ -43,5 +40,5 @@ export function useConfigLoader() {
4340
};
4441

4542
loadConfig();
46-
}, [setGitlabUrl, setGitlabToken, setAutoRefresh, setRefreshInterval, setNotifyPipelineFailures, setNotifyPipelineSuccess, setTheme]);
43+
}, [setAutoRefresh, setRefreshInterval, setNotifyPipelineFailures, setNotifyPipelineSuccess, setTheme]);
4744
}

0 commit comments

Comments
 (0)