Fix TypeScript and ESLint errors for production build
This commit is contained in:
parent
5b3691826b
commit
ae5c952ab1
@ -25,6 +25,7 @@ import { Plus, Calendar, Flag, GripVertical } from "lucide-react"
|
|||||||
import { format, parseISO } from "date-fns"
|
import { format, parseISO } from "date-fns"
|
||||||
|
|
||||||
const statusColumns = ["backlog", "in-progress", "review", "done"] as const
|
const statusColumns = ["backlog", "in-progress", "review", "done"] as const
|
||||||
|
type SprintColumnStatus = typeof statusColumns[number]
|
||||||
|
|
||||||
const statusLabels: Record<string, string> = {
|
const statusLabels: Record<string, string> = {
|
||||||
backlog: "To Do",
|
backlog: "To Do",
|
||||||
@ -149,7 +150,6 @@ export function SprintBoard() {
|
|||||||
selectedSprintId,
|
selectedSprintId,
|
||||||
selectSprint,
|
selectSprint,
|
||||||
selectedProjectId,
|
selectedProjectId,
|
||||||
selectedTaskId,
|
|
||||||
updateTask,
|
updateTask,
|
||||||
selectTask,
|
selectTask,
|
||||||
addSprint,
|
addSprint,
|
||||||
@ -224,7 +224,7 @@ export function SprintBoard() {
|
|||||||
const overId = over.id as string
|
const overId = over.id as string
|
||||||
|
|
||||||
// Check if dropped over a column
|
// Check if dropped over a column
|
||||||
if (statusColumns.includes(overId as any)) {
|
if (statusColumns.includes(overId as SprintColumnStatus)) {
|
||||||
updateTask(taskId, { status: overId as Task["status"] })
|
updateTask(taskId, { status: overId as Task["status"] })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
export interface TextareaProps
|
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>
|
||||||
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
|
||||||
|
|
||||||
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||||||
({ className, ...props }, ref) => {
|
({ className, ...props }, ref) => {
|
||||||
|
|||||||
@ -485,21 +485,23 @@ const normalizeCommentAuthor = (value: unknown): CommentAuthor => {
|
|||||||
const normalizeComments = (value: unknown): Comment[] => {
|
const normalizeComments = (value: unknown): Comment[] => {
|
||||||
if (!Array.isArray(value)) return []
|
if (!Array.isArray(value)) return []
|
||||||
|
|
||||||
return value
|
const comments: Comment[] = []
|
||||||
.map((entry) => {
|
|
||||||
if (!entry || typeof entry !== 'object') return null
|
for (const entry of value) {
|
||||||
const candidate = entry as Partial<Comment>
|
if (!entry || typeof entry !== 'object') continue
|
||||||
if (typeof candidate.id !== 'string' || typeof candidate.text !== 'string') return null
|
const candidate = entry as Partial<Comment>
|
||||||
|
if (typeof candidate.id !== 'string' || typeof candidate.text !== 'string') continue
|
||||||
|
|
||||||
return {
|
comments.push({
|
||||||
id: candidate.id,
|
id: candidate.id,
|
||||||
text: candidate.text,
|
text: candidate.text,
|
||||||
createdAt: typeof candidate.createdAt === 'string' ? candidate.createdAt : new Date().toISOString(),
|
createdAt: typeof candidate.createdAt === 'string' ? candidate.createdAt : new Date().toISOString(),
|
||||||
author: normalizeCommentAuthor(candidate.author),
|
author: normalizeCommentAuthor(candidate.author),
|
||||||
replies: normalizeComments(candidate.replies),
|
replies: normalizeComments(candidate.replies),
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.filter((comment): comment is Comment => comment !== null)
|
}
|
||||||
|
|
||||||
|
return comments
|
||||||
}
|
}
|
||||||
|
|
||||||
const normalizeAttachments = (value: unknown): TaskAttachment[] => {
|
const normalizeAttachments = (value: unknown): TaskAttachment[] => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user