Skip to content

Commit

Permalink
fix: reference master docs [DHIS2-16445] (#1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp authored Aug 14, 2024
1 parent 80c4459 commit 0e6b824
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/components/DocsLink/DocsLink.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
import { useConfig } from '@dhis2/app-runtime'
import { colors, Tooltip, IconQuestion24 } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React from 'react'
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 (
Expand Down

0 comments on commit 0e6b824

Please sign in to comment.