Skip to content

Commit

Permalink
[Unified search] Cleanups the showQueryBar flag (#143270)
Browse files Browse the repository at this point in the history
* [Unified search] Cleanups the showQueryBar flag that is not used anymore

* Fix add filter story error
  • Loading branch information
stratoula authored Oct 18, 2022
1 parent b288c2f commit 411a306
Show file tree
Hide file tree
Showing 29 changed files with 9 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,6 @@ export function DashboardTopNav({
return {
badges,
screenTitle,
showQueryBar,
showSearchBar,
showFilterBar,
showSaveQuery,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ describe('ContextApp test', () => {
const topNavProps = {
appName: 'context',
showSearchBar: true,
showQueryBar: true,
showQueryInput: false,
showFilterBar: true,
showSaveQuery: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ export const ContextApp = ({ dataView, anchorId }: ContextAppProps) => {
return {
appName: 'context',
showSearchBar: true,
showQueryBar: true,
showQueryInput: false,
showFilterBar: true,
showSaveQuery: false,
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/navigation/public/top_nav_menu/top_nav_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export type TopNavMenuProps<QT extends Query | AggregateQuery = Query> =
config?: TopNavMenuData[];
badges?: Array<EuiBadgeProps & { badgeText: string }>;
showSearchBar?: boolean;
showQueryBar?: boolean;
showQueryInput?: boolean;
showDatePicker?: boolean;
showFilterBar?: boolean;
Expand Down Expand Up @@ -142,7 +141,6 @@ export function TopNavMenu<QT extends AggregateQuery | Query = Query>(

TopNavMenu.defaultProps = {
showSearchBar: false,
showQueryBar: true,
showQueryInput: true,
showDatePicker: true,
showFilterBar: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ const mockIndexPatterns = [
title: 'logstash-*',
fields: [
{
name: 'response',
name: 'bytes',
type: 'number',
esTypes: ['integer'],
aggregatable: true,
filterable: true,
searchable: true,
},
],
getName: () => 'logstash-*',
},
{
id: '1235',
Expand All @@ -44,6 +45,7 @@ const mockIndexPatterns = [
searchable: true,
},
],
getName: () => 'test-*',
},
] as DataView[];

Expand Down Expand Up @@ -162,6 +164,11 @@ const services = {
],
},
},
dataViewEditor: {
userPermissions: {
editDataView: action('editDataView'),
},
},
};

setIndexPatterns({
Expand All @@ -173,7 +180,6 @@ function wrapSearchBarInContext(testProps: SearchBarProps<Query>) {
appName: 'test',
timeHistory: mockTimeHistory,
intl: null as any,
showQueryBar: true,
showFilterBar: true,
showDatePicker: true,
showAutoRefreshOnly: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ export function createSearchBar({
showAutoRefreshOnly={props.showAutoRefreshOnly}
showDatePicker={props.showDatePicker}
showFilterBar={props.showFilterBar}
showQueryBar={props.showQueryBar}
showQueryInput={props.showQueryInput}
showSaveQuery={props.showSaveQuery}
showSubmitButton={props.showSubmitButton}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ describe('SearchBar', () => {
screenTitle: 'test screen',
onQuerySubmit: noop,
query: kqlQuery,
showQueryBar: false,
showQueryInput: false,
})
);
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/unified_search/public/search_bar/search_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export interface SearchBarOwnProps<QT extends AggregateQuery | Query = Query> {
screenTitle?: string;
dataTestSubj?: string;
// Togglers
showQueryBar?: boolean;
showQueryInput?: boolean;
showFilterBar?: boolean;
showDatePicker?: boolean;
Expand Down Expand Up @@ -122,7 +121,6 @@ class SearchBarUI<QT extends (Query | AggregateQuery) | Query = Query> extends C
State<QT | Query>
> {
public static defaultProps = {
showQueryBar: true,
showFilterBar: true,
showDatePicker: true,
showSubmitButton: true,
Expand Down
1 change: 0 additions & 1 deletion src/plugins/vis_type_markdown/public/markdown_vis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export const markdownVisDefinition: VisTypeDefinition<MarkdownVisParams> = {
options: {
showTimePicker: false,
showFilterBar: false,
showQueryBar: true,
showQueryInput: false,
},
inspectorAdapters: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const sampleAreaVis = {
stage: 'production',
options: {
showTimePicker: true,
showQueryBar: true,
showFilterBar: true,
showIndexSelection: true,
hierarchicalData: false,
Expand Down
1 change: 0 additions & 1 deletion src/plugins/vis_types/pie/public/sample_vis.test.mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const samplePieVis = {
stage: 'production',
options: {
showTimePicker: true,
showQueryBar: true,
showFilterBar: true,
showIndexSelection: true,
hierarchicalData: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export function getTimelionVisDefinition(dependencies: TimelionVisDependencies)
},
options: {
showIndexSelection: false,
showQueryBar: true,
showFilterBar: false,
showQueryInput: false,
},
Expand Down
1 change: 0 additions & 1 deletion src/plugins/vis_types/timeseries/public/metrics_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ export const metricsVisDefinition: VisTypeDefinition<
editor: TSVB_EDITOR_NAME,
},
options: {
showQueryBar: true,
showFilterBar: true,
showIndexSelection: false,
},
Expand Down
1 change: 0 additions & 1 deletion src/plugins/vis_types/vega/public/vega_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export const createVegaTypeDefinition = (): VisTypeDefinition<VisParams> => {
toExpressionAst,
options: {
showIndexSelection: false,
showQueryBar: true,
showFilterBar: true,
},
getSupportedTriggers: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ export const getVis = (bucketType: string) => {
titleInWizard: '',
options: {
showTimePicker: true,
showQueryBar: true,
showFilterBar: true,
showIndexSelection: true,
hierarchicalData: false,
Expand Down
1 change: 0 additions & 1 deletion src/plugins/vis_types/xy/public/sample_vis.test.mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const sampleAreaVis = {
stage: 'production',
options: {
showTimePicker: true,
showQueryBar: true,
showFilterBar: true,
showIndexSelection: true,
hierarchicalData: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { Schemas } from './schemas';

const defaultOptions: VisTypeOptions = {
showTimePicker: true,
showQueryBar: true,
showFilterBar: true,
showIndexSelection: true,
showQueryInput: true,
Expand Down
1 change: 0 additions & 1 deletion src/plugins/visualizations/public/vis_types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { NavigateToLensContext } from '../../common';

export interface VisTypeOptions {
showTimePicker: boolean;
showQueryBar: boolean;
showFilterBar: boolean;
showIndexSelection: boolean;
showQueryInput: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ const TopNav = ({
return vis.type.options.showTimePicker && hasTimeField;
};
const showFilterBar = vis.type.options.showFilterBar;
const showQueryInput =
vis.type.requiresSearch && vis.type.options.showQueryBar && vis.type.options.showQueryInput;
const showQueryInput = vis.type.requiresSearch && vis.type.options.showQueryInput;

useEffect(() => {
return () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const FindingsSearchBar = ({
appName={PLUGIN_NAME}
dataTestSubj={TEST_SUBJECTS.FINDINGS_SEARCH_BAR}
showFilterBar={true}
showQueryBar={true}
showQueryInput={true}
showDatePicker={false}
showSaveQuery={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export const HostsContent: React.FunctionComponent = () => {
{metricsDataView ? (
<>
<SearchBar
showQueryBar={true}
showFilterBar={false}
showDatePicker={true}
showAutoRefreshOnly={false}
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,6 @@ export const LensTopNavMenu = ({
}
textBasedLanguageModeErrors={textBasedLanguageModeErrors}
onTextBasedSavedAndExit={onTextBasedSavedAndExit}
showQueryBar={true}
showFilterBar={true}
data-test-subj="lnsApp_topNav"
screenTitle={'lens'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export function ProfilingSearchBar({

onQuerySubmit({ dateRange, query });
}}
showQueryBar
showQueryInput
showDatePicker
showFilterBar={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export const FilterBar = memo<FilterBarComponentProps>(
showAutoRefreshOnly={false}
showFilterBar={true}
showDatePicker={false}
showQueryBar={false}
showQueryInput={false}
showSaveQuery={false}
dataTestSubj={dataTestSubj}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ describe('QueryBar ', () => {
showAutoRefreshOnly: false,
showDatePicker: false,
showFilterBar: true,
showQueryBar: true,
showQueryInput: true,
showSaveQuery: true,
showSubmitButton: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ export const QueryBar = memo<QueryBarComponentProps>(
showAutoRefreshOnly={false}
showFilterBar={!hideSavedQuery}
showDatePicker={false}
showQueryBar={true}
showQueryInput={true}
showSaveQuery={true}
timeHistory={timeHistory}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ export const SearchBarComponent = memo<SiemSearchBarProps & PropsFromRedux>(
savedQuery={savedQuery}
showFilterBar={!hideFilterBar}
showDatePicker={true}
showQueryBar={true}
showQueryInput={!hideQueryInput}
showSaveQuery={true}
dataTestSubj={dataTestSubj}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export const AdminSearchBar = memo(() => {
iconType="search"
showFilterBar={false}
showDatePicker={false}
showQueryBar={true}
showQueryInput={true}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ export const SearchSourceExpressionForm = (props: SearchSourceExpressionFormProp
onSavedQueryUpdated={onSavedQuery}
onSaved={onSavedQuery}
showSaveQuery
showQueryBar
showQueryInput
showFilterBar
showDatePicker={false}
Expand Down

0 comments on commit 411a306

Please sign in to comment.