Skip to content

Commit 2f75b67

Browse files
committed
Add serviceClass url param to jump into service-catalog flow
If a `serviceClass` param is present, look up the serviceClass and launch the service-catalog modal for that class.
1 parent db9abb5 commit 2f75b67

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed

Diff for: 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
}

Diff for: dist/scripts/scripts.js

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

Diff for: dist/styles/vendor.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* angularjs-datatables - v0.5.7
2+
* angularjs-datatables - v0.5.9
33
* https://github.com/dtaylor113/angularjs-datatables
44
* License: MIT
55
*/
@@ -19,7 +19,7 @@ div.DTTT .btn,ul.DTTT_dropdown.dropdown-menu a{color:#333!important}
1919
.dataTables_wrapper .dataTables_paginate .paginate_button{padding:.3em .8em}
2020
.dataTables_wrapper .dataTables_paginate .paginate_button:hover{padding:.3em .8em;background:#D6D6D6;border:1px solid transparent}
2121
/*!
22-
* angularjs-datatables - v0.5.7
22+
* angularjs-datatables - v0.5.9
2323
* https://github.com/dtaylor113/angularjs-datatables
2424
* License: MIT
2525
*/

0 commit comments

Comments
 (0)