Skip to content

Commit

Permalink
update docs link
Browse files Browse the repository at this point in the history
  • Loading branch information
semd committed Jun 17, 2024
1 parent 71d0615 commit d3bd19d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
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}/`;
const FLEET_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/fleet/${DOC_LINK_VERSION}/`;
const INTEGRATIONS_DEV_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/integrations-developer/${DOC_LINK_VERSION}/`;
const PLUGIN_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/plugins/${DOC_LINK_VERSION}/`;
const OBSERVABILITY_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/`;
const APM_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/apm/`;
Expand Down Expand Up @@ -861,6 +862,9 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
roleAndPrivileges: `${FLEET_DOCS}fleet-roles-and-privileges.html`,
proxiesSettings: `${FLEET_DOCS}fleet-agent-proxy-support.html`,
},
integrationDeveloper: {
upload: `${INTEGRATIONS_DEV_DOCS}upload-a-new-integration.html`,
},
ecs: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/ecs/${ECS_VERSION}/index.html`,
dataStreams: `${ELASTIC_WEBSITE_URL}guide/en/ecs/${ECS_VERSION}/ecs-data_stream.html`,
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,9 @@ export interface DocLinks {
roleAndPrivileges: string;
proxiesSettings: string;
}>;
readonly integrationDeveloper: {
upload: string;
};
readonly ecs: {
readonly guide: string;
readonly dataStreams: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ export const DocsLinkSubtitle = React.memo(() => {
defaultMessage="Have some issues? Please read the {link}"
values={{
link: (
<EuiLink
href={docLinks?.links.fleet.installAndUninstallIntegrationAssets} // TODO: Update the docs link to the correct place
target="_blank"
>
<EuiLink href={docLinks?.links.integrationDeveloper.upload} target="_blank">
<FormattedMessage
id="xpack.integrationAssistant.createIntegrationUpload.documentation"
defaultMessage="documentation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function createChangelog(packageDir: string): void {
function createReadme(packageDir: string, integration: Integration) {
const readmeDirPath = resolvePath(packageDir, '_dev/build/docs/');
ensureDirSync(readmeDirPath);
const readmeTemplate = nunjucks.render('package_description.njk', {
const readmeTemplate = nunjucks.render('package_readme.md.njk', {
package_name: integration.name,
data_streams: integration.dataStreams,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ export function registerRoutes(router: IRouter<IntegrationAssistantRouteHandlerC
body.templateDir = templateDir;
body.templateFiles = fs.readdirSync(templateDir);

const templateFile = resolvePath(templateDir, 'package_description.njk');
const templateFile = resolvePath(templateDir, 'package_readme.md.njk');
body.templateFile = templateFile;
body.templateContent = fs.readFileSync(templateFile).toString();

nunjucks.configure([templateDir], {
autoescape: false,
});

const readmeTemplate = nunjucks.render('package_description.njk', {
const readmeTemplate = nunjucks.render('package_readme.md.njk', {
package_name: 'testPackageName',
data_streams: ['testDataStreamName'],
});
Expand Down

0 comments on commit d3bd19d

Please sign in to comment.