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

IA-3044: update link to user guide #1343

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
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
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}
};
Loading