Command Palette: Adjust command palette extensions priority (#79992)

adjust command palette extensions priority
This commit is contained in:
Ashley Harrison 2024-01-03 16:18:27 +00:00 committed by GitHub
parent 5c67c4b082
commit d680a020cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -8,7 +8,7 @@ import impressionSrv from 'app/core/services/impression_srv';
import { getGrafanaSearcher } from 'app/features/search/service';
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_RECENT_DASHBOARDS = 5;
@ -41,7 +41,7 @@ export async function getRecentDashboardActions(): Promise<CommandPaletteAction[
id: `recent-dashboards${url}`,
name: `${name}`,
section: t('command-palette.section.recent-dashboards', 'Recent dashboards'),
priority: RECENT_DASHBOARDS_PRORITY,
priority: RECENT_DASHBOARDS_PRIORITY,
url,
};
});
@ -70,7 +70,7 @@ export async function getSearchResultActions(searchQuery: string): Promise<Comma
kind === 'dashboard'
? t('command-palette.section.dashboard-search-results', 'Dashboards')
: t('command-palette.section.folder-search-results', 'Folders'),
priority: SEARCH_RESULTS_PRORITY,
priority: SEARCH_RESULTS_PRIORITY,
url,
subtitle: data.view.dataFrame.meta?.custom?.locationInfo[location]?.name,
};

View File

@ -1,6 +1,6 @@
export const RECENT_DASHBOARDS_PRORITY = 6;
export const EXTENSIONS_PRIORITY = 5;
export const ACTIONS_PRIORITY = 4;
export const DEFAULT_PRIORITY = 3;
export const PREFERENCES_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 RECENT_DASHBOARDS_PRIORITY = 6;
export const ACTIONS_PRIORITY = 5;
export const DEFAULT_PRIORITY = 4;
export const PREFERENCES_PRIORITY = 3;
export const EXTENSIONS_PRIORITY = 2;
export const SEARCH_RESULTS_PRIORITY = 1; // Dynamic actions should be below static ones so the list doesn't 'jump' when they come in