diff --git a/src/plugins/es_ui_shared/public/request/np_ready_request.ts b/src/plugins/es_ui_shared/public/request/np_ready_request.ts index b8f7db1463ab8..790e29b6d3655 100644 --- a/src/plugins/es_ui_shared/public/request/np_ready_request.ts +++ b/src/plugins/es_ui_shared/public/request/np_ready_request.ts @@ -120,7 +120,6 @@ export const useRequest = ( const response = await sendRequest(httpClient, requestBody); const { data: serializedResponseData, error: responseError } = response; - const responseData = deserializer(serializedResponseData); // If an outdated request has resolved, DON'T update state, but DO allow the processData handler // to execute side effects like update telemetry. @@ -129,7 +128,12 @@ export const useRequest = ( } setError(responseError); - setData(responseData); + + if (!responseError) { + const responseData = deserializer(serializedResponseData); + setData(responseData); + } + setIsLoading(false); setIsInitialRequest(false); diff --git a/x-pack/plugins/watcher/public/plugin.ts b/x-pack/plugins/watcher/public/plugin.ts index a2a0d3cf1c978..354edd2078676 100644 --- a/x-pack/plugins/watcher/public/plugin.ts +++ b/x-pack/plugins/watcher/public/plugin.ts @@ -76,7 +76,7 @@ export class WatcherUIPlugin implements Plugin { }), icon: 'watchesApp', path: '/app/kibana#/management/elasticsearch/watcher/watches', - showOnHomePage: true, + showOnHomePage: false, }; home.featureCatalogue.register(watcherHome); @@ -85,9 +85,6 @@ export class WatcherUIPlugin implements Plugin { if (valid) { watcherESApp.enable(); watcherHome.showOnHomePage = true; - } else { - watcherESApp.disable(); - watcherHome.showOnHomePage = false; } }); } diff --git a/x-pack/test/functional/apps/watcher/watcher_test.js b/x-pack/test/functional/apps/watcher/watcher_test.js index a2da0aad2d3c5..d96426997ca8b 100644 --- a/x-pack/test/functional/apps/watcher/watcher_test.js +++ b/x-pack/test/functional/apps/watcher/watcher_test.js @@ -36,10 +36,23 @@ export default function({ getService, getPageObjects }) { } await browser.setWindowSize(1600, 1000); - // TODO: Remove the retry.try wrapper once https://github.com/elastic/kibana/issues/55985 is resolved - retry.try(async () => { - await PageObjects.common.navigateToApp('watcher'); - await testSubjects.find('createWatchButton'); + + // License values are emitted ES -> Kibana Server -> Kibana Public. The current implementation + // creates a situation where the Watcher plugin may not have received a minimum required license at setup time + // so the public app may not have registered in the UI. + // + // For functional testing this is a problem. The temporary solution is we wait for watcher + // to be visible. + // + // See this issue https://github.com/elastic/kibana/issues/55985. + await retry.waitFor('watcher to display in management UI', async () => { + try { + await PageObjects.common.navigateToApp('watcher'); + await testSubjects.find('createWatchButton'); + } catch (e) { + return false; + } + return true; }); });