diff --git a/src/common/serviceInstanceHelpers.js b/src/common/serviceInstanceHelpers.js index 0e29ee468..6f465ba9c 100644 --- a/src/common/serviceInstanceHelpers.js +++ b/src/common/serviceInstanceHelpers.js @@ -123,7 +123,13 @@ const getDashboardUrl = svc => { } const { status, metadata } = svc; - if (status.dashboardURL) { + // Ensure AMQ online console link points to the 'parent' amq console and not to an address space. This should only be applied for OS3 + if ( + window.OPENSHIFT_CONFIG.openshiftVersion === 3 && + svc.spec.clusterServiceClassExternalName === DEFAULT_SERVICES.ENMASSE + ) { + return window.OPENSHIFT_CONFIG.provisionedServices[DEFAULT_SERVICES.ENMASSE].Host; + } else if (status.dashboardURL) { return status.dashboardURL; } else if (metadata.annotations && metadata.annotations['integreatly/dashboard-url']) { return metadata.annotations['integreatly/dashboard-url']; diff --git a/src/components/installedAppsView/InstalledAppsView.js b/src/components/installedAppsView/InstalledAppsView.js index bde8887d7..99f4dbbe8 100644 --- a/src/components/installedAppsView/InstalledAppsView.js +++ b/src/components/installedAppsView/InstalledAppsView.js @@ -16,7 +16,7 @@ import { import { ChartPieIcon, ErrorCircleOIcon, HelpIcon, OnRunningIcon, OffIcon } from '@patternfly/react-icons'; import { getProductDetails, getServiceSortOrder } from '../../services/middlewareServices'; import { SERVICE_STATUSES, SERVICE_TYPES } from '../../redux/constants/middlewareConstants'; -import { DEFAULT_SERVICES } from '../../common/serviceInstanceHelpers'; +import { DEFAULT_SERVICES, getDashboardUrl } from '../../common/serviceInstanceHelpers'; import { getWorkshopUrl, isWorkshopInstallation } from '../../common/docsHelpers'; class InstalledAppsView extends React.Component { @@ -121,6 +121,14 @@ class InstalledAppsView extends React.Component { if (app.type === SERVICE_TYPES.PROVISIONED_SERVICE) { return app.url; } + // Ensure AMQ online console link points to the 'parent' amq console and not to an address space. This should only be applied for OS3 + if ( + window.OPENSHIFT_CONFIG.openshiftVersion === 3 && + app.spec && + app.spec.clusterServiceClassExternalName === DEFAULT_SERVICES.ENMASSE + ) { + return getDashboardUrl(app); + } if (app.status.dashboardURL) { return app.status.dashboardURL; }