various app password ui fixes
This commit is contained in:
+9
-10
@@ -396,13 +396,11 @@ angular.module('Application').controller('ProfileController', ['$scope', '$locat
|
||||
if (error) console.error(error);
|
||||
|
||||
$scope.appPassword.passwords = result.appPasswords || [];
|
||||
$scope.appPassword.identifiers = [
|
||||
{ id: 'mail', label: 'Email' },
|
||||
// { id: 'webadmin', label: 'Web Admin'}
|
||||
];
|
||||
$scope.appPassword.identifiers = [];
|
||||
var appsById = {};
|
||||
$scope.apps.forEach(function (app) {
|
||||
if (!app.manifest.addons || !app.manifest.addons.ldap) return;
|
||||
// ignore apps without ldap or with email
|
||||
if (!app.manifest.addons || !app.manifest.addons.ldap || app.manifest.addons.email || !app.sso) return;
|
||||
|
||||
appsById[app.id] = app;
|
||||
if (app.label) {
|
||||
@@ -411,17 +409,18 @@ angular.module('Application').controller('ProfileController', ['$scope', '$locat
|
||||
$scope.appPassword.identifiers.push({ id: app.id, label: app.fqdn });
|
||||
}
|
||||
});
|
||||
$scope.appPassword.identifiers.push({ id: 'mail', label: 'Mail client' });
|
||||
|
||||
// setup prettyIdentifier for the UI
|
||||
// setup label for the table UI
|
||||
$scope.appPassword.passwords.forEach(function (password) {
|
||||
if (password.identifier === 'mail') return password.prettyIdentifier = password.identifier;
|
||||
if (password.identifier === 'mail') return password.label = password.identifier;
|
||||
var app = appsById[password.identifier];
|
||||
if (!app) return password.prettyIdentifier = password.identifier + ' (App not found)';
|
||||
if (!app) return password.label = password.identifier + ' (App not found)';
|
||||
|
||||
if (app.label) {
|
||||
password.prettyIdentifier = app.label + ' (' + app.fqdn + ')';
|
||||
password.label = app.label + ' (' + app.fqdn + ')';
|
||||
} else {
|
||||
password.prettyIdentifier = app.fqdn;
|
||||
password.label = app.fqdn;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user