diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.test.tsx index 38e57fa0483e..58e2cd8cf4c9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.test.tsx @@ -26,6 +26,8 @@ const MOCK_VALUES = { }, }, }, + // LicensingLogic + hasPlatinumLicense: true, }; describe('SuggestedCurationsCallout', () => { @@ -56,4 +58,14 @@ describe('SuggestedCurationsCallout', () => { expect(wrapper.isEmptyRender()).toBe(true); }); + + it('is empty when the user has no platinum license', () => { + // This would happen if the user *had* suggestions and then downgraded from platinum to gold or something + const values = set('hasPlatinumLicense', false, MOCK_VALUES); + setMockValues(values); + + const wrapper = shallow(); + + expect(wrapper.isEmptyRender()).toBe(true); + }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.tsx index a7155b7d2b16..046cc2d744b0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.tsx @@ -10,6 +10,7 @@ import { useValues } from 'kea'; import { i18n } from '@kbn/i18n'; +import { LicensingLogic } from '../../../../shared/licensing'; import { ENGINE_CURATIONS_PATH } from '../../../routes'; import { SuggestionsCallout } from '../../curations/components/suggestions_callout'; import { EngineLogic, generateEnginePath } from '../../engine'; @@ -18,10 +19,15 @@ export const SuggestedCurationsCallout: React.FC = () => { const { engine: { search_relevance_suggestions: searchRelevanceSuggestions }, } = useValues(EngineLogic); + const { hasPlatinumLicense } = useValues(LicensingLogic); const pendingCount = searchRelevanceSuggestions?.curation.pending; - if (typeof searchRelevanceSuggestions === 'undefined' || pendingCount === 0) { + if ( + typeof searchRelevanceSuggestions === 'undefined' || + pendingCount === 0 || + hasPlatinumLicense === false + ) { return null; }