From 40a29662511daf9d6fb5ecdfc8164e7a453d4f08 Mon Sep 17 00:00:00 2001 From: Quang Son Le Date: Fri, 31 May 2024 10:58:23 +0200 Subject: [PATCH] IA-3044: upadte link to user guide - remove link to outdated RDC google doc - use link to website in all cases - removed dead code in LinkToInstance --- hat/assets/js/apps/Iaso/constants/menu.tsx | 3 +- .../app/components/SidebarMenuComponent.js | 32 +++---------------- .../instances/components/LinkToInstance.tsx | 2 -- 3 files changed, 5 insertions(+), 32 deletions(-) diff --git a/hat/assets/js/apps/Iaso/constants/menu.tsx b/hat/assets/js/apps/Iaso/constants/menu.tsx index 97bdb4ffd1..686fac6de0 100644 --- a/hat/assets/js/apps/Iaso/constants/menu.tsx +++ b/hat/assets/js/apps/Iaso/constants/menu.tsx @@ -389,5 +389,4 @@ export const useMenuItems = (): MenuItems => { }, [admin, basicItems, currentUser, pluginsMenu]); return items; }; -export const RDC_USER_MANUAL = - 'https://docs.google.com/document/d/1eSJWotpTn4OtI1TV9OjJeF0hIa8W_1nUtpg9tmEgCkw/edit?usp=sharing'; +export const DOC_URL = 'https://docs.openiaso.com/en/latest/'; diff --git a/hat/assets/js/apps/Iaso/domains/app/components/SidebarMenuComponent.js b/hat/assets/js/apps/Iaso/domains/app/components/SidebarMenuComponent.js index baa68df0b1..e9d54f4d32 100644 --- a/hat/assets/js/apps/Iaso/domains/app/components/SidebarMenuComponent.js +++ b/hat/assets/js/apps/Iaso/domains/app/components/SidebarMenuComponent.js @@ -29,13 +29,13 @@ import MenuItem from './MenuItemComponent'; import { Logo } from './Logo.tsx'; import LanguageSwitch from './LanguageSwitchComponent'; -import { useMenuItems, RDC_USER_MANUAL } from '../../../constants/menu.tsx'; +import { useMenuItems, DOC_URL } from '../../../constants/menu.tsx'; import MESSAGES from './messages'; import { getDefaultSourceVersion } from '../../dataSources/utils'; import { useCurrentUser } from '../../../utils/usersUtils.ts'; -import { baseUrls } from '../../../constants/urls'; +import { baseUrls } from '../../../constants/urls.ts'; const styles = theme => ({ ...commonStyles(theme), @@ -87,26 +87,7 @@ const styles = theme => ({ }, }); -// not removing the function (or the locale argument) because we will want to link to localized version of the doc website -// eslint-disable-next-line no-unused-vars - -const localizedManualUrl = (locale, account) => { - if (locale === 'fr' && account.name === 'RDC') { - return RDC_USER_MANUAL; - } - - return account.user_manual_path - ? account.user_manual_path - : 'https://iaso.readthedocs.io/en/latest/pages/users/reference/user_guide/user_guide.html'; -}; - -const SidebarMenu = ({ - classes, - isOpen, - toggleSidebar, - location, - activeLocale, -}) => { +const SidebarMenu = ({ classes, isOpen, toggleSidebar, location }) => { const onClick = url => { toggleSidebar(); if (url) { @@ -201,10 +182,7 @@ const SidebarMenu = ({ className={`${classes.userName} ${classes.userManual}`} > ({ isOpen: state.sidebar.isOpen, - activeLocale: state.app.locale, }); const MapDispatchToProps = dispatch => ({ diff --git a/hat/assets/js/apps/Iaso/domains/instances/components/LinkToInstance.tsx b/hat/assets/js/apps/Iaso/domains/instances/components/LinkToInstance.tsx index 24879d3515..bda6449e5d 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/components/LinkToInstance.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/components/LinkToInstance.tsx @@ -1,7 +1,6 @@ import React, { FunctionComponent } from 'react'; import { userHasOneOfPermissions } from '../../users/utils'; import { baseUrls } from '../../../constants/urls'; -import * as Permission from '../../../utils/permissions'; import { useCurrentUser } from '../../../utils/usersUtils'; import MESSAGES from '../../assignments/messages'; import { SUBMISSIONS, SUBMISSIONS_UPDATE } from '../../../utils/permissions'; @@ -42,5 +41,4 @@ export const LinkToInstance: FunctionComponent = ({ iconSize={iconSize} /> ); - color={color} };