Skip to content

Commit

Permalink
Fix bug where create dropdown links incorrect when DISABLE_SERVICE_CA…
Browse files Browse the repository at this point in the history
…TALOG_LANDING_PAGE is true

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1671346
  • Loading branch information
rhamilto committed Feb 1, 2019
1 parent 17e499d commit 6e13099
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 123 deletions.
2 changes: 0 additions & 2 deletions app/scripts/controllers/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ function OverviewController($scope,
$scope.projectName = $routeParams.project;
var isHomePage = $routeParams.isHomePage;

overview.catalogLandingPageEnabled = !Constants.DISABLE_SERVICE_CATALOG_LANDING_PAGE;

// Filters used by this controller.
var annotation = $filter('annotation');
var canI = $filter('canI');
Expand Down
2 changes: 0 additions & 2 deletions app/scripts/directives/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,6 @@ angular.module('openshiftConsole')
_.set($rootScope, 'view.hasProjectSearch', showMobileSearch);
};

$scope.catalogLandingPageEnabled = !Constants.DISABLE_SERVICE_CATALOG_LANDING_PAGE;

var contextSelector = $elem.find('.contextselector');
$scope.clusterConsoleURL = window.OPENSHIFT_CONFIG.adminConsoleURL;
contextSelector
Expand Down
10 changes: 6 additions & 4 deletions app/scripts/extensions/nav/userDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ angular.module('openshiftConsole')
});
}

items.push({
type: 'dom',
node: '<li><set-home-page></set-home-page></li>'
});
if (!_.get(window, 'OPENSHIFT_CONSTANTS.DISABLE_SERVICE_CATALOG_LANDING_PAGE')) {
items.push({
type: 'dom',
node: '<li><set-home-page></set-home-page></li>'
});
}

var msg = 'Log Out';
if ($rootScope.user.fullName && $rootScope.user.fullName !== $rootScope.user.metadata.name) {
Expand Down
3 changes: 1 addition & 2 deletions app/scripts/services/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ angular.module("openshiftConsole")

// Enable service catalog features if the new experience is enabled and the
// servicecatalog.k8s.io resources are available.
var SERVICE_CATALOG_ENABLED = !Constants.DISABLE_SERVICE_CATALOG_LANDING_PAGE &&
APIService.apiInfo(serviceBindingsVersion) &&
var SERVICE_CATALOG_ENABLED = APIService.apiInfo(serviceBindingsVersion) &&
APIService.apiInfo(serviceClassesVersion) &&
APIService.apiInfo(serviceInstancesVersion) &&
APIService.apiInfo(servicePlansVersion);
Expand Down
8 changes: 2 additions & 6 deletions app/views/directives/header/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,9 @@
<span class="hidden-xs caret" aria-hidden="true" title="Add to Project"></span>
</button>
<ul role="menu" uib-dropdown-menu class="dropdown-menu dropdown-menu-right">
<li ng-if-start="!catalogLandingPageEnabled" role="menuitem"><a ng-href="project/{{currentProjectName}}/create?tab=fromCatalog">Browse Catalog</a></li>
<li role="menuitem"><a ng-href="project/{{currentProjectName}}/create?tab=deployImage">Deploy Image</a></li>
<li ng-if-end role="menuitem"><a ng-href="project/{{currentProjectName}}/create?tab=fromFile">Import YAML / JSON</a></li>

<li ng-if-start="catalogLandingPageEnabled" role="menuitem"><a href="{{currentProjectName | catalogURL}}">Browse Catalog</a></li>
<li role="menuitem"><a href="{{currentProjectName | catalogURL}}">Browse Catalog</a></li>
<li role="menuitem"><a href="" ng-click="showOrderingPanel('deployImage')">Deploy Image</a></li>
<li ng-if-end role="menuitem"><a href="" ng-click="showOrderingPanel('fromFile')">Import YAML / JSON</a></li>
<li role="menuitem"><a href="" ng-click="showOrderingPanel('fromFile')">Import YAML / JSON</a></li>
<li role="menuitem"><a href="" ng-click="showOrderingPanel('fromProject')">Select from Project</a></li>
</ul>
</div>
Expand Down
202 changes: 100 additions & 102 deletions dist/scripts/scripts.js

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -7410,12 +7410,9 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<span class=\"hidden-xs caret\" aria-hidden=\"true\" title=\"Add to Project\"></span>\n" +
"</button>\n" +
"<ul role=\"menu\" uib-dropdown-menu class=\"dropdown-menu dropdown-menu-right\">\n" +
"<li ng-if-start=\"!catalogLandingPageEnabled\" role=\"menuitem\"><a ng-href=\"project/{{currentProjectName}}/create?tab=fromCatalog\">Browse Catalog</a></li>\n" +
"<li role=\"menuitem\"><a ng-href=\"project/{{currentProjectName}}/create?tab=deployImage\">Deploy Image</a></li>\n" +
"<li ng-if-end role=\"menuitem\"><a ng-href=\"project/{{currentProjectName}}/create?tab=fromFile\">Import YAML / JSON</a></li>\n" +
"<li ng-if-start=\"catalogLandingPageEnabled\" role=\"menuitem\"><a href=\"{{currentProjectName | catalogURL}}\">Browse Catalog</a></li>\n" +
"<li role=\"menuitem\"><a href=\"{{currentProjectName | catalogURL}}\">Browse Catalog</a></li>\n" +
"<li role=\"menuitem\"><a href=\"\" ng-click=\"showOrderingPanel('deployImage')\">Deploy Image</a></li>\n" +
"<li ng-if-end role=\"menuitem\"><a href=\"\" ng-click=\"showOrderingPanel('fromFile')\">Import YAML / JSON</a></li>\n" +
"<li role=\"menuitem\"><a href=\"\" ng-click=\"showOrderingPanel('fromFile')\">Import YAML / JSON</a></li>\n" +
"<li role=\"menuitem\"><a href=\"\" ng-click=\"showOrderingPanel('fromProject')\">Select from Project</a></li>\n" +
"</ul>\n" +
"</div>\n" +
Expand Down

0 comments on commit 6e13099

Please sign in to comment.