summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-09-18 17:12:59 +0200
committerRob Crittenden <rcritten@redhat.com>2012-09-17 21:24:38 -0400
commite39a109060ce8b92919c00aebd83a682a039d9b5 (patch)
tree22e9b1de47f2bba27a60fc51c7a4667967005e6a /install
parent7269687822b019c209ed759ba42641586abcb2b0 (diff)
downloadfreeipa-e39a109060ce8b92919c00aebd83a682a039d9b5.tar.gz
freeipa-e39a109060ce8b92919c00aebd83a682a039d9b5.tar.xz
freeipa-e39a109060ce8b92919c00aebd83a682a039d9b5.zip
Show trust status in add success notification
Web UI notification of 'Add verification step after trust creation' https://fedorahosted.org/freeipa/ticket/2763
Diffstat (limited to 'install')
-rw-r--r--install/ui/add.js13
-rw-r--r--install/ui/ipa.js4
-rw-r--r--install/ui/trust.js18
3 files changed, 29 insertions, 6 deletions
diff --git a/install/ui/add.js b/install/ui/add.js
index d85587945..a5e30092f 100644
--- a/install/ui/add.js
+++ b/install/ui/add.js
@@ -52,7 +52,7 @@ IPA.entity_adder_dialog = function(spec) {
var facet = IPA.current_entity.get_facet();
facet.refresh();
that.close();
- IPA.notify_success(that.get_success_message());
+ that.notify_success(data);
},
that.on_error);
}
@@ -66,7 +66,7 @@ IPA.entity_adder_dialog = function(spec) {
that.add(
function(data, text_status, xhr) {
that.added.notify();
- that.show_message(that.get_success_message());
+ that.show_message(that.get_success_message(data));
var facet = IPA.current_entity.get_facet();
facet.refresh();
that.reset();
@@ -86,7 +86,7 @@ IPA.entity_adder_dialog = function(spec) {
that.close();
var result = data.result.result;
that.show_edit_page(that.entity, result);
- IPA.notify_success(that.get_success_message());
+ that.notify_success(data);
},
that.on_error);
}
@@ -102,11 +102,15 @@ IPA.entity_adder_dialog = function(spec) {
});
};
- that.get_success_message = function() {
+ that.get_success_message = function(data) {
var message = IPA.messages.dialogs.add_confirmation;
return message.replace('${entity}', that.subject);
};
+ that.notify_success = function(data) {
+ IPA.notify_success(that.get_success_message(data));
+ };
+
function show_edit_page(entity,result) {
var pkey_name = entity.metadata.primary_key;
var pkey = result[pkey_name];
@@ -183,6 +187,7 @@ IPA.entity_adder_dialog = function(spec) {
// methods that should be invoked by subclasses
that.entity_adder_dialog_create = that.create;
that.entity_adder_dialog_create_add_command = that.create_add_command;
+ that.entity_adder_dialog_get_success_message = that.get_success_message;
init();
diff --git a/install/ui/ipa.js b/install/ui/ipa.js
index 23c9933df..a2c4c08d6 100644
--- a/install/ui/ipa.js
+++ b/install/ui/ipa.js
@@ -2040,7 +2040,7 @@ IPA.confirm = function(msg) {
return window.confirm(msg);
};
-IPA.notify_success = function(message) {
+IPA.notify_success = function(message, timeout) {
if (!message) return; // don't show undefined, null and such
@@ -2069,7 +2069,7 @@ IPA.notify_success = function(message) {
IPA.notify_success.timeout = window.setTimeout(function() {
notification_area.fadeOut(IPA.config.message_fadeout_time);
- }, IPA.config.message_timeout);
+ }, timeout || IPA.config.message_timeout);
};
IPA.config = {
diff --git a/install/ui/trust.js b/install/ui/trust.js
index 77e7cb381..939bb59a3 100644
--- a/install/ui/trust.js
+++ b/install/ui/trust.js
@@ -71,6 +71,7 @@ IPA.trust.entity = function(spec) {
]
}).
adder_dialog({
+ factory: IPA.trust.adder_dialog,
fields: [
{
name: 'cn',
@@ -162,4 +163,21 @@ IPA.trust.entity = function(spec) {
return that;
};
+IPA.trust.adder_dialog = function(spec) {
+
+ spec = spec || {};
+
+ var that = IPA.entity_adder_dialog(spec);
+
+ that.get_success_message = function(data) {
+ return that.entity_adder_dialog_get_success_message(data) + '. ' + data.result.result.truststatus[0];
+ };
+
+ that.notify_success = function(data) {
+ IPA.notify_success(that.get_success_message(data), 5000);
+ };
+
+ return that;
+};
+
IPA.register('trust', IPA.trust.entity);