From 10f917e17ee002ce5ea1c53f2dfb84c0e4d84154 Mon Sep 17 00:00:00 2001 From: dulith Date: Sat, 23 Mar 2024 20:28:21 +0530 Subject: [PATCH] Add additional lifeCycleStatus check for prototype APIs --- .../Configuration/components/APISecurity/APISecurity.jsx | 3 ++- .../Apis/Details/Configuration/components/Endpoints.jsx | 2 +- .../app/components/Apis/Details/Endpoints/EndpointOverview.jsx | 3 ++- .../src/app/components/Apis/Details/Endpoints/Endpoints.jsx | 2 +- .../app/components/Apis/Details/LifeCycle/CheckboxLabels.jsx | 2 +- .../src/app/components/Apis/Details/NewOverview/Endpoints.jsx | 3 ++- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/APISecurity/APISecurity.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/APISecurity/APISecurity.jsx index e80d98bc1b6..8c53994bd5d 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/APISecurity/APISecurity.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/APISecurity/APISecurity.jsx @@ -78,7 +78,8 @@ export default function APISecurity(props) { } else { isEndpointAvailable = apiContext.api.endpointConfig !== null; isPrototyped = apiContext.api.endpointConfig !== null - && apiContext.api.endpointConfig.implementation_status === 'prototyped'; + && apiContext.api.endpointConfig.implementation_status === 'prototyped' + && apiContext.api.lifeCycleStatus === 'PROTOTYPED'; } const haveMultiLevelSecurity = securityScheme.includes(API_SECURITY_MUTUAL_SSL) diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/Endpoints.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/Endpoints.jsx index 167969b4aa1..8b7e490ad4b 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/Endpoints.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/Endpoints.jsx @@ -100,7 +100,7 @@ function Endpoints(props) { const { api } = props; const isPrototypedAvailable = api.endpointConfig !== null - && api.endpointConfig.implementation_status === 'prototyped'; + && api.endpointConfig.implementation_status === 'prototyped' && api.lifeCycleStatus === 'PROTOTYPED'; /** * Check whether the endpoint configuration is dynamic diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/EndpointOverview.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/EndpointOverview.jsx index a81d87f8441..209a081a71c 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/EndpointOverview.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/EndpointOverview.jsx @@ -227,7 +227,8 @@ function EndpointOverview(props) { } else if (apiObject.endpointImplementationType === 'MOCKED_OAS') { return endpointTypes[7]; } else if (apiObject.endpointImplementationType === 'ENDPOINT' - && apiObject.endpointConfig.implementation_status === 'prototyped') { + && apiObject.endpointConfig.implementation_status === 'prototyped' + && api.lifeCycleStatus === 'PROTOTYPED') { return endpointTypes[3]; } else if (type === 'http') { if (typeChangeConfirmation.serviceInfo) { diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/Endpoints.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/Endpoints.jsx index 8c1f1adb92b..99a238271bd 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/Endpoints.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/Endpoints.jsx @@ -458,7 +458,7 @@ function Endpoints(props) { } } else { let isValidEndpoint = false; - if (endpointConfig.implementation_status === 'prototyped') { + if (endpointConfig.implementation_status === 'prototyped' && api.lifeCycleStatus === 'PROTOTYPED') { if (implementationType === 'ENDPOINT') { if (endpointConfig.production_endpoints && endpointConfig.production_endpoints.url === '') { return { diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/LifeCycle/CheckboxLabels.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/LifeCycle/CheckboxLabels.jsx index 0b2fb5f0900..e5746167c2f 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/LifeCycle/CheckboxLabels.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/LifeCycle/CheckboxLabels.jsx @@ -106,7 +106,7 @@ export default function CheckboxLabels(props) { isMandatoryPropertiesAvailable, isMandatoryPropertiesConfigured } = props; const isEndpointAvailable = !isAPIProduct - ? api.endpointConfig !== null && !api.endpointConfig.implementation_status + ? api.endpointConfig !== null : false; const lcState = isAPIProduct ? api.state : api.lifeCycleStatus; diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/NewOverview/Endpoints.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/NewOverview/Endpoints.jsx index fd4d6f277c6..20736e58c88 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/NewOverview/Endpoints.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/NewOverview/Endpoints.jsx @@ -53,7 +53,8 @@ const showEndpoint = (api, type) => { function Endpoints(props) { const { parentClasses, api } = props; const isPrototypedAvailable = api.endpointConfig !== null - && api.endpointConfig.implementation_status === 'prototyped'; + && api.endpointConfig.implementation_status === 'prototyped' + && api.lifeCycleStatus === 'PROTOTYPED'; const productionEndpointSecurity = api.endpointConfig && api.endpointConfig.endpoint_security && api.endpointConfig.endpoint_security.production.type; const sandboxEndpointSecurity = api.endpointConfig && api.endpointConfig.endpoint_security