Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions playwright/editing-dashboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ test.describe('Set Dashboard as Homepage from Generic Page', () => {
await page.getByText(`'${nonDefaultName}' has been set as homepage`).waitFor({ state: 'visible', timeout: 10000 });

await navigateToDashboardHub(page);
await page.getByRole('link', { name: nonDefaultName, exact: true }).waitFor({ state: 'visible', timeout: 10000 });

expect(await hasHomeIcon(page, nonDefaultName)).toBe(true);
});
Expand Down
18 changes: 7 additions & 11 deletions src/Components/DashboardHub/DashboardTable/DashboardTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@
return <Button variant="plain" aria-label="Duplicate" icon={<CopyIcon />} onClick={onClick} />;
};

export const DashboardTable: React.FunctionComponent<DashboardTableProps> = ({ dashboards, onRefetchDashboards }) => {

Check warning on line 34 in src/Components/DashboardHub/DashboardTable/DashboardTable.tsx

View workflow job for this annotation

GitHub Actions / lint

'onRefetchDashboards' is defined but never used
const { exportDashboard, isLoading, error } = useExportDashboard();

Check warning on line 35 in src/Components/DashboardHub/DashboardTable/DashboardTable.tsx

View workflow job for this annotation

GitHub Actions / lint

'error' is assigned a value but never used

Check warning on line 35 in src/Components/DashboardHub/DashboardTable/DashboardTable.tsx

View workflow job for this annotation

GitHub Actions / lint

'isLoading' is assigned a value but never used
const { deleteDashboard, isLoading: isDeleting } = useDeleteDashboard();
const [dashboardToDelete, setDashboardToDelete] = useState<Dashboard | null>(null);
const [duplicateDashboardId, setDuplicateDashboardId] = useState<number | null>(null);
const isEnabledDelete = useFlag('platform.widget-layout.delete-dashboard');
const isEnabledShare = useFlag('platform.widget-layout.share');
const isEnabledEdit = useFlag('platform.widget-layout.edit_from_hub');
const addNotification = useAddNotification();
const setDefaultDashboard = useSetAtom(setDefaultDashboardAtom);

Expand Down Expand Up @@ -115,16 +114,13 @@

// Row actions for each dashboard
const getRowActions = (dashboard: Dashboard) => [
...(isEnabledEdit
? [
{
icon: <EditAltIcon />,
title: 'Edit dashboard',
isDisabled: true,
onClick: () => console.log(`Edit dashboard ${dashboard.id}`),
},
]
: []),
{
icon: <EditAltIcon />,
title: 'Edit dashboard',
component: (props: React.HTMLProps<HTMLAnchorElement>) => (
<Link {...props} to={`/dashboard-hub/${dashboard.id}`} style={{ color: 'inherit', textDecoration: 'inherit' }} />
),
},
{
icon: <HomeIcon />,
title: 'Set as homepage',
Expand Down
Loading