Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Constance <[email protected]>
  • Loading branch information
byronhulcher and Constance authored Feb 25, 2021
1 parent 2cd7cd1 commit 31070ee
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,6 @@ describe('EnginesOverview', () => {
...valuesWithEngines,
myRole: { canViewMetaEngines: true },
metaEngines: ['test-meta-engine'],
metaEnginesMeta: {
page: {
current: 1,
size: 10,
total_results: 100,
},
},
});
const wrapper = shallow(<EnginesOverview />);
const pageEvent = { page: { index: 0 } };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export const EnginesOverview: React.FC = () => {
}, [enginesMeta.page.current]);

useEffect(() => {
if (canViewMetaEngines) loadMetaEngines();
}, [canViewMetaEngines, metaEnginesMeta.page.current]);
if (hasPlatinumLicense) loadMetaEngines();
}, [hasPlatinumLicense, metaEnginesMeta.page.current]);

if (dataLoading) return <LoadingState />;
if (!engines.length) return <EmptyState />;
Expand Down Expand Up @@ -112,7 +112,7 @@ export const EnginesOverview: React.FC = () => {
/>
</EuiPageContentBody>

{canViewMetaEngines && (
{hasPlatinumLicense && (
<>
<EuiSpacer size="xl" />
<EuiPageContentHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const META_ENGINE_CREATION_FORM_META_ENGINE_DESCRIPTION = i18n.translate(
'xpack.enterpriseSearch.appSearch.metaEngineCreation.form.metaEngineDescription',
{
defaultMessage:
'Meta engines allow you to combine multiple engines into one, searchable engine.',
'Meta engines allow you to combine multiple engines into one searchable engine.',
}
);

Expand All @@ -54,12 +54,12 @@ export const META_ENGINE_CREATION_FORM_DOCUMENTATION_DESCRIPTION = (
defaultMessage="{documentationLink} for information about how to get started."
values={{
documentationLink: (
<a
href="https://www.elastic.co/guide/en/app-search/current/meta-engines-guide.html"
<EuiLink
href={`${DOCS_PREFIX}/meta-engines-guide.html`}
target="_blank"
>
{META_ENGINE_CREATION_FORM_DOCUMENTATION_LINK}
</a>
</EuiLink>
),
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ export const MetaEngineCreationLogic = kea<
listeners: ({ values, actions }) => ({
fetchIndexedEngineNames: async ({ page }) => {
const { http } = HttpLogic.values;
let response;
let response: { results: EngineDetails[]; meta: Meta } | undefined;

try {
response = (await http.get('/api/app_search/engines', {
response = await http.get('/api/app_search/engines', {
query: { type: 'indexed', 'page[current]': page, 'page[size]': DEFAULT_META.page.size },
})) as { results: EngineDetails[]; meta: Meta };
});
} catch (e) {
flashAPIErrors(e);
}
Expand Down

0 comments on commit 31070ee

Please sign in to comment.