-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enterprise Search] Product 404 polish pass #103198
Changes from 9 commits
a86818c
f4bedcb
4089bb1
90c7fc4
8f19efb
fdbdd74
ff5f2d9
36b753c
da7365c
ae8a3ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,14 +38,15 @@ import { CurationsRouter } from '../curations'; | |
import { DocumentDetail, Documents } from '../documents'; | ||
import { EngineOverview } from '../engine_overview'; | ||
import { AppSearchPageTemplate } from '../layout'; | ||
import { NotFound } from '../not_found'; | ||
import { RelevanceTuning } from '../relevance_tuning'; | ||
import { ResultSettings } from '../result_settings'; | ||
import { SchemaRouter } from '../schema'; | ||
import { SearchUI } from '../search_ui'; | ||
import { SourceEngines } from '../source_engines'; | ||
import { Synonyms } from '../synonyms'; | ||
|
||
import { EngineLogic } from './'; | ||
import { EngineLogic, getEngineBreadcrumbs } from './'; | ||
|
||
export const EngineRouter: React.FC = () => { | ||
const { | ||
|
@@ -159,6 +160,9 @@ export const EngineRouter: React.FC = () => { | |
<ApiLogs /> | ||
</Route> | ||
)} | ||
<Route> | ||
<NotFound pageChrome={getEngineBreadcrumbs()} /> | ||
</Route> | ||
Comment on lines
+163
to
+165
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
</Switch> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { shallow } from 'enzyme'; | ||
|
||
import { NotFoundPrompt } from '../../../shared/not_found'; | ||
import { SendAppSearchTelemetry } from '../../../shared/telemetry'; | ||
import { AppSearchPageTemplate } from '../layout'; | ||
|
||
import { NotFound } from './'; | ||
|
||
describe('NotFound', () => { | ||
const wrapper = shallow(<NotFound />); | ||
|
||
it('renders the shared not found prompt', () => { | ||
expect(wrapper.find(NotFoundPrompt)).toHaveLength(1); | ||
}); | ||
|
||
it('renders a telemetry error event', () => { | ||
expect(wrapper.find(SendAppSearchTelemetry).prop('action')).toEqual('error'); | ||
}); | ||
|
||
it('passes optional preceding page chrome', () => { | ||
wrapper.setProps({ pageChrome: ['Engines', 'some-engine'] }); | ||
|
||
expect(wrapper.find(AppSearchPageTemplate).prop('pageChrome')).toEqual([ | ||
'Engines', | ||
'some-engine', | ||
'404', | ||
]); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { APP_SEARCH_PLUGIN } from '../../../../../common/constants'; | ||
import { PageTemplateProps } from '../../../shared/layout'; | ||
import { NotFoundPrompt } from '../../../shared/not_found'; | ||
import { SendAppSearchTelemetry } from '../../../shared/telemetry'; | ||
import { AppSearchPageTemplate } from '../layout'; | ||
|
||
export const NotFound: React.FC<PageTemplateProps> = ({ pageChrome = [] }) => { | ||
return ( | ||
<AppSearchPageTemplate pageChrome={[...pageChrome, '404']} template="centeredContent"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, I checked the translation JSON files and it looks like those translations aren't translating numbers / left "404" in current messages as-is in multiple plugins, so I think I'm okay to leave this untranslated - but if y'all feel strongly I can change this, just let me know There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes sense, HTTP codes use "Arabic" numerals exclusively There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ooo nice find! Thanks Byron! |
||
<SendAppSearchTelemetry action="error" metric="not_found" /> | ||
<NotFoundPrompt productSupportUrl={APP_SEARCH_PLUGIN.SUPPORT_URL} /> | ||
</AppSearchPageTemplate> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,7 @@ import { APP_SEARCH_PLUGIN } from '../../../common/constants'; | |
import { InitialAppData } from '../../../common/types'; | ||
import { HttpLogic } from '../shared/http'; | ||
import { KibanaLogic } from '../shared/kibana'; | ||
import { Layout, SideNav, SideNavLink } from '../shared/layout'; | ||
import { NotFound } from '../shared/not_found'; | ||
import { SideNav, SideNavLink } from '../shared/layout'; | ||
|
||
import { ROLE_MAPPINGS_TITLE } from '../shared/role_mapping/constants'; | ||
|
||
|
@@ -28,6 +27,7 @@ import { ErrorConnecting } from './components/error_connecting'; | |
import { KibanaHeaderActions } from './components/layout'; | ||
import { Library } from './components/library'; | ||
import { MetaEngineCreation } from './components/meta_engine_creation'; | ||
import { NotFound } from './components/not_found'; | ||
import { RoleMappings } from './components/role_mappings'; | ||
import { Settings, SETTINGS_TITLE } from './components/settings'; | ||
import { SetupGuide } from './components/setup_guide'; | ||
|
@@ -85,7 +85,6 @@ export const AppSearchConfigured: React.FC<Required<InitialAppData>> = (props) = | |
}, | ||
} = useValues(AppLogic(props)); | ||
const { renderHeaderActions } = useValues(KibanaLogic); | ||
const { readOnlyMode } = useValues(HttpLogic); | ||
|
||
useEffect(() => { | ||
renderHeaderActions(KibanaHeaderActions); | ||
|
@@ -133,13 +132,7 @@ export const AppSearchConfigured: React.FC<Required<InitialAppData>> = (props) = | |
</Route> | ||
)} | ||
<Route> | ||
<Layout navigation={<AppSearchNav />} readOnlyMode={readOnlyMode}> | ||
<Switch> | ||
<Route> | ||
<NotFound product={APP_SEARCH_PLUGIN} /> | ||
</Route> | ||
</Switch> | ||
</Layout> | ||
<NotFound /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
</Route> | ||
</Switch> | ||
); | ||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
* 2.0. | ||
*/ | ||
|
||
export { NotFound } from './not_found'; | ||
export { NotFoundPrompt } from './not_found_prompt'; |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bother, I missed a screenshot