From c21e45e428b03ed1f3370e6b3a42ebfad9f44528 Mon Sep 17 00:00:00 2001 From: Alex Khomenko Date: Wed, 17 Feb 2021 14:06:19 +0200 Subject: [PATCH] Search: display sort metadata (#31167) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Search: display metadata * Search: update SortPicker icon * Search: display folder meta data * Search: reset sort picker on layout change * Search: align tags in Card component * Search: replace hyphen with dash * Search: preserve sort state on layout change * Search: update tests * Search: fix tests * Update pkg/services/search/hits.go Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update public/app/features/search/components/SearchItem.tsx Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update public/app/features/search/components/SearchItem.tsx Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update public/app/features/search/types.ts Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Search: fix type error * Search: add General folder name and adjust icon margin Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> --- .../src/components/Card/Card.story.tsx | 4 --- .../grafana-ui/src/components/Card/Card.tsx | 18 ++++++---- pkg/services/search/hits.go | 29 +++++++-------- pkg/services/sqlstore/dashboard.go | 4 +-- .../app/core/components/Select/SortPicker.tsx | 10 +++--- .../components/DashboardSearch.test.tsx | 3 ++ .../features/search/components/SearchItem.tsx | 35 +++++++++++++++++-- .../components/SearchResultsFilter.test.tsx | 1 + .../search/components/SectionHeader.tsx | 1 - public/app/features/search/constants.ts | 2 +- .../features/search/hooks/useSearchQuery.ts | 4 +++ .../search/reducers/searchQueryReducer.ts | 5 +-- public/app/features/search/types.ts | 4 +++ 13 files changed, 83 insertions(+), 37 deletions(-) diff --git a/packages/grafana-ui/src/components/Card/Card.story.tsx b/packages/grafana-ui/src/components/Card/Card.story.tsx index 1396506ccb9..0c0712d755e 100644 --- a/packages/grafana-ui/src/components/Card/Card.story.tsx +++ b/packages/grafana-ui/src/components/Card/Card.story.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import { action } from '@storybook/addon-actions'; import { Story } from '@storybook/react'; import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Card, Props } from './Card'; @@ -133,9 +132,6 @@ export const Full: Story = ({ disabled }) => { Prometheus Logo - - -