diff --git a/src/backend/InvenTree/InvenTree/version.py b/src/backend/InvenTree/InvenTree/version.py index 49e9ef6f6f..ac31999f04 100644 --- a/src/backend/InvenTree/InvenTree/version.py +++ b/src/backend/InvenTree/InvenTree/version.py @@ -133,27 +133,14 @@ def isInvenTreeDevelopmentVersion() -> bool: return inventreeVersion().endswith('dev') -def inventreeDocsVersion() -> str: - """Return the version string matching the latest documentation. - - Development -> "latest" - Release -> "major.minor.sub" e.g. "0.5.2" - """ - if isInvenTreeDevelopmentVersion(): - return 'latest' - - return INVENTREE_SW_VERSION - - def inventreeDocUrl() -> str: """Return URL for InvenTree documentation site.""" - tag = inventreeDocsVersion() - return f'https://docs.inventree.org/en/{tag}' + return 'https://docs.inventree.org' def inventreeAppUrl() -> str: """Return URL for InvenTree app site.""" - return 'https://docs.inventree.org/en/stable/app/' + return 'https://docs.inventree.org/en/latest/app/' def inventreeGithubUrl() -> str: diff --git a/src/frontend/src/components/modals/AboutInvenTreeModal.tsx b/src/frontend/src/components/modals/AboutInvenTreeModal.tsx index 4233c12d1a..12a6a3868e 100644 --- a/src/frontend/src/components/modals/AboutInvenTreeModal.tsx +++ b/src/frontend/src/components/modals/AboutInvenTreeModal.tsx @@ -19,6 +19,7 @@ import { ApiEndpoints } from '@lib/enums/ApiEndpoints'; import { apiUrl } from '@lib/functions/Api'; import { useShallow } from 'zustand/react/shallow'; import { api } from '../../App'; +import { docLinks } from '../../defaults/links'; import { generateUrl } from '../../functions/urls'; import { useServerApiState } from '../../states/ServerApiState'; @@ -111,7 +112,7 @@ const AboutContent = ({ { ref: 'server', title: InvenTree Version, - link: 'https://github.com/inventree/InvenTree/releases', + link: docLinks.releases, copy: true }, { @@ -177,7 +178,12 @@ const AboutContent = ({ { ref: 'app', title: Mobile App }, { ref: 'bug', title: Submit Bug Report } ], - data.links, + { + doc: docLinks.docs, + code: docLinks.github, + app: docLinks.app, + bug: docLinks.bug + }, true )} diff --git a/src/frontend/src/components/nav/NavigationDrawer.tsx b/src/frontend/src/components/nav/NavigationDrawer.tsx index c7a8d3f057..a3faa163b1 100644 --- a/src/frontend/src/components/nav/NavigationDrawer.tsx +++ b/src/frontend/src/components/nav/NavigationDrawer.tsx @@ -6,7 +6,7 @@ import { useEffect, useMemo, useRef, useState } from 'react'; import { StylishText } from '@lib/components/StylishText'; import { ModelType } from '@lib/enums/ModelType'; import { UserRoles } from '@lib/enums/Roles'; -import { AboutLinks, DocumentationLinks } from '../../defaults/links'; +import { AboutLinks } from '../../defaults/links'; import useInstanceName from '../../hooks/UseInstanceName'; import * as classes from '../../main.css'; import { useGlobalSettingsState } from '../../states/SettingsStates'; @@ -158,11 +158,6 @@ function DrawerContent({ closeFunc }: Readonly<{ closeFunc?: () => void }>) { ]; }, [user]); - const menuItemsDocumentation: MenuLinkItem[] = useMemo( - () => DocumentationLinks(), - [] - ); - const menuItemsAbout: MenuLinkItem[] = useMemo( () => AboutLinks(globalSettings, user), [] @@ -203,12 +198,6 @@ function DrawerContent({ closeFunc }: Readonly<{ closeFunc?: () => void }>) { )}
- - { description: t`Report a bug or request a feature on GitHub`, icon: , buttonText: t`Open Issue`, - action: () => - window.open( - 'https://github.com/inventree/inventree/issues/new', - '_blank' - ) + action: () => window.open(`${docLinks.bug}/new`, '_blank') }, { id: '1', diff --git a/src/frontend/src/defaults/links.tsx b/src/frontend/src/defaults/links.tsx index caae4d34c6..c157102d5e 100644 --- a/src/frontend/src/defaults/links.tsx +++ b/src/frontend/src/defaults/links.tsx @@ -81,19 +81,22 @@ export function getNavTabs(user: UserStateProps): NavTab[] { } export const docLinks = { + docs: 'https://docs.inventree.org/', app: 'https://docs.inventree.org/en/latest/app/', getting_started: 'https://docs.inventree.org/en/latest/start/', api: 'https://docs.inventree.org/en/latest/api/', developer: 'https://docs.inventree.org/en/latest/develop/contributing/', faq: 'https://docs.inventree.org/en/latest/faq/', github: 'https://github.com/inventree/inventree', + bug: 'https://github.com/inventree/inventree/issues', + releases: 'https://github.com/inventree/inventree/releases', errorcodes: 'https://docs.inventree.org/en/latest/sref/error-codes/' }; export function DocumentationLinks(): MenuLinkItem[] { return [ { - id: 'gettin-started', + id: 'getting-started', title: t`Getting Started`, link: docLinks.getting_started, external: true, @@ -174,6 +177,13 @@ export function AboutLinks( user: UserStateProps ): MenuLinkItem[] { const base_items: MenuLinkItem[] = [ + { + id: 'documentation', + title: t`Documentation`, + description: t`InvenTree documentation`, + link: docLinks.docs, + external: true + }, { id: 'instance', title: t`System Information`,