RecentlyDeleted: Remove search box (#89043)

* RecentlyDeleted: Remove search box

* i18n
This commit is contained in:
Josh Hunt
2024-06-11 15:45:10 +01:00
committed by GitHub
parent c71f8b8b1f
commit 994ddf7e6f
5 changed files with 13 additions and 33 deletions

View File

@@ -11,11 +11,11 @@ export function BrowseFilters() {
<div>
<ActionRow
showStarredFilter
showLayout
state={searchState}
getTagOptions={stateManager.getTagOptions}
getSortOptions={getGrafanaSearcher().getSortOptions}
sortPlaceholder={getGrafanaSearcher().sortPlaceholder}
includePanels={searchState.includePanels ?? false}
onLayoutChange={stateManager.onLayoutChange}
onStarredFilterChange={stateManager.onStarredFilterChange}
onSortChange={stateManager.onSortChange}

View File

@@ -1,9 +1,7 @@
import React, { memo, useEffect } from 'react';
import AutoSizer from 'react-virtualized-auto-sizer';
import { FilterInput } from '@grafana/ui';
import { Page } from 'app/core/components/Page/Page';
import { t } from 'app/core/internationalization';
import { ActionRow } from 'app/features/search/page/components/ActionRow';
import { getGrafanaSearcher } from 'app/features/search/service';
@@ -37,19 +35,11 @@ const RecentlyDeletedPage = memo(() => {
return (
<Page navId="dashboards/recentlyDeleted">
<Page.Contents>
<FilterInput
placeholder={t('recentlyDeleted.filter.placeholder', 'Search for dashboards')}
value={searchState.query}
escapeRegex={false}
onChange={(e) => stateManager.onQueryChange(e)}
/>
<ActionRow
showStarredFilter={false}
state={searchState}
getTagOptions={stateManager.getTagOptions}
getSortOptions={getGrafanaSearcher().getSortOptions}
sortPlaceholder={getGrafanaSearcher().sortPlaceholder}
includePanels={false}
onLayoutChange={stateManager.onLayoutChange}
onSortChange={stateManager.onSortChange}
onTagFilterChange={stateManager.onTagFilterChange}

View File

@@ -21,21 +21,21 @@ function getLayoutOptions() {
];
}
interface Props {
interface ActionRowProps {
state: SearchState;
showStarredFilter?: boolean;
showLayout?: boolean;
sortPlaceholder?: string;
onLayoutChange: (layout: SearchLayout) => void;
onSortChange: (value?: string) => void;
onStarredFilterChange?: (event: FormEvent<HTMLInputElement>) => void;
onTagFilterChange: (tags: string[]) => void;
getTagOptions: () => Promise<TermCount[]>;
getSortOptions: () => Promise<SelectableValue[]>;
sortPlaceholder?: string;
onDatasourceChange: (ds?: string) => void;
onPanelTypeChange: (pt?: string) => void;
includePanels: boolean;
onSetIncludePanels: (v: boolean) => void;
state: SearchState;
showStarredFilter?: boolean;
hideLayout?: boolean;
}
export function getValidQueryLayout(q: SearchState): SearchLayout {
@@ -52,20 +52,20 @@ export function getValidQueryLayout(q: SearchState): SearchLayout {
}
export const ActionRow = ({
state,
showStarredFilter,
showLayout,
sortPlaceholder,
onLayoutChange,
onSortChange,
onStarredFilterChange = () => {},
onTagFilterChange,
getTagOptions,
getSortOptions,
sortPlaceholder,
onDatasourceChange,
onPanelTypeChange,
onSetIncludePanels,
state,
showStarredFilter,
hideLayout,
}: Props) => {
}: ActionRowProps) => {
const styles = useStyles2(getStyles);
const layout = getValidQueryLayout(state);
@@ -113,7 +113,7 @@ export const ActionRow = ({
</Stack>
<Stack gap={2}>
{!hideLayout && (
{showLayout && (
<RadioButtonGroup
options={getLayoutOptions()}
disabledOptions={disabledOptions}

View File

@@ -1479,11 +1479,6 @@
},
"query-editor-not-exported": "Data source plugin does not export any Query Editor component"
},
"recentlyDeleted": {
"filter": {
"placeholder": "Search for dashboards"
}
},
"refresh-picker": {
"aria-label": {
"choose-interval": "Auto refresh turned off. Choose refresh time interval",

View File

@@ -1479,11 +1479,6 @@
},
"query-editor-not-exported": "Đäŧä şőūřčę pľūģįʼn đőęş ʼnőŧ ęχpőřŧ äʼny Qūęřy Ēđįŧőř čőmpőʼnęʼnŧ"
},
"recentlyDeleted": {
"filter": {
"placeholder": "Ŝęäřčĥ ƒőř đäşĥþőäřđş"
}
},
"refresh-picker": {
"aria-label": {
"choose-interval": "Åūŧő řęƒřęşĥ ŧūřʼnęđ őƒƒ. Cĥőőşę řęƒřęşĥ ŧįmę įʼnŧęřväľ",