KEYCLOAK-14218 Fixes some missing localizations in admin console;

KEYCLOAK-10927 Fixes use of language features not supported in Internet Explorer.
This commit is contained in:
Dirk Weinhardt 2020-05-25 11:03:15 +02:00 committed by Stan Silvert
parent 6ccde288a3
commit 63e6e13cd3
11 changed files with 418 additions and 176 deletions

View file

@ -21,6 +21,9 @@ false=Nein
endpoints=Endpoints
dateFormat=dd.MM.yyyy
timeFormat=HH:mm:ss
# Realm settings
realm-detail.enabled.tooltip=Benutzer und Clients k\u00F6nnen das Realm nur verwenden, wenn es aktiviert ist
#realm-detail.oidc-endpoints.tooltip=Shows the configuration of the OpenID Connect endpoints
@ -702,6 +705,19 @@ group.assigned-roles.tooltip=Realm-Rollen die zur Gruppe zugeordnet sind
#group.assigned-roles-client.tooltip=Role mappings for this client.
#group.effective-roles-client.tooltip=Role mappings for this client. Some roles here might be inherited from a mapped composite role.
group.move.success=Gruppe verschoben.
group.remove.confirm.title=Gruppe löschen
group.remove.confirm.message=Sind Sie sicher, dass Sie die Gruppe \u201E{{name}}\u201C löschen möchten?
group.remove.success=Die Gruppe wurde gelöscht.
group.fetch.fail=Fehler beim Laden: {{params}}
group.create.success=Gruppe erstellt.
group.edit.success=Die Änderungen wurde gespeichert.
group.roles.add.success=Rollenzuweisung hinzugefügt.
group.roles.remove.success=Rollenzuweisung entfernt.
group.default.add.error=Bitte eine Gruppe auswählen.
group.default.add.success=Standardgruppe hinzugefügt.
group.default.remove.success=Standardgruppe entfernt.
default-roles=Standardrollen
no-realm-roles-available=Keine Realm-Rollen verf\u00FCgbar
@ -712,6 +728,71 @@ user.effective-roles.tooltip=Alle Realm-Rollen-Zuweisungen. Einige Rollen hier k
#user.available-roles.tooltip=Assignable roles from this client.
#user.assigned-roles-client.tooltip=Role mappings for this client.
#user.effective-roles-client.tooltip=Role mappings for this client. Some roles here might be inherited from a mapped composite role.
user.roles.add.success=Rollenzuweisung hinzugefügt.
user.roles.remove.success=Rollenzuweisung entfernt.
user.logout.all.success=Benutzer von allen Sitzungen abgemeldet.
user.logout.session.success=Benutzer von Sitzung abgemeldet.
user.fedid.link.remove.confirm.title=Verknüpfung mit Identity Provider entfernen
user.fedid.link.remove.confirm.message=Sind Sie sicher, dass Sie die Verknüpfung mit dem Identity Provider \u201E{{name}}\u201C entfernen möchten?
user.fedid.link.remove.success=Verknüpfung mit Identity Provider entfernt.
user.fedid.link.add.success=Verknüpfung mit Identity Provider angelegt.
user.consent.revoke.success=Einwilligung widerrufen.
user.consent.revoke.error=Einwilligung konnte nicht widerrufen werden.
user.unlock.success=Alle vorübergehend gesperrten Benutzer wurden entsperrt.
user.remove.confirm.title=Benutzer löschen
user.remove.confirm.message=Sind Sie sicher, dass Sie den Benutzer \u201E{{name}}\u201C löschen möchten?
user.remove.success=Der Benutzer wurde gelöscht.
user.remove.error=Der Benutzer konnte nicht gelöscht werden.
user.create.success=Der Benutzer wurde angelegt.
user.edit.success=Die Änderungen wurden gespeichert.
user.credential.update.success=Die Zugangsdaten wurdern gespeichert.
user.credential.update.error=Beim Speichern der Zugangsdaten ist ein Fehler aufgetreten.
user.credential.remove.confirm.title=Zugangsdaten löschen
user.credential.remove.confirm.message=Sind Sie sicher, dass Sie die Zugangsdaten löschen löschen möchten?
user.credential.remove.success=Die Zugangsdaten wurden gelöscht.
user.credential.remove.error=Beim Löschen der Zugangsdaten ist ein Fehler aufgetreten.
user.credential.move-top.error=Beim Verschieben der Zugangsdaten ist ein Fehler aufgetreten.
user.credential.move-up.error=Beim Verschieben der Zugangsdaten ist ein Fehler aufgetreten.
user.credential.move-down.error=Beim Verschieben der Zugangsdaten ist ein Fehler aufgetreten.
user.credential.fetch.error=Beim Laden der Zugangsdaten ist ein Fehler aufgetreten.
#user.credential.storage.fetch.error=Error while loading user storage credentials. See console for more information.
user.password.error.not-matching=Die Passwörter stimmen nicht überein.
user.password.reset.confirm.title=Passwort zurücksetzen
user.password.reset.confirm.message=Sind Sie sicher, dass Sie das Passwort für diesen Benutzer zurücksetzen möchten?
user.password.reset.success=Das Passwort wurde zurückgesetzt.
user.password.set.confirm.title=Passwort setzen
user.password.set.confirm.message=Sind Sie sicher, dass Sie ein Passwort für diesen Benutzer setzen möchten?
user.password.set.success=Das Passwort wurde gesetzt.
user.credential.disable.confirm.title=Zugangsdaten deaktivieren
user.credential.disable.confirm.message=Sind Sie sicher, dass Sie diese Zugangsdaten deaktivieren möchten?
user.credential.disable.confirm.success=Zugangsdaten deaktiviert.
user.credential.disable.confirm.error=Fehler beim Deaktivieren der Zugangsdaten
user.actions-email.send.pending-changes.title=E-Mail kann nicht gesendet werden.
user.actions-email.send.pending-changes.message=Bitte speichern Sie Ihre Änderungen bevor Sie die E-Mail senden.
user.actions-email.send.confirm.title=E-Mail senden
user.actions-email.send.confirm.message=Sind Sie sicher, dass Sie die E-Mail an den Benutzer senden möchten?
user.actions-email.send.confirm.success=E-Mail an Benutzer gesendet.
user.actions-email.send.confirm.error=Fehler beim Senden der E-Mail
#user.storage.remove.confirm.title=Delete User storage provider
#user.storage.remove.confirm.message=Are you sure you want to permanently delete the user storage provider {{name}}?
#user.storage.remove.success=The provider has been deleted.
#user.storage.create.success=The provider has been created.
#user.storage.edit.success=The provider has been updated.
#user.storage.sync.success=Sync of users finished successfully. {{status}}
#user.storage.sync.error=Error during sync of users
#user.storage.remove-users.success=Remove imported users finished successfully.
#user.storage.remove-users.error=Error during remove
#user.storage.unlink.success=Unlink of users finished successfully.
#user.storage.unlink.error=Error during unlink
user.groups.fetch.all.error=Fehler beim Laden alle Gruppen: {{params}}
user.groups.fetch.error=Fehler beim Laden: {{params}}
user.groups.join.error.no-group-selected=Bitte wählen Sie eine Gruppe aus!
user.groups.join.error.already-added=Benutzer gehört der Gruppe bereits an.
user.groups.join.success=Zur Gruppe hinzugefügt.
user.groups.leave.error.no-group-selected=Bitte wählen Sie eine Gruppe aus!
user.groups.leave.success=Aus Gruppe entfernt.
#default.available-roles.tooltip=Realm level roles that can be assigned.
#realm-default-roles=Realm Default Roles
#realm-default-roles.tooltip=Realm level roles assigned to new users.
@ -1521,3 +1602,14 @@ permissions-enabled-users.tooltip=Legt fest, ob feingranulare Berechtigungen f\u
#tls-client-certificate-bound-access-tokens.tooltip=This enables support for OAuth 2.0 Mutual TLS Certificate Bound Access Tokens, which means that keycloak bind an access token and a refresh token with a X.509 certificate of a token requesting client exchanged in mutual TLS between keycloak's Token Endpoint and this client. These tokens can be treated as Holder-of-Key tokens instead of bearer tokens.
#subjectdn=Subject DN
#subjectdn-tooltip=A regular expression for validating Subject DN in the Client Certificate. Use "(.*?)(?:$)" to match all kind of expressions.
notifications.info.header=Information!
notifications.success.header=Erfolg!
notifications.error.header=Fehler!
notifications.warn.header=Warnung!
dialogs.delete.title={{type}} löschen
dialogs.delete.message=Sind Sie sicher, dass Sie {{type}} {{name}} löschen möchten?
dialogs.delete.confirm=Löschen
dialogs.cancel=Abbrechen
dialogs.ok=OK

