From 6e130999114212f09f4605b8dc32d01168ad8c86 Mon Sep 17 00:00:00 2001 From: Robb Hamilton Date: Fri, 1 Feb 2019 10:54:17 -0500 Subject: [PATCH] Fix bug where create dropdown links incorrect when DISABLE_SERVICE_CATALOG_LANDING_PAGE is true Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1671346 --- app/scripts/controllers/overview.js | 2 - app/scripts/directives/nav.js | 2 - app/scripts/extensions/nav/userDropdown.js | 10 +- app/scripts/services/catalog.js | 3 +- app/views/directives/header/header.html | 8 +- dist/scripts/scripts.js | 202 ++++++++++----------- dist/scripts/templates.js | 7 +- 7 files changed, 111 insertions(+), 123 deletions(-) diff --git a/app/scripts/controllers/overview.js b/app/scripts/controllers/overview.js index abb640e016..bf82613250 100644 --- a/app/scripts/controllers/overview.js +++ b/app/scripts/controllers/overview.js @@ -73,8 +73,6 @@ function OverviewController($scope, $scope.projectName = $routeParams.project; var isHomePage = $routeParams.isHomePage; - overview.catalogLandingPageEnabled = !Constants.DISABLE_SERVICE_CATALOG_LANDING_PAGE; - // Filters used by this controller. var annotation = $filter('annotation'); var canI = $filter('canI'); diff --git a/app/scripts/directives/nav.js b/app/scripts/directives/nav.js index d776582084..1914ab4a05 100644 --- a/app/scripts/directives/nav.js +++ b/app/scripts/directives/nav.js @@ -289,8 +289,6 @@ angular.module('openshiftConsole') _.set($rootScope, 'view.hasProjectSearch', showMobileSearch); }; - $scope.catalogLandingPageEnabled = !Constants.DISABLE_SERVICE_CATALOG_LANDING_PAGE; - var contextSelector = $elem.find('.contextselector'); $scope.clusterConsoleURL = window.OPENSHIFT_CONFIG.adminConsoleURL; contextSelector diff --git a/app/scripts/extensions/nav/userDropdown.js b/app/scripts/extensions/nav/userDropdown.js index c53404ef1c..b32434b1c4 100644 --- a/app/scripts/extensions/nav/userDropdown.js +++ b/app/scripts/extensions/nav/userDropdown.js @@ -15,10 +15,12 @@ angular.module('openshiftConsole') }); } - items.push({ - type: 'dom', - node: '
  • ' - }); + if (!_.get(window, 'OPENSHIFT_CONSTANTS.DISABLE_SERVICE_CATALOG_LANDING_PAGE')) { + items.push({ + type: 'dom', + node: '
  • ' + }); + } var msg = 'Log Out'; if ($rootScope.user.fullName && $rootScope.user.fullName !== $rootScope.user.metadata.name) { diff --git a/app/scripts/services/catalog.js b/app/scripts/services/catalog.js index 9e5929df30..24de589c10 100644 --- a/app/scripts/services/catalog.js +++ b/app/scripts/services/catalog.js @@ -21,8 +21,7 @@ angular.module("openshiftConsole") // Enable service catalog features if the new experience is enabled and the // servicecatalog.k8s.io resources are available. - var SERVICE_CATALOG_ENABLED = !Constants.DISABLE_SERVICE_CATALOG_LANDING_PAGE && - APIService.apiInfo(serviceBindingsVersion) && + var SERVICE_CATALOG_ENABLED = APIService.apiInfo(serviceBindingsVersion) && APIService.apiInfo(serviceClassesVersion) && APIService.apiInfo(serviceInstancesVersion) && APIService.apiInfo(servicePlansVersion); diff --git a/app/views/directives/header/header.html b/app/views/directives/header/header.html index 36dd647f1b..2cc160154d 100644 --- a/app/views/directives/header/header.html +++ b/app/views/directives/header/header.html @@ -43,13 +43,9 @@ diff --git a/dist/scripts/scripts.js b/dist/scripts/scripts.js index c47df5ad01..e090dbf1c5 100644 --- a/dist/scripts/scripts.js +++ b/dist/scripts/scripts.js @@ -1,20 +1,20 @@ "use strict"; function OverviewController(e, t, n, r, a, o, i, s, c, l, u, d, m, p, f, g, v, h, y, b, S, C, w, P, j, k, I, R, E, T, N) { -function A(e) { +function D(e) { var t = e.metadata.ownerReferences; return t ? _(t).filter({ kind: "OfflineVirtualMachine" }).map("uid").first() : null; } -function D() { +function A() { if (B.offlineVirtualMachines && B.virtualMachines && B.pods) { var e = _(B.pods).values().filter(function(e) { return !!_.get(e, 'metadata.labels["kubevirt.io/vmUID"]'); }).keyBy('metadata.labels["kubevirt.io/vmUID"]').value(), t = _(B.virtualMachines).values().filter(function(e) { -return !!A(e); +return !!D(e); }).keyBy(function(e) { -return A(e); +return D(e); }).value(), n = []; _.each(B.offlineVirtualMachines, function(r) { var a = r.metadata.uid, o = t[a]; @@ -30,9 +30,7 @@ return !_.includes(n, e); } var B = this, V = t("isIE")(); e.projectName = a.project; -var L = a.isHomePage; -B.catalogLandingPageEnabled = !d.DISABLE_SERVICE_CATALOG_LANDING_PAGE; -var O = t("annotation"), U = t("canI"), F = t("buildConfigForBuild"), x = t("deploymentIsInProgress"), M = t("imageObjectRef"), q = t("isJenkinsPipelineStrategy"), z = t("isNewerResource"), H = t("label"), G = t("podTemplate"), K = i.getPreferredVersion("buildconfigs"), W = i.getPreferredVersion("builds"), Q = i.getPreferredVersion("appliedclusterresourcequotas"), J = i.getPreferredVersion("daemonsets"), Y = i.getPreferredVersion("deploymentconfigs"), Z = i.getPreferredVersion("deployments"), X = i.getPreferredVersion("horizontalpodautoscalers"), ee = i.getPreferredVersion("imagestreams"), te = i.getPreferredVersion("limitranges"), ne = i.getPreferredVersion("pods"), re = i.getPreferredVersion("replicasets"), ae = i.getPreferredVersion("replicationcontrollers"), oe = i.getPreferredVersion("resourcequotas"), ie = i.getPreferredVersion("routes"), se = i.getPreferredVersion("servicebindings"), ce = i.getPreferredVersion("clusterserviceclasses"), le = i.getPreferredVersion("serviceinstances"), ue = i.getPreferredVersion("clusterserviceplans"), de = i.getPreferredVersion("services"), me = i.getPreferredVersion("statefulsets"), pe = i.getPreferredVersion("templates"); +var L = a.isHomePage, O = t("annotation"), U = t("canI"), F = t("buildConfigForBuild"), x = t("deploymentIsInProgress"), M = t("imageObjectRef"), q = t("isJenkinsPipelineStrategy"), z = t("isNewerResource"), H = t("label"), G = t("podTemplate"), K = i.getPreferredVersion("buildconfigs"), W = i.getPreferredVersion("builds"), Q = i.getPreferredVersion("appliedclusterresourcequotas"), J = i.getPreferredVersion("daemonsets"), Y = i.getPreferredVersion("deploymentconfigs"), Z = i.getPreferredVersion("deployments"), X = i.getPreferredVersion("horizontalpodautoscalers"), ee = i.getPreferredVersion("imagestreams"), te = i.getPreferredVersion("limitranges"), ne = i.getPreferredVersion("pods"), re = i.getPreferredVersion("replicasets"), ae = i.getPreferredVersion("replicationcontrollers"), oe = i.getPreferredVersion("resourcequotas"), ie = i.getPreferredVersion("routes"), se = i.getPreferredVersion("servicebindings"), ce = i.getPreferredVersion("clusterserviceclasses"), le = i.getPreferredVersion("serviceinstances"), ue = i.getPreferredVersion("clusterserviceplans"), de = i.getPreferredVersion("services"), me = i.getPreferredVersion("statefulsets"), pe = i.getPreferredVersion("templates"); B.buildConfigsInstantiateVersion = i.getPreferredVersion("buildconfigs/instantiate"); var fe, ge, ve = {}, he = {}, ye = {}, be = B.state = { alerts: {}, @@ -130,14 +128,14 @@ return _.isEmpty(be.pipelinesByDeploymentConfig[t]); B.deploymentConfigsNoPipeline = _.sortBy(e, "metadata.name"), B.pipelineViewHasOtherResources = !(_.isEmpty(B.deploymentConfigsNoPipeline) && _.isEmpty(B.vanillaReplicationControllers) && _.isEmpty(B.deployments) && _.isEmpty(B.vanillaReplicaSets) && _.isEmpty(B.statefulSets) && _.isEmpty(B.monopods)); }, Ne = function() { B.disableFilter = "pipeline" === B.viewBy && _.isEmpty(B.pipelineBuildConfigs); -}, Ae = function(e) { +}, De = function(e) { return b.getLabelSelector().select(e); -}, De = [ "metadata.name", "spec.clusterServiceClassExternalName" ], $e = function(e) { -return y.filterForKeywords(e, De, be.filterKeywords); +}, Ae = [ "metadata.name", "spec.clusterServiceClassExternalName" ], $e = function(e) { +return y.filterForKeywords(e, Ae, be.filterKeywords); }, Be = function(e) { switch (B.filterBy) { case "label": -return Ae(e); +return De(e); case "name": return $e(e); @@ -157,7 +155,7 @@ B.filteredDeploymentConfigs = Be(B.deploymentConfigs), B.filteredReplicationCont B.viewBy = localStorage.getItem(Oe) || "app", e.$watch(function() { return B.viewBy; }, function(e) { -localStorage.setItem(Oe, e), Ne(), De = "app" === B.viewBy ? [ "metadata.name", "metadata.labels.app" ] : [ "metadata.name" ], Le(), "pipeline" === B.viewBy ? b.setLabelSuggestions(he) : b.setLabelSuggestions(ve); +localStorage.setItem(Oe, e), Ne(), Ae = "app" === B.viewBy ? [ "metadata.name", "metadata.labels.app" ] : [ "metadata.name" ], Le(), "pipeline" === B.viewBy ? b.setLabelSuggestions(he) : b.setLabelSuggestions(ve); }), d.DISABLE_OVERVIEW_METRICS || (C.isAvailable(!0).then(function(e) { be.showMetrics = e; }), e.$on("metrics-connection-failed", function(e, t) { @@ -240,7 +238,7 @@ _.isEmpty(e) || (b.addLabelSuggestionsFromResources(e, he), "pipeline" === B.vie }, nt = function(e) { return "Succeeded" !== e.status.phase && "Failed" !== e.status.phase && (!H(e, "openshift.io/deployer-pod-for.name") && (!O(e, "openshift.io/build.name") && "slave" !== H(e, "jenkins"))); }, rt = function() { -be.podsByOwnerUID = j.groupByOwnerUID(B.pods), B.monopods = _.filter(be.podsByOwnerUID[""], nt), D(); +be.podsByOwnerUID = j.groupByOwnerUID(B.pods), B.monopods = _.filter(be.podsByOwnerUID[""], nt), A(); }, at = function(e) { return !!_.get(e, "status.replicas") || (!O(e, "deploymentConfig") || x(e)); }, ot = function(e) { @@ -497,13 +495,13 @@ poll: V, pollInterval: 6e4 })), e.KUBEVIRT_ENABLED) { Rt.push(m.watch(N.offlineVirtualMachine, r, function(e) { -B.offlineVirtualMachines = e.by("metadata.name"), D(), Le(); +B.offlineVirtualMachines = e.by("metadata.name"), A(), Le(); }, { poll: V, pollInterval: 6e4 })); Rt.push(m.watch(N.virtualMachine, r, function(e) { -B.virtualMachines = e.by("metadata.name"), D(), Le(); +B.virtualMachines = e.by("metadata.name"), A(), Le(); }, { poll: V, pollInterval: 6e4 @@ -4053,7 +4051,7 @@ _.set(a, [ n, t.metadata.name ], t); } }; }), angular.module("openshiftConsole").factory("CatalogService", [ "$filter", "$q", "$window", "APIService", "AuthService", "Catalog", "Constants", "KeywordService", "Logger", "NotificationsService", function(e, t, n, r, a, o, i, s, c, l) { -var u, d = e("tags"), m = r.getPreferredVersion("servicebindings"), p = r.getPreferredVersion("clusterserviceclasses"), f = r.getPreferredVersion("serviceinstances"), g = r.getPreferredVersion("clusterserviceplans"), v = !i.DISABLE_SERVICE_CATALOG_LANDING_PAGE && r.apiInfo(m) && r.apiInfo(p) && r.apiInfo(f) && r.apiInfo(g), h = function() { +var u, d = e("tags"), m = r.getPreferredVersion("servicebindings"), p = r.getPreferredVersion("clusterserviceclasses"), f = r.getPreferredVersion("serviceinstances"), g = r.getPreferredVersion("clusterserviceplans"), v = r.apiInfo(m) && r.apiInfo(p) && r.apiInfo(f) && r.apiInfo(g), h = function() { c.debug("ProjectsService: clearing catalog items cache"), u = null; }; a.onUserChanged(h), a.onLogout(h); @@ -5022,7 +5020,7 @@ name: e.containerName }), n = I(t); e.containerState = n; }); -}, N = e("annotation"), A = function(e, t) { +}, N = e("annotation"), D = function(e, t) { if (r.loaded = !0, r.pod = e, r.dcName = N(e, "deploymentConfig"), r.rcName = N(e, "deployment"), r.deploymentVersion = N(e, "deploymentVersion"), r.logCanRun = !_.includes([ "New", "Pending", "Unknown" ], e.status.phase), S(), delete r.controllerRef, !r.dcName) { var n = m.getControllerReferences(e); r.controllerRef = _.find(n, function(e) { @@ -5038,10 +5036,10 @@ f.get(n.project).then(_.spread(function(t, a) { b = a, r.project = t, r.projectContext = a, s.get(r.podsVersion, n.pod, a, { errorNotification: !1 }).then(function(e) { -A(e); +D(e); var t = {}; t[e.metadata.name] = e, r.logOptions.container = n.container || e.spec.containers[0].name, r.containerTerminals = R(), E(e), l.fetchReferencedImageStreamImages(t, r.imagesByDockerReference, r.imageStreamImageRefByDockerReference, b), h.push(s.watchObject(r.podsVersion, n.pod, a, function(e, t) { -A(e, t), T(r.containerTerminals), E(e); +D(e, t), T(r.containerTerminals), E(e); })); }, function(t) { r.loaded = !0, r.alerts.load = { @@ -5242,12 +5240,12 @@ n.filteredStatefulSets = c.filterForKeywords(_.values(n.statefulSets), P, j); C = _.filter(n.pods, function(e) { return !n.filters.hideOlderResources || "Succeeded" !== e.status.phase && "Failed" !== e.status.phase; }), n.filteredPods = c.filterForKeywords(C, P, j); -}, A = r("isIncompleteBuild"), D = r("buildConfigForBuild"), B = r("isRecentBuild"), V = function() { +}, D = r("isIncompleteBuild"), A = r("buildConfigForBuild"), B = r("isRecentBuild"), V = function() { moment().subtract(5, "m"); y = _.filter(n.builds, function(e) { if (!n.filters.hideOlderResources) return !0; -if (A(e)) return !0; -var t = D(e); +if (D(e)) return !0; +var t = A(e); return t ? n.latestBuildByConfig[t].metadata.name === e.metadata.name : B(e); }), n.filteredBuilds = c.filterForKeywords(y, P, j); }, L = r("deploymentStatus"), O = r("deploymentIsInProgress"), U = function() { @@ -5459,7 +5457,7 @@ return e ? r + (y(e, "description") || "") : ""; } } }); -var A = function(e, t, n, a) { +var D = function(e, t, n, a) { var o = { title: "Confirm Removal", alerts: {}, @@ -5506,7 +5504,7 @@ project: n, subjectKinds: N, canUpdateRolebindings: b("rolebindings", "update", v), confirmRemove: function(n, a, i, s) { -var l = null, u = A(n, a, i, r.user.metadata.name); +var l = null, u = D(n, a, i, r.user.metadata.name); _.isEqual(n, r.user.metadata.name) && d.isLastRole(r.user.metadata.name, r.roleBindings) && (l = !0), o.open({ templateUrl: "views/modals/confirm.html", controller: "ConfirmModalController", @@ -6245,7 +6243,7 @@ o.unwatchAll(j); }); })); } ]), angular.module("openshiftConsole").controller("ReplicaSetController", [ "$scope", "$filter", "$routeParams", "APIService", "AuthorizationService", "BreadcrumbsService", "DataService", "DeploymentsService", "HPAService", "ImageStreamResolver", "keyValueEditorUtils", "kind", "Logger", "MetricsService", "ModalsService", "Navigate", "OwnerReferencesService", "PodsService", "ProjectsService", "StorageService", function(e, t, n, r, a, o, i, s, c, l, u, d, m, p, f, g, v, h, y, b) { -var S = !1, C = t("annotation"), w = t("humanizeKind")(d), P = t("hasDeployment"), j = r.getPreferredVersion("builds"), k = r.getPreferredVersion("imagestreams"), I = r.getPreferredVersion("horizontalpodautoscalers"), R = r.getPreferredVersion("limitranges"), E = r.getPreferredVersion("pods"), T = r.getPreferredVersion("replicasets"), N = r.getPreferredVersion("replicationcontrollers"), A = r.getPreferredVersion("resourcequotas"), D = r.getPreferredVersion("appliedclusterresourcequotas"); +var S = !1, C = t("annotation"), w = t("humanizeKind")(d), P = t("hasDeployment"), j = r.getPreferredVersion("builds"), k = r.getPreferredVersion("imagestreams"), I = r.getPreferredVersion("horizontalpodautoscalers"), R = r.getPreferredVersion("limitranges"), E = r.getPreferredVersion("pods"), T = r.getPreferredVersion("replicasets"), N = r.getPreferredVersion("replicationcontrollers"), D = r.getPreferredVersion("resourcequotas"), A = r.getPreferredVersion("appliedclusterresourcequotas"); switch (d) { case "ReplicaSet": e.resource = T, e.healthCheckURL = g.healthCheckURL(n.project, "ReplicaSet", n.replicaSet, "extensions"); @@ -6393,13 +6391,13 @@ pollInterval: 6e4 })), i.list(R, u).then(function(t) { e.limitRanges = t.by("metadata.name"), U(); }); -B.push(i.watch(A, u, function(t) { +B.push(i.watch(D, u, function(t) { e.quotas = t.by("metadata.name"); }, { poll: !0, pollInterval: 6e4, errorNotification: !1 -})), B.push(i.watch(D, u, function(t) { +})), B.push(i.watch(A, u, function(t) { e.clusterQuotas = t.by("metadata.name"); }, { poll: !0, @@ -7315,7 +7313,7 @@ return _.map(e, "metadata.name"); }); e.webhookSecrets = m.groupSecretsByType(t).webhook, e.webhookSecrets.unshift(""), e.secrets.secretsByType = _.each(r, function(e) { e.unshift(""); -}), A(), P = S(t.by("metadata.name")), e.valueFromObjects = w.concat(P); +}), D(), P = S(t.by("metadata.name")), e.valueFromObjects = w.concat(P); }); var n = function(e, n) { e.type = n && n.kind ? n.kind : "None"; @@ -7462,7 +7460,7 @@ var t = [].concat(e.triggers.imageChangeTriggers, e.triggers.builderImageChangeT return t = _.filter(t, function(e) { return _.has(e, "disabled") && !e.disabled || e.present; }), t = t.concat(T(e.triggers.webhookTriggers)), t = _.map(t, "data"); -}, A = function() { +}, D = function() { switch (e.secrets.picked = { gitSecret: e.buildConfig.spec.source.sourceSecret ? [ e.buildConfig.spec.source.sourceSecret ] : [ { name: "" @@ -7492,7 +7490,7 @@ name: "" mountPath: "" } ]; } -}, D = function(e, t, n) { +}, A = function(e, t, n) { t.name ? e[n] = t : delete e[n]; }, $ = function(t, n) { var r = "Custom" === e.strategyType ? "secretSource" : "secret", a = _.filter(n, function(e) { @@ -7513,7 +7511,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 = R(e.imageSourcePaths), e.updatedBuildConfig.spec.source.images[0].from = E(e.imageOptions.fromSource)), "None" === e.imageOptions.from.type ? delete b(e.updatedBuildConfig).from : b(e.updatedBuildConfig).from = E(e.imageOptions.from), "None" === e.imageOptions.to.type ? delete e.updatedBuildConfig.spec.output.to : e.updatedBuildConfig.spec.output.to = E(e.imageOptions.to), b(e.updatedBuildConfig).env = p.compactEntries(e.envVars), D(e.updatedBuildConfig.spec.source, _.head(e.secrets.picked.gitSecret), "sourceSecret"), D(b(e.updatedBuildConfig), _.head(e.secrets.picked.pullSecret), "pullSecret"), D(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 = R(e.imageSourcePaths), e.updatedBuildConfig.spec.source.images[0].from = E(e.imageOptions.fromSource)), "None" === e.imageOptions.from.type ? delete b(e.updatedBuildConfig).from : b(e.updatedBuildConfig).from = E(e.imageOptions.from), "None" === e.imageOptions.to.type ? delete e.updatedBuildConfig.spec.output.to : e.updatedBuildConfig.spec.output.to = E(e.imageOptions.to), b(e.updatedBuildConfig).env = p.compactEntries(e.envVars), A(e.updatedBuildConfig.spec.source, _.head(e.secrets.picked.gitSecret), "sourceSecret"), A(b(e.updatedBuildConfig), _.head(e.secrets.picked.pullSecret), "pullSecret"), A(e.updatedBuildConfig.spec.output, _.head(e.secrets.picked.pushSecret), "pushSecret"), e.strategyType) { case "Source": case "Docker": $(e.updatedBuildConfig.spec.source, e.secrets.picked.sourceSecrets); @@ -8179,13 +8177,13 @@ g.hideNotification("create-builder-list-config-maps-error"), g.hideNotification( }); }; e.$on("$destroy", N); -var A = i.getPreferredVersion("configmaps"), D = i.getPreferredVersion("limitranges"), $ = i.getPreferredVersion("imagestreams"), B = i.getPreferredVersion("imagestreamtags"), V = i.getPreferredVersion("secrets"), L = i.getPreferredVersion("resourcequotas"), O = i.getPreferredVersion("appliedclusterresourcequotas"); +var D = i.getPreferredVersion("configmaps"), A = i.getPreferredVersion("limitranges"), $ = i.getPreferredVersion("imagestreams"), B = i.getPreferredVersion("imagestreamtags"), V = i.getPreferredVersion("secrets"), L = i.getPreferredVersion("resourcequotas"), O = i.getPreferredVersion("appliedclusterresourcequotas"); v.get(a.project).then(_.spread(function(t, n) { e.project = t, a.sourceURI && (e.sourceURIinParams = !0), e.hasClusterResourceOverrides = d.hasClusterResourceOverrides(t); var i = function() { e.cpuProblems = d.validatePodLimits(e.limitRanges, "cpu", [ e.container ], t), e.memoryProblems = d.validatePodLimits(e.limitRanges, "memory", [ e.container ], t); }; -c.list(D, n).then(function(t) { +c.list(A, n).then(function(t) { e.limitRanges = t.by("metadata.name"), _.isEmpty(e.limitRanges) || e.$watch("container", i, !0); }); var v, y, C = function() { @@ -8237,7 +8235,7 @@ return r.buildConfig.sourceUrl === _.get(r, "image.metadata.annotations.sampleRe e.metricsWarning = !t; }); var o = [], i = []; -e.valueFromObjects = [], c.list(A, n, null, { +e.valueFromObjects = [], c.list(D, n, null, { errorNotification: !1 }).then(function(t) { o = R(t.by("metadata.name")), e.valueFromObjects = o.concat(i); @@ -10047,9 +10045,9 @@ details: e("getErrorDetails")(n) } function w() { var e = { -started: "Creating resources in project " + D(p.input.selectedProject), -success: "Creating resources in project " + D(p.input.selectedProject), -failure: "Failed to create some resources in project " + D(p.input.selectedProject) +started: "Creating resources in project " + A(p.input.selectedProject), +success: "Creating resources in project " + A(p.input.selectedProject), +failure: "Failed to create some resources in project " + A(p.input.selectedProject) }, t = {}; d.add(e, t, p.input.selectedProject.metadata.name, function() { var e = n.defer(); @@ -10084,9 +10082,9 @@ hasErrors: r } function P() { var e = { -started: "Updating resources in project " + D(p.input.selectedProject), -success: "Updated resources in project " + D(p.input.selectedProject), -failure: "Failed to update some resources in project " + D(p.input.selectedProject) +started: "Updating resources in project " + A(p.input.selectedProject), +success: "Updated resources in project " + A(p.input.selectedProject), +failure: "Failed to update some resources in project " + A(p.input.selectedProject) }, t = {}; d.add(e, t, p.input.selectedProject.metadata.name, function() { var e = n.defer(); @@ -10169,7 +10167,7 @@ type: "error" }).length ? (_.each(E, function(e) { e.id = _.uniqueId("from-file-alert-"), c.addNotification(e); }), p.disableInputs = !1) : E.length ? (R(E), p.disableInputs = !1) : y(); -}, A = function() { +}, D = function() { if (_.has(p.input.selectedProject, "metadata.uid")) return n.when(p.input.selectedProject); var t = p.input.selectedProject.metadata.name, r = p.input.selectedProject.metadata.annotations["new-display-name"], a = e("description")(p.input.selectedProject); return m.create(t, r, a); @@ -10184,7 +10182,7 @@ var e = []; p.errorOccurred = !1, _.forEach(p.resourceList, function(t) { if (!g(t)) return p.errorOccurred = !0, !1; e.push(S(t)); -}), A().then(function(t) { +}), D().then(function(t) { p.input.selectedProject = t, n.all(e).then(function() { p.errorOccurred || (1 === p.createResources.length && "Template" === p.resourceList[0].kind ? v() : _.isEmpty(p.updateResources) ? l.getLatestQuotaAlerts(p.createResources, { namespace: p.input.selectedProject.metadata.name @@ -10202,7 +10200,7 @@ details: I(e) }, p.cancel = function() { T(), s.toProjectOverview(p.input.selectedProject.metadata.name); }; -var D = e("displayName"); +var A = e("displayName"); p.$on("importFileFromYAMLOrJSON", p.create), p.$on("$destroy", T); } ] }; @@ -11017,76 +11015,76 @@ var h = {}, y = [], b = e("displayName"), S = e("uniqueDisplayName"), C = i.getP return { restrict: "EA", templateUrl: "views/directives/header/header.html", -link: function(i, p) { +link: function(i, u) { i.currentProject = h[a.project]; -var w = function(e, t) { +var p = function(e, t) { var n; _.set(r, "nav.collapsed", e), t && (n = e ? "true" : "false", localStorage.setItem("openshift/vertical-nav-collapsed", n)); }; !function() { var e = "true" === localStorage.getItem("openshift/vertical-nav-collapsed"); -w(e); +p(e); }(); -var P = function() { +var w = function() { return _.get(r, "nav.collapsed", !1); -}, j = function(e) { +}, P = function(e) { _.set(r, "nav.showMobileNav", e); -}, k = function(e) { +}, j = function(e) { "/catalog" === t.path() ? e.selectpicker("val", "catalog") : e.selectpicker("val", "application-console"); -}, I = function(e) { +}, k = function(e) { i.$evalAsync(function() { t.url(e); }); }; i.toggleNav = function() { -var e = P(); -w(!e, !0), r.$emit("oscHeader.toggleNav"); +var e = w(); +p(!e, !0), r.$emit("oscHeader.toggleNav"); }, i.toggleMobileNav = function() { var e = _.get(r, "nav.showMobileNav"); -j(!e); +P(!e); }, i.closeMobileNav = function() { -j(!1); +P(!1); }, i.closeOrderingPanel = function() { i.orderingPanelVisible = !1; }, i.showOrderingPanel = function(e) { i.orderingPanelVisible = !0, i.orderKind = e; }, i.onSearchToggle = function(e) { _.set(r, "view.hasProjectSearch", e); -}, i.catalogLandingPageEnabled = !u.DISABLE_SERVICE_CATALOG_LANDING_PAGE; -var R = p.find(".contextselector"); -i.clusterConsoleURL = window.OPENSHIFT_CONFIG.adminConsoleURL, R.on("loaded.bs.select", function() { -k(R); +}; +var I = u.find(".contextselector"); +i.clusterConsoleURL = window.OPENSHIFT_CONFIG.adminConsoleURL, I.on("loaded.bs.select", function() { +j(I); }).change(function() { switch ($(this).val()) { case "catalog": -I("/catalog"); +k("/catalog"); break; case "application-console": -I("/projects"); +k("/projects"); break; case "cluster-console": window.location.assign(i.clusterConsoleURL); } }); -var E = p.find(".project-picker"), T = [], N = function() { +var R = u.find(".project-picker"), E = [], T = function() { var t = i.currentProjectName; if (t) { var n = function(e, n) { var r = $("')), E.append($('')), E.selectpicker("refresh"); +})) : E = [ n(h[t], !0) ], R.empty(), R.append(E), R.append($('')), R.append($('')), R.selectpicker("refresh"); } -}, A = function() { +}, N = function() { return f.list().then(function(e) { h = e.by("metadata.name"); }); }, D = function() { -k(R); +j(I); var e = a.project; if (i.currentProjectName !== e) { i.currentProjectName = e, i.chromeless = "chromeless" === a.view; @@ -11102,20 +11100,20 @@ n.all([ r, a ]).then(function() { i.catalogItems = c.sortCatalogItems(_.concat(t, o)); }); } -}), A().then(function() { +}), N().then(function() { i.currentProjectName && h && (h[i.currentProjectName] || (h[i.currentProjectName] = { metadata: { name: i.currentProjectName } -}), i.currentProject = h[i.currentProjectName], N()); +}), i.currentProject = h[i.currentProjectName], T()); })) : _.set(r, "view.hasProject", !1); } -}, B = function() { +}, A = function() { i.orderingPanelVisible && v.addItem(_.get(i.selectedItem, "resource.metadata.uid")); -}, V = function(e) { +}, B = function(e) { return "PartialObjectMetadata" === e.kind; -}, L = function(e) { -return V(e) ? d.get(C, e.metadata.name, { +}, V = function(e) { +return B(e) ? d.get(C, e.metadata.name, { namespace: e.metadata.namespace }) : n.when(e); }; @@ -11128,11 +11126,11 @@ status: { removedFromBrokerCatalog: !0 } }), i.selectedItem = t, i.orderingPanelVisible = !0; -}) : L(t.resource).then(function(e) { +}) : V(t.resource).then(function(e) { i.selectedItem = e, i.orderingPanelVisible = !0, i.orderKind = "Template"; })); }); -var O = r.$on("filter-catalog-items", function(e, t) { +var L = r.$on("filter-catalog-items", function(e, t) { if (i.currentProjectName) { var n = { filter: t.searchText @@ -11142,11 +11140,11 @@ m.toProjectCatalog(i.currentProjectName, n); }); i.closeOrderingPanel = function() { v.addItem(_.get(i.selectedItem, "resource.metadata.uid")), i.orderingPanelVisible = !1; -}, D(), i.$on("$routeChangeSuccess", D), E.change(function() { +}, D(), i.$on("$routeChangeSuccess", D), R.change(function() { var e = $(this).val(), t = "" === e ? "projects" : g(e); -I(t); +k(t); }), i.$on("$destroy", function() { -O(), B(); +L(), A(); }); } }; @@ -12147,7 +12145,7 @@ Available: "#d1d1d1" } }; R[t.id] ? R[t.id].load(a) : ((n = B(e)).data = a, r(function() { -D || (R[t.id] = c3.generate(n)); +A || (R[t.id] = c3.generate(n)); })); } } @@ -12163,7 +12161,7 @@ var n, a = c.getSparklineData(t), o = e.chartPrefix + "sparkline"; E[o] ? E[o].load(a) : ((n = V(e)).data = a, e.chartDataColors && (n.color = { pattern: e.chartDataColors }), r(function() { -D || (E[o] = c3.generate(n)); +A || (E[o] = c3.generate(n)); })); } } @@ -12174,7 +12172,7 @@ function h() { return 60 * m.options.timeRange.value * 1e3; } function y() { -return Math.floor(h() / A) + "ms"; +return Math.floor(h() / D) + "ms"; } function b(e, t, n) { var r, a = { @@ -12189,12 +12187,12 @@ containerName: e.containerMetric ? m.options.selectedContainer.name : "pod" }) : null; } function S() { -D || (L = 0, _.each(m.metrics, function(e) { +A || (L = 0, _.each(m.metrics, function(e) { g(e), f(e); })); } function C(e) { -if (!D) if (L++, m.noData) m.metricsError = { +if (!A) if (L++, m.noData) m.metricsError = { status: _.get(e, "status", 0), details: _.get(e, "data.errorMsg") || _.get(e, "statusText") || "Status code " + _.get(e, "status", 0) }; else if (!(L < 2)) { @@ -12223,7 +12221,7 @@ isNaN(r) && (r = 0), e.convert && (r = e.convert(r)), t.used = d3.round(r, e.usa function j(e, t) { m.noData = !1; var n = _.initial(t.data); -e.data ? e.data = _.chain(e.data).takeRight(A).concat(n).value() : e.data = n; +e.data ? e.data = _.chain(e.data).takeRight(D).concat(n).value() : e.data = n; } function k() { if (w()) { @@ -12239,7 +12237,7 @@ P(n, a, e); })); } }), t = t.concat(r), a.all(r).then(function(e) { -D || angular.forEach(e, function(e) { +A || angular.forEach(e, function(e) { e && j(_.find(n.datasets, { id: e.metricID }), e); @@ -12251,7 +12249,7 @@ m.loaded = !0; } } m.includedMetrics = m.includedMetrics || [ "cpu", "memory", "network" ]; -var I, R = {}, E = {}, T = n("resources.limits.memory"), N = n("resources.limits.cpu"), A = 30, D = !1; +var I, R = {}, E = {}, T = n("resources.limits.memory"), N = n("resources.limits.cpu"), D = 30, A = !1; m.uniqueID = c.uniqueID(), m.metrics = [], _.includes(m.includedMetrics, "memory") && m.metrics.push({ label: "Memory", units: "MiB", @@ -12355,7 +12353,7 @@ I && (t.cancel(I), I = null), O && (O(), O = null), angular.forEach(R, function( e.destroy(); }), R = null, angular.forEach(E, function(e) { e.destroy(); -}), E = null, D = !0; +}), E = null, A = !0; }); } }; @@ -12417,7 +12415,7 @@ return e[0]; function u(e) { P || (N = 0, t.showAverage = _.size(t.pods) > 5 || w, _.each(t.metrics, function(n) { var r, a = o(e, n), i = n.descriptor; -w && n.compactCombineWith && (i = n.compactCombineWith, n.lastValue && (T[i].lastValue = (T[i].lastValue || 0) + n.lastValue)), S[i] ? (S[i].load(a), t.showAverage ? S[i].legend.hide() : S[i].legend.show()) : ((r = A(n)).data = a, S[i] = c3.generate(r)); +w && n.compactCombineWith && (i = n.compactCombineWith, n.lastValue && (T[i].lastValue = (T[i].lastValue || 0) + n.lastValue)), S[i] ? (S[i].load(a), t.showAverage ? S[i].legend.hide() : S[i].legend.show()) : ((r = D(n)).data = a, S[i] = c3.generate(r)); })); } function d() { @@ -12547,7 +12545,7 @@ t.metricsURL = e; }), t.options = { rangeOptions: s.getTimeRangeOptions() }, t.options.timeRange = _.head(t.options.rangeOptions), t.options.selectedContainer = _.head(t.containers); -var A = function(e) { +var D = function(e) { var n = s.getDefaultSparklineConfig(e.chartID, e.units, w); return _.set(n, "legend.show", !w && !t.showAverage), n; }; @@ -12556,11 +12554,11 @@ I = {}, j = null, delete t.metricsError, y(); }, !0), b = e(y, s.getDefaultUpdateInterval(), !1), t.updateInView = function(e) { R = !e, e && (!k || Date.now() > k + s.getDefaultUpdateInterval()) && y(); }; -var D = a.$on("metrics.charts.resize", function() { +var A = a.$on("metrics.charts.resize", function() { s.redraw(S); }); t.$on("$destroy", function() { -b && (e.cancel(b), b = null), D && (D(), D = null), angular.forEach(S, function(e) { +b && (e.cancel(b), b = null), A && (A(), A = null), angular.forEach(S, function(e) { e.destroy(); }), S = null, P = !0; }); @@ -12643,13 +12641,13 @@ b = !0, m.scrollBottom(c); t.appendChild(T), T = document.createDocumentFragment(), e.autoScrollActive && E(), e.showScrollLinks || y(); }, 100, { maxWait: 300 -}), A = function(e) { +}), D = function(e) { var n = a.defer(); return R ? (R.onClose(function() { n.resolve(); }), R.stop()) : n.resolve(), e || (N.cancel(), t && (t.innerHTML = ""), T = document.createDocumentFragment()), n.promise; -}, D = function() { -A().then(function() { +}, A = function() { +D().then(function() { e.$evalAsync(function() { if (e.run) { angular.extend(e, { @@ -12680,7 +12678,7 @@ e.$evalAsync(function() { e.empty = !1, "logs" !== e.state && (e.state = "logs", k()); }), r && (t.limitBytes && o >= t.limitBytes && (e.$evalAsync(function() { e.limitReached = !0, e.loading = !1; -}), A(!0)), s(r), !e.largeLog && n >= t.tailLines && e.$evalAsync(function() { +}), D(!0)), s(r), !e.largeLog && n >= t.tailLines && e.$evalAsync(function() { e.largeLog = !0; })); }), R.onClose(function() { @@ -12738,11 +12736,11 @@ toggleAutoScroll: function() { e.autoScrollActive = !e.autoScrollActive, e.autoScrollActive && E(); }, goChromeless: m.chromelessLink, -restartLogs: D +restartLogs: A }), e.$on("$destroy", function() { -A(), p.off("resize", I), p.off("scroll", S), c && $(c).off("scroll", S); +D(), p.off("resize", I), p.off("scroll", S), c && $(c).off("scroll", S); }), "deploymentconfigs/logs" === f && !v) return e.state = "empty", void (e.emptyStateMessage = "Logs are not available for this replication controller because it was not generated from a deployment configuration."); -e.$watchGroup([ "name", "options.container", "run" ], D); +e.$watchGroup([ "name", "options.container", "run" ], A); } ], require: "logViewer", link: function(e, n, r, a) { @@ -14940,7 +14938,7 @@ cancelButtonText: "Cancel" } } }).result.then(T); -}, A = function(e) { +}, D = function(e) { b = e.quotaAlerts || []; var t = _.filter(b, { type: "error" @@ -14957,7 +14955,7 @@ namespace: n.input.selectedProject.metadata.name }), i = function(e) { return n.nameTaken = e.nameTaken, r; }; -t.then(i, i).then(A, A); +t.then(i, i).then(D, D); }, function(e) { n.disableInputs = !1, "AlreadyExists" === e.data.reason ? n.projectNameTaken = !0 : l.addNotification({ id: "deploy-image-create-project-error", @@ -15429,7 +15427,7 @@ namespace: e.namespace S[a.project] && delete S[a.project][e.uid], b[a.project] && delete b[a.project][e.uid], E(e); }, N = function() { b[a.project] = {}, S[a.project] = {}; -}, A = function(e) { +}, D = function(e) { return _.reduce(e, function(e, t) { return e[t.metadata.uid] = { actions: null, @@ -15442,7 +15440,7 @@ firstTimestamp: t.firstTimestamp, event: t }, e; }, {}); -}, D = function(e) { +}, A = function(e) { return _.reduce(e, function(e, t) { return u.isImportantAPIEvent(t) && !u.isCleared(t.metadata.uid) && (e[t.metadata.uid] = t), e; }, {}); @@ -15464,7 +15462,7 @@ m && (l.unwatch(m), m = null); }, U = function() { d && d(), d = null; }, F = function(e) { -b[a.project] = A(D(e.by("metadata.name"))), V(); +b[a.project] = D(A(e.by("metadata.name"))), V(); }, x = function(e, t) { var n = t.namespace || a.project, r = t.id ? n + "/" + t.id : _.uniqueId("notification_") + Date.now(); t.showInDrawer && !u.isCleared(r) && (S[n] = S[n] || {}, S[n][r] = { @@ -16815,7 +16813,7 @@ var e = []; _.get(window, "OPENSHIFT_CONSTANTS.DISABLE_COPY_LOGIN_COMMAND") || e.push({ type: "dom", node: '
  • ' -}), e.push({ +}), _.get(window, "OPENSHIFT_CONSTANTS.DISABLE_SERVICE_CATALOG_LANDING_PAGE") || e.push({ type: "dom", node: "
  • " }); diff --git a/dist/scripts/templates.js b/dist/scripts/templates.js index 1f63ecf000..e53b905c03 100644 --- a/dist/scripts/templates.js +++ b/dist/scripts/templates.js @@ -7410,12 +7410,9 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "\n" + "\n" + "\n" + "\n" +