CommandPalette: Minor usability improvements (#61567)

pull/61676/head
Josh Hunt 3 years ago committed by GitHub
parent f135c6cbf1
commit 665f85cd7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      public/app/features/commandPalette/CommandPalette.tsx
  2. 9
      public/app/features/commandPalette/ResultItem.tsx
  3. 2
      public/app/features/commandPalette/actions/dashboardActions.ts
  4. 2
      public/app/features/commandPalette/actions/staticActions.ts
  5. 3
      public/locales/de-DE/grafana.json
  6. 5
      public/locales/en-US/grafana.json
  7. 3
      public/locales/es-ES/grafana.json
  8. 3
      public/locales/fr-FR/grafana.json
  9. 5
      public/locales/pseudo-LOCALE/grafana.json
  10. 3
      public/locales/zh-Hans/grafana.json

@ -56,7 +56,10 @@ export const CommandPalette = () => {
<KBarAnimator className={styles.animator}>
<FocusScope contain autoFocus restoreFocus>
<div {...overlayProps} {...dialogProps}>
<KBarSearch className={styles.search} />
<KBarSearch
defaultPlaceholder={t('command-palette.search-box.placeholder', 'Search Grafana')}
className={styles.search}
/>
<RenderResults dashboardResults={dashboardResults} />
</div>
</FocusScope>

@ -59,15 +59,6 @@ export const ResultItem = React.forwardRef(
</div>
{action.subtitle && <span className={styles.subtitleText}>{action.subtitle}</span>}
</div>
{action.shortcut?.length ? (
<div aria-hidden className={styles.shortcutContainer}>
{action.shortcut.map((sc) => (
<kbd key={sc} className={styles.shortcut}>
{sc}
</kbd>
))}
</div>
) : null}
</div>
);
}

@ -36,7 +36,7 @@ export async function getRecentDashboardActions(): Promise<CommandPaletteAction[
return {
id: `recent-dashboards/${url}`,
name: `${name}`,
section: t('command-palette.section.recent-dashboards', 'Recently viewed dashboards'),
section: t('command-palette.section.recent-dashboards', 'Recent dashboards'),
priority: RECENT_DASHBOARDS_PRORITY,
perform: () => {
locationService.push(locationUtil.stripBaseFromUrl(url));

@ -55,7 +55,6 @@ export default (navBarTree: NavModelItem[]): CommandPaletteAction[] => {
keywords: 'navigate',
perform: () => locationService.push('?search=open'),
section: t('command-palette.section.pages', 'Pages'),
shortcut: ['s', 'o'],
priority: DEFAULT_PRIORITY,
},
{
@ -63,7 +62,6 @@ export default (navBarTree: NavModelItem[]): CommandPaletteAction[] => {
name: t('command-palette.action.change-theme', 'Change theme...'),
keywords: 'interface color dark light',
section: t('command-palette.section.preferences', 'Preferences'),
shortcut: ['c', 't'],
priority: PREFERENCES_PRIORITY,
},
{

@ -12,6 +12,9 @@
"light-theme": "",
"search": ""
},
"search-box": {
"placeholder": ""
},
"section": {
"actions": "",
"dashboard-search-results": "",

@ -12,12 +12,15 @@
"light-theme": "Light",
"search": "Search"
},
"search-box": {
"placeholder": "Search Grafana"
},
"section": {
"actions": "Actions",
"dashboard-search-results": "Dashboards",
"pages": "Pages",
"preferences": "Preferences",
"recent-dashboards": "Recently viewed dashboards"
"recent-dashboards": "Recent dashboards"
}
},
"common": {

@ -12,6 +12,9 @@
"light-theme": "",
"search": ""
},
"search-box": {
"placeholder": ""
},
"section": {
"actions": "",
"dashboard-search-results": "",

@ -12,6 +12,9 @@
"light-theme": "",
"search": ""
},
"search-box": {
"placeholder": ""
},
"section": {
"actions": "",
"dashboard-search-results": "",

@ -12,12 +12,15 @@
"light-theme": "Ŀįģĥŧ",
"search": "Ŝęäřčĥ"
},
"search-box": {
"placeholder": "Ŝęäřčĥ Ğřäƒäʼnä"
},
"section": {
"actions": "Åčŧįőʼnş",
"dashboard-search-results": "Đäşĥþőäřđş",
"pages": "Päģęş",
"preferences": "Přęƒęřęʼnčęş",
"recent-dashboards": "Ŗęčęʼnŧľy vįęŵęđ đäşĥþőäřđş"
"recent-dashboards": "Ŗęčęʼnŧ đäşĥþőäřđş"
}
},
"common": {

@ -12,6 +12,9 @@
"light-theme": "",
"search": ""
},
"search-box": {
"placeholder": ""
},
"section": {
"actions": "",
"dashboard-search-results": "",

Loading…
Cancel
Save