View file

@ -22,6 +22,10 @@ false=False
endpoints=Endpoints
# Angular date filter format strings: https://docs.angularjs.org/api/ng/filter/date
dateFormat=shortDate
timeFormat=mediumTime
# Realm settings
realm-detail.enabled.tooltip=Users and clients can only access a realm if it's enabled
realm-detail.protocol-endpoints.tooltip=Shows the configuration of the protocol endpoints
@ -775,6 +779,19 @@ group.available-roles.tooltip=Assignable roles from this client.
group.assigned-roles-client.tooltip=Role mappings for this client.
group.effective-roles-client.tooltip=Role mappings for this client. Some roles here might be inherited from a mapped composite role.
group.move.success=Group moved.
group.remove.confirm.title=Delete Group
group.remove.confirm.message=Are you sure you want to permanently delete the group {{name}}?
group.remove.success=The group has been deleted.
group.fetch.fail=Unable to fetch {{params}}
group.create.success=Group Created.
group.edit.success=Your changes have been saved to the group.
group.roles.add.success=Role mappings updated.
group.roles.remove.success=Role mappings updated.
group.default.add.error=Please select a group to add
group.default.add.success=Added default group
group.default.remove.success=Removed default group
default-roles=Default Roles
no-realm-roles-available=No realm roles available
@ -785,6 +802,71 @@ user.effective-roles.tooltip=All realm role mappings. Some roles here might be i
user.available-roles.tooltip=Assignable roles from this client.
user.assigned-roles-client.tooltip=Role mappings for this client.
user.effective-roles-client.tooltip=Role mappings for this client. Some roles here might be inherited from a mapped composite role.
user.roles.add.success=Role mappings updated.
user.roles.remove.success=Role mappings updated.
user.logout.all.success=Logged out user in all clients
user.logout.session.success=Logged out session
user.fedid.link.remove.confirm.title=Delete Identity Provider Link
user.fedid.link.remove.confirm.message=Are you sure you want to permanently delete the Identity Provider Link {{name}}?
user.fedid.link.remove.success=The provider link has been deleted.
user.fedid.link.add.success=Provider link has been created.
user.consent.revoke.success=Grant revoked successfully
user.consent.revoke.error=Grant couldn't be revoked
user.remove.confirm.title=Delete User
user.remove.confirm.message=Are you sure you want to permanently delete the user {{name}}?
user.unlock.success=Any temporarily locked users are now unlocked.
user.remove.success=The user has been deleted.
user.remove.error=User couldn't be deleted
user.create.success=The user has been created.
user.edit.success=Your changes have been saved to the user.
user.credential.update.success=Credentials saved!
user.credential.update.error=Error while updating the credential. See console for more information.
user.credential.remove.confirm.title=Delete credentials
user.credential.remove.confirm.message=Are you sure you want to delete these users credentials?
user.credential.remove.success=Credentials deleted!
user.credential.remove.error=Error while deleting the credential. See console for more information.
user.credential.move-top.error=Error while moving the credential to top. See console for more information.
user.credential.move-up.error=Error while moving the credential up. See console for more information.
user.credential.move-down.error=Error while moving the credential down. See console for more information.
user.credential.fetch.error=Error while loading user credentials. See console for more information.
user.credential.storage.fetch.error=Error while loading user storage credentials. See console for more information.
user.password.error.not-matching=Password and confirmation does not match.
user.password.reset.confirm.title=Reset password
user.password.reset.confirm.message=Are you sure you want to reset the password for the user?
user.password.reset.success=The password has been reset.
user.password.set.confirm.title=Set password
user.password.set.confirm.message=Are you sure you want to set a password for the user?
user.password.set.success=The password has been set.
user.credential.disable.confirm.title=Disable credentials
user.credential.disable.confirm.message=Are you sure you want to disable these users credentials?
user.credential.disable.confirm.success=Credentials disabled
user.credential.disable.confirm.error=Failed to disable credentials
user.actions-email.send.pending-changes.title=Cannot send email
user.actions-email.send.pending-changes.message=You must save your current changes before you can send an email
user.actions-email.send.confirm.title=Send Email
user.actions-email.send.confirm.message=Are you sure you want to send email to user?
user.actions-email.send.confirm.success=Email sent to user
user.actions-email.send.confirm.error=Failed to send email to user
user.storage.remove.confirm.title=Delete User storage provider
user.storage.remove.confirm.message=Are you sure you want to permanently delete the user storage provider {{name}}?
user.storage.remove.success=The provider has been deleted.
user.storage.create.success=The provider has been created.
user.storage.edit.success=The provider has been updated.
user.storage.sync.success=Sync of users finished successfully. {{status}}
user.storage.sync.error=Error during sync of users
user.storage.remove-users.success=Remove imported users finished successfully.
user.storage.remove-users.error=Error during remove
user.storage.unlink.success=Unlink of users finished successfully.
user.storage.unlink.error=Error during unlink
user.groups.fetch.all.error=Unable to fetch all group memberships {{params}}
user.groups.fetch.error=Unable to fetch {{params}}
user.groups.join.error.no-group-selected=Please select a group to add
user.groups.join.error.already-added=Group already added
user.groups.join.success=Added group membership
user.groups.leave.error.no-group-selected=Please select a group to remove
user.groups.leave.success=Removed group membership
default.available-roles.tooltip=Realm level roles that can be assigned.
realm-default-roles=Realm Default Roles
realm-default-roles.tooltip=Realm level roles assigned to new users.
@ -1645,3 +1727,14 @@ key-not-allowed-here=Key '{{character}}' is not allowed here.
advanced-ldap-settings=Advanced Settings
ldap-query-supported-extensions=Query Supported Extensions
ldap-query-supported-extensions.tooltip=This will query LDAP server for supported extensions, controls and features. Some advanced settings of the LDAP provider will be then automatically configured based on the capabilities/extensions/features supported by LDAP server. For example if LDAPv3 Password Modify extension is supported by LDAP server, corresponding switch will be enabled for LDAP provider.
notifications.info.header=Info!
notifications.success.header=Success!
notifications.error.header=Error!
notifications.warn.header=Warning!
dialogs.delete.title=Delete {{type}}
dialogs.delete.message=Are you sure you want to permanently delete the {{type}} {{name}}?
dialogs.delete.confirm=Delete
dialogs.cancel=Cancel
dialogs.ok=Ok

View file

