Skip to content

Commit 3e0a78d

Browse files
committed
review: Address review comments and knip findings
1 parent 5fa9f84 commit 3e0a78d

4 files changed

Lines changed: 10 additions & 27 deletions

File tree

packages/app/src/DBDashboardPage.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,13 +1577,15 @@ function DBDashboardPage() {
15771577
<Menu.Item
15781578
leftSection={<IconTrash size={16} />}
15791579
color="red"
1580-
onClick={() =>
1581-
deleteDashboard.mutate(dashboard?.id ?? '', {
1582-
onSuccess: () => {
1583-
router.push('/dashboards');
1584-
},
1585-
})
1586-
}
1580+
onClick={() => {
1581+
if (dashboard?.id) {
1582+
deleteDashboard.mutate(dashboard?.id, {
1583+
onSuccess: () => {
1584+
router.push('/dashboards');
1585+
},
1586+
});
1587+
}
1588+
}}
15871589
>
15881590
Delete Dashboard
15891591
</Menu.Item>

packages/app/src/components/Dashboards/DashboardsListPage.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
} from '@tabler/icons-react';
2929

3030
import { PageHeader } from '@/components/PageHeader';
31-
import { IS_K8S_DASHBOARD_ENABLED, IS_LOCAL_MODE } from '@/config';
31+
import { IS_K8S_DASHBOARD_ENABLED } from '@/config';
3232
import {
3333
useCreateDashboard,
3434
useDashboards,
@@ -102,10 +102,6 @@ export default function DashboardsListPage() {
102102
}, [dashboards, search, tagFilter]);
103103

104104
const handleCreate = useCallback(() => {
105-
if (IS_LOCAL_MODE) {
106-
Router.push('/dashboards');
107-
return;
108-
}
109105
createDashboard.mutate(
110106
{ name: 'My Dashboard', tiles: [], tags: [] },
111107
{

packages/app/src/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ export type SearchConfig = {
6060
orderBy?: string | null;
6161
};
6262

63-
export type ServerDashboard = z.infer<typeof DashboardSchema>;
64-
6563
export type Session = {
6664
errorCount: string;
6765
maxTimestamp: string;

packages/app/src/utils.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -523,19 +523,6 @@ export function getColorFromCSSVariable(index: number): string {
523523
return COLORS[index % colorArrayLength];
524524
}
525525

526-
export function hashCode(str: string) {
527-
let hash = 0,
528-
i,
529-
chr;
530-
if (str.length === 0) return hash;
531-
for (i = 0; i < str.length; i++) {
532-
chr = str.charCodeAt(i);
533-
hash = (hash << 5) - hash + chr;
534-
hash |= 0; // Convert to 32bit integer
535-
}
536-
return hash;
537-
}
538-
539526
/**
540527
* Gets theme-aware chart color from CSS variable or falls back to palette.
541528
* Reads from --color-chart-{type} CSS variable, falls back to theme-appropriate palette.

0 commit comments

Comments
 (0)