[Enterprise Search] Add docLinks to Overview app (#137342)

* Add docLinks to Overview app

* Move docs.elastic.co Search UI doc links into docLinks

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Byron Hulcher 2022-07-28 12:34:26 -04:00 committed by GitHub
parent f2a14e2899
commit 8077888f1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 60 additions and 16 deletions

View file

@ -19,6 +19,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
const DOC_LINK_VERSION = meta.version;
const ELASTIC_WEBSITE_URL = meta.elasticWebsiteUrl;
const DOCS_WEBSITE_URL = meta.docsWebsiteUrl;
const ELASTICSEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/`;
const KIBANA_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/`;
@ -29,6 +30,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
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}/`;
const SEARCH_UI_DOCS = `${DOCS_WEBSITE_URL}search-ui/`;
return deepFreeze({
settings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/settings.html`,
@ -89,6 +91,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
systemModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/auditbeat/${DOC_LINK_VERSION}/auditbeat-module-system.html`,
},
appSearch: {
adaptiveRelevance: `${APP_SEARCH_DOCS}curations-guide.html#curations-reference-adaptive-relevance`,
apiRef: `${APP_SEARCH_DOCS}api-reference.html`,
apiClients: `${APP_SEARCH_DOCS}api-clients.html`,
apiKeys: `${APP_SEARCH_DOCS}authentication.html#authentication-api-keys`,
@ -98,6 +101,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
duplicateDocuments: `${APP_SEARCH_DOCS}web-crawler-reference.html#web-crawler-reference-content-deduplication`,
elasticsearchIndexedEngines: `${APP_SEARCH_DOCS}elasticsearch-engines.html`,
entryPoints: `${APP_SEARCH_DOCS}crawl-web-content.html#crawl-web-content-manage-entry-points`,
gettingStarted: `${APP_SEARCH_DOCS}getting-started.html`,
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`,
@ -122,6 +126,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
languageAnalyzers: `${ELASTICSEARCH_DOCS}analysis-lang-analyzer.html`,
licenseManagement: `${ENTERPRISE_SEARCH_DOCS}license-management.html`,
mailService: `${ENTERPRISE_SEARCH_DOCS}mailer-configuration.html`,
start: `${ENTERPRISE_SEARCH_DOCS}start.html`,
troubleshootSetup: `${ENTERPRISE_SEARCH_DOCS}troubleshoot-setup.html`,
usersAccess: `${ENTERPRISE_SEARCH_DOCS}users-access.html`,
},
@ -131,6 +136,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
confluenceCloud: `${WORKPLACE_SEARCH_DOCS}workplace-search-confluence-cloud-connector.html`,
confluenceCloudConnectorPackage: `${WORKPLACE_SEARCH_DOCS}confluence-cloud.html`,
confluenceServer: `${WORKPLACE_SEARCH_DOCS}workplace-search-confluence-server-connector.html`,
contentSources: `${WORKPLACE_SEARCH_DOCS}workplace-search-content-sources.html`,
customConnectorPackage: `${WORKPLACE_SEARCH_DOCS}custom-connector-package.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`,
@ -147,7 +153,8 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
jiraServer: `${WORKPLACE_SEARCH_DOCS}workplace-search-jira-server-connector.html`,
networkDrive: `${WORKPLACE_SEARCH_DOCS}network-drives.html`,
oneDrive: `${WORKPLACE_SEARCH_DOCS}workplace-search-onedrive-connector.html`,
permissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-permissions.html#organizational-sources-private-sources`,
permissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-permissions.html`,
privateSourcePermissions: `${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`,
@ -671,5 +678,9 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
routingAllocationDisabled: `${KIBANA_DOCS}resolve-migrations-failures.html#routing-allocation-disabled`,
clusterShardLimitExceeded: `${KIBANA_DOCS}resolve-migrations-failures.html#cluster-shard-limit-exceeded`,
},
searchUI: {
appSearch: `${SEARCH_UI_DOCS}tutorials/app-search`,
elasticsearch: `${SEARCH_UI_DOCS}tutorials/elasticsearch`,
},
});
};

View file

@ -16,5 +16,6 @@ export const getDocLinksMeta = ({ kibanaBranch }: GetDocLinksMetaOptions): DocLi
return {
version: kibanaBranch === 'main' ? 'master' : kibanaBranch,
elasticWebsiteUrl: 'https://www.elastic.co/',
docsWebsiteUrl: 'https://docs.elastic.co/',
};
};

