From 9376d54d40f2caebc7050fa1d48ba2bb92c45d27 Mon Sep 17 00:00:00 2001 From: Jason Stoltzfus Date: Mon, 19 Oct 2020 12:16:42 -0400 Subject: [PATCH] Removed loading state for endpoint --- .../credentials/credentials.test.tsx | 2 +- .../components/credentials/credentials.tsx | 67 ++++++++----------- 2 files changed, 30 insertions(+), 39 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials.test.tsx index 29912e3204ed0..a265b2c998d39 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials.test.tsx @@ -52,7 +52,7 @@ describe('Credentials', () => { setMockValues({ dataLoading: true }); const wrapper = shallow(); expect(wrapper.find('[data-test-subj="CreateAPIKeyButton"]')).toHaveLength(0); - expect(wrapper.find(EuiLoadingContent)).toHaveLength(2); + expect(wrapper.find(EuiLoadingContent)).toHaveLength(1); }); it('renders the API endpoint and a button to copy it', () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials.tsx index a07695145a721..b9a482ae462d5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials.tsx @@ -64,44 +64,35 @@ export const Credentials: React.FC = () => { - {!!dataLoading ? ( - - ) : ( - <> - -

- {i18n.translate('xpack.enterpriseSearch.appSearch.credentials.apiEndpoint', { - defaultMessage: 'Endpoint', - })} -

-
- - {(copy) => ( - <> - - {externalUrl.enterpriseSearchUrl} - - )} - - - )} + +

+ {i18n.translate('xpack.enterpriseSearch.appSearch.credentials.apiEndpoint', { + defaultMessage: 'Endpoint', + })} +

+
+ + {(copy) => ( + <> + + {externalUrl.enterpriseSearchUrl} + + )} +