Skip to content

Commit 0ce60c1

Browse files
author
OpenShift Bot
authoredSep 18, 2017
Merge pull request #2047 from david-martin/url-params-to-jump-into-service-catalog-flow
Merged by openshift-bot
2 parents 1b695d8 + 2f75b67 commit 0ce60c1

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed
 

‎app/scripts/controllers/landingPage.js

+18
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,24 @@ angular.module('openshiftConsole')
111111
});
112112

113113
function dataLoaded() {
114+
// Check for a service class param to launch the catalog flow for
115+
var paramClass = $location.search()['serviceClass'];
116+
if (paramClass) {
117+
// Search by class name e.g. cakephp-mysql-persistent
118+
var paramItem = _.find($scope.catalogItems, {
119+
resource: {
120+
metadata: {
121+
name: paramClass
122+
}
123+
}
124+
});
125+
// If a catalog item matches, lauch the catalog flow
126+
if (paramItem) {
127+
$scope.$broadcast('open-overlay-panel', paramItem);
128+
return;
129+
}
130+
}
131+
114132
if (!tourEnabled) {
115133
return;
116134
}

‎dist/scripts/scripts.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -4230,12 +4230,23 @@ controller: !0
42304230
};
42314231
}), 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) {
42324232
function g() {
4233+
var n = f.search().serviceClass;
4234+
if (n) {
4235+
var a = _.find(e.catalogItems, {
4236+
resource: {
4237+
metadata: {
4238+
name: n
4239+
}
4240+
}
4241+
});
4242+
if (a) return void e.$broadcast("open-overlay-panel", a);
4243+
}
42334244
if (v) if (p.startTour) d(function() {
42344245
f.replace(), f.search("startTour", null), e.startGuidedTour();
42354246
}, 500); else if (_.get(h, "auto_launch")) {
4236-
var n = "openshift/viewedHomePage/" + t.user.metadata.name;
4237-
"true" !== localStorage.getItem(n) && d(function() {
4238-
e.startGuidedTour() && localStorage.setItem(n, "true");
4247+
var r = "openshift/viewedHomePage/" + t.user.metadata.name;
4248+
"true" !== localStorage.getItem(r) && d(function() {
4249+
e.startGuidedTour() && localStorage.setItem(r, "true");
42394250
}, 500);
42404251
}
42414252
}

0 commit comments

Comments
 (0)
Please sign in to comment.