diff --git a/app/scripts/app.js b/app/scripts/app.js index bebbc3a781..484761bf54 100644 --- a/app/scripts/app.js +++ b/app/scripts/app.js @@ -41,18 +41,18 @@ angular templateUrl: 'views/projects.html', controller: 'ProjectsController' }; - if (_.get(window, 'OPENSHIFT_CONSTANTS.ENABLE_TECH_PREVIEW_FEATURE.service_catalog_landing_page')) { + if (_.get(window, 'OPENSHIFT_CONSTANTS.DISABLE_SERVICE_CATALOG_LANDING_PAGE')) { + landingPageRoute = projectsPageRoute; + $routeProvider.when('/projects', { + redirectTo: '/' + }); + } else { landingPageRoute = { templateUrl: 'views/landing-page.html', controller: 'LandingPageController', reloadOnSearch: false }; $routeProvider.when('/projects', projectsPageRoute); - } else { - landingPageRoute = projectsPageRoute; - $routeProvider.when('/projects', { - redirectTo: '/' - }); } $routeProvider @@ -496,15 +496,6 @@ angular // content (e.g. using :before pseudo-elements). $('body').addClass('ios'); } - }) - .run(function($rootScope){ - // if the service catalog landing page is enabled, - // set global variable for use in views - // and add class to body - if (_.get(window, 'OPENSHIFT_CONSTANTS.ENABLE_TECH_PREVIEW_FEATURE.service_catalog_landing_page')) { - $rootScope.globalTechPreviewIndicator = true; - $('body').addClass('tech-preview'); - } }); hawtioPluginLoader.addModule('openshiftConsole'); diff --git a/app/scripts/constants.js b/app/scripts/constants.js index b980fcebd1..4702fab782 100644 --- a/app/scripts/constants.js +++ b/app/scripts/constants.js @@ -82,15 +82,21 @@ angular.extend(window.OPENSHIFT_CONSTANTS, { // when users navigate away from a page without saving. DISABLE_CONFIRM_ON_EXIT: false, - // This blacklist hides certain kinds from the "Other Resources" page because they are unpersisted, disallowed for most end users, or not supported by openshift but exist in kubernetes + // Disable the new landing page and service catalog experience. + DISABLE_SERVICE_CATALOG_LANDING_PAGE: false, + + // This blacklist hides certain kinds from the "Other Resources" page because + // they are unpersisted, disallowed for most end users, or not supported by + // openshift but exist in kubernetes. AVAILABLE_KINDS_BLACKLIST: [], - // Currently disables watch on events used by the drawer + + // Currently disables watch on events used by the drawer. DISABLE_GLOBAL_EVENT_WATCH: false, + ENABLE_TECH_PREVIEW_FEATURE: { - // Enable the new landing page and service catalog experience - service_catalog_landing_page: false, - // Set to `true` when the template service broker is enabled for the cluster in master-config.yaml - template_service_broker: false, + // Set to true when the template service broker is enabled for the cluster in master-config.yaml. + template_service_broker: true, + // Set to true if the service catalog supports pod presets for binding services to applications. pod_presets: false }, diff --git a/app/scripts/controllers/createProject.js b/app/scripts/controllers/createProject.js index 4c4b176b11..00d46bbe35 100644 --- a/app/scripts/controllers/createProject.js +++ b/app/scripts/controllers/createProject.js @@ -14,7 +14,7 @@ angular.module('openshiftConsole') $window, AuthService, Constants) { - var landingPageEnabled = _.get(Constants, 'ENABLE_TECH_PREVIEW_FEATURE.service_catalog_landing_page'); + var landingPageEnabled = !Constants.DISABLE_SERVICE_CATALOG_LANDING_PAGE; $scope.onProjectCreated = function(encodedProjectName) { if (landingPageEnabled) { diff --git a/app/scripts/controllers/overview.js b/app/scripts/controllers/overview.js index d8a886dd36..be4a9f6e28 100644 --- a/app/scripts/controllers/overview.js +++ b/app/scripts/controllers/overview.js @@ -59,6 +59,7 @@ function OverviewController($scope, var DEFAULT_POLL_INTERVAL = 60 * 1000; // milliseconds $scope.projectName = $routeParams.project; + overview.catalogLandingPageEnabled = !Constants.DISABLE_SERVICE_CATALOG_LANDING_PAGE; // Filters used by this controller. var annotation = $filter('annotation'); diff --git a/app/scripts/directives/nav.js b/app/scripts/directives/nav.js index 83d24de038..45250ec948 100644 --- a/app/scripts/directives/nav.js +++ b/app/scripts/directives/nav.js @@ -257,7 +257,7 @@ angular.module('openshiftConsole') _.set($scope, 'ordering.panelName', panelName); }; - $scope.catalogLandingPageEnabled = _.get(Constants, 'ENABLE_TECH_PREVIEW_FEATURE.service_catalog_landing_page'); + $scope.catalogLandingPageEnabled = !Constants.DISABLE_SERVICE_CATALOG_LANDING_PAGE; var select = $elem.find('.selectpicker'); var options = []; diff --git a/app/scripts/extensions/nav/helpDropdown.js b/app/scripts/extensions/nav/helpDropdown.js index a0f4ba2e99..8650624917 100644 --- a/app/scripts/extensions/nav/helpDropdown.js +++ b/app/scripts/extensions/nav/helpDropdown.js @@ -14,7 +14,7 @@ angular.module('openshiftConsole') } ); - if (_.get(window, 'OPENSHIFT_CONSTANTS.ENABLE_TECH_PREVIEW_FEATURE.service_catalog_landing_page')) { + if (!_.get(window, 'OPENSHIFT_CONSTANTS.DISABLE_SERVICE_CATALOG_LANDING_PAGE')) { var tourConfig = _.get(window, 'OPENSHIFT_CONSTANTS.GUIDED_TOURS.landing_page_tour'); if (tourConfig && tourConfig.enabled && tourConfig.steps) { options.push( diff --git a/app/scripts/services/catalog.js b/app/scripts/services/catalog.js index 62173652e4..ca1363fd5f 100644 --- a/app/scripts/services/catalog.js +++ b/app/scripts/services/catalog.js @@ -10,7 +10,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 = - _.get(Constants, 'ENABLE_TECH_PREVIEW_FEATURE.service_catalog_landing_page') && + !Constants.SERVICE_CATALOG_ENABLED && APIService.apiInfo({ group: 'servicecatalog.k8s.io', resource: 'serviceclasses' }) && APIService.apiInfo({ group: 'servicecatalog.k8s.io', resource: 'serviceinstances' }) && APIService.apiInfo({ group: 'servicecatalog.k8s.io', resource: 'serviceinstancecredentials' }); diff --git a/app/views/overview.html b/app/views/overview.html index e4862bc2af..e646c85e8b 100644 --- a/app/views/overview.html +++ b/app/views/overview.html @@ -13,12 +13,12 @@

Get started with your project.

image, or add components like databases and message queues.

- - Add to Project - - + Browse Catalog + + Add to Project +