Skip to content

Commit 805c67b

Browse files
author
OpenShift Bot
authored
Merge pull request #1444 from spadgett/filter-service-instances
Merged by openshift-bot
2 parents 75d1c56 + 143a0ff commit 805c67b

File tree

7 files changed

+19
-25
lines changed

7 files changed

+19
-25
lines changed

app/scripts/controllers/newOverview.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ function OverviewController($scope,
170170
_.size(overview.filteredReplicaSets) +
171171
_.size(overview.filteredStatefulSets) +
172172
_.size(overview.filteredMonopods) +
173-
_.size(overview.state.serviceInstances);
173+
_.size(overview.filteredServiceInstances);
174174
};
175175

176176
// Show the "Get Started" message if the project is empty.
@@ -305,7 +305,7 @@ function OverviewController($scope,
305305
};
306306

307307
// Updated on viewBy changes to include the app label when appropriate.
308-
var filterFields = ['metadata.name'];
308+
var filterFields = ['metadata.name', 'spec.serviceClassName'];
309309
var filterByName = function(items) {
310310
return KeywordService.filterForKeywords(items, filterFields, state.filterKeywords);
311311
};
@@ -338,6 +338,7 @@ function OverviewController($scope,
338338
overview.filteredStatefulSets = filterItems(overview.statefulSets);
339339
overview.filteredMonopods = filterItems(overview.monopods);
340340
overview.filteredPipelineBuildConfigs = filterItems(overview.pipelineBuildConfigs);
341+
overview.filteredServiceInstances = filterItems(state.orderedServiceInstances);
341342
overview.filterActive = isFilterActive();
342343
updateApps();
343344
updateShowGetStarted();
@@ -1281,6 +1282,7 @@ function OverviewController($scope,
12811282
setNotifications(instance, notifications);
12821283
});
12831284
sortServiceInstances();
1285+
updateLabelSuggestions(state.serviceInstances);
12841286
updateFilter();
12851287
}, {poll: limitWatches, pollInterval: DEFAULT_POLL_INTERVAL}));
12861288
}
@@ -1293,7 +1295,6 @@ function OverviewController($scope,
12931295
state.bindings = bindings.by('metadata.name');
12941296
overview.bindingsByInstanceRef = _.groupBy(state.bindings, 'spec.instanceRef.name');
12951297
refreshSecrets(context);
1296-
updateFilter();
12971298
}, {poll: limitWatches, pollInterval: DEFAULT_POLL_INTERVAL}));
12981299
}
12991300

app/views/new-overview.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,13 @@ <h2>Other Resources</h2>
355355
</div>
356356

357357
<!-- service instances appear the same way no matter the filter listBy option -->
358-
<div ng-if="overview.state.serviceInstances | hashSize">
359-
<h2 ng-if="overview.state.serviceInstances">
358+
<div ng-if="overview.filteredServiceInstances.length">
359+
<h2>
360360
Provisioned Services
361361
</h2>
362362
<div class="list-pf">
363363
<service-instance-row
364-
ng-repeat="serviceInstance in overview.state.orderedServiceInstances"
364+
ng-repeat="serviceInstance in overview.filteredServiceInstances"
365365
api-object="serviceInstance"
366366
bindings="overview.bindingsByInstanceRef[serviceInstance.metadata.name]"
367367
state="overview.state"></service-instance-row>

app/views/overview/_service-instance-row.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
<div class="list-pf-name">
88
<h3>
99
<span ng-bind-html="row.displayName | highlightKeywords : row.state.filterKeywords"></span>
10-
<div class="list-row-longname">
11-
{{row.apiObject.metadata.name}}
12-
</div>
10+
<div ng-bind-html="row.apiObject.metadata.name | highlightKeywords : row.state.filterKeywords" class="list-row-longname"></div>
1311
</h3>
1412
<div class="status-icons">
1513
<notification-icon ng-if="!row.expanded" alerts="row.notifications"></notification-icon>

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"microplugin": "0.0.3",
2727
"selectize": "0.12.1",
2828
"messenger": "1.4.1",
29-
"kubernetes-label-selector": "1.4.2",
29+
"kubernetes-label-selector": "1.4.3",
3030
"kubernetes-topology-graph": "0.0.23",
3131
"kubernetes-container-terminal": "1.0.3",
3232
"registry-image-widgets": "0.0.2",