@ -50,6 +50,28 @@ angular.element(document).ready(function () {
req.send();
}
function loadSelect2Localization() {
// 'en' is the built-in default and does not have to be loaded.
var supportedLocales = ['ar', 'az', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'es', 'et', 'eu', 'fa', 'fi', 'fr',
'gl', 'he', 'hr', 'hu', 'id', 'is', 'it', 'ja', 'ka', 'ko', 'lt', 'lv', 'mk', 'ms', 'nl', 'no', 'pl',
'pt-BR', 'pt-PT', 'ro', 'rs', 'ru', 'sk', 'sv', 'th', 'tr', 'ug-CN', 'uk', 'vi', 'zh-CN', 'zh-TW'];
if (supportedLocales.indexOf(locale) == -1) return;
var select2JsUrl;
var allScriptElements = document.getElementsByTagName('script');
for (var i = 0, n = allScriptElements.length; i < n; i++) {
var src = allScriptElements[i].getAttribute('src');
if (src && src.match(/\/select2\/select2\.js$/)) {
select2JsUrl = src;
break;
}
}
if (!select2JsUrl) return;
var scriptElement = document.createElement('script');
scriptElement.src = select2JsUrl.replace(/\/select2\/select2\.js$/, '/select2/select2_locale_'+locale+'.js');
scriptElement.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(scriptElement);
}
function hasAnyAccess(user) {
return user && user['realm_access'];
}
@ -91,6 +113,8 @@ angular.element(document).ready(function () {
});
});
});
loadSelect2Localization();
}).error(function () {
window.location.reload();
});

View file

