From c60c36f4ffb1c7cd52e371c997c99ba7f43dfcb6 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Mon, 2 Nov 2020 14:28:27 -0600 Subject: [PATCH 1/2] [Enterprise Search] Migrate shared LicenseBadge component --- .../shared/license_badge/index.ts | 7 +++++++ .../shared/license_badge/license_badge.scss | 11 ++++++++++ .../license_badge/license_badge.test.tsx | 21 +++++++++++++++++++ .../shared/license_badge/license_badge.tsx | 18 ++++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 x-pack/plugins/enterprise_search/public/applications/shared/license_badge/index.ts create mode 100644 x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.scss create mode 100644 x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.test.tsx create mode 100644 x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.tsx diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/index.ts b/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/index.ts new file mode 100644 index 00000000000000..11549f36df47a5 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/index.ts @@ -0,0 +1,7 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export { LicenseBadge } from './license_badge'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.scss b/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.scss new file mode 100644 index 00000000000000..f295194b7a130a --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.scss @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +.wsLicenseBadge { + &__text { + color: white; + } +} diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.test.tsx new file mode 100644 index 00000000000000..0b50069a7ece10 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.test.tsx @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React from 'react'; +import { shallow } from 'enzyme'; + +import { EuiBadge } from '@elastic/eui'; + +import { LicenseBadge } from './'; + +describe('LicenseBadge', () => { + it('renders', () => { + const wrapper = shallow(); + + expect(wrapper.find(EuiBadge)).toHaveLength(1); + expect(wrapper.find('span').text()).toEqual('Platinum Feature'); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.tsx new file mode 100644 index 00000000000000..1e665d1567145a --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.tsx @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import React from 'react'; + +import { EuiBadge } from '@elastic/eui'; + +import './license_badge.scss'; + +const licenseColor = '#00A7B1'; + +export const LicenseBadge: React.FC = () => ( + + Platinum Feature + +); From 3f2eb6dbdbe97903b5558878558955f33e0d13d6 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Mon, 2 Nov 2020 14:34:16 -0600 Subject: [PATCH 2/2] Move files to Workplace Search dir I mistakenly thought these were shared at the Enterprise Search level --- .../components}/shared/license_badge/index.ts | 0 .../components}/shared/license_badge/license_badge.scss | 0 .../components}/shared/license_badge/license_badge.test.tsx | 0 .../components}/shared/license_badge/license_badge.tsx | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename x-pack/plugins/enterprise_search/public/applications/{ => workplace_search/components}/shared/license_badge/index.ts (100%) rename x-pack/plugins/enterprise_search/public/applications/{ => workplace_search/components}/shared/license_badge/license_badge.scss (100%) rename x-pack/plugins/enterprise_search/public/applications/{ => workplace_search/components}/shared/license_badge/license_badge.test.tsx (100%) rename x-pack/plugins/enterprise_search/public/applications/{ => workplace_search/components}/shared/license_badge/license_badge.tsx (100%) diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/index.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/license_badge/index.ts similarity index 100% rename from x-pack/plugins/enterprise_search/public/applications/shared/license_badge/index.ts rename to x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/license_badge/index.ts diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.scss b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/license_badge/license_badge.scss similarity index 100% rename from x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.scss rename to x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/license_badge/license_badge.scss diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/license_badge/license_badge.test.tsx similarity index 100% rename from x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.test.tsx rename to x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/license_badge/license_badge.test.tsx diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/license_badge/license_badge.tsx similarity index 100% rename from x-pack/plugins/enterprise_search/public/applications/shared/license_badge/license_badge.tsx rename to x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/license_badge/license_badge.tsx