Skip to content

Don't show both toast and in-page alert for missing resources #1721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/scripts/controllers/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ angular.module('openshiftConsole')
$scope.projectContext = context;
$scope.logOptions = {};
DataService
.get("builds", $routeParams.build, context)
.get("builds", $routeParams.build, context, { errorNotification: false })
.then(function(build) {
buildResolved(build);
watches.push(DataService.watchObject("builds", $routeParams.build, context, buildResolved));
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/buildConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ angular.module('openshiftConsole')
$scope.project = project;
requestContext = context;
DataService
.get("buildconfigs", $routeParams.buildconfig, context)
.get("buildconfigs", $routeParams.buildconfig, context, { errorNotification: false })
.then(function(buildConfig) {
buildConfigResolved(buildConfig);
// If we found the item successfully, watch for changes on it
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/deployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ angular.module('openshiftConsole')
DataService.get({
group: 'extensions',
resource: 'deployments'
}, $routeParams.deployment, context).then(
}, $routeParams.deployment, context, { errorNotification: false }).then(
// success
function(deployment) {
$scope.loaded = true;
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/deploymentConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ angular.module('openshiftConsole')
};

var saveEnvPromise;
DataService.get("deploymentconfigs", $routeParams.deploymentconfig, context).then(
DataService.get("deploymentconfigs", $routeParams.deploymentconfig, context, { errorNotification: false }).then(
// success
function(deploymentConfig) {
$scope.loaded = true;
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/edit/buildConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ angular.module('openshiftConsole')
return;
}

DataService.get("buildconfigs", $routeParams.buildconfig, context).then(
DataService.get("buildconfigs", $routeParams.buildconfig, context, { errorNotification: false }).then(
// success
function(buildConfig) {
$scope.buildConfig = buildConfig;
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/edit/configMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ angular.module('openshiftConsole')
.get($routeParams.project)
.then(_.spread(function(project, context) {
DataService
.get("configmaps", $routeParams.configMap, context)
.get("configmaps", $routeParams.configMap, context, { errorNotification: false })
.then(function(configMap) {
$scope.loaded = true;
$scope.breadcrumbs = BreadcrumbsService.getBreadcrumbs({
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/edit/deploymentConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ angular.module('openshiftConsole')
return;
}

DataService.get("deploymentconfigs", $routeParams.deploymentconfig, context).then(
DataService.get("deploymentconfigs", $routeParams.deploymentconfig, context, { errorNotification: false }).then(
// success
function(deploymentConfig) {
$scope.deploymentConfig = deploymentConfig;
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/edit/yaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ angular.module('openshiftConsole')
return;
}

DataService.get(resourceGroupVersion, $scope.name, context).then(
DataService.get(resourceGroupVersion, $scope.name, context, { errorNotification: false }).then(
function(result) {
// Modify a copy of the resource.
var resource = angular.copy(result);
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ angular.module('openshiftConsole')
.then(_.spread(function(project, context) {
$scope.project = project;
DataService
.get("imagestreams", $routeParams.imagestream, context)
.get("imagestreams", $routeParams.imagestream, context, { errorNotification: false })
.then(function(imageStream) {
imageStreamResolved(imageStream, context);
watches.push(DataService.watchObject("imagestreams", $routeParams.imagestream, context, function(imageStream, action) {
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/imagestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ angular.module('openshiftConsole')
.get($routeParams.project)
.then(_.spread(function(project, context) {
$scope.project = project;
DataService.get("imagestreams", $routeParams.imagestream, context).then(
DataService.get("imagestreams", $routeParams.imagestream, context, { errorNotification: false }).then(
// success
function(imageStream) {
$scope.loaded = true;
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/persistentVolumeClaim.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ angular.module('openshiftConsole')
$scope.project = project;
$scope.projectContext = context;
DataService
.get("persistentvolumeclaims", $routeParams.pvc, context)
.get("persistentvolumeclaims", $routeParams.pvc, context, { errorNotification: false })
.then(function(pvc) {
pvcResolved(pvc);
watches.push(DataService.watchObject("persistentvolumeclaims", $routeParams.pvc, context, pvcResolved));
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/pod.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ angular.module('openshiftConsole')
// context into the log-viewer directive.
$scope.projectContext = context;
DataService
.get("pods", $routeParams.pod, context)
.get("pods", $routeParams.pod, context, { errorNotification: false })
.then(function(pod) {
podResolved(pod);
var pods = {};
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/replicaSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ angular.module('openshiftConsole')
context);
};

DataService.get($scope.resource, $routeParams.replicaSet, context)
DataService.get($scope.resource, $routeParams.replicaSet, context, { errorNotification: false })
.then(function(replicaSet) {
$scope.loaded = true;
$scope.replicaSet = replicaSet;
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ angular.module('openshiftConsole')
$scope.project = project;

DataService
.get("routes", $routeParams.route, context)
.get("routes", $routeParams.route, context, { errorNotification: false })
.then(function(route) {
routeResolved(route);
watches.push(DataService.watchObject("routes", $routeParams.route, context, routeResolved));
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ angular.module('openshiftConsole')
$scope.project = project;
$scope.projectContext = context;
DataService
.get("services", $routeParams.service, context)
.get("services", $routeParams.service, context, { errorNotification: false })
.then(function(service) {
serviceResolved(service);
watches.push(DataService.watchObject("services", $routeParams.service, context, serviceResolved));
Expand Down
9 changes: 8 additions & 1 deletion app/scripts/controllers/statefulSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ angular
projectContext = context;

DataService
.get(resourceGroupVersion, $scope.statefulSetName, context)
.get(resourceGroupVersion, $scope.statefulSetName, context, { errorNotification: false })
.then(function(statefulSet) {

angular.extend($scope, {
Expand Down Expand Up @@ -84,6 +84,13 @@ angular
watches.push(DataService.watch('appliedclusterresourcequotas', context, function(clusterQuotaData) {
$scope.clusterQuotas = clusterQuotaData.by("metadata.name");
}, {poll: true, pollInterval: QUOTA_POLL_INTERVAL}));
}, function(e) {
$scope.loaded = true;
$scope.alerts["load"] = {
type: "error",
message: "The stateful set details could not be loaded.",
details: $filter('getErrorDetails')(e)
};
});
}));

Expand Down
2 changes: 1 addition & 1 deletion app/views/browse/stateful-set.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h1>
<div class="container-fluid">
<div ng-if="!loaded">Loading...</div>

<div class="row" ng-if="loaded">
<div class="row" ng-if="loaded && statefulSet">
<div class="col-md-12">
<uib-tabset>
<uib-tab active="selectedTab.details">
Expand Down
90 changes: 64 additions & 26 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4325,7 +4325,9 @@ message:"This pod has been deleted."
});
};
m.get(c.project).then(_.spread(function(d, h) {
o = h, a.project = d, a.projectContext = h, g.get("pods", c.pod, h).then(function(b) {
o = h, a.project = d, a.projectContext = h, g.get("pods", c.pod, h, {
errorNotification:!1
}).then(function(b) {
A(b);
var d = {};
d[b.metadata.name] = b, a.logOptions.container = c.container || b.spec.containers[0].name, a.containerTerminals = v(), w(b), j.fetchReferencedImageStreamImages(d, a.imagesByDockerReference, a.imageStreamImageRefByDockerReference, o), n.push(g.watchObject("pods", c.pod, h, function(b, c) {
Expand Down Expand Up @@ -5010,7 +5012,9 @@ type:"warning",
details:"The active filters are hiding all builds."
};
}
a.project = d, l = f, g.get("buildconfigs", c.buildconfig, f).then(function(a) {
a.project = d, l = f, g.get("buildconfigs", c.buildconfig, f, {
errorNotification:!1
}).then(function(a) {
r(a), o.push(g.watchObject("buildconfigs", c.buildconfig, f, r));
}, function(c) {
a.loaded = !0, a.alerts.load = {
Expand Down Expand Up @@ -5098,7 +5102,9 @@ message:"Build configuration " + a.buildConfigName + " has been deleted."
}, a.buildConfigDeleted = !0), a.buildConfig = b, a.buildConfigPaused = d.isPaused(a.buildConfig), k();
};
h.get(c.project).then(_.spread(function(b, g) {
a.project = b, a.projectContext = g, a.logOptions = {}, e.get("builds", c.build, g).then(function(a) {
a.project = b, a.projectContext = g, a.logOptions = {}, e.get("builds", c.build, g, {
errorNotification:!1
}).then(function(a) {
l(a), i.push(e.watchObject("builds", c.build, g, l)), i.push(e.watchObject("buildconfigs", c.buildconfig, g, n));
}, m), a.toggleSecret = function() {
a.showSecret = !0;
Expand Down Expand Up @@ -5149,7 +5155,9 @@ message:"This image stream has been deleted."
});
};
d.get(b.project).then(_.spread(function(d, f) {
a.project = d, c.get("imagestreams", b.imagestream, f).then(function(a) {
a.project = d, c.get("imagestreams", b.imagestream, f, {
errorNotification:!1
}).then(function(a) {
k(a, f), i.push(c.watchObject("imagestreams", b.imagestream, f, function(a, b) {
k(a, f, b);
}));
Expand Down Expand Up @@ -5205,7 +5213,9 @@ title:b.imagestream
} ], a.emptyMessage = "Loading...";
var h = [];
d.get(b.project).then(_.spread(function(d, g) {
a.project = d, c.get("imagestreams", b.imagestream, g).then(function(d) {
a.project = d, c.get("imagestreams", b.imagestream, g, {
errorNotification:!1
}).then(function(d) {
a.loaded = !0, a.imageStream = d, a.emptyMessage = "No tags to show", h.push(c.watchObject("imagestreams", b.imagestream, g, function(b, c) {
"DELETED" === c && (a.alerts.deleted = {
type:"warning",
Expand Down Expand Up @@ -5319,7 +5329,9 @@ a.hpaWarnings = b;
d.get({
group:"extensions",
resource:"deployments"
}, c.deployment, m).then(function(g) {
}, c.deployment, m, {
errorNotification:!1
}).then(function(g) {
a.loaded = !0, a.deployment = g, x(), a.saveEnvVars = function() {
f.compact(a.updatedDeployment), v = d.update({
group:"extensions",
Expand Down Expand Up @@ -5468,7 +5480,9 @@ h.getHPAWarnings(a.deploymentConfig, a.autoscalers, D, d).then(function(b) {
a.hpaWarnings = b;
});
};
e.get("deploymentconfigs", c.deploymentconfig, k).then(function(d) {
e.get("deploymentconfigs", c.deploymentconfig, k, {
errorNotification:!1
}).then(function(d) {
a.loaded = !0, a.deploymentConfig = d, a.strategyParams = b("deploymentStrategyParams")(d), E(), a.updatedDeploymentConfig = g.copyAndNormalize(a.deploymentConfig), a.saveEnvVars = function() {
l.hideNotification("save-dc-env-error"), g.compact(a.updatedDeploymentConfig), C = e.update("deploymentconfigs", c.deploymentconfig, a.updatedDeploymentConfig, k), C.then(function() {
l.addNotification({
Expand Down Expand Up @@ -5762,7 +5776,9 @@ var b = _.get(a, "replicaSet.spec.template");
b && j.fetchReferencedImageStreamImages([ b ], a.imagesByDockerReference, w, l);
}
};
f.get(a.resource, c.replicaSet, l).then(function(b) {
f.get(a.resource, c.replicaSet, l, {
errorNotification:!1
}).then(function(b) {
switch (a.loaded = !0, a.replicaSet = b, A(b), s) {
case "ReplicationController":
K(b);
Expand Down Expand Up @@ -5914,38 +5930,46 @@ version:"v1beta1"
};
g.isAvailable().then(function(a) {
b.metricsAvailable = a;
}), h.get(c.project).then(_.spread(function(a, c) {
j = c, e.get(m, b.statefulSetName, c).then(function(d) {
}), h.get(c.project).then(_.spread(function(c, d) {
j = d, e.get(m, b.statefulSetName, d, {
errorNotification:!1
}).then(function(a) {
angular.extend(b, {
statefulSet:k(d),
project:a,
projectContext:c,
statefulSet:k(a),
project:c,
projectContext:d,
loaded:!0,
isScalable:function() {
return !1;
},
scale:function() {}
}), l.push(e.watchObject(m, b.statefulSetName, c, function(a) {
}), l.push(e.watchObject(m, b.statefulSetName, d, function(a) {
angular.extend(b, {
resourceGroupVersion:m,
statefulSet:k(a)
});
})), l.push(e.watch("pods", c, function(a) {
var c = a.by("metadata.name");
b.podsForStatefulSet = i.filterForOwner(c, d);
})), l.push(e.watch("pods", d, function(c) {
var d = c.by("metadata.name");
b.podsForStatefulSet = i.filterForOwner(d, a);
}));
var f = 6e4;
l.push(e.watch("resourcequotas", c, function(a) {
l.push(e.watch("resourcequotas", d, function(a) {
b.quotas = a.by("metadata.name");
}, {
poll:!0,
pollInterval:f
})), l.push(e.watch("appliedclusterresourcequotas", c, function(a) {
})), l.push(e.watch("appliedclusterresourcequotas", d, function(a) {
b.clusterQuotas = a.by("metadata.name");
}, {
poll:!0,
pollInterval:f
}));
}, function(c) {
b.loaded = !0, b.alerts.load = {
type:"error",
message:"The stateful set details could not be loaded.",
details:a("getErrorDetails")(c)
};
});
})), b.$on("$destroy", function() {
e.unwatchAll(l);
Expand Down Expand Up @@ -5998,7 +6022,9 @@ message:"This service has been deleted."
});
};
d.get(b.project).then(_.spread(function(d, k) {
a.project = d, a.projectContext = k, c.get("services", b.service, k).then(function(a) {
a.project = d, a.projectContext = k, c.get("services", b.service, k, {
errorNotification:!1
}).then(function(a) {
j(a), g.push(c.watchObject("services", b.service, k, j));
}, function(b) {
a.loaded = !0, a.alerts.load = {
Expand Down Expand Up @@ -6197,7 +6223,9 @@ return !d.isAlertPermanentlyHidden(e, a.projectName);
var c = k(b);
d.permanentlyHideAlert(c, a.projectName);
}, f.get(c.project).then(_.spread(function(d, f) {
a.project = d, e.get("routes", c.route, f).then(function(a) {
a.project = d, e.get("routes", c.route, f, {
errorNotification:!1
}).then(function(a) {
j(a), i.push(e.watchObject("routes", c.route, f, j));
}, function(c) {
a.loaded = !0, a.alerts.load = {
Expand Down Expand Up @@ -6368,7 +6396,9 @@ message:"This persistent volume claim has been deleted."
});
};
d.get(b.project).then(_.spread(function(d, h) {
a.project = d, a.projectContext = h, c.get("persistentvolumeclaims", b.pvc, h).then(function(a) {
a.project = d, a.projectContext = h, c.get("persistentvolumeclaims", b.pvc, h, {
errorNotification:!1
}).then(function(a) {
g(a), f.push(c.watchObject("persistentvolumeclaims", b.pvc, h, g));
}, function(b) {
a.loaded = !0, a.alerts.load = {
Expand Down Expand Up @@ -6577,7 +6607,9 @@ var t = function() {
j.hideNotification("edit-build-config-error"), j.hideNotification("edit-build-config-conflict"), j.hideNotification("edit-build-config-deleted");
};
a.$on("$destroy", t), k.get(d.project).then(_.spread(function(c, e) {
return a.project = c, a.context = e, a.breadcrumbs[0].title = b("displayName")(c), g.canI("buildconfigs", "update", d.project) ? void h.get("buildconfigs", d.buildconfig, e).then(function(b) {
return a.project = c, a.context = e, a.breadcrumbs[0].title = b("displayName")(c), g.canI("buildconfigs", "update", d.project) ? void h.get("buildconfigs", d.buildconfig, e, {
errorNotification:!1
}).then(function(b) {
a.buildConfig = b, o(), a.updatedBuildConfig = angular.copy(a.buildConfig), a.buildStrategy = r(a.updatedBuildConfig), a.strategyType = a.buildConfig.spec.strategy.type, a.envVars = a.buildStrategy.env || [], a.triggers = u(a.triggers, a.buildConfig.spec.triggers), a.sources = B(a.sources, a.buildConfig.spec.source), _.has(b, "spec.strategy.jenkinsPipelineStrategy.jenkinsfile") && (a.jenkinsfileOptions.type = "inline"), h.list("secrets", e).then(function(b) {
var c = m.groupSecretsByType(b), d = _.mapValues(c, function(a) {
return _.map(a, "metadata.name");
Expand Down Expand Up @@ -6842,7 +6874,9 @@ h.hideNotification("edit-config-map-error");
d.history.back();
};
c.cancel = m, i.get(b.project).then(_.spread(function(d, i) {
e.get("configmaps", b.configMap, i).then(function(a) {
e.get("configmaps", b.configMap, i, {
errorNotification:!1
}).then(function(a) {
c.loaded = !0, c.breadcrumbs = f.getBreadcrumbs({
name:b.configMap,
object:a,
Expand Down Expand Up @@ -6907,7 +6941,9 @@ return void Logger.error("Unknown deployment strategy type: " + a);
}
};
m.get(d.project).then(_.spread(function(c, e) {
return a.project = c, a.context = e, g.canI("deploymentconfigs", "update", d.project) ? void i.get("deploymentconfigs", d.deploymentconfig, e).then(function(b) {
return a.project = c, a.context = e, g.canI("deploymentconfigs", "update", d.project) ? void i.get("deploymentconfigs", d.deploymentconfig, e, {
errorNotification:!1
}).then(function(b) {
a.deploymentConfig = b, a.breadcrumbs = h.getBreadcrumbs({
object:b,
project:c,
Expand Down Expand Up @@ -7381,7 +7417,9 @@ var h = {
resource:f.kindToResource(d.kind),
group:d.group
};
return g.canI(h, "update", d.project) ? (i.get(h, a.name, e).then(function(c) {
return g.canI(h, "update", d.project) ? (i.get(h, a.name, e, {
errorNotification:!1
}).then(function(c) {
var g = angular.copy(c);
a.resource = g;
var j = function(a) {
Expand Down
2 changes: 1 addition & 1 deletion dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -3872,7 +3872,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<div class=\"middle-content\" persist-tab-state>\n" +
"<div class=\"container-fluid\">\n" +
"<div ng-if=\"!loaded\">Loading...</div>\n" +
"<div class=\"row\" ng-if=\"loaded\">\n" +
"<div class=\"row\" ng-if=\"loaded && statefulSet\">\n" +
"<div class=\"col-md-12\">\n" +
"<uib-tabset>\n" +
"<uib-tab active=\"selectedTab.details\">\n" +
Expand Down