Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
fcdce56
Initial copy/paste of component tree
scottybollinger Jan 5, 2021
76c6ce0
Replace withRouter HOC with hooks
scottybollinger Jan 5, 2021
95131ff
Migrate LicenseCallout component
scottybollinger Jan 5, 2021
e84ce1c
Update paths
scottybollinger Jan 5, 2021
d01a9ee
Remove conditional and passed in flash messages
scottybollinger Jan 5, 2021
4f15f61
Replace removed ConfirmModal
scottybollinger Jan 5, 2021
00ad23d
Use internal tools for determining license
scottybollinger Jan 5, 2021
d52964f
Fix a bunch of type issues
scottybollinger Jan 5, 2021
c065e9b
Remove telemetry settings section
scottybollinger Jan 5, 2021
adafc58
Add SettingsSubNav component
scottybollinger Jan 5, 2021
eb3ac4a
Add route and update nav
scottybollinger Jan 5, 2021
51aca27
Remove legacy AppView and sidenav
scottybollinger Jan 5, 2021
c75a440
Clear flash messages globally
scottybollinger Jan 5, 2021
fbc6d54
Remove global name change method call
scottybollinger Jan 5, 2021
ddba2a9
Refactor saveUpdatedConfig
scottybollinger Jan 5, 2021
5ac429e
Update logic file to use global flash messages
scottybollinger Jan 5, 2021
9c941a6
Update server routes
scottybollinger Jan 5, 2021
4cce471
Replace Rails http with kibana http
scottybollinger Jan 5, 2021
eaa96ab
Fix subnav
scottybollinger Jan 5, 2021
971d979
Update routes to use consistent syntax
scottybollinger Jan 5, 2021
3a0cf76
Shorten nav item copy
scottybollinger Jan 5, 2021
625a03b
Fix some random typos
scottybollinger Jan 6, 2021
95ea5ec
Replace React Router Link with helper
scottybollinger Jan 6, 2021
d1f36ff
Add i18n
scottybollinger Jan 6, 2021
8878579
Remove redundant clearing of flash messages
scottybollinger Jan 7, 2021
2656a29
Add unit tests for components
scottybollinger Jan 11, 2021
8ec1f9b
Add tests for router
scottybollinger Jan 11, 2021
b9cd89c
Store oauthApplication in mock for reuse
scottybollinger Jan 12, 2021
0c09579
Add tests for SettingsLogic
scottybollinger Jan 12, 2021
19a2ed6
Merge branch 'master' into scottybollinger/migrate-settings
kibanamachine Jan 12, 2021
4ba2337
Merge branch 'master' into scottybollinger/migrate-settings
kibanamachine Jan 15, 2021
2599da3
Merge branch 'master' into scottybollinger/migrate-settings
kibanamachine Jan 15, 2021
233f5eb
Fix typo
scottybollinger Jan 15, 2021
f693ecd
Remove unncessary imports
scottybollinger Jan 15, 2021
f0a10f9
Refactor to use new helpers when mocking
scottybollinger Jan 15, 2021
6cedfd7
Update logic test to use error helper
scottybollinger Jan 15, 2021
4d139d1
Fix type issue
scottybollinger Jan 15, 2021
0e2da9d
Merge branch 'master' into scottybollinger/migrate-settings
scottybollinger Jan 18, 2021
44b450e
Fix whitespace lint issue
scottybollinger Jan 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,15 @@ export const sourceConfigData = {
},
};

export const oauthApplication = {
name: 'app',
uid: '123uid123',
secret: 'shhhhhhhhh',
redirectUri: 'https://foo',
confidential: false,
nativeRedirectUri: 'https://bar',
};

