Skip to content

Commit

Permalink
Merge pull request #2136 from spadgett/add-to-application-show-kind
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Sep 22, 2017
2 parents 6bac146 + 1468e2d commit be4c893
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
5 changes: 5 additions & 0 deletions app/scripts/directives/addConfigToApplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

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

var getApplications = function() {
var context = {
Expand Down Expand Up @@ -62,6 +63,10 @@
});
};

ctrl.groupByKind = function(object) {
return humanizeKind(object.kind);
};

ctrl.addToApplication = function() {
var applicationToUpdate = angular.copy(ctrl.application);

Expand Down
34 changes: 18 additions & 16 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ return _.get(e, "metadata.name");
return _.get(e, "metadata.uid");
}, G = function() {
return _.size(P.deploymentConfigs) + _.size(P.vanillaReplicationControllers) + _.size(P.deployments) + _.size(P.vanillaReplicaSets) + _.size(P.statefulSets) + _.size(P.monopods) + _.size(P.state.serviceInstances);
}, W = function() {
return _.size(P.filteredDeploymentConfigs) + _.size(P.filteredReplicationControllers) + _.size(P.filteredDeployments) + _.size(P.filteredReplicaSets) + _.size(P.filteredStatefulSets) + _.size(P.filteredMonopods) + _.size(P.filteredServiceInstances);
}, K = function() {
P.size = G(), P.filteredSize = W();
return _.size(P.filteredDeploymentConfigs) + _.size(P.filteredReplicationControllers) + _.size(P.filteredDeployments) + _.size(P.filteredReplicaSets) + _.size(P.filteredStatefulSets) + _.size(P.filteredMonopods) + _.size(P.filteredServiceInstances);
}, W = function() {
P.size = G(), P.filteredSize = K();
var e = 0 === P.size, t = P.deploymentConfigs && P.replicationControllers && P.deployments && P.replicaSets && P.statefulSets && P.pods && P.state.serviceInstances;
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));
}, Q = function(e) {
Expand Down Expand Up @@ -119,7 +119,7 @@ case "name":
return !_.isEmpty(V.filterKeywords);
}
}, ie = function() {
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();
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();
}, se = n.project + "/overview/view-by";
P.viewBy = localStorage.getItem(se) || "app", e.$watch(function() {
return P.viewBy;
Expand Down Expand Up @@ -315,7 +315,7 @@ _.isEmpty(o) || (t = t.concat(o));
qe(), ze();
}, Ge = function() {
_.each(P.deploymentConfigs, Me);
}, We = function() {
}, Ke = function() {
if (V.builds && P.buildConfigs) {
P.recentPipelinesByBuildConfig = {}, V.recentBuildsByBuildConfig = {}, V.recentPipelinesByDeploymentConfig = {};
var e = {};
Expand All @@ -330,7 +330,7 @@ return i.sortBuilds(e, !0);
return i.sortBuilds(e, !0);
}), Ge();
}
}, Ke = function() {
}, We = function() {
k.setQuotaNotifications(V.quotas, V.clusterQuotas, n.project);
};
P.clearFilter = function() {
Expand Down Expand Up @@ -395,7 +395,7 @@ resource: "deployments"
}, a, function(e) {
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);
})), Ye.push(l.watch("builds", a, function(e) {
V.builds = e.by("metadata.name"), We(), h.log("builds (subscribe)", V.builds);
V.builds = e.by("metadata.name"), Ke(), h.log("builds (subscribe)", V.builds);
})), Ye.push(l.watch({
group: "apps",
resource: "statefulsets"
Expand All @@ -415,7 +415,7 @@ P.routes = e.by("metadata.name"), Be(), h.log("routes (subscribe)", P.routes);
poll: R,
pollInterval: 6e4
})), Ye.push(l.watch("buildConfigs", a, function(e) {
P.buildConfigs = e.by("metadata.name"), Fe(), He(), We(), ie(), h.log("buildconfigs (subscribe)", P.buildConfigs);
P.buildConfigs = e.by("metadata.name"), Fe(), He(), Ke(), ie(), h.log("buildconfigs (subscribe)", P.buildConfigs);
}, {
poll: R,
pollInterval: 6e4
Expand All @@ -434,12 +434,12 @@ T = e.by("metadata.name"), m.buildDockerRefMapForImageStreams(T, V.imageStreamIm
poll: R,
pollInterval: 6e4
})), Ye.push(l.watch("resourcequotas", a, function(e) {
V.quotas = e.by("metadata.name"), Ke();
V.quotas = e.by("metadata.name"), We();
}, {
poll: !0,
pollInterval: 6e4
})), Ye.push(l.watch("appliedclusterresourcequotas", a, function(e) {
V.clusterQuotas = e.by("metadata.name"), Ke();
V.clusterQuotas = e.by("metadata.name"), We();
}, {
poll: !0,
pollInterval: 6e4
Expand Down Expand Up @@ -10835,7 +10835,7 @@ templateUrl: "views/directives/action-chip.html"
}), function() {
angular.module("openshiftConsole").component("addConfigToApplication", {
controller: [ "$filter", "$scope", "APIService", "ApplicationsService", "DataService", "Navigate", "NotificationsService", "StorageService", function(e, t, n, a, r, o, i, s) {
var c = this, l = function() {
var c = this, l = e("humanizeKind"), u = function() {
var e = {
namespace: c.project.metadata.name
};
Expand All @@ -10844,13 +10844,13 @@ c.applications = e, c.updating = !1;
});
};
c.$onInit = function() {
c.addType = "env", c.disableInputs = !1, l();
c.addType = "env", c.disableInputs = !1, u();
var e = new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");
c.hasInvalidEnvVars = _.some(c.apiObject.data, function(t, n) {
return !e.test(n);
});
};
var u = function(e) {
var d = function(e) {
return c.attachAllContainers || c.attachContainers[e.name];
};
c.$postLink = function() {
Expand All @@ -10860,6 +10860,8 @@ return c.application;
var e = _.get(c.application, "spec.template");
c.existingMountPaths = s.getMountPaths(e), c.attachAllContainers = !0;
});
}, c.groupByKind = function(e) {
return l(e.kind);
}, c.addToApplication = function() {
var t = angular.copy(c.application), a = _.get(t, "spec.template");
if (c.disableInputs = !0, "env" === c.addType) {
Expand All @@ -10877,16 +10879,16 @@ name: c.apiObject.metadata.name
};
}
_.each(a.spec.containers, function(e) {
u(e) && (e.envFrom = e.envFrom || [], e.envFrom.push(s));
d(e) && (e.envFrom = e.envFrom || [], e.envFrom.push(s));
});
} else {
var l = e("generateName")(c.apiObject.metadata.name + "-"), d = {
var l = e("generateName")(c.apiObject.metadata.name + "-"), u = {
name: l,
mountPath: c.mountVolume,
readOnly: !0
};
_.each(a.spec.containers, function(e) {
u(e) && (e.volumeMounts = e.volumeMounts || [], e.volumeMounts.push(d));
d(e) && (e.volumeMounts = e.volumeMounts || [], e.volumeMounts.push(u));
});
var p = {
name: l
Expand Down

0 comments on commit be4c893

Please sign in to comment.