dist/scripts/scripts.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ return _.get(a, "metadata.uid");
5454
}, P = function() {
5555
return _.size(v.deploymentConfigs) + _.size(v.vanillaReplicationControllers) + _.size(v.deployments) + _.size(v.vanillaReplicaSets) + _.size(v.statefulSets) + _.size(v.monopods) + _.size(v.state.serviceInstances);
5656
}, Q = function() {
57-
return _.size(v.filteredDeploymentConfigs) + _.size(v.filteredReplicationControllers) + _.size(v.filteredDeployments) + _.size(v.filteredReplicaSets) + _.size(v.filteredStatefulSets) + _.size(v.filteredMonopods) + _.size(v.state.serviceInstances);
57+
return _.size(v.filteredDeploymentConfigs) + _.size(v.filteredReplicationControllers) + _.size(v.filteredDeployments) + _.size(v.filteredReplicaSets) + _.size(v.filteredStatefulSets) + _.size(v.filteredMonopods) + _.size(v.filteredServiceInstances);
5858
}, R = function() {
5959
v.size = P(), v.filteredSize = Q();
6060
var a = 0 === v.size, b = v.deploymentConfigs && v.replicationControllers && v.deployments && v.replicaSets && v.statefulSets && v.pods && v.state.serviceInstances;
@@ -99,7 +99,7 @@ v.deploymentConfigsNoPipeline = _.sortBy(a, "metadata.name"), v.pipelineViewHasO
9999
v.disableFilter = "pipeline" === v.viewBy && _.isEmpty(v.pipelineBuildConfigs);
100100
}, Y = function(a) {
101101
return n.getLabelSelector().select(a);
102-
}, Z = [ "metadata.name" ], aa = function(a) {
102+
}, Z = [ "metadata.name", "spec.serviceClassName" ], aa = function(a) {
103103
return m.filterForKeywords(a, Z, L.filterKeywords);
104104
}, ba = function(a) {
105105
switch (v.filterBy) {
@@ -119,7 +119,7 @@ case "name":
119119
return !_.isEmpty(L.filterKeywords);
120120
}
121121
}, da = function() {
122-
v.filteredDeploymentConfigs = ba(v.deploymentConfigs), v.filteredReplicationControllers = ba(v.vanillaReplicationControllers), v.filteredDeployments = ba(v.deployments), v.filteredReplicaSets = ba(v.vanillaReplicaSets), v.filteredStatefulSets = ba(v.statefulSets), v.filteredMonopods = ba(v.monopods), v.filteredPipelineBuildConfigs = ba(v.pipelineBuildConfigs), v.filterActive = ca(), V(), R();
122+
v.filteredDeploymentConfigs = ba(v.deploymentConfigs), v.filteredReplicationControllers = ba(v.vanillaReplicationControllers), v.filteredDeployments = ba(v.deployments), v.filteredReplicaSets = ba(v.vanillaReplicaSets), v.filteredStatefulSets = ba(v.statefulSets), v.filteredMonopods = ba(v.monopods), v.filteredPipelineBuildConfigs = ba(v.pipelineBuildConfigs), v.filteredServiceInstances = ba(L.orderedServiceInstances), v.filterActive = ca(), V(), R();
123123
}, ea = c.project + "/overview/view-by";
124124
v.viewBy = localStorage.getItem(ea) || "app", a.$watch(function() {
125125
return v.viewBy;
@@ -461,15 +461,15 @@ resource:"instances"
461461
L.serviceInstances = a.by("metadata.name"), _.each(L.serviceInstances, function(a) {
462462
var b = t.getServiceInstanceAlerts(a);
463463
ha(a, b);
464-
}), Wa(), da();
464+
}), Wa(), ua(L.serviceInstances), da();
465465
}, {
466466
poll:w,
467467
pollInterval:x
468468
})), g.ENABLE_TECH_PREVIEW_FEATURE.service_catalog_landing_page && Xa.push(h.watch({
469469
group:"servicecatalog.k8s.io",
470470
resource:"bindings"
471471
}, c, function(a) {
472-
L.bindings = a.by("metadata.name"), v.bindingsByInstanceRef = _.groupBy(L.bindings, "spec.instanceRef.name"), Va(c), da();
472+
L.bindings = a.by("metadata.name"), v.bindingsByInstanceRef = _.groupBy(L.bindings, "spec.instanceRef.name"), Va(c);
473473
}, {
474474
poll:w,
475475
pollInterval:x

dist/scripts/templates.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11557,12 +11557,12 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
1155711557
"</div>\n" +
1155811558
"</div>\n" +
1155911559
"\n" +
11560-
"<div ng-if=\"overview.state.serviceInstances | hashSize\">\n" +
11561-
"<h2 ng-if=\"overview.state.serviceInstances\">\n" +
11560+
"<div ng-if=\"overview.filteredServiceInstances.length\">\n" +
11561+
"<h2>\n" +
1156211562
"Provisioned Services\n" +
1156311563
"</h2>\n" +
1156411564
"<div class=\"list-pf\">\n" +
11565-
"<service-instance-row ng-repeat=\"serviceInstance in overview.state.orderedServiceInstances\" api-object=\"serviceInstance\" bindings=\"overview.bindingsByInstanceRef[serviceInstance.metadata.name]\" state=\"overview.state\"></service-instance-row>\n" +
11565+
"<service-instance-row ng-repeat=\"serviceInstance in overview.filteredServiceInstances\" api-object=\"serviceInstance\" bindings=\"overview.bindingsByInstanceRef[serviceInstance.metadata.name]\" state=\"overview.state\"></service-instance-row>\n" +
1156611566
"</div>\n" +
1156711567
"</div>\n" +
1156811568
"</div>\n" +
@@ -12710,9 +12710,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
1271012710
"<div class=\"list-pf-name\">\n" +
1271112711
"<h3>\n" +
1271212712
"<span ng-bind-html=\"row.displayName | highlightKeywords : row.state.filterKeywords\"></span>\n" +
12713-
"<div class=\"list-row-longname\">\n" +
12714-
"{{row.apiObject.metadata.name}}\n" +
12715-
"</div>\n" +
12713+
"<div ng-bind-html=\"row.apiObject.metadata.name | highlightKeywords : row.state.filterKeywords\" class=\"list-row-longname\"></div>\n" +
1271612714
"</h3>\n" +
1271712715
"<div class=\"status-icons\">\n" +
1271812716
"<notification-icon ng-if=\"!row.expanded\" alerts=\"row.notifications\"></notification-icon>\n" +

dist/scripts/vendor.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42801,10 +42801,7 @@ return $.isEmptyObject(this._conjuncts);
4280142801
}, LabelSelector.prototype.each = function(a) {
4280242802
angular.forEach(this._conjuncts, a);
4280342803
}, LabelSelector.prototype.select = function(a) {
42804-
var b = {}, c = this;
42805-
return angular.forEach(a, function(a, d) {
42806-
c.matches(a) && (b[d] = a);
42807-
}), b;
42804+
return _.isArray(a) ? _.filter(a, this.matches, this) :_.pick(a, this.matches, this);
4280842805
}, LabelSelector.prototype.matches = function(a) {
4280942806
if (!a) return !1;
4281042807
if (this.isEmpty()) return this._emptySelectsAll;

0 commit comments

Comments
 (0)