From 71a047b02a4e3406fc5302575906370cacbb9bb8 Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Date: Mon, 30 Oct 2017 15:33:22 -0400 Subject: [PATCH] Do not allow 'Select from Project' when there are no projects --- app/scripts/controllers/landingPage.js | 11 + .../directives/processTemplateDialog.js | 8 +- .../process-template-select.html | 1 + app/views/landing-page.html | 2 +- dist/scripts/scripts.js | 304 +++++++++--------- dist/scripts/templates.js | 4 +- 6 files changed, 177 insertions(+), 153 deletions(-) diff --git a/app/scripts/controllers/landingPage.js b/app/scripts/controllers/landingPage.js index 2790b967f0..5a675a4081 100644 --- a/app/scripts/controllers/landingPage.js +++ b/app/scripts/controllers/landingPage.js @@ -11,6 +11,7 @@ angular.module('openshiftConsole') DataService, Navigate, NotificationsService, + ProjectsService, RecentlyViewedServiceItems, GuidedTourService, HTMLService, @@ -20,6 +21,7 @@ angular.module('openshiftConsole') $location) { var tourConfig = _.get(Constants, 'GUIDED_TOURS.landing_page_tour'); var tourEnabled = tourConfig && tourConfig.enabled && tourConfig.steps; + var watches = []; $scope.saasOfferings = Constants.SAAS_OFFERINGS; @@ -103,12 +105,21 @@ angular.module('openshiftConsole') $scope.catalogItems = items; dataLoaded(); })); + ProjectsService.list().then(function(projectData) { + var projects = _.toArray(projectData.by('metadata.name')); + $scope.projectsExist = _.size(projects) > 0; + watches.push(ProjectsService.watch($scope, function(projectData){ + var projects = _.toArray(projectData.by('metadata.name')); + $scope.projectsExist = _.size(projects) > 0; + })); + }); }); $scope.$on('$destroy', function() { // If the template dialog was open when the scope was destroyed, still // add the item to recently-viewed. No-op if the dialog is not open. addTemplateToRecentlyViewed(); + DataService.unwatchAll(watches); }); function findParamServiceItem() { diff --git a/app/scripts/directives/processTemplateDialog.js b/app/scripts/directives/processTemplateDialog.js index 1c9137d21e..e87cb51453 100644 --- a/app/scripts/directives/processTemplateDialog.js +++ b/app/scripts/directives/processTemplateDialog.js @@ -98,7 +98,7 @@ ctrl.projectEmptyState = { title: 'No Project Selected', - info: 'Please select a project from the dropdown to load Templates from that project.' + info: 'Please select a project from the dropdown to load templates from that project.' }; ctrl.templatesEmptyState = { @@ -326,6 +326,12 @@ ctrl.searchEnabled = !_.isEmpty(filteredProjects); ctrl.templateProjects = RecentlyViewedProjectsService.orderByMostRecentlyViewed(projects); + ctrl.numTemplateProjects = _.size(ctrl.templateProjects); + + if (ctrl.numTemplateProjects === 1) { + ctrl.templateProject = _.head(ctrl.templateProjects); + ctrl.templateProjectChange(); + } }; function listProjects() { diff --git a/app/views/directives/process-template-dialog/process-template-select.html b/app/views/directives/process-template-dialog/process-template-select.html index de961f0eb1..4aca06da7d 100644 --- a/app/views/directives/process-template-dialog/process-template-select.html +++ b/app/views/directives/process-template-dialog/process-template-select.html @@ -3,6 +3,7 @@

Select from Project

+ on-create-from-project="projectsExist ? fromProjectSelected : undefined"> diff --git a/dist/scripts/scripts.js b/dist/scripts/scripts.js index 93ed63599a..76ae278cca 100644 --- a/dist/scripts/scripts.js +++ b/dist/scripts/scripts.js @@ -1,6 +1,6 @@ "use strict"; -function OverviewController(e, t, n, a, r, o, i, s, c, l, u, d, m, p, f, g, v, h, y, b, C, S, w, k, P, j, R, I) { +function OverviewController(e, t, n, a, r, o, i, s, c, l, u, d, m, p, f, g, v, h, y, b, C, S, w, k, j, P, R, I) { var E = this, T = t("isIE")(); e.projectName = a.project, E.catalogLandingPageEnabled = !u.DISABLE_SERVICE_CATALOG_LANDING_PAGE; var N, D, A = t("annotation"), B = t("canI"), L = t("buildConfigForBuild"), U = t("deploymentIsInProgress"), O = t("imageObjectRef"), F = t("isJenkinsPipelineStrategy"), x = t("isNewerResource"), V = t("label"), M = t("podTemplate"), q = o.getPreferredVersion("servicebindings"), z = o.getPreferredVersion("clusterserviceclasses"), H = o.getPreferredVersion("serviceinstances"), G = o.getPreferredVersion("clusterserviceplans"), K = {}, W = {}, Q = {}, J = E.state = { @@ -159,7 +159,7 @@ var t = X(e); return t ? _.get(J, [ "notificationsByObjectUID", t ], {}) : {}; }, Ce = function(e) { if (X(e)) { -var t = he(e), n = j.getPodAlerts(t, a.project); +var t = he(e), n = P.getPodAlerts(t, a.project); ye(e, n); } }, Se = function(e) { @@ -177,19 +177,19 @@ return _.size(t) < 2 ? null : t[1]; }; var ke = function(e) { var t = {}, n = _e(e); -_.assign(t, j.getDeploymentStatusAlerts(e, n), j.getPausedDeploymentAlerts(e)); +_.assign(t, P.getDeploymentStatusAlerts(e, n), P.getPausedDeploymentAlerts(e)); var a = we(e); _.each(a, function(e) { var n = be(e); _.assign(t, n); }), ye(e, t); -}, Pe = function() { +}, je = function() { _.each(E.deploymentConfigs, ke); -}, je = function(e) { +}, Pe = function(e) { var t = X(e); return t ? _.get(E, [ "replicaSetsByDeploymentUID", t ]) : {}; }, Re = function(e) { -var t = j.getPausedDeploymentAlerts(e), n = je(e); +var t = P.getPausedDeploymentAlerts(e), n = Pe(e); _.each(n, function(e) { var n = be(e); _.assign(t, n); @@ -200,7 +200,7 @@ _.each(E.deployments, Re); Se(E.replicationControllers), Se(E.replicaSets), Se(E.statefulSets), Se(E.monopods); }, Te = _.debounce(function() { e.$evalAsync(function() { -Ee(), Pe(), Ie(); +Ee(), je(), Ie(); }); }, 500), Ne = function(e) { _.isEmpty(e) || (h.addLabelSuggestionsFromResources(e, K), "pipeline" !== E.viewBy && h.setLabelSuggestions(K)); @@ -231,7 +231,7 @@ _.set(n, [ t, e.metadata.name ], e); }), _.each(n, function(e, t) { var n = m.sortByDeploymentVersion(e, !0); E.replicationControllersByDeploymentConfig[t] = n, E.currentByDeploymentConfig[t] = _.head(n); -}), E.vanillaReplicationControllers = _.sortBy(e, "metadata.name"), Pe(); +}), E.vanillaReplicationControllers = _.sortBy(e, "metadata.name"), je(); } }, Oe = function(e, t) { if (_.get(e, "status.replicas")) return !0; @@ -333,7 +333,7 @@ return c.sortBuilds(e, !0); }), et(); } }, nt = function() { -j.setQuotaNotifications(J.quotas, J.clusterQuotas, a.project); +P.setQuotaNotifications(J.quotas, J.clusterQuotas, a.project); }; E.clearFilter = function() { h.clear(), E.filterText = ""; @@ -465,9 +465,9 @@ delete c[t]; J.serviceInstances = e.by("metadata.name"); var t = []; _.each(J.serviceInstances, function(e) { -var n = j.getServiceInstanceAlerts(e); +var n = P.getServiceInstanceAlerts(e); ye(e, n), t.push(o(e)), t.push(i(e)); -}), P.waitForAll(t).finally(function() { +}), j.waitForAll(t).finally(function() { rt(), fe(); }), Ne(J.serviceInstances); }, { @@ -3580,7 +3580,7 @@ target: "_blank" } ] }; } -}, P = function(e, t) { +}, j = function(e, t) { var n = [], a = "Pod" === e.kind ? e : _.get(e, "spec.template"); return a ? (_.each([ "cpu", "memory", "requests.cpu", "requests.memory", "limits.cpu", "limits.memory", "pods" ], function(r) { var o = t.status.total || t.status; @@ -3592,7 +3592,7 @@ s && n.push(s); } } }), n) : n; -}, j = function(t, n, a) { +}, P = function(t, n, a) { var r = []; return t && n ? (_.each(t, function(t) { var o = y(t, n), i = y(t, a), s = e.objectToResourceGroupVersion(t); @@ -3610,7 +3610,7 @@ href: "project/" + e.metadata.namespace + "/quota", label: "View Quota", target: "_blank" } ] -}), r = r.concat(P(t, e)); +}), r = r.concat(j(t, e)); }; _.each(o, p), _.each(i, p); } @@ -3636,8 +3636,8 @@ return { filterQuotasForResource: y, isBestEffortPod: g, isTerminatingPod: v, -getResourceLimitAlerts: P, -getQuotaAlerts: j, +getResourceLimitAlerts: j, +getQuotaAlerts: P, getLatestQuotaAlerts: function(e, t) { var n, a, r = []; return r.push(s.list("resourcequotas", t).then(function(e) { @@ -3646,7 +3646,7 @@ n = e.by("metadata.name"), l.log("quotas", n); a = e.by("metadata.name"), l.log("cluster quotas", a); })), o.all(r).then(function() { return { -quotaAlerts: j(e, n, a) +quotaAlerts: P(e, n, a) }; }); }, @@ -4448,9 +4448,9 @@ g(e, t), f(e); }); } }; -} ]), angular.module("openshiftConsole").controller("LandingPageController", [ "$scope", "$rootScope", "AuthService", "Catalog", "CatalogService", "Constants", "DataService", "Navigate", "NotificationsService", "RecentlyViewedServiceItems", "GuidedTourService", "HTMLService", "$timeout", "$q", "$routeParams", "$location", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, f, g) { -function v() { -var t = g.search(); +} ]), angular.module("openshiftConsole").controller("LandingPageController", [ "$scope", "$rootScope", "AuthService", "Catalog", "CatalogService", "Constants", "DataService", "Navigate", "NotificationsService", "ProjectsService", "RecentlyViewedServiceItems", "GuidedTourService", "HTMLService", "$timeout", "$q", "$routeParams", "$location", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, f, g, v) { +function h() { +var t = v.search(); return t.serviceExternalName ? _.find(e.catalogItems, { resource: { spec: { @@ -4459,39 +4459,39 @@ externalName: t.serviceExternalName } }) : null; } -function h() { -var n = v(); -if (n) e.$broadcast("open-overlay-panel", n); else if (b) if (f.startTour) m(function() { -g.replace(), g.search("startTour", null), e.startGuidedTour(); -}, 500); else if (_.get(y, "auto_launch")) { +function y() { +var n = h(); +if (n) e.$broadcast("open-overlay-panel", n); else if (C) if (g.startTour) p(function() { +v.replace(), v.search("startTour", null), e.startGuidedTour(); +}, 500); else if (_.get(b, "auto_launch")) { var a = "openshift/viewedHomePage/" + t.user.metadata.name; -"true" !== localStorage.getItem(a) && m(function() { +"true" !== localStorage.getItem(a) && p(function() { e.startGuidedTour() && localStorage.setItem(a, "true"); }, 500); } } -var y = _.get(o, "GUIDED_TOURS.landing_page_tour"), b = y && y.enabled && y.steps; +var b = _.get(o, "GUIDED_TOURS.landing_page_tour"), C = b && b.enabled && b.steps, S = []; e.saasOfferings = o.SAAS_OFFERINGS, e.viewMembership = function(e) { s.toProjectMembership(e.metadata.name); -}, b && (e.startGuidedTour = function() { -return !d.isWindowBelowBreakpoint(d.WINDOW_SIZE_SM) && (u.startTour(y.steps), !0); +}, C && (e.startGuidedTour = function() { +return !m.isWindowBelowBreakpoint(m.WINDOW_SIZE_SM) && (d.startTour(b.steps), !0); }), c.clearNotifications(); -var C = function() { +var w = function() { var t = _.get(e, "template.metadata.uid"); -t && l.addItem(t); -}, S = function(e) { +t && u.addItem(t); +}, k = function(e) { return "PartialObjectMetadata" === e.kind; -}, w = function(e) { -return S(e) ? i.get("templates", e.metadata.name, { +}, j = function(e) { +return k(e) ? i.get("templates", e.metadata.name, { namespace: e.metadata.namespace -}) : p.when(e); +}) : f.when(e); }; e.templateSelected = function(t) { -w(t).then(function(t) { +j(t).then(function(t) { _.set(e, "ordering.panelName", "template"), e.template = t; }); }, e.closeOrderingPanel = function() { -e.template && (C(), e.template = null), _.set(e, "ordering.panelName", ""); +e.template && (w(), e.template = null), _.set(e, "ordering.panelName", ""); }, e.deployImageSelected = function() { _.set(e, "ordering.panelName", "deployImage"); }, e.fromFileSelected = function() { @@ -4508,12 +4508,18 @@ message: n }; c.addNotification(a); } -e.catalogItems = t, h(); +e.catalogItems = t, y(); +})), l.list().then(function(t) { +var n = _.toArray(t.by("metadata.name")); +e.projectsExist = _.size(n) > 0, S.push(l.watch(e, function(t) { +var n = _.toArray(t.by("metadata.name")); +e.projectsExist = _.size(n) > 0; })); +}); }), e.$on("$destroy", function() { -C(); -}), b && e.$on("$locationChangeStart", function(t) { -g.search().startTour && (e.startGuidedTour(), t.preventDefault()); +w(), i.unwatchAll(S); +}), C && e.$on("$locationChangeStart", function(t) { +v.search().startTour && (e.startGuidedTour(), t.preventDefault()); }); } ]), angular.module("openshiftConsole").factory("EventsService", [ "BrowserStore", function(e) { var t = e.loadJSON("session", "events") || {}, n = _.get(window, "OPENSHIFT_CONSTANTS.EVENTS_TO_SHOW"); @@ -4739,7 +4745,7 @@ name: t.containerName }), a = b(n); t.containerState = a; }); -}, k = t("annotation"), P = function(t, n) { +}, k = t("annotation"), j = function(t, n) { if (e.loaded = !0, e.pod = t, e.dcName = k(t, "deploymentConfig"), e.rcName = k(t, "deployment"), e.deploymentVersion = k(t, "deploymentVersion"), e.logCanRun = !_.includes([ "New", "Pending", "Unknown" ], t.status.phase), g(), delete e.controllerRef, !e.dcName) { var a = u.getControllerReferences(t); e.controllerRef = _.find(a, function(e) { @@ -4755,10 +4761,10 @@ m.get(n.project).then(_.spread(function(a, l) { f = l, e.project = a, e.projectContext = l, i.get("pods", n.pod, l, { errorNotification: !1 }).then(function(t) { -P(t); +j(t); var a = {}; a[t.metadata.name] = t, e.logOptions.container = n.container || t.spec.containers[0].name, e.containerTerminals = C(), S(t), c.fetchReferencedImageStreamImages(a, e.imagesByDockerReference, e.imageStreamImageRefByDockerReference, f), p.push(i.watchObject("pods", n.pod, l, function(t, n) { -P(t, n), w(e.containerTerminals), S(t); +j(t, n), w(e.containerTerminals), S(t); })); }, function(n) { e.loaded = !0, e.alerts.load = { @@ -4934,9 +4940,9 @@ var h, y, b, C; l.isAvailable().then(function(e) { n.metricsAvailable = e; }); -var S = a("orderObjectsByDate"), w = [ "metadata.name" ], k = [], P = function() { +var S = a("orderObjectsByDate"), w = [ "metadata.name" ], k = [], j = function() { n.filteredPods = s.filterForKeywords(C, w, k), n.filteredReplicationControllers = s.filterForKeywords(y, w, k), n.filteredReplicaSets = s.filterForKeywords(b, w, k), n.filteredBuilds = s.filterForKeywords(h, w, k), n.filteredStatefulSets = s.filterForKeywords(_.values(n.statefulSets), w, k); -}, j = function(e) { +}, P = function(e) { n.logOptions.pods[e.metadata.name] = { container: e.spec.containers[0].name }, n.logCanRun.pods[e.metadata.name] = !_.includes([ "New", "Pending", "Unknown" ], e.status.phase); @@ -5012,7 +5018,7 @@ var t = _.get(n, [ "podsByOwnerUID", e.metadata.uid ], []); _.isEmpty(t) || u.toPodsForDeployment(e, t); }, m.get(e.project).then(_.spread(function(e, a) { n.project = e, n.projectContext = a, g.push(o.watch("pods", a, function(e) { -n.podsByName = e.by("metadata.name"), n.pods = S(n.podsByName, !0), n.podsByOwnerUID = d.groupByOwnerUID(n.pods), n.podsLoaded = !0, _.each(n.pods, j), T(), c.log("pods", n.pods); +n.podsByName = e.by("metadata.name"), n.pods = S(n.podsByName, !0), n.podsByOwnerUID = d.groupByOwnerUID(n.pods), n.podsLoaded = !0, _.each(n.pods, P), T(), c.log("pods", n.pods); })), g.push(o.watch({ resource: "statefulsets", group: "apps", @@ -5044,7 +5050,7 @@ e.hideOlderResources = n.filters.hideOlderResources ? "true" : "false", t.replac var e = t.search(); e.kind = n.kindSelector.selected.kind, t.replace().search(e); }), n.$watch("filters.text", _.debounce(function() { -n.filterKeywords = k = s.generateKeywords(n.filters.text), n.$apply(P); +n.filterKeywords = k = s.generateKeywords(n.filters.text), n.$apply(j); }, 50, { maxWait: 250 })), n.$watch("renderOptions.collapseEventsSidebar", function(e, t) { @@ -5095,7 +5101,7 @@ e && !_.includes(a.serviceAccounts, e) ? a.serviceAccounts = [ e ].concat(t) : a } }); }); -}, P = function(e) { +}, j = function(e) { c.list("rolebindings", f, null, { errorNotification: !1 }).then(function(e) { @@ -5107,14 +5113,14 @@ subjectKindsForUI: u.mapRolebindingsForUI(e.by("metadata.name"), b) }, function() { e && (a.roleBindings[e.metadata.name] = e, a.subjectKindsForUI = u.mapRolebindingsForUI(a.roleBindings, b)), w(); }); -}, j = function(t, n) { +}, P = function(t, n) { a.disableAddForm = !0, m.create(t, n, g, f).then(function() { -P(), S("success", C.update.subject.success({ +j(), S("success", C.update.subject.success({ roleName: t.metadata.name, subjectName: n.name })); }, function(a) { -w(), P(), S("error", C.update.subject.error({ +w(), j(), S("error", C.update.subject.error({ roleName: t.metadata.name, subjectName: n.name }), C.errorReason({ @@ -5123,12 +5129,12 @@ httpErr: e("getErrorDetails")(a) }); }, R = function(t, n, r) { a.disableAddForm = !0, m.addSubject(t, n, r, f).then(function() { -P(), S("success", C.update.subject.success({ +j(), S("success", C.update.subject.success({ roleName: t.roleRef.name, subjectName: n.name })); }, function(a) { -w(), P(), S("error", C.update.subject.error({ +w(), j(), S("error", C.update.subject.error({ roleName: t.roleRef.name, subjectName: n.name }), C.errorReason({ @@ -5216,7 +5222,7 @@ e && !_.includes(a.projects, e) ? a.projects = [ e ].concat(t) : a.projects = t; } }); }), l.get(n.project).then(_.spread(function(n, r) { -f = r, P(), k(f), angular.extend(a, { +f = r, j(), k(f), angular.extend(a, { project: n, subjectKinds: E, canUpdateRolebindings: y("rolebindings", "update", g), @@ -5234,7 +5240,7 @@ return l; }).result.then(function() { m.removeSubject(n, i, a.roleBindings, f).then(function(e) { c ? t.url("./") : (s.getProjectRules(g, !0).then(function() { -P(e[0]); +j(e[0]); var t = y("rolebindings", "update", g); angular.extend(a, { canUpdateRolebindings: t, @@ -5270,7 +5276,7 @@ name: n.metadata.name i && _.some(i.subjects, o) ? S("error", C.update.subject.exists({ roleName: n.metadata.name, subjectName: e -})) : i ? R(i, o, r) : j(n, o); +})) : i ? R(i, o, r) : P(n, o); } }), p.listAllRoles(f, { errorNotification: !1 @@ -5283,7 +5289,7 @@ name: e } }); }; -P(), angular.extend(a, { +j(), angular.extend(a, { toggle: { roles: !1 }, @@ -5822,7 +5828,7 @@ namespace: n.project }), e.emptyMessage = "Loading...", e.deploymentConfigsInstantiateVersion = a.getPreferredVersion("deploymentconfigs/instantiate"), e.deploymentConfigsVersion = a.getPreferredVersion("deploymentconfigs"), e.eventsVersion = a.getPreferredVersion("events"), e.horizontalPodAutoscalersVersion = a.getPreferredVersion("horizontalpodautoscalers"); var y = a.getPreferredVersion("builds"), b = a.getPreferredVersion("imagestreams"), C = a.getPreferredVersion("limitranges"), S = a.getPreferredVersion("replicationcontrollers"); e.healthCheckURL = u.healthCheckURL(n.project, "DeploymentConfig", n.deploymentconfig, e.deploymentConfigsVersion.group); -var w = t("mostRecent"), k = t("orderObjectsByDate"), P = []; +var w = t("mostRecent"), k = t("orderObjectsByDate"), j = []; p.get(n.project).then(_.spread(function(a, r) { function u() { g.getLabelSelector().isEmpty() || !$.isEmptyObject(e.deployments) || $.isEmptyObject(e.unfilteredDeployments) ? delete e.alerts.deployments : e.alerts.deployments = { @@ -5839,7 +5845,7 @@ e.hpaWarnings = t; o.get(e.deploymentConfigsVersion, n.deploymentconfig, r, { errorNotification: !1 }).then(function(a) { -e.loaded = !0, e.deploymentConfig = a, e.strategyParams = t("deploymentStrategyParams")(a), p(), P.push(o.watchObject(e.deploymentConfigsVersion, n.deploymentconfig, r, function(t, n) { +e.loaded = !0, e.deploymentConfig = a, e.strategyParams = t("deploymentStrategyParams")(a), p(), j.push(o.watchObject(e.deploymentConfigsVersion, n.deploymentconfig, r, function(t, n) { "DELETED" === n && (e.alerts.deleted = { type: "warning", message: "This deployment configuration has been deleted." @@ -5851,7 +5857,7 @@ type: "error", message: 404 === n.status ? "This deployment configuration can not be found, it may have been deleted." : "The deployment configuration details could not be loaded.", details: 404 === n.status ? "Any remaining deployment history for this deployment will be shown." : t("getErrorDetails")(n) }; -}), P.push(o.watch(S, r, function(a, r, o) { +}), j.push(o.watch(S, r, function(a, r, o) { var s = n.deploymentconfig; if (e.emptyMessage = "No deployments to show", r) { if (i.deploymentBelongsToConfig(o, n.deploymentconfig)) { @@ -5881,12 +5887,12 @@ labelSelector: v("deploymentConfig") + "=" + e.deploymentConfigName } })), o.list(C, r).then(function(e) { d = e.by("metadata.name"), p(); -}), P.push(o.watch(b, r, function(t) { +}), j.push(o.watch(b, r, function(t) { var n = t.by("metadata.name"); c.buildDockerRefMapForImageStreams(n, h), e.deploymentConfig && c.fetchReferencedImageStreamImages([ e.deploymentConfig.spec.template ], e.imagesByDockerReference, h, r), m.log("imagestreams (subscribe)", e.imageStreams); -})), P.push(o.watch(y, r, function(t) { +})), j.push(o.watch(y, r, function(t) { e.builds = t.by("metadata.name"), m.log("builds (subscribe)", e.builds); -})), P.push(o.watch(e.horizontalPodAutoscalersVersion, r, function(t) { +})), j.push(o.watch(e.horizontalPodAutoscalersVersion, r, function(t) { e.autoscalers = s.filterHPA(t.by("metadata.name"), "DeploymentConfig", n.deploymentconfig), p(); })), g.onActiveFiltersChanged(function(t) { e.$apply(function() { @@ -5913,7 +5919,7 @@ details: t("getErrorDetails")(a) }; }); }; -var j = function() { +var P = function() { if (_.get(e, "deploymentConfig.spec.paused")) return !1; var t = _.get(e, "deploymentConfig.spec.triggers", []); return _.some(t, { @@ -5922,7 +5928,7 @@ type: "ConfigChange" }; e.removeVolume = function(t) { var n; -n = j() ? "This will remove the volume from the deployment config and trigger a new deployment." : "This will remove the volume from the deployment config.", t.persistentVolumeClaim ? n += " It will not delete the persistent volume claim." : t.secret ? n += " It will not delete the secret." : t.configMap && (n += " It will not delete the config map."); +n = P() ? "This will remove the volume from the deployment config and trigger a new deployment." : "This will remove the volume from the deployment config.", t.persistentVolumeClaim ? n += " It will not delete the persistent volume claim." : t.secret ? n += " It will not delete the secret." : t.configMap && (n += " It will not delete the config map."); l.confirm({ message: "Remove volume " + t.name + "?", details: n, @@ -5933,7 +5939,7 @@ cancelButtonText: "Cancel" f.removeVolume(e.deploymentConfig, t, r); }); }, e.$on("$destroy", function() { -o.unwatchAll(P); +o.unwatchAll(j); }); })); } ]), angular.module("openshiftConsole").controller("ReplicaSetController", [ "$scope", "$filter", "$routeParams", "AuthorizationService", "BreadcrumbsService", "DataService", "DeploymentsService", "HPAService", "ImageStreamResolver", "Logger", "MetricsService", "ModalsService", "Navigate", "OwnerReferencesService", "PodsService", "ProjectsService", "StorageService", "keyValueEditorUtils", "kind", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, f, g, v, h, y) { @@ -5951,12 +5957,12 @@ e.resource = "replicationcontrollers", e.healthCheckURL = m.healthCheckURL(n.pro } var k = {}; e.projectName = n.project, e.kind = y, e.replicaSet = null, e.deploymentConfig = null, e.deploymentConfigMissing = !1, e.imagesByDockerReference = {}, e.builds = {}, e.alerts = {}, e.renderOptions = e.renderOptions || {}, e.renderOptions.hideFilterWidget = !0, e.forms = {}, e.logOptions = {}; -var P = []; +var j = []; u.isAvailable().then(function(t) { e.metricsAvailable = t; }); -var j = t("deploymentStatus"), R = function(t) { -e.logCanRun = !_.includes([ "New", "Pending" ], j(t)); +var P = t("deploymentStatus"), R = function(t) { +e.logCanRun = !_.includes([ "New", "Pending" ], P(t)); }, I = t("isIE")(); g.get(n.project).then(_.spread(function(u, g) { e.project = u, e.projectContext = g; @@ -5969,7 +5975,7 @@ var a = s.filterHPA(h, "Deployment", e.deployment.metadata.name); e.autoscalers = e.hpaForRS.concat(a); } else e.autoscalers = e.hpaForRS; }, T = function() { -P.push(o.watch(e.resource, g, function(t) { +j.push(o.watch(e.resource, g, function(t) { var n, a = []; angular.forEach(t.by("metadata.name"), function(t) { (C(t, "deploymentConfig") || "") === e.deploymentConfigName && a.push(t); @@ -6015,7 +6021,7 @@ a && o.get({ group: "apps", resource: "deployments" }, a.name, g).then(function(t) { -e.deployment = t, e.healthCheckURL = m.healthCheckURL(n.project, "Deployment", t.metadata.name, "apps"), P.push(o.watchObject({ +e.deployment = t, e.healthCheckURL = m.healthCheckURL(n.project, "Deployment", t.metadata.name, "apps"), j.push(o.watchObject({ group: "apps", resource: "deployments" }, t.metadata.name, g, function(t, a) { @@ -6032,7 +6038,7 @@ link: m.resourceURL(e.deployment) }, humanizedKind: "Deployments" }), A(), E(); -})), P.push(o.watch({ +})), j.push(o.watch({ group: "extensions", resource: "replicasets" }, g, function(e) { @@ -6059,12 +6065,12 @@ L(); } N(), e.breadcrumbs = r.getBreadcrumbs({ object: t -}), P.push(o.watchObject(e.resource, n.replicaSet, g, function(t, n) { +}), j.push(o.watchObject(e.resource, n.replicaSet, g, function(t, n) { "DELETED" === n && (e.alerts.deleted = { type: "warning", message: "This " + S + " has been deleted." }), e.replicaSet = t, R(t), N(), U(), e.deployment && A(); -})), e.deploymentConfigName && T(), P.push(o.watch("pods", g, function(t) { +})), e.deploymentConfigName && T(), j.push(o.watch("pods", g, function(t) { var n = t.by("metadata.name"); e.podsForDeployment = f.filterForOwner(n, e.replicaSet); })); @@ -6078,18 +6084,18 @@ name: n.replicaSet, kind: y, namespace: n.project }); -}), P.push(o.watch(e.resource, g, function(n, a, r) { +}), j.push(o.watch(e.resource, g, function(n, a, r) { e.replicaSets = n.by("metadata.name"), "ReplicationController" === y && (e.deploymentsByDeploymentConfig = i.associateDeploymentsToDeploymentConfig(e.replicaSets)); var o, s; r && (o = C(r, "deploymentConfig"), s = r.metadata.name), e.deploymentConfigDeploymentsInProgress = e.deploymentConfigDeploymentsInProgress || {}, a ? "ADDED" === a || "MODIFIED" === a && t("deploymentIsInProgress")(r) ? (e.deploymentConfigDeploymentsInProgress[o] = e.deploymentConfigDeploymentsInProgress[o] || {}, e.deploymentConfigDeploymentsInProgress[o][s] = r) : "MODIFIED" === a && e.deploymentConfigDeploymentsInProgress[o] && delete e.deploymentConfigDeploymentsInProgress[o][s] : e.deploymentConfigDeploymentsInProgress = i.associateRunningDeploymentToDeploymentConfig(e.deploymentsByDeploymentConfig), r ? "DELETED" !== a && (r.causes = t("deploymentCauses")(r)) : angular.forEach(e.replicaSets, function(e) { e.causes = t("deploymentCauses")(e); }); -})), P.push(o.watch("imagestreams", g, function(e) { +})), j.push(o.watch("imagestreams", g, function(e) { var t = e.by("metadata.name"); c.buildDockerRefMapForImageStreams(t, k), U(), l.log("imagestreams (subscribe)", t); -})), P.push(o.watch("builds", g, function(t) { +})), j.push(o.watch("builds", g, function(t) { e.builds = t.by("metadata.name"), l.log("builds (subscribe)", e.builds); -})), P.push(o.watch({ +})), j.push(o.watch({ group: "autoscaling", resource: "horizontalpodautoscalers", version: "v1" @@ -6101,12 +6107,12 @@ pollInterval: 6e4 })), o.list("limitranges", g).then(function(t) { e.limitRanges = t.by("metadata.name"), N(); }); -P.push(o.watch("resourcequotas", g, function(t) { +j.push(o.watch("resourcequotas", g, function(t) { e.quotas = t.by("metadata.name"); }, { poll: !0, pollInterval: 6e4 -})), P.push(o.watch("appliedclusterresourcequotas", g, function(t) { +})), j.push(o.watch("appliedclusterresourcequotas", g, function(t) { e.clusterQuotas = t.by("metadata.name"); }, { poll: !0, @@ -6114,7 +6120,7 @@ pollInterval: 6e4 })); var O = t("deploymentIsLatest"); e.showRollbackAction = function() { -return "Complete" === j(e.replicaSet) && !O(e.replicaSet, e.deploymentConfig) && !e.replicaSet.metadata.deletionTimestamp && a.canI("deploymentconfigrollbacks", "create"); +return "Complete" === P(e.replicaSet) && !O(e.replicaSet, e.deploymentConfig) && !e.replicaSet.metadata.deletionTimestamp && a.canI("deploymentconfigrollbacks", "create"); }, e.retryFailedDeployment = function(t) { i.retryFailedDeployment(t, g, e); }, e.rollbackToDeployment = function(t, n, a, r) { @@ -6147,7 +6153,7 @@ cancelButtonText: "Cancel" v.removeVolume(e.replicaSet, n, g); }); }, e.$on("$destroy", function() { -o.unwatchAll(P); +o.unwatchAll(j); }); })); } ]), angular.module("openshiftConsole").controller("StatefulSetsController", [ "$scope", "$routeParams", "DataService", "ProjectsService", "LabelFilter", "PodsService", function(e, t, n, a, r, o) { @@ -6991,7 +6997,7 @@ return _.map(e, "metadata.name"); }); e.secrets.secretsByType = _.each(a, function(e) { e.unshift(""); -}), P(); +}), j(); }); var n = function(e, n) { e.type = n && n.kind ? n.kind : "None"; @@ -7141,7 +7147,7 @@ var t = [].concat(e.triggers.githubWebhooks, e.triggers.gitlabWebhooks, e.trigge return t = _.filter(t, function(e) { return _.has(e, "disabled") && !e.disabled || e.present; }), t = _.map(t, "data"); -}, P = function() { +}, j = function() { switch (e.secrets.picked = { gitSecret: e.buildConfig.spec.source.sourceSecret ? [ e.buildConfig.spec.source.sourceSecret ] : [ { name: "" @@ -7171,7 +7177,7 @@ name: "" mountPath: "" } ]; } -}, j = function(e, t, n) { +}, P = function(e, t, n) { t.name ? e[n] = t : delete e[n]; }, R = function(t, n) { var a = "Custom" === e.strategyType ? "secretSource" : "secret", r = _.filter(n, function(e) { @@ -7206,7 +7212,7 @@ break; case "JenkinsPipeline": "path" === e.jenkinsfileOptions.type ? delete e.updatedBuildConfig.spec.strategy.jenkinsPipelineStrategy.jenkinsfile : delete e.updatedBuildConfig.spec.strategy.jenkinsPipelineStrategy.jenkinsfilePath; } -switch (e.sources.images && !_.isEmpty(e.sourceImages) && (e.updatedBuildConfig.spec.source.images[0].paths = S(e.imageSourcePaths), e.updatedBuildConfig.spec.source.images[0].from = w(e.imageOptions.fromSource)), "None" === e.imageOptions.from.type ? delete h(e.updatedBuildConfig).from : h(e.updatedBuildConfig).from = w(e.imageOptions.from), "None" === e.imageOptions.to.type ? delete e.updatedBuildConfig.spec.output.to : e.updatedBuildConfig.spec.output.to = w(e.imageOptions.to), h(e.updatedBuildConfig).env = p.compactEntries(e.envVars), j(e.updatedBuildConfig.spec.source, _.head(e.secrets.picked.gitSecret), "sourceSecret"), j(h(e.updatedBuildConfig), _.head(e.secrets.picked.pullSecret), "pullSecret"), j(e.updatedBuildConfig.spec.output, _.head(e.secrets.picked.pushSecret), "pushSecret"), e.strategyType) { +switch (e.sources.images && !_.isEmpty(e.sourceImages) && (e.updatedBuildConfig.spec.source.images[0].paths = S(e.imageSourcePaths), e.updatedBuildConfig.spec.source.images[0].from = w(e.imageOptions.fromSource)), "None" === e.imageOptions.from.type ? delete h(e.updatedBuildConfig).from : h(e.updatedBuildConfig).from = w(e.imageOptions.from), "None" === e.imageOptions.to.type ? delete e.updatedBuildConfig.spec.output.to : e.updatedBuildConfig.spec.output.to = w(e.imageOptions.to), h(e.updatedBuildConfig).env = p.compactEntries(e.envVars), P(e.updatedBuildConfig.spec.source, _.head(e.secrets.picked.gitSecret), "sourceSecret"), P(h(e.updatedBuildConfig), _.head(e.secrets.picked.pullSecret), "pullSecret"), P(e.updatedBuildConfig.spec.output, _.head(e.secrets.picked.pushSecret), "pushSecret"), e.strategyType) { case "Source": case "Docker": R(e.updatedBuildConfig.spec.source, e.secrets.picked.sourceSecrets); @@ -7428,7 +7434,7 @@ command: [], environment: [] }), e.strategyParamsPropertyName = t; }; -var P = function(e, t, n, a) { +var j = function(e, t, n, a) { var r = { kind: "ImageStreamTag", namespace: t.namespace, @@ -7442,12 +7448,12 @@ containerNames: [ e ], from: r } }, n; -}, j = function() { +}, P = function() { var t = _.reject(e.updatedDeploymentConfig.spec.triggers, function(e) { return "ImageChange" === e.type || "ConfigChange" === e.type; }); return _.each(e.containerConfigByName, function(n, a) { -n.hasDeploymentTrigger ? t.push(P(a, n.triggerData.istag, n.triggerData.data, n.triggerData.automatic)) : _.find(e.updatedDeploymentConfig.spec.template.spec.containers, { +n.hasDeploymentTrigger ? t.push(j(a, n.triggerData.istag, n.triggerData.data, n.triggerData.automatic)) : _.find(e.updatedDeploymentConfig.spec.template.spec.containers, { name: a }).image = n.image; }), e.triggers.hasConfigTrigger && t.push({ @@ -7469,7 +7475,7 @@ var o = e.strategyData[e.strategyParamsPropertyName].maxUnavailable, i = Number( } "Custom" !== e.strategyData.type && _.each([ "pre", "mid", "post" ], function(t) { _.has(e.strategyData, [ e.strategyParamsPropertyName, t, "execNewPod", "env" ]) && (e.strategyData[e.strategyParamsPropertyName][t].execNewPod.env = f.compactEntries(e.strategyData[e.strategyParamsPropertyName][t].execNewPod.env)); -}), _.has(e, "strategyData.customParams.environment") && (e.strategyData.customParams.environment = f.compactEntries(e.strategyData.customParams.environment)), e.updatedDeploymentConfig.spec.template.spec.imagePullSecrets = _.filter(e.secrets.pullSecrets, "name"), e.updatedDeploymentConfig.spec.strategy = e.strategyData, e.updatedDeploymentConfig.spec.triggers = j(), R(), c.update("deploymentconfigs", e.updatedDeploymentConfig.metadata.name, e.updatedDeploymentConfig, e.context).then(function() { +}), _.has(e, "strategyData.customParams.environment") && (e.strategyData.customParams.environment = f.compactEntries(e.strategyData.customParams.environment)), e.updatedDeploymentConfig.spec.template.spec.imagePullSecrets = _.filter(e.secrets.pullSecrets, "name"), e.updatedDeploymentConfig.spec.strategy = e.strategyData, e.updatedDeploymentConfig.spec.triggers = P(), R(), c.update("deploymentconfigs", e.updatedDeploymentConfig.metadata.name, e.updatedDeploymentConfig, e.context).then(function() { d.addNotification({ type: "success", message: "Deployment config " + e.updatedDeploymentConfig.metadata.name + " was successfully updated." @@ -7873,11 +7879,11 @@ e.projectTemplates = t.by("metadata.name"); }))) : l.toErrorPage("Catalog category " + r.category + "/" + r.subcategory + " not found."); } else l.toErrorPage("Catalog category " + r.category + " not found."); } ]), angular.module("openshiftConsole").controller("CreateFromImageController", [ "$scope", "$filter", "$parse", "$q", "$routeParams", "$uibModal", "APIService", "ApplicationGenerator", "DataService", "HPAService", "ImagesService", "LimitRangesService", "Logger", "MetricsService", "Navigate", "NotificationsService", "ProjectsService", "QuotaService", "SOURCE_URL_PATTERN", "SecretsService", "TaskList", "failureObjectNameFilter", "keyValueEditorUtils", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, f, g, v, h, y, b, C, S, w) { -var k = t("displayName"), P = t("humanize"); +var k = t("displayName"), j = t("humanize"); e.projectName = r.project, e.sourceURLPattern = y; -var j = r.imageStream; -if (j) if (r.imageTag) { -var R = r.displayName || j; +var P = r.imageStream; +if (P) if (r.imageTag) { +var R = r.displayName || P; e.displayName = r.displayName, e.advancedOptions = "true" === r.advanced, e.breadcrumbs = [ { title: "Add to Project", link: "project/" + e.projectName + "/create" @@ -7913,7 +7919,7 @@ y = e.by("metadata.name"), m.log("cluster quotas", y); }), e.$watch("scaling.autoscale", S), e.$watch("container", S, !0), e.$watch("name", function(e, t) { I.value && I.value !== t || (I.value = e); }), function(a) { -a.name = r.name, a.imageName = j, a.imageTag = r.imageTag, a.namespace = r.namespace, a.buildConfig = { +a.name = r.name, a.imageName = P, a.imageTag = r.imageTag, a.namespace = r.namespace, a.buildConfig = { buildOnSourceChange: !0, buildOnImageChange: !0, buildOnConfigChange: !0, @@ -8020,13 +8026,13 @@ message: "All resources for application " + e.name + " were created successfully }) : (r = !0, n.failure.forEach(function(e) { a.push({ type: "error", -message: "Cannot create " + P(e.object.kind).toLowerCase() + ' "' + e.object.metadata.name + '". ', +message: "Cannot create " + j(e.object.kind).toLowerCase() + ' "' + e.object.metadata.name + '". ', details: e.data.message }); }), n.success.forEach(function(e) { a.push({ type: "success", -message: "Created " + P(e.kind).toLowerCase() + ' "' + e.metadata.name + '" successfully. ' +message: "Created " + j(e.kind).toLowerCase() + ' "' + e.metadata.name + '" successfully. ' }); })), t.resolve({ alerts: a, @@ -8567,11 +8573,11 @@ a.history.back(); n.cancel = w; var k = function(e) { return n.attach.allContainers || n.attach.containers[e.name]; -}, P = function() { +}, j = function() { var e = _.get(n, "attach.resource.spec.template"); n.existingMountPaths = m.getMountPaths(e, k); }; -n.$watchGroup([ "attach.resource", "attach.allContainers" ], P), n.$watch("attach.containers", P, !0); +n.$watchGroup([ "attach.resource", "attach.allContainers" ], j), n.$watch("attach.containers", j, !0); s.get(v, t.name, d).then(function(e) { n.attach.resource = e, n.breadcrumbs = i.getBreadcrumbs({ object: e, @@ -9542,7 +9548,7 @@ _.isEmpty(p.createResources) ? (t = _.head(p.updateResources), i.update(r.kindTo namespace: p.input.selectedProject.metadata.name }).then(function() { if (!p.isDialog) { -var e = j(t.kind); +var e = P(t.kind); c.addNotification({ type: "success", message: _.capitalize(e) + " " + t.metadata.name + " was successfully updated." @@ -9553,14 +9559,14 @@ b(); c.addNotification({ id: "from-file-error", type: "error", -message: "Unable to update the " + j(t.kind) + " '" + t.metadata.name + "'.", +message: "Unable to update the " + P(t.kind) + " '" + t.metadata.name + "'.", details: e("getErrorDetails")(n) }); })) : (t = _.head(p.createResources), i.create(r.kindToResource(t.kind), null, t, { namespace: p.input.selectedProject.metadata.name }).then(function() { if (!p.isDialog) { -var e = j(t.kind); +var e = P(t.kind); c.addNotification({ type: "success", message: _.capitalize(e) + " " + t.metadata.name + " was successfully created." @@ -9571,7 +9577,7 @@ b(); c.addNotification({ id: "from-file-error", type: "error", -message: "Unable to create the " + j(t.kind) + " '" + t.metadata.name + "'.", +message: "Unable to create the " + P(t.kind) + " '" + t.metadata.name + "'.", details: e("getErrorDetails")(n) }); })); @@ -9591,17 +9597,17 @@ var n = [], a = !1; if (t.failure.length > 0) a = !0, p.errorOccurred = !0, t.failure.forEach(function(e) { n.push({ type: "error", -message: "Cannot create " + j(e.object.kind) + ' "' + e.object.metadata.name + '". ', +message: "Cannot create " + P(e.object.kind) + ' "' + e.object.metadata.name + '". ', details: e.data.message }); }), t.success.forEach(function(e) { n.push({ type: "success", -message: "Created " + j(e.kind) + ' "' + e.metadata.name + '" successfully. ' +message: "Created " + P(e.kind) + ' "' + e.metadata.name + '" successfully. ' }); }); else { var r; -r = p.isList ? "All items in list were created successfully." : j(p.resourceKind) + " " + p.resourceName + " was successfully created.", n.push({ +r = p.isList ? "All items in list were created successfully." : P(p.resourceKind) + " " + p.resourceName + " was successfully created.", n.push({ type: "success", message: r }); @@ -9628,17 +9634,17 @@ var n = [], a = !1; if (t.failure.length > 0) a = !0, p.errorOccurred = !0, t.failure.forEach(function(e) { n.push({ type: "error", -message: "Cannot update " + j(e.object.kind) + ' "' + e.object.metadata.name + '". ', +message: "Cannot update " + P(e.object.kind) + ' "' + e.object.metadata.name + '". ', details: e.data.message }); }), t.success.forEach(function(e) { n.push({ type: "success", -message: "Updated " + j(e.kind) + ' "' + e.metadata.name + '" successfully. ' +message: "Updated " + P(e.kind) + ' "' + e.metadata.name + '" successfully. ' }); }); else { var r; -r = p.isList ? "All items in list were updated successfully." : j(p.resourceKind) + " " + p.resourceName + " was successfully updated.", n.push({ +r = p.isList ? "All items in list were updated successfully." : P(p.resourceKind) + " " + p.resourceName + " was successfully updated.", n.push({ type: "success", message: r }); @@ -9659,15 +9665,15 @@ alerts: n }), e.promise; }); } -var P; +var j; p.noProjectsCantCreate = !1; -var j = e("humanizeKind"), R = e("getErrorDetails"); +var P = e("humanizeKind"), R = e("getErrorDetails"); d.clear(), p.$on("no-projects-cannot-create", function() { p.noProjectsCantCreate = !0; }), p.input = { selectedProject: p.project }, p.aceLoaded = function(e) { -(P = e.getSession()).setOption("tabSize", 2), P.setOption("useSoftTabs", !0), e.setDragDelay = 0, e.$blockScrolling = 1 / 0; +(j = e.getSession()).setOption("tabSize", 2), j.setOption("useSoftTabs", !0), e.setDragDelay = 0, e.$blockScrolling = 1 / 0; }; var I = function(e) { a.open({ @@ -11494,7 +11500,7 @@ links: [ { href: "", label: "Retry", onClick: function() { -delete m.alerts[t], U = 1, j(); +delete m.alerts[t], U = 1, P(); } } ] }; @@ -11508,12 +11514,12 @@ t.total = p(t.id), t.total && (m.hasLimits = !0); var a = _.get(n, "usage.value"); isNaN(a) && (a = 0), e.convert && (a = e.convert(a)), t.used = d3.round(a, e.usagePrecision), t.total && (t.available = d3.round(t.total - a, e.usagePrecision)), e.totalUsed += t.used; } -function P(e, t) { +function j(e, t) { m.noData = !1; var n = _.initial(t.data); e.data ? e.data = _.chain(e.data).takeRight(D).concat(n).value() : e.data = n; } -function j() { +function P() { if (w()) { var e = v(), t = []; angular.forEach(m.metrics, function(n) { @@ -11528,7 +11534,7 @@ k(n, r, e); } }), t = t.concat(a), r.all(a).then(function(e) { A || angular.forEach(e, function(e) { -e && P(_.find(n.datasets, { +e && j(_.find(n.datasets, { id: e.metricID }), e); }); @@ -11632,8 +11638,8 @@ _.each(m.metrics, function(e) { _.each(e.datasets, function(e) { delete e.data; }); -}), delete m.metricsError, j(); -}, !0), R = t(j, c.getDefaultUpdateInterval(), !1); +}), delete m.metricsError, P(); +}, !0), R = t(P, c.getDefaultUpdateInterval(), !1); }); var O = o.$on("metrics.charts.resize", function() { c.redraw(I), c.redraw(E); @@ -11674,7 +11680,7 @@ count: 0 return _.each(R[e.descriptor], function(e) { _.each(e, function(e) { var t = s(e); -(!P || P < e.end) && (P = e.end), n(e) || (t.total += e.value, t.count = t.count + 1); +(!j || j < e.end) && (j = e.end), n(e) || (t.total += e.value, t.count = t.count + 1); }); }), _.each(a, function(t, n) { var a; @@ -11693,7 +11699,7 @@ var a = t + "-dates"; _.set(i, [ "xs", t ], a); var s = [ a ], c = [ t ]; o.push(s), o.push(c), _.each(R[r.descriptor][t], function(e) { -if (s.push(e.start), (!P || P < e.end) && (P = e.end), n(e)) c.push(e.value); else { +if (s.push(e.start), (!j || j < e.end) && (j = e.end), n(e)) c.push(e.value); else { var t = r.convert ? r.convert(e.value) : e.value; c.push(t); } @@ -11725,7 +11731,7 @@ pods: t.pods, namespace: e.metadata.namespace, bucketDuration: p() }; -return w || (n.containerName = t.options.selectedContainer.name), n.start = P || d(), n; +return w || (n.containerName = t.options.selectedContainer.name), n.start = j || d(), n; } } function g(e) { @@ -11760,7 +11766,7 @@ _.set(R, [ e, n ], i); } function y() { if (!I && v()) { -j = Date.now(); +P = Date.now(); var e = f(); c.getPodMetrics(e).then(u, g).finally(function() { t.loaded = !0; @@ -11769,7 +11775,7 @@ t.loaded = !0; } var b, C = {}, S = 30, w = "compact" === t.profile, k = !1; t.uniqueID = s.uniqueID(); -var P, j, R = {}, I = w, E = function(e) { +var j, P, R = {}, I = w, E = function(e) { return e >= 1024; }; t.metrics = [ { @@ -11840,9 +11846,9 @@ var n = s.getDefaultSparklineConfig(e.chartID, e.units, w); return _.set(n, "legend.show", !w && !t.showAverage), n; }; t.$watch("options", function() { -R = {}, P = null, delete t.metricsError, y(); +R = {}, j = null, delete t.metricsError, y(); }, !0), b = e(y, s.getDefaultUpdateInterval(), !1), t.updateInView = function(e) { -I = !e, e && (!j || Date.now() > j + s.getDefaultUpdateInterval()) && y(); +I = !e, e && (!P || Date.now() > P + s.getDefaultUpdateInterval()) && y(); }; var A = r.$on("metrics.charts.resize", function() { s.redraw(C); @@ -11900,10 +11906,10 @@ offset: { top: t.followAffixTop || 0 } }); -}, P = function() { +}, j = function() { return $("#" + t.logViewerID + " .log-view-output"); -}, j = function(e) { -var n = P(), a = n.offset().top; +}, P = function(e) { +var n = j(), a = n.offset().top; if (!(a < 0)) { var r = $(".ellipsis-pulser").outerHeight(!0), o = t.fixedHeight ? t.fixedHeight : Math.floor($(window).height() - a - r); t.chromeless || t.fixedHeight || (o -= 40), e ? n.animate({ @@ -11918,11 +11924,11 @@ t.sized = !0; }); }, n = 0; y = setInterval(function() { -n > 10 ? e() : (n++, P().is(":visible") && (j(), e())); +n > 10 ? e() : (n++, j().is(":visible") && (P(), e())); }, 100); } }, I = _.debounce(function() { -j(!0), b(), S(); +P(!0), b(), S(); }, 100); m.on("resize", I); var E, T = function() { @@ -13101,7 +13107,7 @@ cancelButtonText: "Cancel" i.hideNotification("process-template-error"), _.each(w, function(e) { !e.id || "error" !== e.type && "warning" !== e.type || i.hideNotification(e.id); }); -}, P = function(e) { +}, j = function(e) { k(), w = u.getSecurityAlerts(b, v.selectedProject.metadata.name); var t = e.quotaAlerts || []; w = w.concat(t), _.filter(w, { @@ -13109,17 +13115,17 @@ type: "error" }).length ? (v.disableInputs = !1, _.each(w, function(e) { e.id = _.uniqueId("process-template-alert-"), i.addNotification(e); })) : w.length ? (S(w), v.disableInputs = !1) : C(); -}, j = function() { +}, P = function() { if (_.has(v.selectedProject, "metadata.uid")) return t.when(v.selectedProject); var n = v.selectedProject.metadata.name, a = v.selectedProject.metadata.annotations["new-display-name"], r = e("description")(v.selectedProject); return c.create(n, a, r); }; v.createFromTemplate = function() { -v.disableInputs = !0, j().then(function(e) { +v.disableInputs = !0, P().then(function(e) { v.selectedProject = e, g = { namespace: v.selectedProject.metadata.name }, v.template.labels = m.mapEntries(m.compactEntries(v.labels)), r.create("processedtemplates", null, v.template, g).then(function(e) { -s.setTemplateData(e.parameters, v.template.parameters, e.message), b = e.objects, l.getLatestQuotaAlerts(b, g).then(P); +s.setTemplateData(e.parameters, v.template.parameters, e.message), b = e.objects, l.getLatestQuotaAlerts(b, g).then(j); }, function(e) { v.disableInputs = !1; var t; @@ -13248,7 +13254,7 @@ b.loginBaseUrl = r.openshiftAPIBaseUrl(), b.preSelectedProject = b.selectedProje b.noProjectsCantCreate = !0; }), b.projectEmptyState = { title: "No Project Selected", -info: "Please select a project from the dropdown to load Templates from that project." +info: "Please select a project from the dropdown to load templates from that project." }, b.templatesEmptyState = { title: "No Templates", info: "The selected project has no templates available to import." @@ -13294,7 +13300,7 @@ return c.isRecentlyViewed(e.metadata.uid) ? "Recently Viewed" : "Other Projects" }; var w = function() { var e = _.reject(b.unfilteredProjects, "metadata.deletionTimestamp"), n = _.sortBy(e, t("displayName")); -b.searchEnabled = !_.isEmpty(e), b.templateProjects = c.orderByMostRecentlyViewed(n); +b.searchEnabled = !_.isEmpty(e), b.templateProjects = c.orderByMostRecentlyViewed(n), b.numTemplateProjects = _.size(b.templateProjects), 1 === b.numTemplateProjects && (b.templateProject = _.head(b.templateProjects), b.templateProjectChange()); }; } ], controllerAs: "$ctrl", @@ -14083,15 +14089,15 @@ details: g(e) } } else n.mode = "istag"; }); -var P, j = e("displayName"), R = function() { +var j, P = e("displayName"), R = function() { var e = { -started: "Deploying image " + n.app.name + " to project " + j(n.input.selectedProject), -success: "Deployed image " + n.app.name + " to project " + j(n.input.selectedProject), -failure: "Failed to deploy image " + n.app.name + " to project " + j(n.input.selectedProject) +started: "Deploying image " + n.app.name + " to project " + P(n.input.selectedProject), +success: "Deployed image " + n.app.name + " to project " + P(n.input.selectedProject), +failure: "Failed to deploy image " + n.app.name + " to project " + P(n.input.selectedProject) }; d.clear(), d.add(e, {}, n.input.selectedProject.metadata.name, function() { var e = t.defer(); -return o.batch(P, { +return o.batch(j, { namespace: n.input.selectedProject.metadata.name }).then(function(t) { var a, r = !_.isEmpty(t.failure); @@ -14146,8 +14152,8 @@ e.id = _.uniqueId("deploy-image-alert-"), c.addNotification(e); }; n.create = function() { n.disableInputs = !0, h(), y().then(function(e) { -n.input.selectedProject = e, P = m(); -var t = r.ifResourcesDontExist(P, n.input.selectedProject.metadata.name), a = u.getLatestQuotaAlerts(P, { +n.input.selectedProject = e, j = m(); +var t = r.ifResourcesDontExist(j, n.input.selectedProject.metadata.name), a = u.getLatestQuotaAlerts(j, { namespace: n.input.selectedProject.metadata.name }), o = function(e) { return n.nameTaken = e.nameTaken, a; @@ -14606,15 +14612,15 @@ return _.filter(e, "unread"); _.each(p.notificationGroups, function(e) { e.totalUnread = w(e.notifications).length, e.hasUnread = !!e.totalUnread, o.$emit("NotificationDrawerWrapper.onUnreadNotifications", e.totalUnread); }); -}, P = function(e) { +}, j = function(e) { _.each(p.notificationGroups, function(t) { _.remove(t.notifications, { uid: e.uid, namespace: e.namespace }); }); -}, j = function(e) { -v[r.project] && delete v[r.project][e.uid], g[r.project] && delete g[r.project][e.uid], P(e); +}, P = function(e) { +v[r.project] && delete v[r.project][e.uid], g[r.project] && delete g[r.project][e.uid], j(e); }, R = function() { g[r.project] = {}, v[r.project] = {}; }, I = function(e) { @@ -14707,7 +14713,7 @@ headingInclude: "views/directives/notifications/header.html", notificationBodyInclude: "views/directives/notifications/notification-body.html", customScope: { clear: function(e, t, n) { -c.markRead(e.uid), c.markCleared(e.uid), n.notifications.splice(t, 1), j(e), D(); +c.markRead(e.uid), c.markCleared(e.uid), n.notifications.splice(t, 1), P(e), D(); }, markRead: function(e) { e.unread = !1, c.markRead(e.uid), D(); @@ -14729,7 +14735,7 @@ p.drawerHidden = !p.drawerHidden; })), f.push(o.$on("NotificationDrawerWrapper.hide", function() { p.drawerHidden = !0; })), f.push(o.$on("NotificationDrawerWrapper.clear", function(e, t) { -c.markCleared(t.uid), j(t), p.countUnreadNotifications(); +c.markCleared(t.uid), P(t), p.countUnreadNotifications(); })); }; p.$onInit = function() { diff --git a/dist/scripts/templates.js b/dist/scripts/templates.js index 9fa911a796..e44b071166 100644 --- a/dist/scripts/templates.js +++ b/dist/scripts/templates.js @@ -9070,7 +9070,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
\n" + "
\n" + "

Select from Project

\n" + - "\n" + + "\n" + "\n" + "{{$select.selected | displayName}}\n" + "\n" + @@ -10565,7 +10565,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
\n" + "\n" + "\n" + - "\n" + + "\n" + "\n" + "\n" + "\n" +