Skip to content

Commit 2605c38

Browse files
author
OpenShift Bot
authored
Merge pull request #71 from spadgett/loading-message
Merged by openshift-bot
2 parents d97c6c1 + 6a49015 commit 2605c38

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

app/scripts/controllers/overview.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ angular.module('openshiftConsole')
2424
// scope variables are inherited by overview-service-group and overview-service directives.
2525
$scope.projectName = $routeParams.project;
2626
$scope.renderOptions = $scope.renderOptions || {};
27+
$scope.renderOptions.showLoading = true;
2728
$scope.renderOptions.showGetStarted = false;
2829

2930
$scope.alerts = $scope.alerts || {};
@@ -266,13 +267,18 @@ angular.module('openshiftConsole')
266267

267268
// Show the "Get Started" message if the project is empty.
268269
var updateShowGetStarted = function() {
270+
// Check if there is any data visible in the overview.
269271
var projectEmpty =
270272
_.isEmpty(services) &&
271273
_.isEmpty(pods) &&
272274
_.isEmpty(deployments) &&
273275
_.isEmpty(deploymentConfigs);
274276

275-
$scope.renderOptions.showGetStarted = projectEmpty;
277+
// Check if we've loaded everything we show on the overview.
278+
var loaded = services && pods && deployments && deploymentConfigs;
279+
280+
$scope.renderOptions.showGetStarted = loaded && projectEmpty;
281+
$scope.renderOptions.showLoading = !loaded && projectEmpty;
276282
};
277283

278284
ProjectsService

app/views/overview.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ <h2>Get started with your project.</h2>
2626
</p>
2727
</div>
2828
</div>
29-
<div ng-if="((services | hashSize) === 0 && (deploymentConfigsByService[''] | hashSize) === 0 && (monopodsByService[''] | hashSize) === 0) && !renderOptions.showGetStarted"
30-
class="loading-message">
29+
<div ng-if="renderOptions.showLoading" class="loading-message">
3130
Loading...
3231
</div>
3332
<div ng-repeat="service in services" ng-if="!isChildService(service) && (service.metadata.labels.app || routesByService[service.metadata.name].length || childServicesByParent[service.metadata.name].length)">
@@ -44,7 +43,7 @@ <h2>Get started with your project.</h2>
4443
</div>
4544

4645
<!-- Unserviced DCs, RCs, and pods -->
47-
<div >
46+
<div>
4847
<overview-service-group
4948
ng-if="(monopodsByService[''] | hashSize) > 0 || (deploymentConfigsByService[''] | hashSize) > 0 || (deploymentsByService[''] | hashSize) > 0">
5049
</overview-service-group>

dist/scripts/scripts.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2725,7 +2725,7 @@ f.unwatchAll(k), n();
27252725
});
27262726
}));
27272727
} ]), angular.module("openshiftConsole").controller("OverviewController", [ "$filter", "$routeParams", "$scope", "AlertMessageService", "BuildsService", "DataService", "DeploymentsService", "Logger", "PodsService", "ProjectsService", "RoutesService", "ServicesService", function(a, b, c, d, e, f, g, h, i, j, k, l) {
2728-
c.projectName = b.project, c.renderOptions = c.renderOptions || {}, c.renderOptions.showGetStarted = !1, c.alerts = c.alerts || {}, d.getAlerts().forEach(function(a) {
2728+
c.projectName = b.project, c.renderOptions = c.renderOptions || {}, c.renderOptions.showLoading = !0, c.renderOptions.showGetStarted = !1, c.alerts = c.alerts || {}, d.getAlerts().forEach(function(a) {
27292729
c.alerts[a.name] = a.data;
27302730
}), d.clearAlerts();
27312731
var m, n, o, p, q, r, s, t, u, v, w = [], x = a("isJenkinsPipelineStrategy"), y = a("annotation"), z = a("label"), A = a("imageObjectRef"), B = a("isRecentDeployment"), C = function() {
@@ -2812,8 +2812,8 @@ s && (c.recentPipelinesByDC = {}, c.recentBuildsByOutputImage = {}, _.each(s, fu
28122812
return R(a) ? x(a) ? void Q(a) :void O(a) :void 0;
28132813
}));
28142814
}, T = function() {
2815-
var a = _.isEmpty(n) && _.isEmpty(q) && _.isEmpty(p) && _.isEmpty(o);
2816-
c.renderOptions.showGetStarted = a;
2815+
var a = _.isEmpty(n) && _.isEmpty(q) && _.isEmpty(p) && _.isEmpty(o), b = n && q && p && o;
2816+
c.renderOptions.showGetStarted = b && a, c.renderOptions.showLoading = !b && a;
28172817
};
28182818
j.get(b.project).then(_.spread(function(a, b) {
28192819
c.project = a, w.push(f.watch("pods", b, function(a) {

dist/scripts/templates.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6597,7 +6597,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
65976597
"</p>\n" +
65986598
"</div>\n" +
65996599
"</div>\n" +
6600-
"<div ng-if=\"((services | hashSize) === 0 && (deploymentConfigsByService[''] | hashSize) === 0 && (monopodsByService[''] | hashSize) === 0) && !renderOptions.showGetStarted\" class=\"loading-message\">\n" +
6600+
"<div ng-if=\"renderOptions.showLoading\" class=\"loading-message\">\n" +
66016601
"Loading...\n" +
66026602
"</div>\n" +
66036603
"<div ng-repeat=\"service in services\" ng-if=\"!isChildService(service) && (service.metadata.labels.app || routesByService[service.metadata.name].length || childServicesByParent[service.metadata.name].length)\">\n" +

0 commit comments

Comments
 (0)