mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
fix: Switch to 'all' after filters change on kubernetes dashboard page (#1337)
Fixes: HDX-2789
This commit is contained in:
parent
44caf197b4
commit
b90a0649b8
3 changed files with 32 additions and 0 deletions
5
.changeset/lucky-colts-raise.md
Normal file
5
.changeset/lucky-colts-raise.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@hyperdx/app": patch
|
||||
---
|
||||
|
||||
fix: Switch to 'all' after filters change on kubernetes dashboard page
|
||||
|
|
@ -140,6 +140,13 @@ export const InfraPodsStatusTable = ({
|
|||
where: string;
|
||||
}) => {
|
||||
const [phaseFilter, setPhaseFilter] = React.useState('running');
|
||||
|
||||
// Auto-switch to "All" when search filters are applied
|
||||
useEffect(() => {
|
||||
if (where) {
|
||||
setPhaseFilter('all');
|
||||
}
|
||||
}, [where]);
|
||||
const [sortState, setSortState] = React.useState<{
|
||||
column: InfraPodsStatusTableColumn;
|
||||
order: 'asc' | 'desc';
|
||||
|
|
|
|||
|
|
@ -148,4 +148,24 @@ test.describe('Kubernetes Dashboard', { tag: ['@kubernetes'] }, () => {
|
|||
'ResourceAttributes.k8s.namespace.name:"default"',
|
||||
);
|
||||
});
|
||||
|
||||
test('should switch to "All" tab when filtering by pod or namespace', async ({
|
||||
page,
|
||||
}) => {
|
||||
// Verify initial state is "Running"
|
||||
const podsTable = page.getByTestId('k8s-pods-table');
|
||||
const runningTab = podsTable.getByRole('radio', { name: 'Running' });
|
||||
await expect(runningTab).toBeChecked();
|
||||
|
||||
// Filter by namespace
|
||||
const namespaceFilter = page.getByTestId('namespace-filter-select');
|
||||
await namespaceFilter.click();
|
||||
await page.getByRole('option', { name: 'default' }).click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Verify it switched to "All" tab
|
||||
const allTab = podsTable.getByRole('radio', { name: 'All' });
|
||||
await expect(allTab).toBeChecked();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue