Skip to content

Commit

Permalink
Merge pull request #1343 from BLSQ/IA-3044_link_to_doc_site
Browse files Browse the repository at this point in the history
IA-3044: update link to user guide
  • Loading branch information
quang-le authored Jun 3, 2024
2 parents 2f13c2b + 40a2966 commit 043ac57
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 32 deletions.
3 changes: 1 addition & 2 deletions hat/assets/js/apps/Iaso/constants/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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/';
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -201,10 +182,7 @@ const SidebarMenu = ({
className={`${classes.userName} ${classes.userManual}`}
>
<a
href={localizedManualUrl(
activeLocale.code,
currentUser.account,
)}
href={DOC_URL}
target="_blank"
rel="noreferrer"
className={classes.link}
Expand Down Expand Up @@ -232,12 +210,10 @@ SidebarMenu.propTypes = {
isOpen: PropTypes.bool.isRequired,
toggleSidebar: PropTypes.func.isRequired,
location: PropTypes.object.isRequired,
activeLocale: PropTypes.object.isRequired,
};

const MapStateToProps = state => ({
isOpen: state.sidebar.isOpen,
activeLocale: state.app.locale,
});

const MapDispatchToProps = dispatch => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -42,5 +41,4 @@ export const LinkToInstance: FunctionComponent<Props> = ({
iconSize={iconSize}
/>
);
color={color}
};

0 comments on commit 043ac57

Please sign in to comment.