@ -1772,7 +1772,7 @@ module.controller('ResourceServerPolicyRoleDetailCtrl', function($scope, $route,
}
});
module.controller('ResourceServerPolicyGroupDetailCtrl', function($scope, $route, realm, client, Client, Groups, Group, PolicyController, Notifications) {
module.controller('ResourceServerPolicyGroupDetailCtrl', function($scope, $route, realm, client, Client, Groups, Group, PolicyController, Notifications, $translate) {
PolicyController.onInit({
getPolicyType : function() {
return "group";
@ -1784,7 +1784,7 @@ module.controller('ResourceServerPolicyGroupDetailCtrl', function($scope, $route
Groups.query({realm: $route.current.params.realm}, function(groups) {
$scope.groups = groups;
$scope.groupList = [
{"id" : "realm", "name": "Groups",
{"id" : "realm", "name": $translate.instant('groups'),
"subGroups" : groups}
];
});

View file

@ -1,9 +1,9 @@
module.controller('GroupListCtrl', function($scope, $route, $q, realm, Groups, GroupsCount, Group, GroupChildren, Notifications, $location, Dialog, ComponentUtils) {
module.controller('GroupListCtrl', function($scope, $route, $q, realm, Groups, GroupsCount, Group, GroupChildren, Notifications, $location, Dialog, ComponentUtils, $translate) {
$scope.realm = realm;
$scope.groupList = [
{
"id" : "realm",
"name": "Groups",
"name": $translate.instant('groups'),
"subGroups" : []
}
];
@ -40,13 +40,13 @@ module.controller('GroupListCtrl', function($scope, $route, $q, realm, Groups, G
Groups.query(queryParams, function(entry) {
promiseGetGroups.resolve(entry);
}, function() {
promiseGetGroups.reject('Unable to fetch ' + queryParams);
promiseGetGroups.reject($translate.instant('group.fetch.fail', {params: queryParams}));
});
promiseGetGroups.promise.then(function(groups) {
$scope.groupList = [
{
"id" : "realm",
"name": "Groups",
"name": $translate.instant('groups'),
"subGroups": ComponentUtils.sortGroups('name', groups)
}
];
@ -69,7 +69,7 @@ module.controller('GroupListCtrl', function($scope, $route, $q, realm, Groups, G
GroupsCount.query(countParams, function(entry) {
promiseCount.resolve(entry);
}, function() {
promiseCount.reject('Unable to fetch ' + countParams);
promiseCount.reject($translate.instant('group.fetch.fail', {params: countParams}));
});
promiseCount.promise.then(function(entry) {
if(angular.isDefined(entry.count) && entry.count > $scope.pageSize) {
@ -127,14 +127,14 @@ module.controller('GroupListCtrl', function($scope, $route, $q, realm, Groups, G
if (selected.id === 'realm') {
Groups.save({realm: realm.realm}, {id:$scope.cutNode.id}, function() {
$route.reload();
Notifications.success("Group moved.");
Notifications.success($translate.instant('group.move.success'));
});
} else {
GroupChildren.save({realm: realm.realm, groupId: selected.id}, {id:$scope.cutNode.id}, function() {
$route.reload();
Notifications.success("Group moved.");
Notifications.success($translate.instant('group.move.success'));
});
@ -144,13 +144,17 @@ module.controller('GroupListCtrl', function($scope, $route, $q, realm, Groups, G
$scope.remove = function(selected) {
if (selected === null) return;
Dialog.confirmDelete(selected.name, 'group', function() {
Dialog.confirmWithButtonText(
$translate.instant('group.remove.confirm.title', {name: selected.name}),
$translate.instant('group.remove.confirm.message', {name: selected.name}),
$translate.instant('dialogs.delete.confirm'),
function() {
Group.remove({ realm: realm.realm, groupId : selected.id }, function() {
$route.reload();
Notifications.success("The group has been deleted.");
Notifications.success($translate.instant('group.remove.success'));
});
});
}
);
};
$scope.createGroup = function(selected) {
@ -189,7 +193,7 @@ module.controller('GroupListCtrl', function($scope, $route, $q, realm, Groups, G
});
module.controller('GroupCreateCtrl', function($scope, $route, realm, parentId, Groups, Group, GroupChildren, Notifications, $location) {
module.controller('GroupCreateCtrl', function($scope, $route, realm, parentId, Groups, Group, GroupChildren, Notifications, $location, $translate) {
$scope.realm = realm;
$scope.group = {};
$scope.save = function() {
@ -203,7 +207,7 @@ module.controller('GroupCreateCtrl', function($scope, $route, realm, parentId, G
var id = l.substring(l.lastIndexOf("/") + 1);
$location.url("/realms/" + realm.realm + "/groups/" + id);
Notifications.success("Group Created.");
Notifications.success($translate.instant('group.create.success'));
})
} else {
@ -214,7 +218,7 @@ module.controller('GroupCreateCtrl', function($scope, $route, realm, parentId, G
var id = l.substring(l.lastIndexOf("/") + 1);
$location.url("/realms/" + realm.realm + "/groups/" + id);
Notifications.success("Group Created.");
Notifications.success($translate.instant('group.create.success'));
})
}
@ -225,21 +229,26 @@ module.controller('GroupCreateCtrl', function($scope, $route, realm, parentId, G
};
});
module.controller('GroupTabCtrl', function(Dialog, $scope, Current, Group, Notifications, $location) {
module.controller('GroupTabCtrl', function(Dialog, $scope, Current, Group, Notifications, $location, $translate) {
$scope.removeGroup = function() {
Dialog.confirmDelete($scope.group.name, 'group', function() {
Dialog.confirmWithButtonText(
$translate.instant('group.remove.confirm.title', {name: $scope.group.name}),
$translate.instant('group.remove.confirm.message', {name: $scope.group.name}),
$translate.instant('dialogs.delete.confirm'),
function() {
Group.remove({
realm : Current.realm.realm,
groupId : $scope.group.id
}, function() {
$location.url("/realms/" + Current.realm.realm + "/groups");
Notifications.success("The group has been deleted.");
});
Notifications.success($translate.instant('group.remove.success'));
});
}
);
};
});
module.controller('GroupDetailCtrl', function(Dialog, $scope, realm, group, Group, Notifications, $location) {
module.controller('GroupDetailCtrl', function(Dialog, $scope, realm, group, Group, Notifications, $location, $translate) {
$scope.realm = realm;
if (!group.attributes) {
@ -267,7 +276,7 @@ module.controller('GroupDetailCtrl', function(Dialog, $scope, realm, group, Grou
$scope.changed = false;
convertAttributeValuesToString($scope.group);
group = angular.copy($scope.group);
Notifications.success("Your changes have been saved to the group.");
Notifications.success($translate.instant('group.edit.success'));
});
};
@ -310,7 +319,7 @@ module.controller('GroupDetailCtrl', function(Dialog, $scope, realm, group, Grou
module.controller('GroupRoleMappingCtrl', function($scope, $http, $route, realm, group, clients, client, Client, Notifications, GroupRealmRoleMapping,
GroupClientRoleMapping, GroupAvailableRealmRoleMapping, GroupAvailableClientRoleMapping,
GroupCompositeRealmRoleMapping, GroupCompositeClientRoleMapping) {
GroupCompositeRealmRoleMapping, GroupCompositeClientRoleMapping, $translate) {
$scope.realm = realm;
$scope.group = group;
$scope.selectedRealmRoles = [];
@ -348,7 +357,7 @@ module.controller('GroupRoleMappingCtrl', function($scope, $http, $route, realm,
$scope.selectedClientMappings = [];
}
$scope.selectedRealmRolesToAdd = [];
Notifications.success("Role mappings updated.");
Notifications.success($translate.instant('group.roles.add.success'));
});
};
@ -371,7 +380,7 @@ module.controller('GroupRoleMappingCtrl', function($scope, $http, $route, realm,
$scope.selectedClientMappings = [];
}
$scope.selectedRealmMappingsToRemove = [];
Notifications.success("Role mappings updated.");
Notifications.success($translate.instant('group.roles.remove.success'));
});
};
@ -387,7 +396,7 @@ module.controller('GroupRoleMappingCtrl', function($scope, $http, $route, realm,
$scope.realmComposite = GroupCompositeRealmRoleMapping.query({realm : realm.realm, groupId : group.id});
$scope.realmRoles = GroupAvailableRealmRoleMapping.query({realm : realm.realm, groupId : group.id});
$scope.selectedClientRolesToAdd = [];
Notifications.success("Role mappings updated.");
Notifications.success($translate.instant('group.roles.add.success'));
});
};
@ -403,7 +412,7 @@ module.controller('GroupRoleMappingCtrl', function($scope, $http, $route, realm,
$scope.realmComposite = GroupCompositeRealmRoleMapping.query({realm : realm.realm, groupId : group.id});
$scope.realmRoles = GroupAvailableRealmRoleMapping.query({realm : realm.realm, groupId : group.id});
$scope.selectedClientMappingsToRemove = [];
Notifications.success("Role mappings updated.");
Notifications.success($translate.instant('group.roles.remove.success'));
});
};
@ -476,7 +485,7 @@ module.controller('GroupMembersCtrl', function($scope, realm, group, GroupMember
});
module.controller('DefaultGroupsCtrl', function($scope, $q, realm, Groups, GroupsCount, DefaultGroups, Notifications) {
module.controller('DefaultGroupsCtrl', function($scope, $q, realm, Groups, GroupsCount, DefaultGroups, Notifications, $translate) {
$scope.realm = realm;
$scope.groupList = [];
$scope.selectedGroup = null;
@ -516,7 +525,7 @@ module.controller('DefaultGroupsCtrl', function($scope, $q, realm, Groups, Group
Groups.query(queryParams, function(entry) {
promiseGetGroups.resolve(entry);
}, function() {
promiseGetGroups.reject('Unable to fetch ' + queryParams);
promiseGetGroups.reject($translate.instant('group.fetch.fail', {params: queryParams}));
});
promiseGetGroups.promise.then(function(groups) {
$scope.groupList = groups;
@ -528,7 +537,7 @@ module.controller('DefaultGroupsCtrl', function($scope, $q, realm, Groups, Group
GroupsCount.query(countParams, function(entry) {
promiseCount.resolve(entry);
}, function() {
promiseCount.reject('Unable to fetch ' + countParams);
promiseCount.reject($translate.instant('group.fetch.fail', {params: countParams}));
});
promiseCount.promise.then(function(entry) {
if(angular.isDefined(entry.count) && entry.count > $scope.pageSize) {
@ -568,13 +577,13 @@ module.controller('DefaultGroupsCtrl', function($scope, $q, realm, Groups, Group
$scope.addDefaultGroup = function() {
if (!$scope.tree.currentNode) {
Notifications.error('Please select a group to add');
Notifications.error($translate.instant('group.default.add.error'));
return;
}
DefaultGroups.update({realm: realm.realm, groupId: $scope.tree.currentNode.id}, function() {
refreshDefaultGroups();
Notifications.success('Added default group');
Notifications.success($translate.instant('group.default.add.success'));
});
};
@ -582,7 +591,7 @@ module.controller('DefaultGroupsCtrl', function($scope, $q, realm, Groups, Group
$scope.removeDefaultGroup = function() {
DefaultGroups.remove({realm: realm.realm, groupId: $scope.selectedGroup.id}, function() {
refreshDefaultGroups();
Notifications.success('Removed default group');
Notifications.success($translate.instant('group.default.remove.success'));
});
};

View file

@ -1,6 +1,6 @@
module.controller('UserRoleMappingCtrl', function($scope, $http, $route, realm, user, client, Client, Notifications, RealmRoleMapping,
ClientRoleMapping, AvailableRealmRoleMapping, AvailableClientRoleMapping,
CompositeRealmRoleMapping, CompositeClientRoleMapping) {
CompositeRealmRoleMapping, CompositeClientRoleMapping, $translate) {
$scope.realm = realm;
$scope.user = user;
$scope.selectedRealmRoles = [];
@ -38,7 +38,7 @@ module.controller('UserRoleMappingCtrl', function($scope, $http, $route, realm,
$scope.selectedClientRoles = [];
$scope.selectedClientMappings = [];
}
Notifications.success("Role mappings updated.");
Notifications.success($translate.instant('user.roles.add.success'));
});
};
@ -60,7 +60,7 @@ module.controller('UserRoleMappingCtrl', function($scope, $http, $route, realm,
$scope.selectedClientRoles = [];
$scope.selectedClientMappings = [];
}
Notifications.success("Role mappings updated.");
Notifications.success($translate.instant('user.roles.remove.success'));
});
};
@ -75,7 +75,7 @@ module.controller('UserRoleMappingCtrl', function($scope, $http, $route, realm,
$scope.selectedClientMappings = [];
$scope.realmComposite = CompositeRealmRoleMapping.query({realm : realm.realm, userId : user.id});
$scope.realmRoles = AvailableRealmRoleMapping.query({realm : realm.realm, userId : user.id});
Notifications.success("Role mappings updated.");
Notifications.success($translate.instant('user.roles.add.success'));
});
};
@ -90,7 +90,7 @@ module.controller('UserRoleMappingCtrl', function($scope, $http, $route, realm,
$scope.selectedClientMappings = [];
$scope.realmComposite = CompositeRealmRoleMapping.query({realm : realm.realm, userId : user.id});
$scope.realmRoles = AvailableRealmRoleMapping.query({realm : realm.realm, userId : user.id});
Notifications.success("Role mappings updated.");
Notifications.success($translate.instant('user.roles.remove.success'));
});
};
@ -119,14 +119,14 @@ module.controller('UserRoleMappingCtrl', function($scope, $http, $route, realm,
clientSelectControl($scope, $route.current.params.realm, Client);
});
module.controller('UserSessionsCtrl', function($scope, realm, user, sessions, UserSessions, UserLogout, UserSessionLogout, Notifications) {
module.controller('UserSessionsCtrl', function($scope, realm, user, sessions, UserSessions, UserLogout, UserSessionLogout, Notifications, $translate) {
$scope.realm = realm;
$scope.user = user;
$scope.sessions = sessions;
$scope.logoutAll = function() {
UserLogout.save({realm : realm.realm, user: user.id}, function () {
Notifications.success('Logged out user in all clients');
Notifications.success($translate.instant('user.logout.all.success'));
UserSessions.query({realm: realm.realm, user: user.id}, function(updated) {
$scope.sessions = updated;
})
@ -138,13 +138,13 @@ module.controller('UserSessionsCtrl', function($scope, realm, user, sessions, Us
UserSessionLogout.delete({realm : realm.realm, session: sessionId}, function() {
UserSessions.query({realm: realm.realm, user: user.id}, function(updated) {
$scope.sessions = updated;
Notifications.success('Logged out session');
Notifications.success($translate.instant('user.logout.session.success'));
})
});
}
});
module.controller('UserFederatedIdentityCtrl', function($scope, $location, realm, user, federatedIdentities, UserFederatedIdentity, Notifications, Dialog) {
module.controller('UserFederatedIdentityCtrl', function($scope, $location, realm, user, federatedIdentities, UserFederatedIdentity, Notifications, Dialog, $translate) {
$scope.realm = realm;
$scope.user = user;
$scope.federatedIdentities = federatedIdentities;
@ -157,17 +157,22 @@ module.controller('UserFederatedIdentityCtrl', function($scope, $location, realm
console.log("Removing provider link: " + providerLink.identityProvider);
Dialog.confirmDelete(providerLink.identityProvider, 'Identity Provider Link', function() {
Dialog.confirmWithButtonText(
$translate.instant('user.fedid.link.remove.confirm.title', {name: providerLink.identityProvider}),
$translate.instant('user.fedid.link.remove.confirm.message', {name: providerLink.identityProvider}),
$translate.instant('dialogs.delete.confirm'),
function() {
UserFederatedIdentity.remove({ realm: realm.realm, user: user.id, provider: providerLink.identityProvider }, function() {
Notifications.success("The provider link has been deleted.");
Notifications.success($translate.instant('user.fedid.link.remove.success'));
var indexToRemove = $scope.federatedIdentities.indexOf(providerLink);
$scope.federatedIdentities.splice(indexToRemove, 1);
});
});
}
);
}
});
module.controller('UserFederatedIdentityAddCtrl', function($scope, $location, realm, user, federatedIdentities, UserFederatedIdentity, Notifications) {
module.controller('UserFederatedIdentityAddCtrl', function($scope, $location, realm, user, federatedIdentities, UserFederatedIdentity, Notifications, $translate) {
$scope.realm = realm;
$scope.user = user;
$scope.federatedIdentity = {};
@ -196,7 +201,7 @@ module.controller('UserFederatedIdentityAddCtrl', function($scope, $location, re
provider: $scope.federatedIdentity.identityProvider
}, $scope.federatedIdentity, function(data, headers) {
$location.url("/realms/" + realm.realm + '/users/' + $scope.user.id + '/federated-identity');
Notifications.success("Provider link has been created.");
Notifications.success($translate.instant('user.fedid.link.add.success'));
});
};
@ -206,7 +211,7 @@ module.controller('UserFederatedIdentityAddCtrl', function($scope, $location, re
});
module.controller('UserConsentsCtrl', function($scope, realm, user, userConsents, UserConsents, Notifications) {
module.controller('UserConsentsCtrl', function($scope, realm, user, userConsents, UserConsents, Notifications, $translate) {
$scope.realm = realm;
$scope.user = user;
$scope.userConsents = userConsents;
@ -216,9 +221,9 @@ module.controller('UserConsentsCtrl', function($scope, realm, user, userConsents
UserConsents.query({realm: realm.realm, user: user.id}, function(updated) {
$scope.userConsents = updated;
})
Notifications.success('Grant revoked successfully');
Notifications.success($translate.instant('user.consent.revoke.success'));
}, function() {
Notifications.error("Grant couldn't be revoked");
Notifications.error($translate.instant('user.consent.revoke.error'));
});
console.log("Revoke consent " + clientId);
}
@ -236,7 +241,7 @@ module.controller('UserOfflineSessionsCtrl', function($scope, $location, realm,
});
module.controller('UserListCtrl', function($scope, realm, User, UserSearchState, UserImpersonation, BruteForce, Notifications, $route, Dialog) {
module.controller('UserListCtrl', function($scope, realm, User, UserSearchState, UserImpersonation, BruteForce, Notifications, $route, Dialog, $translate) {
$scope.init = function() {
$scope.realm = realm;
@ -260,7 +265,7 @@ module.controller('UserListCtrl', function($scope, realm, User, UserSearchState,
$scope.unlockUsers = function() {
BruteForce.delete({realm: realm.realm}, function(data) {
Notifications.success("Any temporarily locked users are now unlocked.");
Notifications.success($translate.instant('user.unlock.success'));
});
}
@ -295,7 +300,11 @@ module.controller('UserListCtrl', function($scope, realm, User, UserSearchState,
};
$scope.removeUser = function(user) {
Dialog.confirmDelete(user.id, 'user', function() {
Dialog.confirmWithButtonText(
$translate.instant('user.remove.confirm.title', {name: user.id}),
$translate.instant('user.remove.confirm.message', {name: user.id}),
$translate.instant('dialogs.delete.confirm'),
function() {
user.$remove({
realm : realm.realm,
userId : user.id
@ -306,11 +315,12 @@ module.controller('UserListCtrl', function($scope, realm, User, UserSearchState,
$scope.previousPage();
}
Notifications.success("The user has been deleted.");
Notifications.success($translate.instant('user.remove.success'));
}, function() {
Notifications.error("User couldn't be deleted");
});
Notifications.error($translate.instant('user.remove.error'));
});
}
);
};
});
@ -323,9 +333,9 @@ module.controller('UserTabCtrl', function($scope, $location, Dialog, Notificatio
userId : $scope.user.id
}, function() {
$location.url("/realms/" + Current.realm.realm + "/users");
Notifications.success("The user has been deleted.");
Notifications.success($translate.instant('user.remove.success'));
}, function() {
Notifications.error("User couldn't be deleted");
Notifications.error($translate.instant('user.remove.error'));
});
});
};
@ -375,7 +385,7 @@ module.controller('UserDetailCtrl', function($scope, realm, user, BruteForceUser
Components,
UserImpersonation, RequiredActions,
UserStorageOperations,
$location, $http, Dialog, Notifications) {
$location, $http, Dialog, Notifications, $translate) {
$scope.realm = realm;
$scope.create = !user.id;
$scope.editUsername = $scope.create || $scope.realm.editUsernameAllowed;
@ -468,7 +478,7 @@ module.controller('UserDetailCtrl', function($scope, realm, user, BruteForceUser
$location.url("/realms/" + realm.realm + "/users/" + id);
Notifications.success("The user has been created.");
Notifications.success($translate.instant('user.create.success'));
});
} else {
User.update({
@ -478,7 +488,7 @@ module.controller('UserDetailCtrl', function($scope, realm, user, BruteForceUser
$scope.changed = false;
convertAttributeValuesToString($scope.user);
user = angular.copy($scope.user);
Notifications.success("Your changes have been saved to the user.");
Notifications.success($translate.instant('user.edit.success'));
});
}
};
@ -523,7 +533,7 @@ module.controller('UserDetailCtrl', function($scope, realm, user, BruteForceUser
});
module.controller('UserCredentialsCtrl', function($scope, realm, user, $route, $location, RequiredActions, User, UserExecuteActionsEmail,
UserCredentials, Notifications, Dialog, TimeUnit2, Components, UserStorageOperations, $modal) {
UserCredentials, Notifications, Dialog, TimeUnit2, Components, UserStorageOperations, $modal, $translate) {
console.log('UserCredentialsCtrl');
$scope.hasPassword = false;
@ -547,23 +557,28 @@ module.controller('UserCredentialsCtrl', function($scope, realm, user, $route, $
// We JSONify the credential data
'credentialData': JSON.stringify(credential.credentialData)
}, function() {
Notifications.success("Credentials saved!");
Notifications.success($translate.instant('user.credential.update.success'));
}, function(err) {
Notifications.error("Error while updating the credential. See console for more information.");
Notifications.error($translate.instant('user.credential.update.error'));
console.log(err);
});
}
$scope.deleteCredential = function(credential) {
Dialog.confirm('Delete credentials', 'Are you sure you want to delete these users credentials?', function() {
Dialog.confirmWithButtonText(
$translate.instant('user.credential.remove.confirm.title', {name: credential.id}),
$translate.instant('user.credential.remove.confirm.message', {name: credential.id}),
$translate.instant('dialogs.delete.confirm'),
function() {
UserCredentials.deleteCredential({ realm: realm.realm, userId: user.id, credentialId: credential.id }, null, function() {
Notifications.success("Credentials deleted!");
Notifications.success($translate.instant('user.credential.remove.success'));
$route.reload();
}, function(err) {
Notifications.error("Error while deleting the credential. See console for more information.");
Notifications.error($translate.instant('user.credential.remove.error'));
console.log(err);
});
});
})
}
);
}
$scope.moveUp = function(credentials, index) {
@ -581,7 +596,7 @@ module.controller('UserCredentialsCtrl', function($scope, realm, user, $route, $
$route.reload();
},
function (err) {
Notifications.error("Error while moving the credential to top. See console for more information.");
Notifications.error($translate.instant('user.credential.move-top.error'));
console.log(err);
});
@ -597,7 +612,7 @@ module.controller('UserCredentialsCtrl', function($scope, realm, user, $route, $
$route.reload();
},
function (err) {
Notifications.error("Error while moving the credential up. See console for more information.");
Notifications.error($translate.instant('user.credential.move-up.error'));
console.log(err);
});
}
@ -619,7 +634,7 @@ module.controller('UserCredentialsCtrl', function($scope, realm, user, $route, $
$route.reload();
},
function(err) {
Notifications.error("Error while moving the credential down. See console for more information.");
Notifications.error($translate.instant('user.credential.move-down.error'));
console.log(err);
});
}
@ -670,7 +685,7 @@ module.controller('UserCredentialsCtrl', function($scope, realm, user, $route, $
return c;
});
}, function(err) {
Notifications.error("Error while loading user credentials. See console for more information.");
Notifications.error($translate.instant('user.credential.fetch.error'));
console.log(err);
});
@ -678,7 +693,7 @@ module.controller('UserCredentialsCtrl', function($scope, realm, user, $route, $
$scope.userStorageCredentialTypes = userStorageCredentialTypes;
$scope.hasPassword = $scope.hasPassword || userStorageCredentialTypes.lastIndexOf("password") > -1;
}, function(err) {
Notifications.error("Error while loading user storage credentials. See console for more information.");
Notifications.error($translate.instant('user.credential.storage.fetch.error'));
console.log(err);
});
}
@ -689,14 +704,14 @@ module.controller('UserCredentialsCtrl', function($scope, realm, user, $route, $
if ($scope.pwdChange) {
if ($scope.password != $scope.confirmPassword) {
Notifications.error("Password and confirmation does not match.");
Notifications.error($translate.instant('user.password.error.not-matching'));
return;
}
}
var msgTitle = ($scope.hasPassword ? 'Reset' : 'Set') + ' password';
var msg = 'Are you sure you want to ' + ($scope.hasPassword ? 'reset' : 'set') + ' a password for the user?';
var msgSuccess = 'The password has been ' + ($scope.hasPassword ? 'reset.' : 'set.');
var msgTitle = ($scope.hasPassword ? $translate.instant('user.password.reset.confirm.title') : $translate.instant('user.password.set.confirm.title'));
var msg = ($scope.hasPassword ? $translate.instant('user.password.reset.confirm.message') : $translate.instant('user.password.set.confirm.message'));
var msgSuccess = ($scope.hasPassword ? $translate.instant('user.password.reset.success') : $translate.instant('user.password.set.success'));
Dialog.confirm(msgTitle, msg, function() {
UserCredentials.resetPassword({ realm: realm.realm, userId: user.id }, { type : "password", value : $scope.password, temporary: $scope.temporaryPassword }, function() {
@ -716,12 +731,15 @@ module.controller('UserCredentialsCtrl', function($scope, realm, user, $route, $
}
$scope.disableCredentialTypes = function() {
Dialog.confirm('Disable credentials', 'Are you sure you want to disable these users credentials?', function() {
Dialog.confirm(
$translate.instant('user.credential.disable.confirm.title'),
$translate.instant('user.credential.disable.confirm.message'),
function() {
UserCredentials.disableCredentialTypes({ realm: realm.realm, userId: user.id }, $scope.disableableCredentialTypes, function() {
$route.reload();
Notifications.success("Credentials disabled");
Notifications.success($translate.instant('user.credential.disable.confirm.success'));
}, function() {
Notifications.error("Failed to disable credentials");
Notifications.error($translate.instant('user.credential.disable.confirm.error'));
});
});
};
@ -732,14 +750,18 @@ module.controller('UserCredentialsCtrl', function($scope, realm, user, $route, $
$scope.sendExecuteActionsEmail = function() {
if ($scope.changed) {
Dialog.message("Cannot send email", "You must save your current changes before you can send an email");
Dialog.message($translate.instant('user.actions-email.send.pending-changes.title'),
$translate.instant('user.actions-email.send.pending-changes.message'));
return;
}
Dialog.confirm('Send Email', 'Are you sure you want to send email to user?', function() {
Dialog.confirm(
$translate.instant('user.actions-email.send.confirm.title'),
$translate.instant('user.actions-email.send.confirm.message'),
function() {
UserExecuteActionsEmail.update({ realm: realm.realm, userId: user.id, lifespan: $scope.emailActionsTimeout.toSeconds() }, $scope.emailActions, function() {
Notifications.success("Email sent to user");
Notifications.success($translate.instant('user.actions-email.send.confirm.success'));
}, function() {
Notifications.error("Failed to send email to user");
Notifications.error($translate.instant('user.actions-email.send.confirm.error'));
});
});
};
@ -786,7 +808,7 @@ module.controller('UserCredentialsDataModalCtrl', function($scope, credentialDat
}
});
module.controller('UserFederationCtrl', function($scope, $location, $route, realm, serverInfo, Components, Notifications, Dialog) {
module.controller('UserFederationCtrl', function($scope, $location, $route, realm, serverInfo, Components, Notifications, Dialog, $translate) {
console.log('UserFederationCtrl ++++****');
$scope.realm = realm;
$scope.providers = serverInfo.componentTypes['org.keycloak.storage.UserStorageProvider'];
@ -830,20 +852,25 @@ module.controller('UserFederationCtrl', function($scope, $location, $route, real
});
$scope.removeInstance = function(instance) {
Dialog.confirmDelete(instance.name, 'user storage provider', function() {
Dialog.confirmWithButtonText(
$translate.instant('user.storage.remove.confirm.title', {name: instance.name}),
$translate.instant('user.storage.remove.confirm.message', {name: instance.name}),
$translate.instant('dialogs.delete.confirm'),
function() {
Components.remove({
realm : realm.realm,
componentId : instance.id
}, function() {
$route.reload();
Notifications.success("The provider has been deleted.");
});
Notifications.success($translate.instant('user.storage.remove.success'));
});
}
);
};
});
module.controller('GenericUserStorageCtrl', function($scope, $location, Notifications, $route, Dialog, realm,
serverInfo, instance, providerId, Components, UserStorageOperations) {
serverInfo, instance, providerId, Components, UserStorageOperations, $translate) {
console.log('GenericUserStorageCtrl');
console.log('providerId: ' + providerId);
$scope.create = !instance.providerId;
@ -1007,7 +1034,7 @@ module.controller('GenericUserStorageCtrl', function($scope, $location, Notifica
var id = l.substring(l.lastIndexOf("/") + 1);
$location.url("/realms/" + realm.realm + "/user-storage/providers/" + $scope.instance.providerId + "/" + id);
Notifications.success("The provider has been created.");
Notifications.success($translate.instant('user.storage.create.success'));
});
} else {
console.log('update existing provider');
@ -1016,7 +1043,7 @@ module.controller('GenericUserStorageCtrl', function($scope, $location, Notifica
},
$scope.instance, function () {
$route.reload();
Notifications.success("The provider has been updated.");
Notifications.success($translate.instant('user.storage.edit.success'));
});
}
};
@ -1049,28 +1076,28 @@ module.controller('GenericUserStorageCtrl', function($scope, $location, Notifica
function triggerSync(action) {
UserStorageOperations.sync.save({ action: action, realm: $scope.realm.realm, componentId: $scope.instance.id }, {}, function(syncResult) {
$route.reload();
Notifications.success("Sync of users finished successfully. " + syncResult.status);
Notifications.success($translate.instant('user.storage.sync.success',{status: syncResult.status}));
}, function() {
$route.reload();
Notifications.error("Error during sync of users");
Notifications.error($translate.instant('user.storage.sync.error'));
});
}
$scope.removeImportedUsers = function() {
UserStorageOperations.removeImportedUsers.save({ realm: $scope.realm.realm, componentId: $scope.instance.id }, {}, function(syncResult) {
$route.reload();
Notifications.success("Remove imported users finished successfully. ");
Notifications.success($translate.instant('user.storage.remove-users.success'));
}, function() {
$route.reload();
Notifications.error("Error during remove");
Notifications.error($translate.instant('user.storage.remove-users.error'));
});
};
$scope.unlinkUsers = function() {
UserStorageOperations.unlinkUsers.save({ realm: $scope.realm.realm, componentId: $scope.instance.id }, {}, function(syncResult) {
$route.reload();
Notifications.success("Unlink of users finished successfully. ");
Notifications.success($translate.instant('user.storage.unlink.success'));
}, function() {
$route.reload();
Notifications.error("Error during unlink");
Notifications.error($translate.instant('user.storage.unlink.error'));
});
};
@ -1091,7 +1118,7 @@ function removeGroupMember(groups, member) {
}
}
module.controller('UserGroupMembershipCtrl', function($scope, $q, realm, user, UserGroupMembership, UserGroupMembershipCount, UserGroupMapping, Notifications, Groups, GroupsCount, ComponentUtils) {
module.controller('UserGroupMembershipCtrl', function($scope, $q, realm, user, UserGroupMembership, UserGroupMembershipCount, UserGroupMapping, Notifications, Groups, GroupsCount, ComponentUtils, $translate) {
$scope.realm = realm;
$scope.user = user;
$scope.groupList = [];
@ -1120,7 +1147,7 @@ module.controller('UserGroupMembershipCtrl', function($scope, $q, realm, user, U
UserGroupMembership.query(queryParams, function(entry) {
promiseGetCompleteUserGroupMembership.resolve(entry);
}, function() {
promiseGetCompleteUserGroupMembership.reject('Unable to fetch all group memberships' + queryParams);
promiseGetCompleteUserGroupMembership.reject($translate.instant('user.groups.fetch.all.error', {params: queryParams}));
});
promiseGetCompleteUserGroupMembership.promise.then(function(groups) {
for (var i = 0; i < groups.length; i++) {
@ -1160,7 +1187,7 @@ module.controller('UserGroupMembershipCtrl', function($scope, $q, realm, user, U
UserGroupMembership.query(queryParams, function(entry) {
promiseGetUserGroupMembership.resolve(entry);
}, function() {
promiseGetUserGroupMembership.reject('Unable to fetch ' + queryParams);
promiseGetUserGroupMembership.reject($translate.instant('user.groups.fetch.error', {params: queryParams}));
});
promiseGetUserGroupMembership.promise.then(function(groups) {
$scope.groupMemberships = groups;
@ -1172,7 +1199,7 @@ module.controller('UserGroupMembershipCtrl', function($scope, $q, realm, user, U
UserGroupMembershipCount.query(countParams, function(entry) {
promiseMembershipCount.resolve(entry);
}, function() {
promiseMembershipCount.reject('Unable to fetch ' + countParams);
promiseMembershipCount.reject($translate.instant('user.groups.fetch.error', {params: countParams}));
});
promiseMembershipCount.promise.then(function(membershipEntry) {
if(angular.isDefined(membershipEntry.count) && membershipEntry.count > $scope.pageSize) {
@ -1211,7 +1238,7 @@ module.controller('UserGroupMembershipCtrl', function($scope, $q, realm, user, U
Groups.query(queryParams, function(entry) {
promiseGetGroups.resolve(entry);
}, function() {
promiseGetGroups.reject('Unable to fetch ' + queryParams);
promiseGetGroups.reject($translate.instant('user.groups.fetch.error', {params: queryParams}));
});
promiseGetGroups.promise.then(function(groups) {
@ -1224,7 +1251,7 @@ module.controller('UserGroupMembershipCtrl', function($scope, $q, realm, user, U
GroupsCount.query(countParams, function(entry) {
promiseCount.resolve(entry);
}, function() {
promiseCount.reject('Unable to fetch ' + countParams);
promiseCount.reject($translate.instant('user.groups.fetch.error', {params: countParams}));
});
promiseCount.promise.then(function(entry) {
if(angular.isDefined(entry.count) && entry.count > $scope.pageSize) {
@ -1290,30 +1317,30 @@ module.controller('UserGroupMembershipCtrl', function($scope, $q, realm, user, U
$scope.joinGroup = function() {
if (!$scope.tree.currentNode) {
Notifications.error('Please select a group to add');
Notifications.error($translate.instant('user.groups.join.error.no-group-selected'));
return;
}
if (isMember($scope.tree.currentNode)) {
Notifications.error('Group already added');
Notifications.error($translate.instant('user.groups.join.error.already-added'));
return;
}
UserGroupMapping.update({realm: realm.realm, userId: user.id, groupId: $scope.tree.currentNode.id}, function() {
$scope.allGroupMemberships.push($scope.tree.currentNode);
refreshUserGroupMembership($scope.searchCriteriaMembership);
Notifications.success('Added group membership');
Notifications.success($translate.instant('user.groups.join.success'));
});
};
$scope.leaveGroup = function() {
if (!$scope.membershipTree.currentNode) {
Notifications.error('Please select a group to remove');
Notifications.error($translate.instant('user.groups.leave.error.no-group-selected'));
return;
}
UserGroupMapping.remove({realm: realm.realm, userId: user.id, groupId: $scope.membershipTree.currentNode.id}, function () {
removeGroupMember($scope.allGroupMemberships, $scope.membershipTree.currentNode);
refreshUserGroupMembership($scope.searchCriteriaMembership);
Notifications.success('Removed group membership');
Notifications.success($translate.instant('user.groups.leave.success'));
});
};
@ -1711,17 +1738,19 @@ module.controller('LDAPUserStorageCtrl', function($scope, $location, Notificatio
const PASSWORD_MODIFY_OID = '1.3.6.1.4.1.4203.1.11.1';
$http.post(
`${authUrl}/admin/realms/${realm.realm}/ldap-server-capabilities`,
authUrl + '/admin/realms/' + realm.realm + '/ldap-server-capabilities',
initConnectionTest("queryServerCapabilities", $scope.instance.config)).then(
(response) => {
function(response) {
Notifications.success("LDAP supported extensions successfully requested.");
const ldapOids = response.data;
if (angular.isArray(ldapOids)) {
const passwordModifyOid = ldapOids.filter(ldapOid => ldapOid.oid === PASSWORD_MODIFY_OID);
$scope.instance.config['usePasswordModifyExtendedOp'][0] = `${passwordModifyOid.length > 0}`;
const passwordModifyOid = ldapOids.filter(function(ldapOid) { return ldapOid.oid === PASSWORD_MODIFY_OID; });
$scope.instance.config['usePasswordModifyExtendedOp'][0] = (passwordModifyOid.length > 0).toString();
}
},
() => Notifications.error("Error when trying to request supported extensions of LDAP. See server.log for details."));
function() {
Notifications.error("Error when trying to request supported extensions of LDAP. See server.log for details.");
});
}
});

View file

@ -2,7 +2,7 @@
var module = angular.module('keycloak.services', [ 'ngResource', 'ngRoute' ]);
module.service('Dialog', function($modal) {
module.service('Dialog', function($modal, $translate) {
var dialog = {};
var openDialog = function(title, message, btns, template) {
@ -43,20 +43,11 @@ module.service('Dialog', function($modal) {
};
dialog.confirmDelete = function(name, type, success) {
var title = 'Delete ' + escapeHtml(type.charAt(0).toUpperCase() + type.slice(1));
var msg = 'Are you sure you want to permanently delete the ' + type + ' ' + name + '?';
var btns = {
ok: {
label: 'Delete',
cssClass: 'btn btn-danger'
},
cancel: {
label: 'Cancel',
cssClass: 'btn btn-default'
}
}
var title = $translate.instant('dialogs.delete.title', {type: escapeHtml(type.charAt(0).toUpperCase() + type.slice(1))});
var msg = $translate.instant('dialogs.delete.message', {type: type, name: name});
var confirm = $translate.instant('dialogs.delete.confirm');
openDialog(title, msg, btns, '/templates/kc-modal.html').then(success);
dialog.confirmWithButtonText(title, msg, confirm, success);
}
dialog.confirmGenerateKeys = function(name, type, success) {
@ -77,13 +68,17 @@ module.service('Dialog', function($modal) {
}
dialog.confirm = function(title, message, success, cancel) {
dialog.confirmWithButtonText(title, message, title, success, cancel);
}
dialog.confirmWithButtonText = function(title, message, confirm, success, cancel) {
var btns = {
ok: {
label: title,
label: confirm,
cssClass: 'btn btn-danger'
},
cancel: {
label: 'Cancel',
label: $translate.instant('dialogs.cancel'),
cssClass: 'btn btn-default'
}
}
@ -94,7 +89,7 @@ module.service('Dialog', function($modal) {
dialog.message = function(title, message, success, cancel) {
var btns = {
ok: {
label: "Ok",
label: $translate.instant('dialogs.ok'),
cssClass: 'btn btn-default'
}
}
@ -166,7 +161,7 @@ module.service('UpdateDialog', function($modal) {
return dialog;
});
module.factory('Notifications', function($rootScope, $timeout) {
module.factory('Notifications', function($rootScope, $timeout, $translate) {
// time (in ms) the notifications are shown
var delay = 5000;
@ -202,19 +197,19 @@ module.factory('Notifications', function($rootScope, $timeout) {
}
notifications.info = function(message) {
notifications.message("info", "Info!", message);
notifications.message("info", $translate.instant('notifications.info.header'), message);
};
notifications.success = function(message) {
notifications.message("success", "Success!", message);
notifications.message("success", $translate.instant('notifications.success.header'), message);
};
notifications.error = function(message) {
notifications.message("danger", "Error!", message);
notifications.message("danger", $translate.instant('notifications.error.header'), message);
};
notifications.warn = function(message) {
notifications.message("warning", "Warning!", message);
notifications.message("warning", $translate.instant('notifications.warn.header'), message);
};
return notifications;

View file

@ -38,8 +38,8 @@
<tbody>
<tr ng-repeat="ia in clientInitialAccess | filter:search2 | orderBy:'timestamp'">
<td>{{ia.id}}</td>
<td>{{(ia.timestamp * 1000)|date:'shortDate'}}&nbsp;{{(ia.timestamp * 1000)|date:'mediumTime'}}</td>
<td><span data-ng-show="ia.expiration > 0">{{((ia.timestamp + ia.expiration) * 1000)|date:'shortDate'}}&nbsp;{{((ia.timestamp + ia.expiration) * 1000)|date:'mediumTime'}}</span></td>
<td>{{(ia.timestamp * 1000)|date:('dateFormat' | translate)}}&nbsp;{{(ia.timestamp * 1000)|date:('timeFormat' | translate)}}</td>
<td><span data-ng-show="ia.expiration > 0">{{((ia.timestamp + ia.expiration) * 1000)|date:('dateFormat' | translate)}}&nbsp;{{((ia.timestamp + ia.expiration) * 1000)|date:('timeFormat' | translate)}}</span></td>
<td>{{ia.count}}</td>
<td>{{ia.remainingCount}}</td>
<td class="kc-action-cell" data-ng-click="remove(ia.id)">{{:: 'delete' | translate}}</td>

View file

@ -114,7 +114,7 @@
</tfoot>
<tbody>
<tr data-ng-repeat="event in events">
<td>{{event.time|date:'shortDate'}}<br>{{event.time|date:'mediumTime'}}</td>
<td>{{event.time|date:('dateFormat' | translate)}}<br>{{event.time|date:('timeFormat' | translate)}}</td>
<td data-ng-class="events-error">{{event.operationType}}</td>
<td data-ng-class="events-error">{{event.resourceType}}</td>
<td>{{event.resourcePath}}</td>

View file

@ -81,7 +81,7 @@
</tfoot>
<tbody>
<tr ng-repeat="event in events">
<td>{{event.time|date:'shortDate'}}<br>{{event.time|date:'mediumTime'}}</td>
<td>{{event.time|date:('dateFormat' | translate)}}<br>{{event.time|date:('timeFormat' | translate)}}</td>
<td>{{event.type}}</td>
<td>
<table class="table table-striped table-bordered">

View file

@ -20,7 +20,7 @@
<div class="form-group">
<label class="col-md-2 control-label"for="id">{{:: 'created-at' | translate}}</label>
<div class="col-md-6">
{{user.createdTimestamp|date:'shortDate'}}&nbsp;{{user.createdTimestamp|date:'mediumTime'}}
{{user.createdTimestamp|date:('dateFormat' | translate)}}&nbsp;{{user.createdTimestamp|date:('timeFormat' | translate)}}
</div>
</div>