Prevent some more angular warnings if app object isn't set yet

This commit is contained in:
Johannes Zellner
2019-09-19 19:46:20 +02:00
parent a666cb00eb
commit 6dea2475c7
+14 -10
View File
@@ -193,6 +193,8 @@ var RSTATES ={
app.filter('installError', function () {
return function (app) {
if (!app) return false;
if (app.installationState === ISTATES.ERROR) return true;
if (app.installationState === ISTATES.INSTALLED) {
// app.health can also be null to indicate insufficient data
@@ -224,6 +226,18 @@ app.filter('appIsInstalledAndHealthy', function () {
};
});
app.filter('applicationLink', function() {
return function(app) {
if (!app) return '';
if (app.installationState === ISTATES.INSTALLED && app.health === HSTATES.HEALTHY && app.runState === RSTATES.RUNNING && !app.pendingPostInstallConfirmation) {
return 'https://' + app.fqdn;
} else {
return '';
}
};
});
app.filter('activeOAuthClients', function () {
return function (clients, user) {
return clients.filter(function (c) { return user.admin || (c.activeTokens && c.activeTokens.length > 0); });
@@ -375,16 +389,6 @@ app.filter('inProgressApps', function () {
};
});
app.filter('applicationLink', function() {
return function(app) {
if (app.installationState === ISTATES.INSTALLED && app.health === HSTATES.HEALTHY && app.runState === RSTATES.RUNNING && !app.pendingPostInstallConfirmation) {
return 'https://' + app.fqdn;
} else {
return '';
}
};
});
app.filter('prettyHref', function () {
return function (input) {
if (!input) return input;