View file

@ -12,6 +12,7 @@
export interface DocLinksMeta {
version: string;
elasticWebsiteUrl: string;
docsWebsiteUrl: string;
}
/**
@ -76,6 +77,7 @@ export interface DocLinks {
readonly start: string;
};
readonly appSearch: {
readonly adaptiveRelevance: string;
readonly apiRef: string;
readonly apiClients: string;
readonly apiKeys: string;
@ -85,6 +87,7 @@ export interface DocLinks {
readonly duplicateDocuments: string;
readonly elasticsearchIndexedEngines: string;
readonly entryPoints: string;
readonly gettingStarted: string;
readonly guide: string;
readonly indexingDocuments: string;
readonly indexingDocumentsSchema: string;
@ -109,6 +112,7 @@ export interface DocLinks {
readonly languageAnalyzers: string;
readonly licenseManagement: string;
readonly mailService: string;
readonly start: string;
readonly troubleshootSetup: string;
readonly usersAccess: string;
};
@ -118,6 +122,7 @@ export interface DocLinks {
readonly confluenceCloud: string;
readonly confluenceCloudConnectorPackage: string;
readonly confluenceServer: string;
readonly contentSources: string;
readonly customConnectorPackage: string;
readonly customSources: string;
readonly customSourcePermissions: string;
@ -135,6 +140,7 @@ export interface DocLinks {
readonly networkDrive: string;
readonly oneDrive: string;
readonly permissions: string;
readonly privateSourcePermissions: string;
readonly salesforce: string;
readonly security: string;
readonly serviceNow: string;
@ -426,4 +432,8 @@ export interface DocLinks {
readonly routingAllocationDisabled: string;
readonly clusterShardLimitExceeded: string;
};
readonly searchUI: {
readonly appSearch: string;
readonly elasticsearch: string;
};
}

View file

@ -140,7 +140,7 @@ export const ProductCard: React.FC<ProductCardProps> = ({
>
{resourceLinks.map((resource, index) => (
<EuiFlexItem key={index} grow={false}>
<EuiLink href={resource.to} external>
<EuiLink href={resource.to} target="_blank" external>
{resource.label}
</EuiLink>
</EuiFlexItem>

View file

@ -127,7 +127,7 @@ export const ProductSelector: React.FC<ProductSelectorProps> = ({
defaultMessage: 'Getting started with Elasticsearch',
}
),
to: '', // TODO Update docLink
to: docLinks.start,
},
{
label: i18n.translate(
@ -136,7 +136,7 @@ export const ProductSelector: React.FC<ProductSelectorProps> = ({
defaultMessage: 'Create a new index',
}
),
to: '', // TODO Update docLink
to: docLinks.start,
},
{
label: i18n.translate(
@ -145,7 +145,7 @@ export const ProductSelector: React.FC<ProductSelectorProps> = ({
defaultMessage: 'Set up a language client',
}
),
to: '', // TODO Update docLink
to: docLinks.start,
},
{
label: i18n.translate(
@ -154,7 +154,7 @@ export const ProductSelector: React.FC<ProductSelectorProps> = ({
defaultMessage: 'Search UI for Elasticsearch',
}
),
to: '', // TODO Update docLink
to: docLinks.searchUIElasticsearch,
},
]}
url={ELASTICSEARCH_PLUGIN.URL}
@ -196,7 +196,7 @@ export const ProductSelector: React.FC<ProductSelectorProps> = ({
defaultMessage: 'Getting started with App Search',
}
),
to: '', // TODO Update docLink
to: docLinks.appSearchGettingStarted,
},
{
label: i18n.translate(
@ -205,7 +205,7 @@ export const ProductSelector: React.FC<ProductSelectorProps> = ({
defaultMessage: 'Search UI for App Search',
}
),
to: '', // TODO Update docLink
to: docLinks.searchUIAppSearch,
},
{
label: i18n.translate(
@ -214,7 +214,7 @@ export const ProductSelector: React.FC<ProductSelectorProps> = ({
defaultMessage: 'Tune your search relevance',
}
),
to: '', // TODO Update docLink
to: docLinks.appSearchRelevance,
},
{
label: i18n.translate(
@ -223,7 +223,7 @@ export const ProductSelector: React.FC<ProductSelectorProps> = ({
defaultMessage: 'Automate with Adaptive Relevance',
}
),
to: '', // TODO Update docLink
to: docLinks.appSearchAdaptiveRelevance,
},
]}
url={APP_SEARCH_PLUGIN.URL}
@ -272,7 +272,7 @@ export const ProductSelector: React.FC<ProductSelectorProps> = ({
defaultMessage: 'Getting started with Workplace Search',
}
),
to: '', // TODO Update docLink
to: docLinks.workplaceSearchGettingStarted,
},
{
label: i18n.translate(
@ -281,7 +281,7 @@ export const ProductSelector: React.FC<ProductSelectorProps> = ({
defaultMessage: 'Set up your connectors',
}
),
to: '', // TODO Update docLink
to: docLinks.workplaceSearchContentSources,
},
{
label: i18n.translate(
@ -290,7 +290,7 @@ export const ProductSelector: React.FC<ProductSelectorProps> = ({
defaultMessage: 'Manage permissions',
}
),
to: '', // TODO Update docLink
to: docLinks.workplaceSearchPermissions,
},
]}
url={WORKPLACE_SEARCH_URL}

View file

@ -28,6 +28,7 @@ import { ENTERPRISE_SEARCH_CONTENT_PLUGIN } from '../../../../common/constants';
import welcomeGraphicDark from '../../../assets/images/welcome_dark.svg';
import welcomeGraphicLight from '../../../assets/images/welcome_light.svg';
import { NEW_INDEX_PATH } from '../../enterprise_search_content/routes';
import { docLinks } from '../doc_links';
import { EuiLinkTo } from '../react_router_helpers';
import './add_content_empty_prompt.scss';
@ -86,8 +87,7 @@ export const AddContentEmptyPrompt: React.FC<EmptyPromptProps> = ({ title, butto
</EuiLinkTo>
</EuiFlexItem>
<EuiFlexItem>
{/* TODO need link for Learn More link*/}
<EuiLink href="#" target="_blank">
<EuiLink href={docLinks.start} target="_blank">
{i18n.translate('xpack.enterpriseSearch.overview.emptyState.footerLinkTitle', {
defaultMessage: 'Learn more',
})}

