Skip to content

Commit 5456efa

Browse files
author
OpenShift Bot
authored
Merge pull request #1389 from spadgett/mall-test
Merged by openshift-bot
2 parents 3483dc3 + f43fbbe commit 5456efa

File tree

14 files changed

+979
-290
lines changed

14 files changed

+979
-290
lines changed

app/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ <h1>JavaScript Required</h1>
211211
<script src="scripts/services/apps.js"></script>
212212
<script src="scripts/services/resourceAlerts.js"></script>
213213
<script src="scripts/services/listRowUtils.js"></script>
214+
<script src="scripts/controllers/landingPage.js"></script>
214215
<script src="scripts/controllers/projects.js"></script>
215216
<script src="scripts/controllers/pods.js"></script>
216217
<script src="scripts/controllers/pod.js"></script>

app/scripts/app.js

+19-4
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,26 @@ angular
5252
};
5353
}
5454

55+
var landingPageRoute;
56+
var projectsPageRoute = {
57+
templateUrl: 'views/projects.html',
58+
controller: 'ProjectsController'
59+
};
60+
if (_.get(window, 'OPENSHIFT_CONSTANTS.ENABLE_TECH_PREVIEW_FEATURE.service_catalog_landing_page')) {
61+
landingPageRoute = {
62+
templateUrl: 'views/landing-page.html',
63+
controller: 'LandingPageController'
64+
};
65+
$routeProvider.when('/projects', projectsPageRoute);
66+
} else {
67+
landingPageRoute = projectsPageRoute;
68+
$routeProvider.when('/projects', {
69+
redirectTo: '/'
70+
});
71+
}
72+
5573
$routeProvider
56-
.when('/', {
57-
templateUrl: 'views/projects.html',
58-
controller: 'ProjectsController'
59-
})
74+
.when('/', landingPageRoute)
6075
.when('/create-project', {
6176
templateUrl: 'views/create-project.html',
6277
controller: 'CreateProjectController'

app/scripts/constants.js

+6
Original file line numberDiff line numberDiff line change
@@ -436,5 +436,11 @@ angular.extend(window.OPENSHIFT_CONSTANTS, {
436436
}
437437
]
438438
}
439+
],
440+
SAAS_OFFERINGS: [
441+
{id: 1, title: 'Microservices Application', icon: 'fa fa-cubes', url: 'https://www.redhat.com/en/technologies/virtualization', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt.'},
442+
{id: 2, title: 'Mobile Application', icon: 'fa fa-mobile', url: 'https://www.redhat.com/en/technologies/mobile', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt.'},
443+
{id: 3, title: 'Integration Application', icon: 'fa fa-plug', url: 'https://www.redhat.com/en/technologies/cloud-computing', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt.'},
444+
{id: 4, title: 'Business Process Application', icon: 'fa fa-cubes', url: 'https://www.redhat.com/en/technologies/management', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt.'},
439445
]
440446
});
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
'use strict';
2+
3+
angular.module('openshiftConsole')
4+
.controller('LandingPageController',
5+
function($scope,
6+
AuthService,
7+
Constants,
8+
DataService,
9+
Navigate) {
10+
$scope.saasOfferings = Constants.SAAS_OFFERINGS;
11+
12+
$scope.navToProject = function(project) {
13+
Navigate.toProjectOverview(project.metadata.name);
14+
};
15+
16+
$scope.navToProjectList = function() {
17+
Navigate.toProjectList();
18+
};
19+
20+
AuthService.withUser().then(function() {
21+
DataService.list({
22+
group: 'servicecatalog.k8s.io',
23+
resource: 'serviceclasses'
24+
}, $scope).then(function(resp) {
25+
$scope.serviceClasses = resp.by('metadata.name');
26+
});
27+
28+
DataService.list('imagestreams', { namespace: 'openshift' }).then(function(resp) {
29+
$scope.imageStreams = resp.by('metadata.name');
30+
});
31+
});
32+
});

app/scripts/services/navigate.js

+4
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ angular.module("openshiftConsole")
7070
return "project/" + encodeURIComponent(projectName) + "/overview";
7171
},
7272

73+
toProjectList: function(){
74+
$location.path('projects');
75+
},
76+
7377
quotaURL: function(projectName) {
7478
return "project/" + encodeURIComponent(projectName) + "/quota";
7579
},

app/styles/_catalog.less

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@landing-side-bar-top-offset: @navbar-os-header-height-desktop;
2+
@landing-side-bar-width-lg: 425px;
3+
@landing-side-bar-width-md: 375px;
4+
@landing-side-bar-width-sm: 325px;
5+
6+
.console-os .wrap.no-sidebar .middle.landing-page {
7+
background: @panel-shaded;
8+
flex: none;
9+
h1, .nav-tabs {
10+
margin-bottom: 0;
11+
}
12+
@media(min-width: @screen-sm-min){
13+
overflow-y: auto;
14+
width: calc(100% ~"-" @landing-side-bar-width-sm);
15+
}
16+
@media(min-width: @screen-md-min) {
17+
width: calc(100% ~"-" @landing-side-bar-width-md);
18+
}
19+
20+
@media(min-width: @screen-lg-min) {
21+
width: calc(100% ~"-" @landing-side-bar-width-lg);
22+
}
23+
}
24+
25+
@media(min-width: @screen-sm-min) {
26+
.landing-side-bar {
27+
top: @landing-side-bar-top-offset;
28+
}
29+
}

app/styles/main.less

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
@import "_buttons.less";
1313
@import "_forms.less";
1414
@import "_cards.less";
15+
@import "_catalog.less";
1516
@import "_component-animations.less";
1617
@import "_components.less";
1718
@import "_core.less";

app/views/landing-page.html

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<default-header class="top-header"></default-header>
2+
<div class="wrap no-sidebar">
3+
<div class="sidebar-left collapse navbar-collapse navbar-collapse-2">
4+
<navbar-utility-mobile></navbar-utility-mobile>
5+
</div>
6+
<div class="middle landing-page">
7+
<!-- Middle section -->
8+
<div class="middle-section">
9+
<div class="middle-container">
10+
<div class="middle-content">
11+
<landing-page service-classes="serviceClasses" image-streams="imageStreams">
12+
<landingheader>
13+
<div class="build-applications-view">
14+
<saas-list saas-offerings="saasOfferings"></saas-list>
15+
</div>
16+
</landingheader>
17+
<landingbody>
18+
<services-view base-project-url="project" service-classes="serviceClasses" image-streams="imageStreams"></services-view>
19+
</landingbody>
20+
<landingside>
21+
<projects-summary base-project-url="project" projects-url="projects"></projects-summary>
22+
</landingside>
23+
</landing-page>
24+
</div><!-- /middle-content -->
25+
</div><!-- /middle-container -->
26+
</div><!-- /middle-section -->
27+
</div><!-- /middle -->
28+
</div><!-- /wrap -->

bower.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"file-saver": "1.3.3",
4949
"bootstrap-switch": "3.3.3",
5050
"origin-web-common": "0.0.12",
51-
"origin-web-catalog": "0.0.4"
51+
"origin-web-catalog": "0.0.6"
5252
},
5353
"devDependencies": {
5454
"angular-mocks": "1.5.11",
@@ -63,8 +63,7 @@
6363
"patternfly-bootstrap-treeview": "2.1.1",
6464
"angular": "1.5.11",
6565
"kubernetes-object-describer": "1.0.4",
66-
"angular-sanitize": "1.5.11",
67-
"origin-web-common": "0.0.12"
66+
"angular-sanitize": "1.5.11"
6867
},
6968
"overrides": {
7069
"angular": {

dist/scripts/scripts.js

+55-3
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,31 @@ id:"",
12671267
label:"Uncategorized",
12681268
description:""
12691269
} ]
1270+
} ],
1271+
SAAS_OFFERINGS:[ {
1272+
id:1,
1273+
title:"Microservices Application",
1274+
icon:"fa fa-cubes",
1275+
url:"https://www.redhat.com/en/technologies/virtualization",
1276+
description:"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt."
1277+
}, {
1278+
id:2,
1279+
title:"Mobile Application",
1280+
icon:"fa fa-mobile",
1281+
url:"https://www.redhat.com/en/technologies/mobile",
1282+
description:"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt."
1283+
}, {
1284+
id:3,
1285+
title:"Integration Application",
1286+
icon:"fa fa-plug",
1287+
url:"https://www.redhat.com/en/technologies/cloud-computing",
1288+
description:"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt."
1289+
}, {
1290+
id:4,
1291+
title:"Business Process Application",
1292+
icon:"fa fa-cubes",
1293+
url:"https://www.redhat.com/en/technologies/management",
1294+
description:"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt."
12701295
} ]
12711296
}), angular.module("openshiftConsole", [ "ngAnimate", "ngCookies", "ngResource", "ngRoute", "ngSanitize", "openshiftUI", "kubernetesUI", "registryUI.images", "ui.bootstrap", "patternfly.charts", "patternfly.sort", "openshiftConsoleTemplates", "ui.ace", "extension-registry", "as.sortable", "ui.select", "angular-inview", "angularMoment", "ab-base64", "openshiftCommonServices", "openshiftCommonUI", "webCatalog" ]).config([ "$routeProvider", function(a) {
12721297
var b;
@@ -1278,10 +1303,17 @@ templateUrl:"views/new-overview.html",
12781303
controller:"NewOverviewController",
12791304
controllerAs:"overview",
12801305
reloadOnSearch:!1
1281-
}, a.when("/", {
1306+
};
1307+
var c, d = {
12821308
templateUrl:"views/projects.html",
12831309
controller:"ProjectsController"
1284-
}).when("/create-project", {
1310+
};
1311+
_.get(window, "OPENSHIFT_CONSTANTS.ENABLE_TECH_PREVIEW_FEATURE.service_catalog_landing_page") ? (c = {
1312+
templateUrl:"views/landing-page.html",
1313+
controller:"LandingPageController"
1314+
}, a.when("/projects", d)) :(c = d, a.when("/projects", {
1315+
redirectTo:"/"
1316+
})), a.when("/", c).when("/create-project", {
12851317
templateUrl:"views/create-project.html",
12861318
controller:"CreateProjectController"
12871319
}).when("/project/:project", {
@@ -1893,6 +1925,9 @@ a.path(this.projectOverviewURL(b));
18931925
projectOverviewURL:function(a) {
18941926
return "project/" + encodeURIComponent(a) + "/overview";
18951927
},
1928+
toProjectList:function() {
1929+
a.path("projects");
1930+
},
18961931
quotaURL:function(a) {
18971932
return "project/" + encodeURIComponent(a) + "/quota";
18981933
},
@@ -4337,7 +4372,24 @@ _.set(this, "selectedTab.networking", !0), b(this);
43374372
}
43384373
}
43394374
};
4340-
}), angular.module("openshiftConsole").controller("ProjectsController", [ "$scope", "$filter", "$location", "$route", "$timeout", "AlertMessageService", "AuthService", "DataService", "KeywordService", "Logger", "ProjectsService", function(a, b, c, d, e, f, g, h, i, j, k) {
4375+
}), angular.module("openshiftConsole").controller("LandingPageController", [ "$scope", "AuthService", "Constants", "DataService", "Navigate", function(a, b, c, d, e) {
4376+
a.saasOfferings = c.SAAS_OFFERINGS, a.navToProject = function(a) {
4377+
e.toProjectOverview(a.metadata.name);
4378+
}, a.navToProjectList = function() {
4379+
e.toProjectList();
4380+
}, b.withUser().then(function() {
4381+
d.list({
4382+
group:"servicecatalog.k8s.io",
4383+
resource:"serviceclasses"
4384+
}, a).then(function(b) {
4385+
a.serviceClasses = b.by("metadata.name");
4386+
}), d.list("imagestreams", {
4387+
namespace:"openshift"
4388+
}).then(function(b) {
4389+
a.imageStreams = b.by("metadata.name");
4390+
});
4391+
});
4392+
} ]), angular.module("openshiftConsole").controller("ProjectsController", [ "$scope", "$filter", "$location", "$route", "$timeout", "AlertMessageService", "AuthService", "DataService", "KeywordService", "Logger", "ProjectsService", function(a, b, c, d, e, f, g, h, i, j, k) {
43414393
var l, m, n = [], o = [];
43424394
a.alerts = a.alerts || {}, a.loading = !0, a.showGetStarted = !1, a.canCreate = void 0, a.search = {
43434395
text:""

dist/scripts/templates.js

+32
Original file line numberDiff line numberDiff line change
@@ -10237,6 +10237,38 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
1023710237
);
1023810238

1023910239

10240+
$templateCache.put('views/landing-page.html',
10241+
"<default-header class=\"top-header\"></default-header>\n" +
10242+
"<div class=\"wrap no-sidebar\">\n" +
10243+
"<div class=\"sidebar-left collapse navbar-collapse navbar-collapse-2\">\n" +
10244+
"<navbar-utility-mobile></navbar-utility-mobile>\n" +
10245+
"</div>\n" +
10246+
"<div class=\"middle landing-page\">\n" +
10247+
"\n" +
10248+
"<div class=\"middle-section\">\n" +
10249+
"<div class=\"middle-container\">\n" +
10250+
"<div class=\"middle-content\">\n" +
10251+
"<landing-page service-classes=\"serviceClasses\" image-streams=\"imageStreams\">\n" +
10252+
"<landingheader>\n" +
10253+
"<div class=\"build-applications-view\">\n" +
10254+
"<saas-list saas-offerings=\"saasOfferings\"></saas-list>\n" +
10255+
"</div>\n" +
10256+
"</landingheader>\n" +
10257+
"<landingbody>\n" +
10258+
"<services-view base-project-url=\"project\" service-classes=\"serviceClasses\" image-streams=\"imageStreams\"></services-view>\n" +
10259+
"</landingbody>\n" +
10260+
"<landingside>\n" +
10261+
"<projects-summary base-project-url=\"project\" projects-url=\"projects\"></projects-summary>\n" +
10262+
"</landingside>\n" +
10263+
"</landing-page>\n" +
10264+
"</div>\n" +
10265+
"</div>\n" +
10266+
"</div>\n" +
10267+
"</div>\n" +
10268+
"</div>"
10269+
);
10270+
10271+
1024010272
$templateCache.put('views/logs/chromeless-build-log.html',
1024110273
"<default-header class=\"top-header\"></default-header>\n" +
1024210274
"<div class=\"sidebar-left collapse navbar-collapse navbar-collapse-2\">\n" +

0 commit comments

Comments
 (0)