diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Environments/DeploymentOnbording.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Environments/DeploymentOnbording.jsx index 47acc32d921..b0be11016be 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Environments/DeploymentOnbording.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Environments/DeploymentOnbording.jsx @@ -95,8 +95,12 @@ export default function DeploymentOnboarding(props) { const [api] = useAPI(); const theme = useTheme(); const { maxCommentLength } = theme.custom; + const assignGateway = api.gatewayType === "wso2/synapse" ? "Regular" : "APK"; const { settings: { environment: environments } } = useAppContext(); - const internalGateways = environments.filter((p) => !p.provider.toLowerCase().includes('solace')); + const internalGatewaysFiltered = environments.filter((p) => !p.provider.toLowerCase().includes('solace')); + const internalGateways = internalGatewaysFiltered && internalGatewaysFiltered.filter((p) => + p.gatewayType.toLowerCase() === assignGateway.toLowerCase() + ); const externalGateways = environments.filter((p) => p.provider.toLowerCase().includes('solace')); const hasOnlyOneEnvironment = internalGateways.length === 1; const securityScheme = [...api.securityScheme]; diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Environments/Environments.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Environments/Environments.jsx index 0ba5cb225f5..5a81026610b 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Environments/Environments.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Environments/Environments.jsx @@ -2013,7 +2013,7 @@ export default function Environments() { { + opacity: allEnvRevision && allEnvRevision.some(o1 => { return o1.deploymentInfo.some(o2 => o2.name === row.name && o2.status === 'CREATED'); @@ -2029,7 +2029,7 @@ export default function Environments() { - {allEnvRevision.some(o1 => { + {allEnvRevision && allEnvRevision.some(o1 => { return o1.deploymentInfo.some(o2 => o2.name === row.name && o2.status === 'CREATED'); @@ -2139,7 +2139,7 @@ export default function Environments() { - {allEnvRevision + {allEnvRevision && allEnvRevision .filter(o1 => { if (o1.deploymentInfo.some( o2 => o2.name === row.name && @@ -2162,7 +2162,7 @@ export default function Environments() { ))} - {allEnvRevision + {allEnvRevision && allEnvRevision .filter(o1 => { if (o1.deploymentInfo.some( o2 => o2.name === row.name && diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/Policies.tsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/Policies.tsx index 065b8a1a862..ea648c72fe3 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/Policies.tsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/Policies.tsx @@ -78,7 +78,7 @@ const Policies: React.FC = () => { const [policies, setPolicies] = useState(null); const [allPolicies, setAllPolicies] = useState(null); const [expandedResource, setExpandedResource] = useState(null); - const [isChoreoConnectEnabled, setIsChoreoConnectEnabled] = useState(api.gatewayType === 'wso2/choreo-connect'); + const [isChoreoConnectEnabled, setIsChoreoConnectEnabled] = useState(api.gatewayType === 'wso2/apk'); const { showMultiVersionPolicies } = Configurations.apis; const [selectedTab, setSelectedTab] = useState((api.apiPolicies != null) ? 0 : 1); @@ -434,7 +434,7 @@ const Policies: React.FC = () => { // Handles normal policy savings for choreo connect gateway type. if(isChoreoConnectEnabled) { - getewayTypeForPolicies = "wso2/choreo-connect"; + getewayTypeForPolicies = "wso2/apk"; } const updatePromise = updateAPI({ @@ -490,7 +490,7 @@ const Policies: React.FC = () => { /> - {(api.type === 'HTTP') && ( + {/* {(api.type === 'HTTP') && ( { removeAPIPoliciesForGatewayChange={removeAPIPoliciesForGatewayChange} /> - )} + )} */} @@ -522,7 +522,6 @@ const Policies: React.FC = () => { } id='api-level-policies-tab' aria-controls='api-level-policies-tabpanel' - disabled={isChoreoConnectEnabled} /> = ({ ) : ( - {!isChoreoConnectEnabled && ( - - - - - )} + + + + {Object.entries(openAPISpec.paths).map(([target, verbObject]: [string, any]) => ( diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/PolicyForm/SourceDetails.tsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/PolicyForm/SourceDetails.tsx index 719f10fe556..09d2c5f2e27 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/PolicyForm/SourceDetails.tsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/PolicyForm/SourceDetails.tsx @@ -284,24 +284,10 @@ const SourceDetails: FC = ({ label={GATEWAY_TYPE_LABELS.SYNAPSE} data-testid='regular-gateway-label' /> - {/* - } - label={GATEWAY_TYPE_LABELS.CC} - data-testid='choreo-connect-label' - /> */} {supportedGatewaysError - ? 'Please select one or more Gateways' + ? 'Please select Regular Gateways' : ''} diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/PolicyList.tsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/PolicyList.tsx index 8e28939c7e8..5a4b88d7b11 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/PolicyList.tsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/PolicyList.tsx @@ -92,21 +92,23 @@ const PolicyList: FC = ({policyList, fetchPolicies, isChoreoCon defaultMessage='Policy List' /> - + {!isChoreoConnectEnabled && ( + + )} { const { icon, isCreateMenu } = props; + const { data: settings } = usePublisherSettings(); + const apkGatewayType = settings && settings.gatewayTypes.length === 1 && settings.gatewayTypes.includes('APK'); const Component = isCreateMenu ? APICreateMenuSection : LandingMenu; const dense = isCreateMenu; const { alwaysShowDeploySampleButton } = Configurations.apis; @@ -94,7 +97,8 @@ const RestAPIMenu = (props) => { defaultMessage='Import Open API' /> - {(!isCreateMenu || (isCreateMenu && alwaysShowDeploySampleButton)) && showSampleDeploy && ( + {(!isCreateMenu || (isCreateMenu && alwaysShowDeploySampleButton)) && showSampleDeploy && + !apkGatewayType && ( <> diff --git a/portals/publisher/src/main/webapp/source/src/app/components/GlobalPolicies/Listing/Listing.tsx b/portals/publisher/src/main/webapp/source/src/app/components/GlobalPolicies/Listing/Listing.tsx index 0762b2983bd..3eb4524ad24 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/GlobalPolicies/Listing/Listing.tsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/GlobalPolicies/Listing/Listing.tsx @@ -136,6 +136,7 @@ interface Environment { type: string; serverUrl: string; provider: string; + gatewayType: string; showInApiConsole: boolean; vhosts: any; endpointURIs: any; @@ -890,7 +891,10 @@ const Listing: React.FC = () => { /** * Expandable area where you can deploy and undeploy. */ - const gatewayList = environments.map((env: any) => { + const regularGatewayEnvironments = environments && environments.filter((env) => { + return env.gatewayType === 'Regular'; + }); + const gatewayList = regularGatewayEnvironments.map((env: any) => { return env.name; }); const rowIndex = rowMeta.dataIndex;