Skip to content

Commit

Permalink
Enterprise Search: remove search applications feature flag (#154609)
Browse files Browse the repository at this point in the history
## Summary

Remove the feature flagging of the search applications (engines) section
for nav and routes.


![image](https://user-images.githubusercontent.com/1972968/230502703-694c480d-b997-4d9d-bea6-1f5ba763d6be.png)

*Note we should do some more work on the side nav separate from this PR.
  • Loading branch information
TattdCodeMonkey authored Apr 10, 2023
1 parent 5c759a1 commit c98fa82
Show file tree
Hide file tree
Showing 12 changed files with 150 additions and 477 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ export const DEFAULT_INITIAL_APP_DATA = {
},
access: {
hasAppSearchAccess: true,
hasSearchEnginesAccess: false,
hasWorkplaceSearchAccess: true,
},
features: {
hasConnectors: true,
hasDefaultIngestPipeline: true,
hasNativeConnectors: true,
hasSearchApplications: false,
hasWebCrawler: true,
},
appSearch: {
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/enterprise_search/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,5 @@ export const DEFAULT_PRODUCT_FEATURES: ProductFeatures = {
hasConnectors: true,
hasDefaultIngestPipeline: true,
hasNativeConnectors: true,
hasSearchApplications: false,
hasWebCrawler: true,
};
2 changes: 0 additions & 2 deletions x-pack/plugins/enterprise_search/common/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@ export interface ConfiguredLimits {

export interface ProductAccess {
hasAppSearchAccess: boolean;
hasSearchEnginesAccess: boolean;
hasWorkplaceSearchAccess: boolean;
}

export interface ProductFeatures {
hasConnectors: boolean;
hasDefaultIngestPipeline: boolean;
hasNativeConnectors: boolean;
hasSearchApplications: boolean;
hasWebCrawler: boolean;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ export const mockKibanaValues = {
navigateToUrl: jest.fn(),
productAccess: {
hasAppSearchAccess: true,
hasSearchEnginesAccess: false,
hasWorkplaceSearchAccess: true,
},
productFeatures: {
hasNativeConnectors: true,
hasSearchApplications: false,
hasWebCrawler: true,
},
uiSettings: uiSettingsServiceMock.createStartContract(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
import React from 'react';
import { Switch } from 'react-router-dom';

import { useValues } from 'kea';

import { Route } from '@kbn/shared-ux-router';

import { KibanaLogic } from '../../../shared/kibana';
import { ENGINES_PATH, ENGINE_PATH } from '../../routes';

import { EngineRouter } from '../engine/engine_router';
Expand All @@ -21,17 +18,6 @@ import { NotFound } from '../not_found';
import { EnginesList } from './engines_list';

export const EnginesRouter: React.FC = () => {
const { productAccess } = useValues(KibanaLogic);
const enginesSectionEnabled = productAccess.hasSearchEnginesAccess;
if (!enginesSectionEnabled) {
return (
<Switch>
<Route>
<NotFound />
</Route>
</Switch>
);
}
return (
<Switch>
<Route exact path={ENGINES_PATH}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const renderApp = (

const noProductAccess: ProductAccess = {
hasAppSearchAccess: false,
hasSearchEnginesAccess: false,
hasWorkplaceSearchAccess: false,
};
const productAccess = data.access || noProductAccess;
Expand Down
Loading

0 comments on commit c98fa82

Please sign in to comment.