From b2233e1ddc5fcfa02b365b8b2b12144f182103d1 Mon Sep 17 00:00:00 2001 From: Ashan Rathnaweera Date: Mon, 14 Oct 2024 10:30:19 +0530 Subject: [PATCH 1/2] fix not a function error related to FormattedMessage --- .../Apis/Listing/SampleAPI/SampleAPIProduct.jsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/SampleAPI/SampleAPIProduct.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/SampleAPI/SampleAPIProduct.jsx index b62879476b4..baa2f1bdc6b 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/SampleAPI/SampleAPIProduct.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/SampleAPI/SampleAPIProduct.jsx @@ -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'; @@ -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 ( - )} + name={intl.formatMessage({ + id: 'Apis.Listing.SampleAPIProduct.onboarding.menu.card.name', + defaultMessage: 'API Product', + })} iconName={apiproductAddIcon} /> From ffc6bdea2ffe438cc1bc02166a45bd0219521bad Mon Sep 17 00:00:00 2001 From: Ashan Rathnaweera Date: Mon, 14 Oct 2024 10:54:10 +0530 Subject: [PATCH 2/2] Remove user role checks from navigation bar --- .../Base/Header/navbar/GlobalNavLinks.jsx | 69 ++++++++----------- 1 file changed, 30 insertions(+), 39 deletions(-) diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Base/Header/navbar/GlobalNavLinks.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Base/Header/navbar/GlobalNavLinks.jsx index ebb349ff801..f9dde5249bf 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Base/Header/navbar/GlobalNavLinks.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Base/Header/navbar/GlobalNavLinks.jsx @@ -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'; @@ -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(); @@ -119,41 +116,35 @@ function GlobalNavLinks(props) { defaultMessage='Services' /> - { (readOnlyUser || publisherUser) - && ( - - - - )} - {(adminUser) - && ( - - - - )} + + + + + +