View file

@ -8,6 +8,7 @@
import { DocLinksStart } from '@kbn/core/public';
class DocLinks {
public appSearchAdaptiveRelevance: string;
public appSearchApiClients: string;
public appSearchApiKeys: string;
public appSearchApis: string;
@ -17,6 +18,7 @@ class DocLinks {
public appSearchDuplicateDocuments: string;
public appSearchElasticsearchIndexedEngines: string;
public appSearchEntryPoints: string;
public appSearchGettingStarted: string;
public appSearchGuide: string;
public appSearchIndexingDocs: string;
public appSearchIndexingDocsSchema: string;
@ -69,11 +71,15 @@ class DocLinks {
public licenseManagement: string;
public pluginsIngestAttachment: string;
public queryDsl: string;
public searchUIAppSearch: string;
public searchUIElasticsearch: string;
public start: string;
public workplaceSearchApiKeys: string;
public workplaceSearchBox: string;
public workplaceSearchConfluenceCloud: string;
public workplaceSearchConfluenceCloudConnectorPackage: string;
public workplaceSearchConfluenceServer: string;
public workplaceSearchContentSources: string;
public workplaceSearchCustomConnectorPackage: string;
public workplaceSearchCustomSourcePermissions: string;
public workplaceSearchCustomSources: string;
@ -92,6 +98,7 @@ class DocLinks {
public workplaceSearchOneDrive: string;
public workplaceSearchOutlook: string;
public workplaceSearchPermissions: string;
public workplaceSearchPrivateSourcePermissions: string;
public workplaceSearchSalesforce: string;
public workplaceSearchSecurity: string;
public workplaceSearchServiceNow: string;
@ -104,6 +111,7 @@ class DocLinks {
public workplaceSearchZoom: string;
constructor() {
this.appSearchAdaptiveRelevance = '';
this.appSearchApis = '';
this.appSearchApiClients = '';
this.appSearchApiKeys = '';
@ -113,6 +121,7 @@ class DocLinks {
this.appSearchDuplicateDocuments = '';
this.appSearchEntryPoints = '';
this.appSearchElasticsearchIndexedEngines = '';
this.appSearchGettingStarted = '';
this.appSearchGuide = '';
this.appSearchIndexingDocs = '';
this.appSearchIndexingDocsSchema = '';
@ -165,11 +174,15 @@ class DocLinks {
this.licenseManagement = '';
this.pluginsIngestAttachment = '';
this.queryDsl = '';
this.searchUIAppSearch = '';
this.searchUIElasticsearch = '';
this.start = '';
this.workplaceSearchApiKeys = '';
this.workplaceSearchBox = '';
this.workplaceSearchConfluenceCloud = '';
this.workplaceSearchConfluenceCloudConnectorPackage = '';
this.workplaceSearchConfluenceServer = '';
this.workplaceSearchContentSources = '';
this.workplaceSearchCustomConnectorPackage = '';
this.workplaceSearchCustomSources = '';
this.workplaceSearchCustomSourcePermissions = '';
@ -188,6 +201,7 @@ class DocLinks {
this.workplaceSearchOneDrive = '';
this.workplaceSearchOutlook = '';
this.workplaceSearchPermissions = '';
this.workplaceSearchPrivateSourcePermissions = '';
this.workplaceSearchSalesforce = '';
this.workplaceSearchSecurity = '';
this.workplaceSearchServiceNow = '';
@ -201,6 +215,7 @@ class DocLinks {
}
public setDocLinks(docLinks: DocLinksStart): void {
this.appSearchAdaptiveRelevance = docLinks.links.appSearch.adaptiveRelevance;
this.appSearchApis = docLinks.links.appSearch.apiRef;
this.appSearchApiClients = docLinks.links.appSearch.apiClients;
this.appSearchApiKeys = docLinks.links.appSearch.apiKeys;
@ -211,6 +226,7 @@ class DocLinks {
this.appSearchElasticsearchIndexedEngines =
docLinks.links.appSearch.elasticsearchIndexedEngines;
this.appSearchEntryPoints = docLinks.links.appSearch.entryPoints;
this.appSearchGettingStarted = docLinks.links.appSearch.gettingStarted;
this.appSearchGuide = docLinks.links.appSearch.guide;
this.appSearchIndexingDocs = docLinks.links.appSearch.indexingDocuments;
this.appSearchIndexingDocsSchema = docLinks.links.appSearch.indexingDocumentsSchema;
@ -263,12 +279,16 @@ class DocLinks {
this.licenseManagement = docLinks.links.enterpriseSearch.licenseManagement;
this.pluginsIngestAttachment = docLinks.links.plugins.ingestAttachment;
this.queryDsl = docLinks.links.query.queryDsl;
this.searchUIAppSearch = docLinks.links.searchUI.appSearch;
this.searchUIElasticsearch = docLinks.links.searchUI.elasticsearch;
this.start = docLinks.links.enterpriseSearch.start;
this.workplaceSearchApiKeys = docLinks.links.workplaceSearch.apiKeys;
this.workplaceSearchBox = docLinks.links.workplaceSearch.box;
this.workplaceSearchConfluenceCloud = docLinks.links.workplaceSearch.confluenceCloud;
this.workplaceSearchConfluenceCloudConnectorPackage =
docLinks.links.workplaceSearch.confluenceCloudConnectorPackage;
this.workplaceSearchConfluenceServer = docLinks.links.workplaceSearch.confluenceServer;
this.workplaceSearchContentSources = docLinks.links.workplaceSearch.contentSources;
this.workplaceSearchCustomConnectorPackage =
docLinks.links.workplaceSearch.customConnectorPackage;
this.workplaceSearchCustomSources = docLinks.links.workplaceSearch.customSources;
@ -289,6 +309,8 @@ class DocLinks {
this.workplaceSearchNetworkDrive = docLinks.links.workplaceSearch.networkDrive;
this.workplaceSearchOneDrive = docLinks.links.workplaceSearch.oneDrive;
this.workplaceSearchPermissions = docLinks.links.workplaceSearch.permissions;
this.workplaceSearchPrivateSourcePermissions =
docLinks.links.workplaceSearch.privateSourcePermissions;
this.workplaceSearchSalesforce = docLinks.links.workplaceSearch.salesforce;
this.workplaceSearchSecurity = docLinks.links.workplaceSearch.security;
this.workplaceSearchServiceNow = docLinks.links.workplaceSearch.serviceNow;

View file

@ -125,7 +125,7 @@ export const ConfigCompleted: React.FC<ConfigCompletedProps> = ({
<EuiLink
target="_blank"
data-test-subj="ConfigCompletedPrivateSourcesDocsLink"
href={docLinks.workplaceSearchPermissions}
href={docLinks.workplaceSearchPrivateSourcePermissions}
>
{CONFIG_COMPLETED_PRIVATE_SOURCES_DOCS_LINK}
</EuiLink>