Navigation: more command palette tweaks (#62286)

* update placeholder text, only create search keybindings if topNavCommandPalette is disabled

* make search input wider
This commit is contained in:
Ashley Harrison 2023-01-27 16:21:48 +00:00 committed by GitHub
parent 305209f4be
commit 1ef7cfda3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 20 additions and 12 deletions

View File

@ -79,7 +79,7 @@ const getStyles = (theme: GrafanaTheme2) => ({
justifyContent: 'space-between',
[theme.breakpoints.up('sm')]: {
gridTemplateColumns: '1.5fr minmax(200px, 1fr) 1.5fr', // search should not be smaller than 200px
gridTemplateColumns: '1.5fr minmax(240px, 1fr) 1.5fr', // search should not be smaller than 240px
display: 'grid',
justifyContent: 'flex-start',

View File

@ -36,7 +36,7 @@ export function TopSearchBarCommandPaletteTrigger() {
<ToolbarButton
iconOnly
icon="search"
aria-label={t('nav.search.placeholder', 'Search Grafana')}
aria-label={t('nav.search.placeholderCommandPalette', 'Search or jump to...')}
onClick={onOpenSearch}
/>
);
@ -65,7 +65,7 @@ function PretendTextInput({ onClick }: PretendTextInputProps) {
</div>
<button className={styles.fakeInput} onClick={onClick}>
{t('nav.search.placeholder', 'Search Grafana')}
{t('nav.search.placeholderCommandPalette', 'Search or jump to...')}
</button>
<div className={styles.suffix}>

View File

@ -39,9 +39,11 @@ export class KeybindingSrv {
this.bind('g a', this.openAlerting);
this.bind('g p', this.goToProfile);
this.bind('g e', this.goToExplore);
this.bind('s o', this.openSearch);
if (!config.featureToggles.topNavCommandPalette) {
this.bind('s o', this.openSearch);
this.bind('f', this.openSearch);
}
this.bind('t a', this.makeAbsoluteTime);
this.bind('f', this.openSearch);
this.bind('esc', this.exit);
this.bindGlobalEsc();
}

View File

@ -59,7 +59,7 @@ export const CommandPalette = () => {
<div className={styles.searchContainer}>
{isFetchingDashboardResults ? <Spinner className={styles.spinner} /> : <Icon name="search" size="md" />}
<KBarSearch
defaultPlaceholder={t('command-palette.search-box.placeholder', 'Search Grafana')}
defaultPlaceholder={t('command-palette.search-box.placeholder', 'Search or jump to...')}
className={styles.search}
/>
</div>

View File

@ -292,7 +292,8 @@
"title": "Szenen"
},
"search": {
"placeholder": "Grafana durchsuchen"
"placeholder": "Grafana durchsuchen",
"placeholderCommandPalette": ""
},
"search-dashboards": {
"title": "Dashboards durchsuchen"

View File

@ -292,7 +292,8 @@
"title": "Scenes"
},
"search": {
"placeholder": "Search Grafana"
"placeholder": "Search Grafana",
"placeholderCommandPalette": "Search or jump to..."
},
"search-dashboards": {
"title": "Search dashboards"

View File

@ -292,7 +292,8 @@
"title": "Escenas"
},
"search": {
"placeholder": "Buscar Grafana"
"placeholder": "Buscar Grafana",
"placeholderCommandPalette": ""
},
"search-dashboards": {
"title": "Buscar paneles de control"

View File

@ -292,7 +292,8 @@
"title": "Scènes"
},
"search": {
"placeholder": "Rechercher dans Grafana"
"placeholder": "Rechercher dans Grafana",
"placeholderCommandPalette": ""
},
"search-dashboards": {
"title": "Rechercher dans les tableaux de bord"

View File

@ -292,7 +292,8 @@
"title": "Ŝčęʼnęş"
},
"search": {
"placeholder": "Ŝęäřčĥ Ğřäƒäʼnä"
"placeholder": "Ŝęäřčĥ Ğřäƒäʼnä",
"placeholderCommandPalette": "Ŝęäřčĥ őř ĵūmp ŧő..."
},
"search-dashboards": {
"title": "Ŝęäřčĥ đäşĥþőäřđş"

View File

@ -292,7 +292,8 @@
"title": "场景"
},
"search": {
"placeholder": "搜索 Grafana"
"placeholder": "搜索 Grafana",
"placeholderCommandPalette": ""
},
"search-dashboards": {
"title": ""