Skip to content

Commit

Permalink
Merge pull request #2047 from david-martin/url-params-to-jump-into-se…
Browse files Browse the repository at this point in the history
…rvice-catalog-flow

Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Sep 18, 2017
2 parents 1b695d8 + 2f75b67 commit 0ce60c1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
18 changes: 18 additions & 0 deletions app/scripts/controllers/landingPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,24 @@ angular.module('openshiftConsole')
});

function dataLoaded() {
// Check for a service class param to launch the catalog flow for
var paramClass = $location.search()['serviceClass'];
if (paramClass) {
// Search by class name e.g. cakephp-mysql-persistent
var paramItem = _.find($scope.catalogItems, {
resource: {
metadata: {
name: paramClass
}
}
});
// If a catalog item matches, lauch the catalog flow
if (paramItem) {
$scope.$broadcast('open-overlay-panel', paramItem);
return;
}
}

if (!tourEnabled) {
return;
}
Expand Down
17 changes: 14 additions & 3 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4230,12 +4230,23 @@ controller: !0
};
}), angular.module("openshiftConsole").controller("LandingPageController", [ "$scope", "$rootScope", "AuthService", "Catalog", "Constants", "DataService", "Navigate", "NotificationsService", "RecentlyViewedServiceItems", "GuidedTourService", "HTMLService", "$timeout", "$q", "$routeParams", "$location", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, f) {
function g() {
var n = f.search().serviceClass;
if (n) {
var a = _.find(e.catalogItems, {
resource: {
metadata: {
name: n
}
}
});
if (a) return void e.$broadcast("open-overlay-panel", a);
}
if (v) if (p.startTour) d(function() {
f.replace(), f.search("startTour", null), e.startGuidedTour();
}, 500); else if (_.get(h, "auto_launch")) {
var n = "openshift/viewedHomePage/" + t.user.metadata.name;
"true" !== localStorage.getItem(n) && d(function() {
e.startGuidedTour() && localStorage.setItem(n, "true");
var r = "openshift/viewedHomePage/" + t.user.metadata.name;
"true" !== localStorage.getItem(r) && d(function() {
e.startGuidedTour() && localStorage.setItem(r, "true");
}, 500);
}
}
Expand Down

0 comments on commit 0ce60c1

Please sign in to comment.