Skip to content

Commit 97ff87c

Browse files
authored
[7.15] Replace hard-coded doc links in uptime #111075 (#111814)
1 parent 7ceb5a0 commit 97ff87c

File tree

9 files changed

+32
-11
lines changed

9 files changed

+32
-11
lines changed

docs/development/core/public/kibana-plugin-core-public.chromestart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ core.chrome.setHelpExtension(elem => {
6060
| [getHelpExtension$()](./kibana-plugin-core-public.chromestart.gethelpextension_.md) | Get an observable of the current custom help conttent |
6161
| [getIsNavDrawerLocked$()](./kibana-plugin-core-public.chromestart.getisnavdrawerlocked_.md) | Get an observable of the current locked state of the nav drawer. |
6262
| [getIsVisible$()](./kibana-plugin-core-public.chromestart.getisvisible_.md) | Get an observable of the current visibility state of the chrome. |
63+
| [hasHeaderBanner$()](./kibana-plugin-core-public.chromestart.hasheaderbanner_.md) | Get an observable of the current header banner presence state. |
6364
| [removeApplicationClass(className)](./kibana-plugin-core-public.chromestart.removeapplicationclass.md) | Remove a className added with <code>addApplicationClass()</code>. If className is unknown it is ignored. |
6465
| [setAppTitle(appTitle)](./kibana-plugin-core-public.chromestart.setapptitle.md) | Sets the current app's title |
65-
| [hasHeaderBanner$()](./kibana-plugin-core-public.chromestart.hasheaderbanner_.md) | Get an observable of the current header banner presence state. |
6666
| [setBadge(badge)](./kibana-plugin-core-public.chromestart.setbadge.md) | Override the current badge |
6767
| [setBrand(brand)](./kibana-plugin-core-public.chromestart.setbrand.md) | Set the brand configuration. |
6868
| [setBreadcrumbs(newBreadcrumbs)](./kibana-plugin-core-public.chromestart.setbreadcrumbs.md) | Override the current set of breadcrumbs |

docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,13 @@ readonly links: {
180180
timeUnits: string;
181181
updateTransform: string;
182182
}>;
183-
readonly observability: Record<string, string>;
183+
readonly observability: Readonly<{
184+
guide: string;
185+
monitorStatus: string;
186+
monitorUptime: string;
187+
tlsCertificate: string;
188+
uptimeDurationAnomaly: string;
189+
}>;
184190
readonly alerting: Record<string, string>;
185191
readonly maps: Record<string, string>;
186192
readonly monitoring: Record<string, string>;

docs/development/core/public/kibana-plugin-core-public.doclinksstart.md

Lines changed: 1 addition & 2 deletions
Large diffs are not rendered by default.

src/core/public/doc_links/doc_links_service.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ export class DocLinksService {
275275
},
276276
observability: {
277277
guide: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/index.html`,
278+
monitorStatus: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-status-alert.html`,
279+
monitorUptime: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-uptime.html`,
280+
tlsCertificate: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/tls-certificate-alert.html`,
281+
uptimeDurationAnomaly: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/duration-anomaly-alert.html`,
278282
},
279283
alerting: {
280284
guide: `${KIBANA_DOCS}create-and-manage-rules.html`,
@@ -623,7 +627,13 @@ export interface DocLinksStart {
623627
timeUnits: string;
624628
updateTransform: string;
625629
}>;
626-
readonly observability: Record<string, string>;
630+
readonly observability: Readonly<{
631+
guide: string;
632+
monitorStatus: string;
633+
monitorUptime: string;
634+
tlsCertificate: string;
635+
uptimeDurationAnomaly: string;
636+
}>;
627637
readonly alerting: Record<string, string>;
628638
readonly maps: Record<string, string>;
629639
readonly monitoring: Record<string, string>;

src/core/public/public.api.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,13 @@ export interface DocLinksStart {
660660
timeUnits: string;
661661
updateTransform: string;
662662
}>;
663-
readonly observability: Record<string, string>;
663+
readonly observability: Readonly<{
664+
guide: string;
665+
monitorStatus: string;
666+
monitorUptime: string;
667+
tlsCertificate: string;
668+
uptimeDurationAnomaly: string;
669+
}>;
664670
readonly alerting: Record<string, string>;
665671
readonly maps: Record<string, string>;
666672
readonly monitoring: Record<string, string>;

x-pack/plugins/uptime/public/apps/render_app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function renderApp(
2727
const {
2828
application: { capabilities },
2929
chrome: { setBadge, setHelpExtension },
30-
docLinks: { DOC_LINK_VERSION, ELASTIC_WEBSITE_URL },
30+
docLinks,
3131
http: { basePath },
3232
i18n,
3333
} = core;
@@ -59,7 +59,7 @@ export function renderApp(
5959
links: [
6060
{
6161
linkType: 'documentation',
62-
href: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-uptime.html`,
62+
href: `${docLinks.links.observability.monitorUptime}`,
6363
},
6464
{
6565
linkType: 'discuss',

x-pack/plugins/uptime/public/lib/alert_types/duration_anomaly.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const initDurationAnomalyAlertType: AlertTypeInitializer = ({
2626
id: CLIENT_ALERT_TYPES.DURATION_ANOMALY,
2727
iconClass: 'uptimeApp',
2828
documentationUrl(docLinks) {
29-
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/observability/${docLinks.DOC_LINK_VERSION}/duration-anomaly-alert.html`;
29+
return `${docLinks.links.observability.uptimeDurationAnomaly}`;
3030
},
3131
alertParamsExpression: (params: unknown) => (
3232
<DurationAnomalyAlert core={core} plugins={plugins} params={params} />

x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const initMonitorStatusAlertType: AlertTypeInitializer = ({
3737
description,
3838
iconClass: 'uptimeApp',
3939
documentationUrl(docLinks) {
40-
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/observability/${docLinks.DOC_LINK_VERSION}/monitor-status-alert.html`;
40+
return `${docLinks.links.observability.monitorStatus}`;
4141
},
4242
alertParamsExpression: (params: any) => (
4343
<MonitorStatusAlert core={core} plugins={plugins} params={params} />

x-pack/plugins/uptime/public/lib/alert_types/tls.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const initTlsAlertType: AlertTypeInitializer = ({
2323
id: CLIENT_ALERT_TYPES.TLS,
2424
iconClass: 'uptimeApp',
2525
documentationUrl(docLinks) {
26-
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/observability/${docLinks.DOC_LINK_VERSION}/tls-certificate-alert.html`;
26+
return `${docLinks.links.observability.tlsCertificate}`;
2727
},
2828
alertParamsExpression: (params: any) => (
2929
<TLSAlert core={core} plugins={plugins} params={params} />

0 commit comments

Comments
 (0)