Skip to content

Commit

Permalink
[Workplace Search] Refactor documentation links to use docLinks ser…
Browse files Browse the repository at this point in the history
…vice directly (#120675)

* Replace `sourceData` links with `docLinks`

* Replace Getting Started link

* Replace Custom Source Permissions link

* Replace Indexing Schedule link

* Replace Sync link

* Replace Permissions link

* Replace Sync link (Objects & Assets)

* Replace Custom Source links

* Replace External Identities links

* Replace Doc Permissions links

* Replace License Management links

* Replace Security links
  • Loading branch information
scottybollinger authored Dec 7, 2021
1 parent 27ef4b4 commit 069f35b
Show file tree
Hide file tree
Showing 18 changed files with 64 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import React from 'react';

import { EuiLink, EuiFlexItem, EuiFlexGroup, EuiText } from '@elastic/eui';

import { docLinks } from '../../../../shared/doc_links';

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

interface LicenseCalloutProps {
message?: string;
Expand All @@ -20,7 +21,7 @@ export const LicenseCallout: React.FC<LicenseCalloutProps> = ({ message }) => {
const title = (
<>
{message}{' '}
<EuiLink target="_blank" external href={ENT_SEARCH_LICENSE_MANAGEMENT}>
<EuiLink target="_blank" external href={docLinks.licenseManagement}>
<strong>{EXPLORE_PLATINUM_FEATURES_LINK}</strong>
</EuiLink>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

import { generatePath } from 'react-router-dom';

import { docLinks } from '../shared/doc_links';

import {
GITHUB_VIA_APP_SERVICE_TYPE,
GITHUB_ENTERPRISE_SERVER_VIA_APP_SERVICE_TYPE,
Expand All @@ -22,35 +20,6 @@ export const LOGOUT_ROUTE = '/logout';
export const LEAVE_FEEDBACK_EMAIL = '[email protected]';
export const LEAVE_FEEDBACK_URL = `mailto:${LEAVE_FEEDBACK_EMAIL}?Subject=Elastic%20Workplace%20Search%20Feedback`;

export const BOX_DOCS_URL = docLinks.workplaceSearchBox;
export const CONFLUENCE_DOCS_URL = docLinks.workplaceSearchConfluenceCloud;
export const CONFLUENCE_SERVER_DOCS_URL = docLinks.workplaceSearchConfluenceServer;
export const CUSTOM_SOURCE_DOCS_URL = docLinks.workplaceSearchCustomSources;
export const CUSTOM_API_DOCUMENT_PERMISSIONS_DOCS_URL =
docLinks.workplaceSearchCustomSourcePermissions;
export const DIFFERENT_SYNC_TYPES_DOCS_URL = docLinks.workplaceSearchIndexingSchedule;
export const DOCUMENT_PERMISSIONS_DOCS_URL = docLinks.workplaceSearchDocumentPermissions;
export const DROPBOX_DOCS_URL = docLinks.workplaceSearchDropbox;
export const ENT_SEARCH_LICENSE_MANAGEMENT = docLinks.licenseManagement;
export const EXTERNAL_IDENTITIES_DOCS_URL = docLinks.workplaceSearchExternalIdentities;
export const GETTING_STARTED_DOCS_URL = docLinks.workplaceSearchGettingStarted;
export const GITHUB_DOCS_URL = docLinks.workplaceSearchGitHub;
export const GITHUB_ENTERPRISE_DOCS_URL = docLinks.workplaceSearchGitHub;
export const GMAIL_DOCS_URL = docLinks.workplaceSearchGmail;
export const GOOGLE_DRIVE_DOCS_URL = docLinks.workplaceSearchGoogleDrive;
export const JIRA_DOCS_URL = docLinks.workplaceSearchJiraCloud;
export const JIRA_SERVER_DOCS_URL = docLinks.workplaceSearchJiraServer;
export const OBJECTS_AND_ASSETS_DOCS_URL = docLinks.workplaceSearchSynch;
export const ONEDRIVE_DOCS_URL = docLinks.workplaceSearchOneDrive;
export const PRIVATE_SOURCES_DOCS_URL = docLinks.workplaceSearchPermissions;
export const SALESFORCE_DOCS_URL = docLinks.workplaceSearchSalesforce;
export const SECURITY_DOCS_URL = docLinks.workplaceSearchSecurity;
export const SERVICENOW_DOCS_URL = docLinks.workplaceSearchServiceNow;
export const SHAREPOINT_DOCS_URL = docLinks.workplaceSearchSharePoint;
export const SLACK_DOCS_URL = docLinks.workplaceSearchSlack;
export const SYNCHRONIZATION_DOCS_URL = docLinks.workplaceSearchSynch;
export const ZENDESK_DOCS_URL = docLinks.workplaceSearchZendesk;

export const PERSONAL_PATH = '/p';

export const OAUTH_AUTHORIZE_PATH = `${PERSONAL_PATH}/oauth/authorize`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,9 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

import { docLinks } from '../../../../../shared/doc_links';
import { EuiLinkTo, EuiButtonTo } from '../../../../../shared/react_router_helpers';
import {
getSourcesPath,
ADD_SOURCE_PATH,
SECURITY_PATH,
PRIVATE_SOURCES_DOCS_URL,
} from '../../../../routes';
import { getSourcesPath, ADD_SOURCE_PATH, SECURITY_PATH } from '../../../../routes';

import {
CONFIG_COMPLETED_PRIVATE_SOURCES_DISABLED_LINK,
Expand Down Expand Up @@ -126,7 +122,7 @@ export const ConfigCompleted: React.FC<ConfigCompletedProps> = ({
<EuiLink
target="_blank"
data-test-subj="ConfigCompletedPrivateSourcesDocsLink"
href={PRIVATE_SOURCES_DOCS_URL}
href={docLinks.workplaceSearchPermissions}
>
{CONFIG_COMPLETED_PRIVATE_SOURCES_DOCS_LINK}
</EuiLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';

import { CUSTOM_SOURCE_DOCS_URL } from '../../../../routes';
import { docLinks } from '../../../../../shared/doc_links';

import { SOURCE_NAME_LABEL } from '../../constants';

Expand Down Expand Up @@ -63,7 +63,7 @@ export const ConfigureCustom: React.FC<ConfigureCustomProps> = ({
defaultMessage="{link} to learn more about Custom API Sources."
values={{
link: (
<EuiLink href={CUSTOM_SOURCE_DOCS_URL} target="_blank">
<EuiLink href={docLinks.workplaceSearchCustomSources} target="_blank">
{CONFIG_CUSTOM_LINK_TEXT}
</EuiLink>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
EuiText,
} from '@elastic/eui';

import { docLinks } from '../../../../../shared/doc_links';
import { EXPLORE_PLATINUM_FEATURES_LINK } from '../../../../constants';
import { ENT_SEARCH_LICENSE_MANAGEMENT } from '../../../../routes';

import {
SOURCE_FEATURES_DOCUMENT_LEVEL_PERMISSIONS_FEATURE,
Expand All @@ -45,7 +45,7 @@ export const DocumentPermissionsCallout: React.FC = () => {
</EuiText>
<EuiSpacer size="s" />
<EuiText size="xs">
<EuiLink external target="_blank" href={ENT_SEARCH_LICENSE_MANAGEMENT}>
<EuiLink external target="_blank" href={docLinks.licenseManagement}>
{EXPLORE_PLATINUM_FEATURES_LINK}
</EuiLink>
</EuiText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';

import { DOCUMENT_PERMISSIONS_DOCS_URL } from '../../../../routes';
import { docLinks } from '../../../../../shared/doc_links';
import { LEARN_MORE_LINK } from '../../constants';

import {
Expand All @@ -42,7 +42,7 @@ export const DocumentPermissionsField: React.FC<Props> = ({
setValue,
}) => {
const whichDocsLink = (
<EuiLink target="_blank" href={DOCUMENT_PERMISSIONS_DOCS_URL}>
<EuiLink target="_blank" href={docLinks.workplaceSearchDocumentPermissions}>
{CONNECT_WHICH_OPTION_LINK}
</EuiLink>
);
Expand All @@ -64,7 +64,7 @@ export const DocumentPermissionsField: React.FC<Props> = ({
defaultMessage="Document-level permissions are not yet available for this source. {link}"
values={{
link: (
<EuiLink target="_blank" href={DOCUMENT_PERMISSIONS_DOCS_URL}>
<EuiLink target="_blank" href={docLinks.workplaceSearchDocumentPermissions}>
{LEARN_MORE_LINK}
</EuiLink>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

import { docLinks } from '../../../../../shared/doc_links';
import { LicensingLogic } from '../../../../../shared/licensing';
import { EuiLinkTo } from '../../../../../shared/react_router_helpers';
import { LicenseBadge } from '../../../../components/shared/license_badge';
import {
SOURCES_PATH,
SOURCE_DISPLAY_SETTINGS_PATH,
CUSTOM_API_DOCUMENT_PERMISSIONS_DOCS_URL,
ENT_SEARCH_LICENSE_MANAGEMENT,
getContentSourcePath,
getSourcesPath,
} from '../../../../routes';
Expand Down Expand Up @@ -178,7 +177,10 @@ export const SaveCustom: React.FC<SaveCustomProps> = ({
defaultMessage="{link} manage content access content on individual or group attributes. Allow or deny access to specific documents."
values={{
link: (
<EuiLink target="_blank" href={CUSTOM_API_DOCUMENT_PERMISSIONS_DOCS_URL}>
<EuiLink
target="_blank"
href={docLinks.workplaceSearchCustomSourcePermissions}
>
{SAVE_CUSTOM_DOC_PERMISSIONS_LINK}
</EuiLink>
),
Expand All @@ -189,7 +191,7 @@ export const SaveCustom: React.FC<SaveCustomProps> = ({
<EuiSpacer size="xs" />
{!hasPlatinumLicense && (
<EuiText size="s">
<EuiLink target="_blank" href={ENT_SEARCH_LICENSE_MANAGEMENT}>
<EuiLink target="_blank" href={docLinks.licenseManagement}>
{LEARN_CUSTOM_FEATURES_BUTTON}
</EuiLink>
</EuiText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
import { FormattedMessage } from '@kbn/i18n-react';

import { CANCEL_BUTTON_LABEL, START_BUTTON_LABEL } from '../../../../shared/constants';
import { docLinks } from '../../../../shared/doc_links';
import { EuiListGroupItemTo, EuiLinkTo } from '../../../../shared/react_router_helpers';
import { AppLogic } from '../../../app_logic';
import aclImage from '../../../assets/supports_acl.svg';
Expand All @@ -46,10 +47,6 @@ import {
DOCUMENTATION_LINK_TITLE,
} from '../../../constants';
import {
CUSTOM_SOURCE_DOCS_URL,
DOCUMENT_PERMISSIONS_DOCS_URL,
ENT_SEARCH_LICENSE_MANAGEMENT,
EXTERNAL_IDENTITIES_DOCS_URL,
SYNC_FREQUENCY_PATH,
BLOCKED_TIME_WINDOWS_PATH,
getGroupPath,
Expand Down Expand Up @@ -347,7 +344,7 @@ export const Overview: React.FC = () => {
defaultMessage="{learnMoreLink} about permissions"
values={{
learnMoreLink: (
<EuiLink target="_blank" href={DOCUMENT_PERMISSIONS_DOCS_URL}>
<EuiLink target="_blank" href={docLinks.workplaceSearchDocumentPermissions}>
{LEARN_MORE_LINK}
</EuiLink>
),
Expand Down Expand Up @@ -408,7 +405,7 @@ export const Overview: React.FC = () => {
defaultMessage="The {externalIdentitiesLink} must be used to configure user access mappings. Read the guide to learn more."
values={{
externalIdentitiesLink: (
<EuiLink target="_blank" href={EXTERNAL_IDENTITIES_DOCS_URL}>
<EuiLink target="_blank" href={docLinks.workplaceSearchExternalIdentities}>
{EXTERNAL_IDENTITIES_LINK}
</EuiLink>
),
Expand Down Expand Up @@ -466,7 +463,7 @@ export const Overview: React.FC = () => {
</EuiText>
<EuiSpacer size="s" />
<EuiText size="s">
<EuiLink target="_blank" href={ENT_SEARCH_LICENSE_MANAGEMENT}>
<EuiLink target="_blank" href={docLinks.licenseManagement}>
{LEARN_CUSTOM_FEATURES_BUTTON}
</EuiLink>
</EuiText>
Expand Down Expand Up @@ -569,7 +566,7 @@ export const Overview: React.FC = () => {
defaultMessage="{learnMoreLink} about custom sources."
values={{
learnMoreLink: (
<EuiLink target="_blank" href={CUSTOM_SOURCE_DOCS_URL}>
<EuiLink target="_blank" href={docLinks.workplaceSearchCustomSources}>
{LEARN_MORE_LINK}
</EuiLink>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

import { docLinks } from '../../../../shared/doc_links';
import { TruncatedContent } from '../../../../shared/truncate';
import { ComponentLoader } from '../../../components/shared/component_loader';
import { TablePaginationBar } from '../../../components/shared/table_pagination_bar';
import { ViewContentHeader } from '../../../components/shared/view_content_header';
import { NAV, CUSTOM_SERVICE_TYPE } from '../../../constants';
import { CUSTOM_SOURCE_DOCS_URL } from '../../../routes';
import { SourceContentItem } from '../../../types';
import {
NO_CONTENT_MESSAGE,
Expand Down Expand Up @@ -110,7 +110,7 @@ export const SourceContent: React.FC = () => {
defaultMessage="Learn more about adding content in our {documentationLink}"
values={{
documentationLink: (
<EuiLink target="_blank" href={CUSTOM_SOURCE_DOCS_URL}>
<EuiLink target="_blank" href={docLinks.workplaceSearchCustomSources}>
{CUSTOM_DOCUMENTATION_LINK}
</EuiLink>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import moment from 'moment';

import { EuiButton, EuiCallOut, EuiHorizontalRule, EuiSpacer } from '@elastic/eui';

import { docLinks } from '../../../../shared/doc_links';
import { PageTemplateProps } from '../../../../shared/layout';
import { AppLogic } from '../../../app_logic';
import { WorkplaceSearchPageTemplate, PersonalDashboardLayout } from '../../../components/layout';
import { NAV } from '../../../constants';
import { ENT_SEARCH_LICENSE_MANAGEMENT } from '../../../routes';

import {
SOURCE_DISABLED_CALLOUT_TITLE,
Expand Down Expand Up @@ -53,7 +53,7 @@ export const SourceLayout: React.FC<PageTemplateProps> = ({
<>
<EuiCallOut title={SOURCE_DISABLED_CALLOUT_TITLE} color="warning" iconType="alert">
<p>{SOURCE_DISABLED_CALLOUT_DESCRIPTION}</p>
<EuiButton color="warning" href={ENT_SEARCH_LICENSE_MANAGEMENT}>
<EuiButton color="warning" href={docLinks.licenseManagement}>
{SOURCE_DISABLED_CALLOUT_BUTTON}
</EuiButton>
</EuiCallOut>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import {
} from '@elastic/eui';

import { SAVE_BUTTON_LABEL } from '../../../../../shared/constants';
import { docLinks } from '../../../../../shared/doc_links';
import { UnsavedChangesPrompt } from '../../../../../shared/unsaved_changes_prompt';
import { ViewContentHeader } from '../../../../components/shared/view_content_header';
import { NAV, RESET_BUTTON } from '../../../../constants';
import { DIFFERENT_SYNC_TYPES_DOCS_URL } from '../../../../routes';
import {
LEARN_MORE_LINK,
SOURCE_FREQUENCY_DESCRIPTION,
Expand Down Expand Up @@ -102,7 +102,7 @@ export const Frequency: React.FC<FrequencyProps> = ({ tabId }) => {
description={
<>
{SOURCE_FREQUENCY_DESCRIPTION}{' '}
<EuiLink href={DIFFERENT_SYNC_TYPES_DOCS_URL} external>
<EuiLink href={docLinks.workplaceSearchIndexingSchedule} external>
{LEARN_MORE_LINK}
</EuiLink>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import {
} from '@elastic/eui';

import { SAVE_BUTTON_LABEL } from '../../../../../shared/constants';
import { docLinks } from '../../../../../shared/doc_links';
import { UnsavedChangesPrompt } from '../../../../../shared/unsaved_changes_prompt';
import { ViewContentHeader } from '../../../../components/shared/view_content_header';
import { NAV, RESET_BUTTON } from '../../../../constants';
import { OBJECTS_AND_ASSETS_DOCS_URL } from '../../../../routes';
import {
LEARN_MORE_LINK,
SYNC_MANAGEMENT_CONTENT_EXTRACTION_LABEL,
Expand Down Expand Up @@ -87,7 +87,7 @@ export const ObjectsAndAssets: React.FC = () => {
description={
<>
{SOURCE_OBJECTS_AND_ASSETS_DESCRIPTION}{' '}
<EuiLink href={OBJECTS_AND_ASSETS_DOCS_URL} external>
<EuiLink href={docLinks.workplaceSearchSynch} external>
{LEARN_MORE_LINK}
</EuiLink>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { useActions, useValues } from 'kea';

import { EuiCallOut, EuiLink, EuiPanel, EuiSwitch, EuiSpacer, EuiText } from '@elastic/eui';

import { docLinks } from '../../../../../shared/doc_links';
import { ViewContentHeader } from '../../../../components/shared/view_content_header';
import { NAV } from '../../../../constants';
import { SYNCHRONIZATION_DOCS_URL } from '../../../../routes';
import {
LEARN_MORE_LINK,
SOURCE_SYNCHRONIZATION_DESCRIPTION,
Expand Down Expand Up @@ -68,7 +68,7 @@ export const Synchronization: React.FC = () => {
description={
<>
{SOURCE_SYNCHRONIZATION_DESCRIPTION}{' '}
<EuiLink href={SYNCHRONIZATION_DOCS_URL} external>
<EuiLink href={docLinks.workplaceSearchSynch} external>
{LEARN_MORE_LINK}
</EuiLink>
</>
Expand Down
Loading

0 comments on commit 069f35b

Please sign in to comment.