export const exampleResult = {
sourceName: 'source',
searchResultConfig: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ import {
interface Props {
sourcesSubNav?: React.ReactNode;
groupsSubNav?: React.ReactNode;
settingsSubNav?: React.ReactNode;
}

export const WorkplaceSearchNav: React.FC<Props> = ({ sourcesSubNav, groupsSubNav }) => (
export const WorkplaceSearchNav: React.FC<Props> = ({
sourcesSubNav,
groupsSubNav,
settingsSubNav,
}) => (
<SideNav product={WORKPLACE_SEARCH_PLUGIN}>
<SideNavLink to="/" isRoot>
{NAV.OVERVIEW}
Expand All @@ -43,7 +48,7 @@ export const WorkplaceSearchNav: React.FC<Props> = ({ sourcesSubNav, groupsSubNa
<SideNavLink isExternal to={getWorkplaceSearchUrl(`#${SECURITY_PATH}`)}>
{NAV.SECURITY}
</SideNavLink>
<SideNavLink isExternal to={getWorkplaceSearchUrl(ORG_SETTINGS_PATH)}>
<SideNavLink subNav={settingsSubNav} to={ORG_SETTINGS_PATH}>
{NAV.SETTINGS}
</SideNavLink>
<EuiSpacer />
Expand Down
Original file line number Diff line number Diff line change
@@ -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 { LicenseCallout } from './license_callout';
Original file line number Diff line number Diff line change
@@ -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 { EuiLink, EuiText } from '@elastic/eui';

import { LicenseCallout } from '.';

describe('LicenseCallout', () => {
it('renders', () => {
const wrapper = shallow(<LicenseCallout message="foo" />);

expect(wrapper.find(EuiLink)).toHaveLength(1);
expect(wrapper.find(EuiText)).toHaveLength(1);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* 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 { EuiLink, EuiFlexItem, EuiFlexGroup, EuiText } from '@elastic/eui';

import { ENT_SEARCH_LICENSE_MANAGEMENT } from '../../../routes';

interface LicenseCalloutProps {
message?: string;
}

export const LicenseCallout: React.FC<LicenseCalloutProps> = ({ message }) => {
const title = (
<>
{message}{' '}
<EuiLink
className="wsLicenseLink"
target="_blank"
external
href={ENT_SEARCH_LICENSE_MANAGEMENT}
>
<strong>Explore Platinum features</strong>
</EuiLink>
</>
);

return (
<div className="wsLicenseCallout">
<EuiFlexGroup responsive={false}>
<EuiFlexItem grow={false}>
<div className="wsLicenseIcon">
<strong>&#8593;</strong>
</div>
</EuiFlexItem>
<EuiFlexItem>
<EuiText size="xs">{title}</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ export const NAV = {
SETTINGS: i18n.translate('xpack.enterpriseSearch.workplaceSearch.nav.settings', {
defaultMessage: 'Settings',
}),
SETTINGS_CUSTOMIZE: i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.nav.settingsCustomize',
{
defaultMessage: 'Customize',
}
),
SETTINGS_SOURCE_PRIORITIZATION: i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.nav.settingsSourcePrioritization',
{
defaultMessage: 'Content source connectors',
}
),
SETTINGS_OAUTH: i18n.translate('xpack.enterpriseSearch.workplaceSearch.nav.settingsOauth', {
defaultMessage: 'OAuth application',
}),
ADD_SOURCE: i18n.translate('xpack.enterpriseSearch.workplaceSearch.nav.addSource', {
defaultMessage: 'Add Source',
}),
Expand Down Expand Up @@ -275,43 +290,240 @@ export const DOCUMENTATION_LINK_TITLE = i18n.translate(
);

export const PUBLIC_KEY_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearc.publicKey.label',
'xpack.enterpriseSearch.workplaceSearch.publicKey.label',
{
defaultMessage: 'Public Key',
}
);

export const CONSUMER_KEY_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearc.consumerKey.label',
'xpack.enterpriseSearch.workplaceSearch.consumerKey.label',
{
defaultMessage: 'Consumer Key',
}
);

export const BASE_URI_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearc.baseUri.label',
'xpack.enterpriseSearch.workplaceSearch.baseUri.label',
{
defaultMessage: 'Base URI',
}
);

export const BASE_URL_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearc.baseUrl.label',
'xpack.enterpriseSearch.workplaceSearch.baseUrl.label',
{
defaultMessage: 'Base URL',
}
);

export const CLIENT_ID_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearc.clientId.label',
'xpack.enterpriseSearch.workplaceSearch.clientId.label',
{
defaultMessage: 'Client id',
}
);

export const CLIENT_SECRET_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearc.clientSecret.label',
'xpack.enterpriseSearch.workplaceSearch.clientSecret.label',
{
defaultMessage: 'Client secret',
}
);

export const CONFIDENTIAL_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.confidential.label',
{
defaultMessage: 'Confidential',
}
);

export const CONFIDENTIAL_HELP_TEXT = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.confidential.text',
{
defaultMessage:
'Deselect for environments in which the client secret cannot be kept confidential, such as native mobile apps and single page applications.',
}
);

export const CREDENTIALS_TITLE = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.credentials.title',
{
defaultMessage: 'Credentials',
}
);

export const CREDENTIALS_DESCRIPTION = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.credentials.description',
{
defaultMessage:
'Use the following credentials within your client to request access tokens from our authentication server.',
}
);

export const ORG_UPDATED_MESSAGE = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.settings.orgUpdated.message',
{
defaultMessage: 'Successfully updated organization.',
}
);

