Command Palette: Adjust command palette extensions priority (#79992)
adjust command palette extensions priority
This commit is contained in:
@@ -8,7 +8,7 @@ import impressionSrv from 'app/core/services/impression_srv';
|
|||||||
import { getGrafanaSearcher } from 'app/features/search/service';
|
import { getGrafanaSearcher } from 'app/features/search/service';
|
||||||
|
|
||||||
import { CommandPaletteAction } from '../types';
|
import { CommandPaletteAction } from '../types';
|
||||||
import { RECENT_DASHBOARDS_PRORITY, SEARCH_RESULTS_PRORITY } from '../values';
|
import { RECENT_DASHBOARDS_PRIORITY, SEARCH_RESULTS_PRIORITY } from '../values';
|
||||||
|
|
||||||
const MAX_SEARCH_RESULTS = 100;
|
const MAX_SEARCH_RESULTS = 100;
|
||||||
const MAX_RECENT_DASHBOARDS = 5;
|
const MAX_RECENT_DASHBOARDS = 5;
|
||||||
@@ -41,7 +41,7 @@ export async function getRecentDashboardActions(): Promise<CommandPaletteAction[
|
|||||||
id: `recent-dashboards${url}`,
|
id: `recent-dashboards${url}`,
|
||||||
name: `${name}`,
|
name: `${name}`,
|
||||||
section: t('command-palette.section.recent-dashboards', 'Recent dashboards'),
|
section: t('command-palette.section.recent-dashboards', 'Recent dashboards'),
|
||||||
priority: RECENT_DASHBOARDS_PRORITY,
|
priority: RECENT_DASHBOARDS_PRIORITY,
|
||||||
url,
|
url,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -70,7 +70,7 @@ export async function getSearchResultActions(searchQuery: string): Promise<Comma
|
|||||||
kind === 'dashboard'
|
kind === 'dashboard'
|
||||||
? t('command-palette.section.dashboard-search-results', 'Dashboards')
|
? t('command-palette.section.dashboard-search-results', 'Dashboards')
|
||||||
: t('command-palette.section.folder-search-results', 'Folders'),
|
: t('command-palette.section.folder-search-results', 'Folders'),
|
||||||
priority: SEARCH_RESULTS_PRORITY,
|
priority: SEARCH_RESULTS_PRIORITY,
|
||||||
url,
|
url,
|
||||||
subtitle: data.view.dataFrame.meta?.custom?.locationInfo[location]?.name,
|
subtitle: data.view.dataFrame.meta?.custom?.locationInfo[location]?.name,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export const RECENT_DASHBOARDS_PRORITY = 6;
|
export const RECENT_DASHBOARDS_PRIORITY = 6;
|
||||||
export const EXTENSIONS_PRIORITY = 5;
|
export const ACTIONS_PRIORITY = 5;
|
||||||
export const ACTIONS_PRIORITY = 4;
|
export const DEFAULT_PRIORITY = 4;
|
||||||
export const DEFAULT_PRIORITY = 3;
|
export const PREFERENCES_PRIORITY = 3;
|
||||||
export const PREFERENCES_PRIORITY = 2;
|
export const EXTENSIONS_PRIORITY = 2;
|
||||||
export const SEARCH_RESULTS_PRORITY = 1; // Dynamic actions should be below static ones so the list doesn't 'jump' when they come in
|
export const SEARCH_RESULTS_PRIORITY = 1; // Dynamic actions should be below static ones so the list doesn't 'jump' when they come in
|
||||||
|
|||||||
Reference in New Issue
Block a user