Skip to content

Commit

Permalink
Use documentation link service for Watcher (#93339)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodewig authored Mar 16, 2021
1 parent 4a83a02 commit 6c9cfd4
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions x-pack/plugins/watcher/public/application/app_context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@ interface ContextValue extends Omit<AppDeps, 'docLinks'> {

const AppContext = createContext<ContextValue>(null as any);

// eslint-disable-next-line @typescript-eslint/naming-convention
const generateDocLinks = ({ ELASTIC_WEBSITE_URL, DOC_LINK_VERSION }: DocLinksStart) => {
const elasticDocLinkBase = `${ELASTIC_WEBSITE_URL}guide/en/`;
const esBase = `${elasticDocLinkBase}elasticsearch/reference/${DOC_LINK_VERSION}`;
const kibanaBase = `${elasticDocLinkBase}kibana/${DOC_LINK_VERSION}`;
const putWatchApiUrl = `${esBase}/watcher-api-put-watch.html`;
const executeWatchApiUrl = `${esBase}/watcher-api-execute-watch.html#watcher-api-execute-watch-action-mode`;
const watcherGettingStartedUrl = `${kibanaBase}/watcher-ui.html`;
const generateDocLinks = ({ links }: DocLinksStart) => {
const putWatchApiUrl = `${links.apis.putWatch}`;
const executeWatchApiUrl = `${links.apis.executeWatchActionModes}`;
const watcherGettingStartedUrl = `${links.watcher.ui}`;
const watchActionsConfigurationMap = {
[ACTION_TYPES.SLACK]: `${esBase}/actions-slack.html#configuring-slack`,
[ACTION_TYPES.PAGERDUTY]: `${esBase}/actions-pagerduty.html#configuring-pagerduty`,
[ACTION_TYPES.JIRA]: `${esBase}/actions-jira.html#configuring-jira`,
[ACTION_TYPES.SLACK]: `${links.watcher.slackAction}`,
[ACTION_TYPES.PAGERDUTY]: `${links.watcher.pagerDutyAction}`,
[ACTION_TYPES.JIRA]: `${links.watcher.jiraAction}`,
};

return {
Expand Down

0 comments on commit 6c9cfd4

Please sign in to comment.