Skip to content

Commit

Permalink
EPMRPP-77768 || Code Review fix - 3
Browse files Browse the repository at this point in the history
  • Loading branch information
BlazarQSO committed Jul 23, 2024
1 parent 6bdfda9 commit 3876189
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions app/src/controllers/pages/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const CLEAR_PAGE_STATE = 'clearPageStateAction';
export const NO_PAGE = undefined;
// admin
export const ORGANIZATIONS_PAGE = 'ORGANIZATIONS_PAGE';
export const ALL_ORGANIZATIONS_PAGE = 'ALL_ORGANIZATIONS_PAGE';
export const PROJECTS_PAGE = 'PROJECTS_PAGE';
export const PROJECT_DETAILS_PAGE = 'PROJECT_DETAILS_PAGE';
export const ALL_USERS_PAGE = 'ALL_USERS_PAGE';
Expand Down
1 change: 1 addition & 0 deletions app/src/controllers/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export { updatePagePropertiesAction, clearPageStateAction } from './actionCreato

export {
NO_PAGE,
ALL_ORGANIZATIONS_PAGE,
ORGANIZATIONS_PAGE,
PROJECTS_PAGE,
PROJECT_DETAILS_PAGE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import { useSelector } from 'react-redux';
import { availableProjectsSelector } from 'controllers/user';
import { urlProjectSlugSelector, urlOrganizationSlugSelector } from 'controllers/pages';
import { ScrollWrapper } from 'components/main/scrollWrapper';
import Link from 'redux-first-router-link';
import { ORGANIZATIONS_PAGE } from 'controllers/pages/constants';
import { ALL_ORGANIZATIONS_PAGE } from 'controllers/pages/constants';
import { NavLink } from 'components/main/navLink';
import { OrganizationsItem } from './organizationsItem';
import { messages } from '../../messages';
import styles from './organizationsPopover.scss';
Expand All @@ -47,14 +47,14 @@ export const OrganizationsPopover = ({ closePopover, closeSidebar }) => {
{availableProjects.length > 0 && (
<>
<div className={cx('all-organizations')}>
<Link
to={{ type: ORGANIZATIONS_PAGE }}
// TODO: Instead of an additional class, use the active class
className={cx('all-organizations-link', { 'instance-level': !currentOrganization })}
<NavLink
to={{ type: ALL_ORGANIZATIONS_PAGE }}
className={cx('all-organizations-link')}
onClick={onClose}
activeClassName={cx('active')}
>
{formatMessage(messages.allOrganizations)}
</Link>
</NavLink>
</div>
<div className={cx('divider')} />
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@
margin: 0 16px 8px 16px;
}

.instance-level {
.active {
color: $COLOR--darkmode-topaz-text;
}
2 changes: 2 additions & 0 deletions app/src/routes/routesMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ import {
ORGANIZATION_PROJECTS_PAGE,
ORGANIZATION_MEMBERS_PAGE,
ORGANIZATION_SETTINGS_PAGE,
ORGANIZATIONS_PAGE,
} from 'controllers/pages/constants';
import {
fetchOrganizationBySlugAction,
Expand All @@ -124,6 +125,7 @@ const routesMap = {
[OAUTH_SUCCESS]: '/authSuccess',
[NOT_FOUND]: '/notfound',

ALL_ORGANIZATIONS_PAGE: redirectRoute('/', () => ({ type: ORGANIZATIONS_PAGE })),
ORGANIZATIONS_PAGE: redirectRoute('/organizations', () => ({ type: PROJECTS_PAGE })),
USER_PROFILE_PAGE: redirectRoute('/userProfile', () => ({
type: USER_PROFILE_SUB_PAGE,
Expand Down

0 comments on commit 3876189

Please sign in to comment.