Skip to content

Commit 3cc6aa9

Browse files
committed
fix: resolve TypeScript linting errors
- Replace 'any' type casts with proper type checking using 'in' operator - Convert DetailPanelIssue to ActionItem format in Kanban functions - Remove unused getPriorityColor function - Ensure strict TypeScript compliance without suppressing types
1 parent 3fefb93 commit 3cc6aa9

File tree

2 files changed

+36
-19
lines changed

2 files changed

+36
-19
lines changed

src/app/action-required/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,9 @@ function ActionRequiredContent() {
631631
item={item as StoreActionItem}
632632
itemType={
633633
type === "all"
634-
? (item as any).mentionType || (item as any).mentionedAt
634+
? ("mentionType" in item || "mentionedAt" in item)
635635
? "mentions"
636-
: (item as any).daysStale !== undefined || (item as any).lastActivity
636+
: ("daysStale" in item || "lastActivity" in item)
637637
? "stale"
638638
: "assigned"
639639
: type

src/components/ui/detail-panel.tsx

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,23 @@ export function DetailPanel({ issue, isOpen, onClose }: DetailPanelProps) {
121121
const handleAddToKanban = () => {
122122
if (!issue) return;
123123
try {
124-
addTaskFromActionItem(issue as any, "", "todo");
124+
const actionItem = {
125+
id: issue.id.toString(),
126+
title: issue.title,
127+
repo: issue.repository || issue.repo || "Unknown",
128+
type: issue.type === "pullRequest" ? ("pullRequest" as const) : ("issue" as const),
129+
priority: issue.priority || ("medium" as const),
130+
url: issue.url,
131+
createdAt: issue.created_at || issue.createdAt || new Date().toISOString(),
132+
updatedAt: issue.updated_at || issue.updatedAt || new Date().toISOString(),
133+
author: {
134+
login: issue.author.login,
135+
avatarUrl: issue.author.avatar_url || issue.author.avatarUrl || "",
136+
},
137+
labels: issue.labels.map(l => ({ name: l.name, color: l.color })),
138+
daysOld: 0,
139+
};
140+
addTaskFromActionItem(actionItem, "", "todo");
125141
setActionMessage({ type: "success", text: "Added to Kanban board" });
126142
setTimeout(() => setActionMessage(null), 3000);
127143
} catch (error) {
@@ -134,7 +150,23 @@ export function DetailPanel({ issue, isOpen, onClose }: DetailPanelProps) {
134150
const handleQuickStart = () => {
135151
if (!issue) return;
136152
try {
137-
addTaskFromActionItem(issue as any, "", "inProgress");
153+
const actionItem = {
154+
id: issue.id.toString(),
155+
title: issue.title,
156+
repo: issue.repository || issue.repo || "Unknown",
157+
type: issue.type === "pullRequest" ? ("pullRequest" as const) : ("issue" as const),
158+
priority: issue.priority || ("medium" as const),
159+
url: issue.url,
160+
createdAt: issue.created_at || issue.createdAt || new Date().toISOString(),
161+
updatedAt: issue.updated_at || issue.updatedAt || new Date().toISOString(),
162+
author: {
163+
login: issue.author.login,
164+
avatarUrl: issue.author.avatar_url || issue.author.avatarUrl || "",
165+
},
166+
labels: issue.labels.map(l => ({ name: l.name, color: l.color })),
167+
daysOld: 0,
168+
};
169+
addTaskFromActionItem(actionItem, "", "inProgress");
138170
setActionMessage({ type: "success", text: "Task started in Kanban" });
139171
setTimeout(() => setActionMessage(null), 3000);
140172
} catch (error) {
@@ -202,21 +234,6 @@ export function DetailPanel({ issue, isOpen, onClose }: DetailPanelProps) {
202234
}).format(date);
203235
};
204236

205-
const getPriorityColor = (priority?: string) => {
206-
switch (priority) {
207-
case "urgent":
208-
return "bg-red-100 text-red-700 border-red-300 dark:bg-red-950 dark:text-red-400 dark:border-red-800";
209-
case "high":
210-
return "bg-orange-100 text-orange-700 border-orange-300 dark:bg-orange-950 dark:text-orange-400 dark:border-orange-800";
211-
case "medium":
212-
return "bg-yellow-100 text-yellow-700 border-yellow-300 dark:bg-yellow-950 dark:text-yellow-400 dark:border-yellow-800";
213-
case "low":
214-
return "bg-green-100 text-green-700 border-green-300 dark:bg-green-950 dark:text-green-400 dark:border-green-800";
215-
default:
216-
return "bg-gray-100 text-gray-700 border-gray-300 dark:bg-gray-950 dark:text-gray-400 dark:border-gray-800";
217-
}
218-
};
219-
220237
return (
221238
<>
222239
<div

0 commit comments

Comments
 (0)