Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reference master docs [DHIS2-16445] (v40) #1075

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading