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

Make all navigation bar links visible to all users #803

Merged
merged 2 commits into from
Oct 21, 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
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import Grid from '@mui/material/Grid';
import OnboardingMenuCard from 'AppComponents/Shared/Onboarding/OnboardingMenuCard';
import Onboarding from 'AppComponents/Shared/Onboarding/Onboarding';
import { PropTypes } from 'prop-types';
import { FormattedMessage, injectIntl } from 'react-intl';
import { FormattedMessage, injectIntl, useIntl } from 'react-intl';
import AuthManager from 'AppData/AuthManager';
import Alert from 'AppComponents/Shared/MuiAlert';

Expand All @@ -36,6 +36,7 @@ import Alert from 'AppComponents/Shared/MuiAlert';
*/
function SampleAPI() {
const theme = useTheme();
const intl = useIntl();
const { apiproductAddIcon } = theme.custom.landingPage.icons;
return (
<Onboarding
Expand Down Expand Up @@ -70,12 +71,10 @@ function SampleAPI() {
disabled={AuthManager.isNotPublisher()}
id='itest-id-create-api-product'
to='/api-products/create'
name={(
<FormattedMessage
id='Apis.Listing.SampleAPIProduct.onboarding.menu.card.name'
defaultMessage='API Product'
/>
)}
name={intl.formatMessage({
id: 'Apis.Listing.SampleAPIProduct.onboarding.menu.card.name',
defaultMessage: 'API Product',
})}
iconName={apiproductAddIcon}
/>
</Onboarding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Box from '@mui/material/Box';
import List from '@mui/material/List';
import LaunchIcon from '@mui/icons-material/Launch';
import { FormattedMessage, useIntl } from 'react-intl';
import AuthManager, { isRestricted } from 'AppData/AuthManager';
import { isRestricted } from 'AppData/AuthManager';
import { usePublisherSettings } from 'AppComponents/Shared/AppContext';
import Divider from '@mui/material/Divider';

Expand Down Expand Up @@ -58,9 +58,6 @@ const StyledBox = styled(Box)((
* @returns
*/
function GlobalNavLinks(props) {
const publisherUser = !AuthManager.isNotPublisher();
const readOnlyUser = AuthManager.isReadOnlyUser();
const adminUser = AuthManager.isAdminUser();

const { selected } = props;
const theme = useTheme();
Expand Down Expand Up @@ -119,41 +116,35 @@ function GlobalNavLinks(props) {
defaultMessage='Services'
/>
</GlobalNavLink>
{ (readOnlyUser || publisherUser)
&& (
<GlobalNavLink
to='/api-products'
type='api-product'
title={intl.formatMessage({
id: 'Base.Header.navbar.GlobalNavBar.title.api.products',
defaultMessage: 'API Products',
})}
active={selected === 'api-products'}
>
<FormattedMessage
id='Base.Header.navbar.GlobalNavBar.api.products'
defaultMessage='API Products'
/>
</GlobalNavLink>
)}
{(adminUser)
&& (
<GlobalNavLink
id='scope'
to='/scopes'
type='scopes'
title={intl.formatMessage({
id: 'Base.Header.navbar.GlobalNavBar.title.scopes',
defaultMessage: 'Scopes',
})}
active={selected === 'scopes'}
>
<FormattedMessage
id='Base.Header.navbar.GlobalNavBar.scopes'
defaultMessage='Scopes'
/>
</GlobalNavLink>
)}
<GlobalNavLink
to='/api-products'
type='api-product'
title={intl.formatMessage({
id: 'Base.Header.navbar.GlobalNavBar.title.api.products',
defaultMessage: 'API Products',
})}
active={selected === 'api-products'}
>
<FormattedMessage
id='Base.Header.navbar.GlobalNavBar.api.products'
defaultMessage='API Products'
/>
</GlobalNavLink>
<GlobalNavLink
id='scope'
to='/scopes'
type='scopes'
title={intl.formatMessage({
id: 'Base.Header.navbar.GlobalNavBar.title.scopes',
defaultMessage: 'Scopes',
})}
active={selected === 'scopes'}
>
<FormattedMessage
id='Base.Header.navbar.GlobalNavBar.scopes'
defaultMessage='Scopes'
/>
</GlobalNavLink>
<GlobalNavLink
id='policies'
to='/policies'
Expand Down
Loading