From f80b82f218e5ecbe5d087ca907deea01a83ea8fa Mon Sep 17 00:00:00 2001 From: Tharanidk Date: Thu, 1 Feb 2024 12:42:05 +0530 Subject: [PATCH] fix Unlimited tier disabling issue --- .../components/Applications/Details/Overview.jsx | 15 ++++++++++++--- .../app/components/Applications/Details/index.jsx | 3 +-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/portals/devportal/src/main/webapp/source/src/app/components/Applications/Details/Overview.jsx b/portals/devportal/src/main/webapp/source/src/app/components/Applications/Details/Overview.jsx index a9a72a77cc5..0db79e4eb39 100644 --- a/portals/devportal/src/main/webapp/source/src/app/components/Applications/Details/Overview.jsx +++ b/portals/devportal/src/main/webapp/source/src/app/components/Applications/Details/Overview.jsx @@ -65,6 +65,10 @@ const useStyles = makeStyles((theme) => ({ actionPanel: { justifyContent: 'flex-start', }, + disabledTier: { + color: '#999999', + fontWeight: '400', + }, Paper: { marginTop: theme.spacing(2), padding: theme.spacing(2), @@ -139,6 +143,7 @@ function Overview(props) { const [notFound, setNotFound] = useState(false); const { match: { params: { applicationId } } } = props; const [environment, setEnvironment] = useState(null); + const [tierDisabled, setTierDisabled] = useState(false); const [selectedProtocol, setSelectedProtocol] = useState(null); const [selectedEndpoint, setSelectedEndpoint] = useState(null); const [topics, setTopics] = useState(null); @@ -148,11 +153,11 @@ function Overview(props) { const promisedApplication = client.getApplication(applicationId); promisedApplication .then((response) => { - const promisedTier = client.getTierByName(response.obj.throttlingPolicy, 'application'); const appInner = response.obj; + setApplication(appInner); + const promisedTier = client.getTierByName(response.obj.throttlingPolicy, 'application'); promisedTier.then((tierResponse) => { setTierDescription(tierResponse.obj.description); - setApplication(appInner); if (appInner.solaceDeployedEnvironments) { setEnvironment(appInner.solaceDeployedEnvironments[0]); setSelectedProtocol(appInner.solaceDeployedEnvironments[0].solaceURLs[0].protocol); @@ -163,6 +168,10 @@ function Overview(props) { setTopics(appInner.solaceDeployedEnvironments[0].SolaceTopicsObject.defaultSyntax); } } + }).catch((error) => { + setTierDisabled(true); + setTierDescription('Tier is disabled.'); + console.log(error); }); }).catch((error) => { if (process.env.NODE_ENV !== 'production') { @@ -251,7 +260,7 @@ function Overview(props) { {application.throttlingPolicy} {' '} - {`(${tierDescription})`} + {`(${tierDescription})`} )} diff --git a/portals/devportal/src/main/webapp/source/src/app/components/Applications/Details/index.jsx b/portals/devportal/src/main/webapp/source/src/app/components/Applications/Details/index.jsx index 2049114c088..98e696f9049 100755 --- a/portals/devportal/src/main/webapp/source/src/app/components/Applications/Details/index.jsx +++ b/portals/devportal/src/main/webapp/source/src/app/components/Applications/Details/index.jsx @@ -180,8 +180,7 @@ class Details extends Component { promisedApplication .then((response) => { this.setState({ application: response.obj }); - const promisedPolicy = client.getTierByName(response.obj.throttlingPolicy, 'application'); - return Promise.all([response, promisedPolicy]); + return Promise.all([response]); }) .catch((error) => { if (process.env.NODE_ENV !== 'production') {