mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-25 08:21:05 -06:00
webui: proper alerts in dialogs
Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
parent
0fadb14ec7
commit
bedd128de0
@ -85,7 +85,7 @@ IPA.entity_adder_dialog = function(spec) {
|
|||||||
that.add(
|
that.add(
|
||||||
function(data, text_status, xhr) {
|
function(data, text_status, xhr) {
|
||||||
that.added.notify([data], that);
|
that.added.notify([data], that);
|
||||||
that.show_message(that.get_success_message(data));
|
that.show_message(that.get_success_message(data), 'success');
|
||||||
that.reset();
|
that.reset();
|
||||||
that.focus_first_element();
|
that.focus_first_element();
|
||||||
},
|
},
|
||||||
|
@ -30,7 +30,7 @@ define([
|
|||||||
'./text',
|
'./text',
|
||||||
'./field',
|
'./field',
|
||||||
'./widget'],
|
'./widget'],
|
||||||
function(keys, builder, IPA, $, phases, reg, text) {
|
function(keys, builder, IPA, $, phases, reg, text, field_mod, widget_mod) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opened dialogs
|
* Opened dialogs
|
||||||
@ -331,7 +331,7 @@ IPA.dialog = function(spec) {
|
|||||||
|
|
||||||
that.message_container = $('<div/>', {
|
that.message_container = $('<div/>', {
|
||||||
style: 'display: none',
|
style: 'display: none',
|
||||||
'class': 'dialog-message alert'
|
'class': 'dialog-message col-sm-12'
|
||||||
}).appendTo(that.body_node);
|
}).appendTo(that.body_node);
|
||||||
|
|
||||||
var widgets = that.widgets.get_widgets();
|
var widgets = that.widgets.get_widgets();
|
||||||
@ -433,14 +433,19 @@ IPA.dialog = function(spec) {
|
|||||||
* Show message in dialog's message container
|
* Show message in dialog's message container
|
||||||
* @param {string} message
|
* @param {string} message
|
||||||
*/
|
*/
|
||||||
that.show_message = function(message) {
|
that.show_message = function(message, type) {
|
||||||
that.message_container.text(message);
|
|
||||||
|
var ah = widget_mod.alert_helper;
|
||||||
|
var alert = ah.create_alert('msg', message, type);
|
||||||
|
var el = ah.render_alert(alert);
|
||||||
|
that.message_container.append(el);
|
||||||
that.message_container.css('display', '');
|
that.message_container.css('display', '');
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Hide dialog message */
|
/** Hide dialog message */
|
||||||
that.hide_message = function() {
|
that.hide_message = function() {
|
||||||
that.message_container.css('display', 'none');
|
that.message_container.css('display', 'none');
|
||||||
|
that.message_container.empty();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1884,7 +1884,7 @@ IPA.dns.record_type_table_widget = function(spec) {
|
|||||||
dialog.add(
|
dialog.add(
|
||||||
function(data, text_status, xhr) {
|
function(data, text_status, xhr) {
|
||||||
|
|
||||||
dialog.show_message(dialog.get_add_message());
|
dialog.show_message(dialog.get_add_message(), 'success');
|
||||||
|
|
||||||
if (data.result.result.dnsrecords) {
|
if (data.result.result.dnsrecords) {
|
||||||
that.reload_facet(data);
|
that.reload_facet(data);
|
||||||
|
Loading…
Reference in New Issue
Block a user