From fd35253c1ee7b5a41a9ba46455c5d13ae486de98 Mon Sep 17 00:00:00 2001 From: Thomas Zemp Date: Tue, 13 Aug 2024 16:20:57 +0200 Subject: [PATCH] fix: reference master docs [DHIS2-16445] --- src/components/DocsLink/DocsLink.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/components/DocsLink/DocsLink.js b/src/components/DocsLink/DocsLink.js index 7f13628b..5d13bde1 100644 --- a/src/components/DocsLink/DocsLink.js +++ b/src/components/DocsLink/DocsLink.js @@ -1,4 +1,3 @@ -import { useConfig } from '@dhis2/app-runtime' import { colors, Tooltip, IconQuestion24 } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' @@ -6,16 +5,9 @@ import i18n from '../../locales/index.js' import { getDocsKeyForSection } from '../../pages/sections.conf.js' import styles from './DocsLink.module.css' -const getDocsVersion = ({ major, minor, tag }) => { - if (tag === 'SNAPSHOT') { - return 'master' - } - return `${major}${minor}` -} - const DocsLink = ({ sectionKey }) => { - const { serverVersion } = useConfig() - const docsVersion = getDocsVersion(serverVersion) + // by default, use 'master' to prevent links to expired / removed docs + const docsVersion = 'master' const docsKey = getDocsKeyForSection(sectionKey) return (