Skip to content

Commit be4c893

Browse files
author
OpenShift Bot
authored
Merge pull request #2136 from spadgett/add-to-application-show-kind
Merged by openshift-bot
2 parents 6bac146 + 1468e2d commit be4c893

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

app/scripts/directives/addConfigToApplication.js

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
function AddConfigToApplication($filter, $scope, APIService, ApplicationsService, DataService, Navigate, NotificationsService, StorageService) {
2626
var ctrl = this;
27+
var humanizeKind = $filter('humanizeKind');
2728

2829
var getApplications = function() {
2930
var context = {
@@ -62,6 +63,10 @@
6263
});
6364
};
6465

66+
ctrl.groupByKind = function(object) {
67+
return humanizeKind(object.kind);
68+
};
69+
6570
ctrl.addToApplication = function() {
6671
var applicationToUpdate = angular.copy(ctrl.application);
6772

dist/scripts/scripts.js

+18-16
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ return _.get(e, "metadata.name");
5353
return _.get(e, "metadata.uid");
5454
}, G = function() {
5555
return _.size(P.deploymentConfigs) + _.size(P.vanillaReplicationControllers) + _.size(P.deployments) + _.size(P.vanillaReplicaSets) + _.size(P.statefulSets) + _.size(P.monopods) + _.size(P.state.serviceInstances);
56-
}, W = function() {
57-
return _.size(P.filteredDeploymentConfigs) + _.size(P.filteredReplicationControllers) + _.size(P.filteredDeployments) + _.size(P.filteredReplicaSets) + _.size(P.filteredStatefulSets) + _.size(P.filteredMonopods) + _.size(P.filteredServiceInstances);
5856
}, K = function() {
59-
P.size = G(), P.filteredSize = W();
57+
return _.size(P.filteredDeploymentConfigs) + _.size(P.filteredReplicationControllers) + _.size(P.filteredDeployments) + _.size(P.filteredReplicaSets) + _.size(P.filteredStatefulSets) + _.size(P.filteredMonopods) + _.size(P.filteredServiceInstances);
58+
}, W = function() {
59+
P.size = G(), P.filteredSize = K();
6060
var e = 0 === P.size, t = P.deploymentConfigs && P.replicationControllers && P.deployments && P.replicaSets && P.statefulSets && P.pods && P.state.serviceInstances;
6161
V.expandAll = t && 1 === P.size, P.showGetStarted = t && e, P.showLoading = !t && e, P.everythingFiltered = !e && !P.filteredSize, P.hidePipelineOtherResources = "pipeline" === P.viewBy && (P.filterActive || _.isEmpty(P.pipelineBuildConfigs));
6262
}, Q = function(e) {
@@ -119,7 +119,7 @@ case "name":
119119
return !_.isEmpty(V.filterKeywords);
120120
}
121121
}, ie = function() {
122-
P.filteredDeploymentConfigs = re(P.deploymentConfigs), P.filteredReplicationControllers = re(P.vanillaReplicationControllers), P.filteredDeployments = re(P.deployments), P.filteredReplicaSets = re(P.vanillaReplicaSets), P.filteredStatefulSets = re(P.statefulSets), P.filteredMonopods = re(P.monopods), P.filteredPipelineBuildConfigs = re(P.pipelineBuildConfigs), P.filteredServiceInstances = re(V.orderedServiceInstances), P.filterActive = oe(), Z(), K();
122+
P.filteredDeploymentConfigs = re(P.deploymentConfigs), P.filteredReplicationControllers = re(P.vanillaReplicationControllers), P.filteredDeployments = re(P.deployments), P.filteredReplicaSets = re(P.vanillaReplicaSets), P.filteredStatefulSets = re(P.statefulSets), P.filteredMonopods = re(P.monopods), P.filteredPipelineBuildConfigs = re(P.pipelineBuildConfigs), P.filteredServiceInstances = re(V.orderedServiceInstances), P.filterActive = oe(), Z(), W();
123123
}, se = n.project + "/overview/view-by";
124124
P.viewBy = localStorage.getItem(se) || "app", e.$watch(function() {
125125
return P.viewBy;
@@ -315,7 +315,7 @@ _.isEmpty(o) || (t = t.concat(o));
315315
qe(), ze();
316316
}, Ge = function() {
317317
_.each(P.deploymentConfigs, Me);
318-
}, We = function() {
318+
}, Ke = function() {
319319
if (V.builds && P.buildConfigs) {
320320
P.recentPipelinesByBuildConfig = {}, V.recentBuildsByBuildConfig = {}, V.recentPipelinesByDeploymentConfig = {};
321321
var e = {};
@@ -330,7 +330,7 @@ return i.sortBuilds(e, !0);
330330
return i.sortBuilds(e, !0);
331331
}), Ge();
332332
}
333-
}, Ke = function() {
333+
}, We = function() {
334334
k.setQuotaNotifications(V.quotas, V.clusterQuotas, n.project);
335335
};
336336
P.clearFilter = function() {
@@ -395,7 +395,7 @@ resource: "deployments"
395395
}, a, function(e) {
396396
I = e.by("metadata.uid"), P.deployments = _.sortBy(I, "metadata.name"), Ee(), Ae(P.deployments), Ae(P.vanillaReplicaSets), we(P.deployments), Qe(), ie(), h.log("deployments (subscribe)", P.deploymentsByUID);
397397
})), Ye.push(l.watch("builds", a, function(e) {
398-
V.builds = e.by("metadata.name"), We(), h.log("builds (subscribe)", V.builds);
398+
V.builds = e.by("metadata.name"), Ke(), h.log("builds (subscribe)", V.builds);
399399
})), Ye.push(l.watch({
400400
group: "apps",
401401
resource: "statefulsets"
@@ -415,7 +415,7 @@ P.routes = e.by("metadata.name"), Be(), h.log("routes (subscribe)", P.routes);
415415
poll: R,
416416
pollInterval: 6e4
417417
})), Ye.push(l.watch("buildConfigs", a, function(e) {
418-
P.buildConfigs = e.by("metadata.name"), Fe(), He(), We(), ie(), h.log("buildconfigs (subscribe)", P.buildConfigs);
418+
P.buildConfigs = e.by("metadata.name"), Fe(), He(), Ke(), ie(), h.log("buildconfigs (subscribe)", P.buildConfigs);
419419
}, {
420420
poll: R,
421421
pollInterval: 6e4
@@ -434,12 +434,12 @@ T = e.by("metadata.name"), m.buildDockerRefMapForImageStreams(T, V.imageStreamIm
434434
poll: R,
435435
pollInterval: 6e4
436436
})), Ye.push(l.watch("resourcequotas", a, function(e) {
437-
V.quotas = e.by("metadata.name"), Ke();
437+
V.quotas = e.by("metadata.name"), We();
438438
}, {
439439
poll: !0,
440440
pollInterval: 6e4
441441
})), Ye.push(l.watch("appliedclusterresourcequotas", a, function(e) {
442-
V.clusterQuotas = e.by("metadata.name"), Ke();
442+
V.clusterQuotas = e.by("metadata.name"), We();
443443
}, {
444444
poll: !0,
445445
pollInterval: 6e4
@@ -10835,7 +10835,7 @@ templateUrl: "views/directives/action-chip.html"
1083510835
}), function() {
1083610836
angular.module("openshiftConsole").component("addConfigToApplication", {
1083710837
controller: [ "$filter", "$scope", "APIService", "ApplicationsService", "DataService", "Navigate", "NotificationsService", "StorageService", function(e, t, n, a, r, o, i, s) {
10838-
var c = this, l = function() {
10838+
var c = this, l = e("humanizeKind"), u = function() {
1083910839
var e = {
1084010840
namespace: c.project.metadata.name
1084110841
};
@@ -10844,13 +10844,13 @@ c.applications = e, c.updating = !1;
1084410844
});
1084510845
};
1084610846
c.$onInit = function() {
10847-
c.addType = "env", c.disableInputs = !1, l();
10847+
c.addType = "env", c.disableInputs = !1, u();
1084810848
var e = new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");
1084910849
c.hasInvalidEnvVars = _.some(c.apiObject.data, function(t, n) {
1085010850
return !e.test(n);
1085110851
});
1085210852
};
10853-
var u = function(e) {
10853+
var d = function(e) {
1085410854
return c.attachAllContainers || c.attachContainers[e.name];
1085510855
};
1085610856
c.$postLink = function() {
@@ -10860,6 +10860,8 @@ return c.application;
1086010860
var e = _.get(c.application, "spec.template");
1086110861
c.existingMountPaths = s.getMountPaths(e), c.attachAllContainers = !0;
1086210862
});
10863+
}, c.groupByKind = function(e) {
10864+
return l(e.kind);
1086310865
}, c.addToApplication = function() {
1086410866
var t = angular.copy(c.application), a = _.get(t, "spec.template");
1086510867
if (c.disableInputs = !0, "env" === c.addType) {
@@ -10877,16 +10879,16 @@ name: c.apiObject.metadata.name
1087710879
};
1087810880
}
1087910881
_.each(a.spec.containers, function(e) {
10880-
u(e) && (e.envFrom = e.envFrom || [], e.envFrom.push(s));
10882+
d(e) && (e.envFrom = e.envFrom || [], e.envFrom.push(s));
1088110883
});
1088210884
} else {
10883-
var l = e("generateName")(c.apiObject.metadata.name + "-"), d = {
10885+
var l = e("generateName")(c.apiObject.metadata.name + "-"), u = {
1088410886
name: l,
1088510887
mountPath: c.mountVolume,
1088610888
readOnly: !0
1088710889
};
1088810890
_.each(a.spec.containers, function(e) {
10889-
u(e) && (e.volumeMounts = e.volumeMounts || [], e.volumeMounts.push(d));
10891+
d(e) && (e.volumeMounts = e.volumeMounts || [], e.volumeMounts.push(u));
1089010892
});
1089110893
var p = {
1089210894
name: l

0 commit comments

Comments
 (0)