-
Notifications
You must be signed in to change notification settings - Fork 14
Fix include done switch bug and add shimmer for table #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,11 @@ | ||
| import { Dashboard } from '@/modules/dashboard' | ||
| import { DashboardShimmer } from '@/modules/dashboard/components/dashboard-shimmer' | ||
| import { Suspense } from 'react' | ||
|
|
||
| export default Dashboard | ||
| export default function DashboardPage() { | ||
| return ( | ||
| <Suspense fallback={<DashboardShimmer />}> | ||
| <Dashboard /> | ||
| </Suspense> | ||
| ) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,18 @@ | ||
| 'use client' | ||
|
|
||
| import { TasksApi } from '@/api/tasks/tasks.api' | ||
| import { CommonPageError } from '@/components/common-page-error' | ||
| import { TodoListTable } from '@/components/todo-list-table' | ||
| import { useQuery } from '@tanstack/react-query' | ||
| import { useSearchParams } from 'next/navigation' | ||
| import { DashboardTasksTableTabs as TabsConstants } from '../constants' | ||
|
|
||
| export const DashboardWatchlistTable = () => { | ||
| const searchParams = useSearchParams() | ||
| const tab = searchParams.get('tab') | ||
| const status = searchParams.get('status') | ||
| const isInvalidCombination = tab === TabsConstants.WatchList && status === 'Done' | ||
|
|
||
| const { data, isLoading, isError } = useQuery({ | ||
| queryKey: TasksApi.getWatchListTasks.key, | ||
| queryFn: TasksApi.getWatchListTasks.fn, | ||
|
|
@@ -17,7 +26,7 @@ export const DashboardWatchlistTable = () => { | |
| })), | ||
| }) | ||
|
|
||
| if (isError) { | ||
| if (isError || isInvalidCombination) { | ||
| return <CommonPageError /> | ||
| } | ||
|
Comment on lines
+29
to
31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect Error Handling for Invalid URL Parameters
Tell me moreWhat is the issue?Using CommonPageError for an invalid combination of URL parameters is inappropriate as it suggests a system error rather than a user navigation error. Why this mattersUsers encountering this error won't understand why they're seeing a generic error page when they've simply accessed an invalid URL combination. This could lead to confusion and unnecessary support tickets. Suggested change ∙ Feature PreviewCreate a specific error component for invalid URL parameters or redirect to a valid state: if (isError) {
return <CommonPageError />
}
if (isInvalidCombination) {
return <div>Cannot view completed tasks in Watchlist view</div>
// Or redirect to a valid state:
// router.replace('/dashboard?tab=watchlist')
}Provide feedback to improve future suggestions💬 Looking for more details? Reply to this comment to chat with Korbit. |
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.