Skip to content

Commit

Permalink
ensure amq online url points to the parent console instead of address…
Browse files Browse the repository at this point in the history
… space on os3 (#583)
  • Loading branch information
JameelB authored May 11, 2020
1 parent 7bd203d commit f9c4c7c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/common/serviceInstanceHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
10 changes: 9 additions & 1 deletion src/components/installedAppsView/InstalledAppsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit f9c4c7c

Please sign in to comment.