summaryrefslogtreecommitdiffstats
path: root/install/ui/ipa.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-07-19 14:47:48 +0200
committerPetr Vobornik <pvoborni@redhat.com>2012-07-25 11:05:56 +0200
commit65bd82eaa1a0d8e377b58ebc6b5d96ea9364c993 (patch)
tree8d6495127926a6927bf1aef10f557a70ee3e87f6 /install/ui/ipa.js
parentdedb180ddc773baf42bb31efc07a1dda698631bb (diff)
downloadfreeipa-65bd82eaa1a0d8e377b58ebc6b5d96ea9364c993.tar.gz
freeipa-65bd82eaa1a0d8e377b58ebc6b5d96ea9364c993.tar.xz
freeipa-65bd82eaa1a0d8e377b58ebc6b5d96ea9364c993.zip
IDs and names for dialogs
It's hard to detect if or which type dialog is displayed becouse not all dialogs have IDs. On dialog open, it's id or name (if id is not set) is used for containing element id. Many of dialog types were missing id or name so name was added to each dialog type. In HTML, element's id should be unique. Our framework allows opening two dialogs with the same id. It may lead to state where getElementById method may have unpredicted behaviour. Therefore attribute 'data-name' with dialog's name was added to dialog's containing element. Automation framework can search more reliable by using this attribute instead of id. https://fedorahosted.org/freeipa/ticket/2853
Diffstat (limited to 'install/ui/ipa.js')
-rw-r--r--install/ui/ipa.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/install/ui/ipa.js b/install/ui/ipa.js
index 413951ff1..8a690c984 100644
--- a/install/ui/ipa.js
+++ b/install/ui/ipa.js
@@ -331,6 +331,7 @@ IPA.logout = function() {
function show_error(message) {
var dialog = IPA.message_dialog({
+ name: 'logout_error',
message: message,
title: IPA.messages.login.logout_error
});
@@ -1023,6 +1024,7 @@ IPA.concurrent_command = function(spec) {
command = command_info.command;
if(!command) {
var dialog = IPA.message_dialog({
+ name: 'internal_error',
title: IPA.get_message('errors.error', 'Error'),
message: IPA.get_message('errors.internal_error', 'Internal error.')
});
@@ -1118,6 +1120,7 @@ IPA.concurrent_command = function(spec) {
} else {
var dialog = IPA.message_dialog({
+ name: 'operation_error',
title: IPA.get_message('dialogs.batch_error_title', 'Operations Error'),
message: IPA.get_message('dialogs.batch_error_message', 'Some operations failed.')
});
@@ -1377,7 +1380,7 @@ IPA.error_dialog = function(spec) {
var init = function() {
spec = spec || {};
- that.id = 'error_dialog';
+ that.id = spec.id || 'error_dialog';
that.xhr = spec.xhr || {};
that.text_status = spec.text_status || '';
that.error_thrown = spec.error_thrown || {};
@@ -1554,6 +1557,7 @@ IPA.create_4304_error_handler = function(adder_dialog) {
if (data && data.error && data.error.code === 4304) {
dialog = IPA.message_dialog({
+ name: 'error_4304_info',
message: data.error.message,
title: adder_dialog.title,
on_ok: function() {
@@ -1621,6 +1625,8 @@ IPA.unauthorized_dialog = function(spec) {
];
spec.visible_buttons = spec.visible_buttons || ['retry'];
+ spec.name = spec.name || 'unauthorized_dialog';
+ spec.id = spec.id || spec.name;
var that = IPA.error_dialog(spec);