mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 02:10:45 -06:00
Scopes: Allow navigating to inner containers (#89676)
Scopes: Allow navigating to inner levels after selecting a scope
This commit is contained in:
parent
a3879e02bb
commit
0ea2d6972f
@ -38,7 +38,6 @@ import {
|
||||
mocksScopes,
|
||||
queryAllDashboard,
|
||||
queryFiltersApply,
|
||||
queryApplicationsClustersSlothClusterNorthTitle,
|
||||
queryApplicationsClustersTitle,
|
||||
queryApplicationsSlothPictureFactoryTitle,
|
||||
queryApplicationsSlothVoteTrackerTitle,
|
||||
@ -137,12 +136,14 @@ describe('ScopesScene', () => {
|
||||
expect(getFiltersInput().value).toBe('slothVoteTracker, slothPictureFactory, Cluster Index Helper');
|
||||
});
|
||||
|
||||
it("Can't navigate deeper than the level where scopes are selected", async () => {
|
||||
it('Can select a node from an inner level', async () => {
|
||||
await userEvents.click(getFiltersInput());
|
||||
await userEvents.click(getApplicationsExpand());
|
||||
await userEvents.click(getApplicationsSlothVoteTrackerSelect());
|
||||
await userEvents.click(getApplicationsClustersExpand());
|
||||
expect(queryApplicationsClustersSlothClusterNorthTitle()).not.toBeInTheDocument();
|
||||
await userEvents.click(getApplicationsClustersSlothClusterNorthSelect());
|
||||
await userEvents.click(getFiltersApply());
|
||||
expect(getFiltersInput().value).toBe('slothClusterNorth');
|
||||
});
|
||||
|
||||
it('Can select a node from an upper level', async () => {
|
||||
|
@ -36,7 +36,6 @@ export function ScopesTreeLevel({
|
||||
|
||||
const scopeNames = scopes.map(({ scopeName }) => scopeName);
|
||||
const anyChildExpanded = childNodesArr.some(({ isExpanded }) => isExpanded);
|
||||
const anyChildSelected = childNodesArr.some(({ linkId }) => linkId && scopeNames.includes(linkId!));
|
||||
|
||||
const onQueryUpdate = useMemo(() => debounce(onNodeUpdate, 500), [onNodeUpdate]);
|
||||
|
||||
@ -102,7 +101,6 @@ export function ScopesTreeLevel({
|
||||
|
||||
{childNode.isExpandable && (
|
||||
<IconButton
|
||||
disabled={anyChildSelected && !childNode.isExpanded}
|
||||
name={!childNode.isExpanded ? 'angle-right' : 'angle-down'}
|
||||
aria-label={
|
||||
childNode.isExpanded ? t('scopes.tree.collapse', 'Collapse') : t('scopes.tree.expand', 'Expand')
|
||||
|
Loading…
Reference in New Issue
Block a user