Skip to content

Commit

Permalink
Add workplace search links to doc link service (elastic#118814)
Browse files Browse the repository at this point in the history
Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
  • Loading branch information
2 people authored and TinLe committed Dec 22, 2021
1 parent 574d500 commit 05332d1
Show file tree
Hide file tree
Showing 57 changed files with 585 additions and 244 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ readonly links: {
readonly canvas: {
readonly guide: string;
};
readonly cloud: {
readonly indexManagement: string;
};
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
Expand Down Expand Up @@ -55,10 +58,64 @@ readonly links: {
readonly install: string;
readonly start: string;
};
readonly appSearch: {
readonly apiRef: string;
readonly apiClients: string;
readonly apiKeys: string;
readonly authentication: string;
readonly crawlRules: string;
readonly curations: string;
readonly duplicateDocuments: string;
readonly entryPoints: string;
readonly guide: string;
readonly indexingDocuments: string;
readonly indexingDocumentsSchema: string;
readonly logSettings: string;
readonly metaEngines: string;
readonly nativeAuth: string;
readonly precisionTuning: string;
readonly relevanceTuning: string;
readonly resultSettings: string;
readonly searchUI: string;
readonly security: string;
readonly standardAuth: string;
readonly synonyms: string;
readonly webCrawler: string;
readonly webCrawlerEventLogs: string;
};
readonly enterpriseSearch: {
readonly base: string;
readonly appSearchBase: string;
readonly workplaceSearchBase: string;
readonly configuration: string;
readonly licenseManagement: string;
readonly mailService: string;
readonly usersAccess: string;
};
readonly workplaceSearch: {
readonly box: string;
readonly confluenceCloud: string;
readonly confluenceServer: string;
readonly customSources: string;
readonly customSourcePermissions: string;
readonly documentPermissions: string;
readonly dropbox: string;
readonly externalIdentities: string;
readonly gitHub: string;
readonly gettingStarted: string;
readonly gmail: string;
readonly googleDrive: string;
readonly indexingSchedule: string;
readonly jiraCloud: string;
readonly jiraServer: string;
readonly nativeAuth: string;
readonly oneDrive: string;
readonly permissions: string;
readonly salesforce: string;
readonly security: string;
readonly serviceNow: string;
readonly sharePoint: string;
readonly slack: string;
readonly standardAuth: string;
readonly synch: string;
readonly zendesk: string;
};
readonly heartbeat: {
readonly base: string;
Expand Down

Large diffs are not rendered by default.

129 changes: 123 additions & 6 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export class DocLinksService {
const APM_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/apm/`;
const SECURITY_SOLUTION_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/`;
const STACK_GETTING_STARTED = `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack-get-started/${DOC_LINK_VERSION}/`;
const APP_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/app-search/${DOC_LINK_VERSION}/`;
const ENTERPRISE_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/enterprise-search/${DOC_LINK_VERSION}/`;
const WORKPLACE_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/workplace-search/${DOC_LINK_VERSION}/`;

return deepFreeze({
DOC_LINK_VERSION,
Expand All @@ -51,6 +54,9 @@ export class DocLinksService {
canvas: {
guide: `${KIBANA_DOCS}canvas.html`,
},
cloud: {
indexManagement: `${ELASTIC_WEBSITE_URL}/guide/en/cloud/current/ec-configure-index-management.html`,
},
dashboard: {
guide: `${KIBANA_DOCS}dashboard.html`,
drilldowns: `${KIBANA_DOCS}drilldowns.html`,
Expand All @@ -77,10 +83,64 @@ export class DocLinksService {
auditdModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/auditbeat/${DOC_LINK_VERSION}/auditbeat-module-auditd.html`,
systemModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/auditbeat/${DOC_LINK_VERSION}/auditbeat-module-system.html`,
},
appSearch: {
apiRef: `${APP_SEARCH_DOCS}api-reference.html`,
apiClients: `${APP_SEARCH_DOCS}api-clients.html`,
apiKeys: `${APP_SEARCH_DOCS}authentication.html#authentication-api-keys`,
authentication: `${APP_SEARCH_DOCS}authentication.html`,
crawlRules: `${APP_SEARCH_DOCS}crawl-web-content.html#crawl-web-content-manage-crawl-rules`,
curations: `${APP_SEARCH_DOCS}curations-guide.html`,
duplicateDocuments: `${APP_SEARCH_DOCS}web-crawler-reference.html#web-crawler-reference-content-deduplication`,
entryPoints: `${APP_SEARCH_DOCS}crawl-web-content.html#crawl-web-content-manage-entry-points`,
guide: `${APP_SEARCH_DOCS}index.html`,
indexingDocuments: `${APP_SEARCH_DOCS}indexing-documents-guide.html`,
indexingDocumentsSchema: `${APP_SEARCH_DOCS}indexing-documents-guide.html#indexing-documents-guide-schema`,
logSettings: `${APP_SEARCH_DOCS}logs.html`,
metaEngines: `${APP_SEARCH_DOCS}meta-engines-guide.html`,
nativeAuth: `${APP_SEARCH_DOCS}security-and-users.html#app-search-self-managed-security-and-user-management-elasticsearch-native-realm`,
precisionTuning: `${APP_SEARCH_DOCS}precision-tuning.html`,
relevanceTuning: `${APP_SEARCH_DOCS}relevance-tuning-guide.html`,
resultSettings: `${APP_SEARCH_DOCS}result-settings-guide.html`,
searchUI: `${APP_SEARCH_DOCS}reference-ui-guide.html`,
security: `${APP_SEARCH_DOCS}security-and-users.html`,
standardAuth: `${APP_SEARCH_DOCS}security-and-users.html#app-search-self-managed-security-and-user-management-standard`,
synonyms: `${APP_SEARCH_DOCS}synonyms-guide.html`,
webCrawler: `${APP_SEARCH_DOCS}web-crawler.html`,
webCrawlerEventLogs: `${APP_SEARCH_DOCS}view-web-crawler-events-logs.html`,
},
enterpriseSearch: {
base: `${ELASTIC_WEBSITE_URL}guide/en/enterprise-search/${DOC_LINK_VERSION}`,
appSearchBase: `${ELASTIC_WEBSITE_URL}guide/en/app-search/${DOC_LINK_VERSION}`,
workplaceSearchBase: `${ELASTIC_WEBSITE_URL}guide/en/workplace-search/${DOC_LINK_VERSION}`,
configuration: `${ENTERPRISE_SEARCH_DOCS}configuration.html`,
licenseManagement: `${ENTERPRISE_SEARCH_DOCS}license-management.html`,
mailService: `${ENTERPRISE_SEARCH_DOCS}mailer-configuration.html`,
usersAccess: `${ENTERPRISE_SEARCH_DOCS}users-access.html`,
},
workplaceSearch: {
box: `${WORKPLACE_SEARCH_DOCS}workplace-search-box-connector.html`,
confluenceCloud: `${WORKPLACE_SEARCH_DOCS}workplace-search-confluence-cloud-connector.html`,
confluenceServer: `${WORKPLACE_SEARCH_DOCS}workplace-search-confluence-server-connector.html`,
customSources: `${WORKPLACE_SEARCH_DOCS}workplace-search-custom-api-sources.html`,
customSourcePermissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-custom-api-sources.html#custom-api-source-document-level-access-control`,
documentPermissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-sources-document-permissions.html`,
dropbox: `${WORKPLACE_SEARCH_DOCS}workplace-search-dropbox-connector.html`,
externalIdentities: `${WORKPLACE_SEARCH_DOCS}workplace-search-external-identities-api.html`,
gettingStarted: `${WORKPLACE_SEARCH_DOCS}workplace-search-getting-started.html`,
gitHub: `${WORKPLACE_SEARCH_DOCS}workplace-search-github-connector.html`,
gmail: `${WORKPLACE_SEARCH_DOCS}workplace-search-gmail-connector.html`,
googleDrive: `${WORKPLACE_SEARCH_DOCS}workplace-search-google-drive-connector.html`,
indexingSchedule: `${WORKPLACE_SEARCH_DOCS}workplace-search-customizing-indexing-rules.html#_indexing_schedule`,
jiraCloud: `${WORKPLACE_SEARCH_DOCS}workplace-search-jira-cloud-connector.html`,
jiraServer: `${WORKPLACE_SEARCH_DOCS}workplace-search-jira-server-connector.html`,
nativeAuth: `${WORKPLACE_SEARCH_DOCS}workplace-search-security.html#elasticsearch-native-realm`,
oneDrive: `${WORKPLACE_SEARCH_DOCS}workplace-search-onedrive-connector.html`,
permissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-permissions.html#organizational-sources-private-sources`,
salesforce: `${WORKPLACE_SEARCH_DOCS}workplace-search-salesforce-connector.html`,
security: `${WORKPLACE_SEARCH_DOCS}workplace-search-security.html`,
serviceNow: `${WORKPLACE_SEARCH_DOCS}workplace-search-servicenow-connector.html`,
sharePoint: `${WORKPLACE_SEARCH_DOCS}workplace-search-sharepoint-online-connector.html`,
slack: `${WORKPLACE_SEARCH_DOCS}workplace-search-slack-connector.html`,
standardAuth: `${WORKPLACE_SEARCH_DOCS}workplace-search-security.html#standard`,
synch: `${WORKPLACE_SEARCH_DOCS}workplace-search-customizing-indexing-rules.html`,
zendesk: `${WORKPLACE_SEARCH_DOCS}workplace-search-zendesk-connector.html`,
},
metricbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}`,
Expand Down Expand Up @@ -550,6 +610,9 @@ export interface DocLinksStart {
readonly canvas: {
readonly guide: string;
};
readonly cloud: {
readonly indexManagement: string;
};
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
Expand Down Expand Up @@ -581,10 +644,64 @@ export interface DocLinksStart {
readonly install: string;
readonly start: string;
};
readonly appSearch: {
readonly apiRef: string;
readonly apiClients: string;
readonly apiKeys: string;
readonly authentication: string;
readonly crawlRules: string;
readonly curations: string;
readonly duplicateDocuments: string;
readonly entryPoints: string;
readonly guide: string;
readonly indexingDocuments: string;
readonly indexingDocumentsSchema: string;
readonly logSettings: string;
readonly metaEngines: string;
readonly nativeAuth: string;
readonly precisionTuning: string;
readonly relevanceTuning: string;
readonly resultSettings: string;
readonly searchUI: string;
readonly security: string;
readonly standardAuth: string;
readonly synonyms: string;
readonly webCrawler: string;
readonly webCrawlerEventLogs: string;
};
readonly enterpriseSearch: {
readonly base: string;
readonly appSearchBase: string;
readonly workplaceSearchBase: string;
readonly configuration: string;
readonly licenseManagement: string;
readonly mailService: string;
readonly usersAccess: string;
};
readonly workplaceSearch: {
readonly box: string;
readonly confluenceCloud: string;
readonly confluenceServer: string;
readonly customSources: string;
readonly customSourcePermissions: string;
readonly documentPermissions: string;
readonly dropbox: string;
readonly externalIdentities: string;
readonly gitHub: string;
readonly gettingStarted: string;
readonly gmail: string;
readonly googleDrive: string;
readonly indexingSchedule: string;
readonly jiraCloud: string;
readonly jiraServer: string;
readonly nativeAuth: string;
readonly oneDrive: string;
readonly permissions: string;
readonly salesforce: string;
readonly security: string;
readonly serviceNow: string;
readonly sharePoint: string;
readonly slack: string;
readonly standardAuth: string;
readonly synch: string;
readonly zendesk: string;
};
readonly heartbeat: {
readonly base: string;
Expand Down
63 changes: 60 additions & 3 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,9 @@ export interface DocLinksStart {
readonly canvas: {
readonly guide: string;
};
readonly cloud: {
readonly indexManagement: string;
};
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
Expand Down Expand Up @@ -537,10 +540,64 @@ export interface DocLinksStart {
readonly install: string;
readonly start: string;
};
readonly appSearch: {
readonly apiRef: string;
readonly apiClients: string;
readonly apiKeys: string;
readonly authentication: string;
readonly crawlRules: string;
readonly curations: string;
readonly duplicateDocuments: string;
readonly entryPoints: string;
readonly guide: string;
readonly indexingDocuments: string;
readonly indexingDocumentsSchema: string;
readonly logSettings: string;
readonly metaEngines: string;
readonly nativeAuth: string;
readonly precisionTuning: string;
readonly relevanceTuning: string;
readonly resultSettings: string;
readonly searchUI: string;
readonly security: string;
readonly standardAuth: string;
readonly synonyms: string;
readonly webCrawler: string;
readonly webCrawlerEventLogs: string;
};
readonly enterpriseSearch: {
readonly base: string;
readonly appSearchBase: string;
readonly workplaceSearchBase: string;
readonly configuration: string;
readonly licenseManagement: string;
readonly mailService: string;
readonly usersAccess: string;
};
readonly workplaceSearch: {
readonly box: string;
readonly confluenceCloud: string;
readonly confluenceServer: string;
readonly customSources: string;
readonly customSourcePermissions: string;
readonly documentPermissions: string;
readonly dropbox: string;
readonly externalIdentities: string;
readonly gitHub: string;
readonly gettingStarted: string;
readonly gmail: string;
readonly googleDrive: string;
readonly indexingSchedule: string;
readonly jiraCloud: string;
readonly jiraServer: string;
readonly nativeAuth: string;
readonly oneDrive: string;
readonly permissions: string;
readonly salesforce: string;
readonly security: string;
readonly serviceNow: string;
readonly sharePoint: string;
readonly slack: string;
readonly standardAuth: string;
readonly synch: string;
readonly zendesk: string;
};
readonly heartbeat: {
readonly base: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { shallow } from 'enzyme';

import { EuiEmptyPrompt, EuiButton } from '@elastic/eui';

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

import { EmptyState } from './';

describe('EmptyState', () => {
Expand All @@ -21,7 +23,7 @@ describe('EmptyState', () => {

expect(wrapper.find('h2').text()).toEqual('No API events in the last 24 hours');
expect(wrapper.find(EuiButton).prop('href')).toEqual(
expect.stringContaining('/api-reference.html')
expect.stringContaining(docLinks.appSearchApis)
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
import React from 'react';

import { EuiButton, EuiEmptyPrompt } from '@elastic/eui';

import { i18n } from '@kbn/i18n';

import { DOCS_PREFIX } from '../../../routes';
import { API_DOCS_URL } from '../../../routes';

export const EmptyState: React.FC = () => (
<EuiEmptyPrompt
Expand All @@ -30,12 +31,7 @@ export const EmptyState: React.FC = () => (
</p>
}
actions={
<EuiButton
size="s"
target="_blank"
iconType="popout"
href={`${DOCS_PREFIX}/api-reference.html`}
>
<EuiButton size="s" target="_blank" iconType="popout" href={API_DOCS_URL}>
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.apiLogs.empty.buttonLabel', {
defaultMessage: 'View the API reference',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { clearFlashMessages, flashSuccessToast } from '../../../../shared/flash_
import { GenericEndpointInlineEditableTable } from '../../../../shared/tables/generic_endpoint_inline_editable_table';
import { InlineEditableTableColumn } from '../../../../shared/tables/inline_editable_table/types';
import { ItemWithAnID } from '../../../../shared/tables/types';
import { DOCS_PREFIX } from '../../../routes';
import { CRAWL_RULES_DOCS_URL } from '../../../routes';
import { CrawlerSingleDomainLogic } from '../crawler_single_domain_logic';
import {
CrawlerPolicies,
Expand All @@ -53,11 +53,7 @@ const DEFAULT_DESCRIPTION = (
defaultMessage="Create a crawl rule to include or exclude pages whose URL matches the rule. Rules run in sequential order, and each URL is evaluated according to the first match. {link}"
values={{
link: (
<EuiLink
href={`${DOCS_PREFIX}/crawl-web-content.html#crawl-web-content-manage-crawl-rules`}
target="_blank"
external
>
<EuiLink href={CRAWL_RULES_DOCS_URL} target="_blank" external>
{i18n.translate(
'xpack.enterpriseSearch.appSearch.crawler.crawlRulesTable.descriptionLinkText',
{ defaultMessage: 'Learn more about crawl rules' }
Expand Down
Loading

0 comments on commit 05332d1

Please sign in to comment.