export const OAUTH_APP_UPDATED_MESSAGE = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.settings.oauthAppUpdated.message',
{
defaultMessage: 'Successfully updated application.',
}
);

export const SAVE_CHANGES_BUTTON = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.saveChanges.button',
{
defaultMessage: 'Save changes',
}
);

export const NAME_LABEL = i18n.translate('xpack.enterpriseSearch.workplaceSearch.name.label', {
defaultMessage: 'Name',
});

export const OAUTH_DESCRIPTION = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.oauth.description',
{
defaultMessage: 'Create an OAuth client for your organization.',
}
);

export const OAUTH_PERSISTED_DESCRIPTION = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.oauthPersisted.description',
{
defaultMessage:
"Access your organization's OAuth client credentials and manage OAuth settings.",
}
);

export const REDIRECT_URIS_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.redirectURIs.label',
{
defaultMessage: 'Redirect URIs',
}
);

export const REDIRECT_HELP_TEXT = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.redirectHelp.text',
{
defaultMessage: 'Provide one URI per line.',
}
);

export const REDIRECT_NATIVE_HELP_TEXT = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.redirectNativeHelp.text',
{
defaultMessage: 'For local development URIs, use format',
}
);

export const REDIRECT_SECURE_ERROR_TEXT = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.redirectSecureError.text',
{
defaultMessage: 'Cannot contain duplicate redirect URIs.',
}
);

export const REDIRECT_INSECURE_ERROR_TEXT = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.redirectInsecureError.text',
{
defaultMessage: 'Using an insecure redirect URI (http) is not recommended.',
}
);

export const LICENSE_MODAL_TITLE = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.licenseModal.title',
{
defaultMessage: 'Configuring OAuth for Custom Search Applications',
}
);

export const LICENSE_MODAL_DESCRIPTION = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.licenseModal.description',
{
defaultMessage:
'Configure an OAuth application for secure use of the Workplace Search Search API. Upgrade to a Platinum license to enable the Search API and create your OAuth application.',
}
);

export const LICENSE_MODAL_LINK = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.licenseModal.link',
{
defaultMessage: 'Explore Platinum features',
}
);

export const CUSTOMIZE_HEADER_TITLE = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.customize.header.title',
{
defaultMessage: 'Customize Workplace Search',
}
);

export const CUSTOMIZE_HEADER_DESCRIPTION = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.customize.header.description',
{
defaultMessage: 'Personalize general organization settings.',
}
);

export const CUSTOMIZE_NAME_LABEL = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.customize.name.label',
{
defaultMessage: 'Personalize general organization settings.',
}
);

export const CUSTOMIZE_NAME_BUTTON = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.customize.name.button',
{
defaultMessage: 'Save organization name',
}
);

export const UPDATE_BUTTON = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.update.button',
{
defaultMessage: 'Update',
}
);

export const CONFIGURE_BUTTON = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.configure.button',
{
defaultMessage: 'Configure',
}
);

export const PRIVATE_PLATINUM_LICENSE_CALLOUT = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.privatePlatinumCallout.text',
{
defaultMessage: 'Private Sources require a Platinum license.',
}
);

export const PRIVATE_SOURCE = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.privateSource.text',
{
defaultMessage: 'Private Source',
}
);

export const CONNECTORS_HEADER_TITLE = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.connectors.header.title',
{
defaultMessage: 'Content source connectors',
}
);

export const CONNECTORS_HEADER_DESCRIPTION = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.connectors.header.description',
{
defaultMessage: 'All of your configurable connectors.',
}
);
Loading