mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -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(
|
||||
function(data, text_status, xhr) {
|
||||
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.focus_first_element();
|
||||
},
|
||||
|
@ -30,7 +30,7 @@ define([
|
||||
'./text',
|
||||
'./field',
|
||||
'./widget'],
|
||||
function(keys, builder, IPA, $, phases, reg, text) {
|
||||
function(keys, builder, IPA, $, phases, reg, text, field_mod, widget_mod) {
|
||||
|
||||
/**
|
||||
* Opened dialogs
|
||||
@ -331,7 +331,7 @@ IPA.dialog = function(spec) {
|
||||
|
||||
that.message_container = $('<div/>', {
|
||||
style: 'display: none',
|
||||
'class': 'dialog-message alert'
|
||||
'class': 'dialog-message col-sm-12'
|
||||
}).appendTo(that.body_node);
|
||||
|
||||
var widgets = that.widgets.get_widgets();
|
||||
@ -433,14 +433,19 @@ IPA.dialog = function(spec) {
|
||||
* Show message in dialog's message container
|
||||
* @param {string} message
|
||||
*/
|
||||
that.show_message = function(message) {
|
||||
that.message_container.text(message);
|
||||
that.show_message = function(message, type) {
|
||||
|
||||
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', '');
|
||||
};
|
||||
|
||||
/** Hide dialog message */
|
||||
that.hide_message = function() {
|
||||
that.message_container.css('display', 'none');
|
||||
that.message_container.empty();
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1884,7 +1884,7 @@ IPA.dns.record_type_table_widget = function(spec) {
|
||||
dialog.add(
|
||||
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) {
|
||||
that.reload_facet(data);
|
||||
|
Loading…
Reference in New Issue
Block a user