mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
WebUI: Create non editable row widget for mutlivalued widget
Old krb-principal widget is changed to general one. And used also for ipacertmapdata in user. This widget make every line non-editable. Part of: https://fedorahosted.org/freeipa/ticket/6601 Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com> Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
committed by
Tomas Krizek
parent
27027bbc9c
commit
fba318b833
@@ -93,7 +93,8 @@ return {
|
|||||||
name: 'krbprincipalname',
|
name: 'krbprincipalname',
|
||||||
item_name: 'principal',
|
item_name: 'principal',
|
||||||
child_spec: {
|
child_spec: {
|
||||||
$type: 'krb_principal'
|
$type: 'non_editable_row',
|
||||||
|
data_name: 'krb-principal'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ return {
|
|||||||
name: 'krbprincipalname',
|
name: 'krbprincipalname',
|
||||||
item_name: 'principal',
|
item_name: 'principal',
|
||||||
child_spec: {
|
child_spec: {
|
||||||
$type: 'krb_principal'
|
$type: 'non_editable_row',
|
||||||
|
data_name: 'krb-principal'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -192,7 +192,8 @@ return {
|
|||||||
name: 'krbprincipalname',
|
name: 'krbprincipalname',
|
||||||
item_name: 'principal',
|
item_name: 'principal',
|
||||||
child_spec: {
|
child_spec: {
|
||||||
$type: 'krb_principal'
|
$type: 'non_editable_row',
|
||||||
|
data_name: 'krb-principal'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1792,6 +1792,8 @@ IPA.custom_command_multivalued_widget = function(spec) {
|
|||||||
IPA.krb_principal_multivalued_widget = function (spec) {
|
IPA.krb_principal_multivalued_widget = function (spec) {
|
||||||
|
|
||||||
spec = spec || {};
|
spec = spec || {};
|
||||||
|
spec.child_spec = spec.child_spec || {};
|
||||||
|
spec.child_spec.data_name = spec.child_spec.data_name || 'krb-principal';
|
||||||
|
|
||||||
spec.adder_dialog_spec = spec.adder_dialog_spec || {
|
spec.adder_dialog_spec = spec.adder_dialog_spec || {
|
||||||
title: '@i18n:krbaliases.adder_title',
|
title: '@i18n:krbaliases.adder_title',
|
||||||
@@ -1812,7 +1814,7 @@ IPA.krb_principal_multivalued_widget = function (spec) {
|
|||||||
|
|
||||||
that.create_remove_dialog_message = function(row) {
|
that.create_remove_dialog_message = function(row) {
|
||||||
var message = text.get('@i18n:krbaliases.remove_message');
|
var message = text.get('@i18n:krbaliases.remove_message');
|
||||||
message = message.replace('${alias}', row.widget.principal_name);
|
message = message.replace('${alias}', row.widget.new_value);
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
};
|
};
|
||||||
@@ -1820,7 +1822,7 @@ IPA.krb_principal_multivalued_widget = function (spec) {
|
|||||||
|
|
||||||
that.create_remove_args = function(row) {
|
that.create_remove_args = function(row) {
|
||||||
var pkey = that.facet.get_pkey();
|
var pkey = that.facet.get_pkey();
|
||||||
var krbprincipalname = row.widget.principal_name;
|
var krbprincipalname = row.widget.new_value;
|
||||||
krbprincipalname = [ krbprincipalname ];
|
krbprincipalname = [ krbprincipalname ];
|
||||||
|
|
||||||
var args = [
|
var args = [
|
||||||
@@ -1847,22 +1849,27 @@ IPA.krb_principal_multivalued_widget = function (spec) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Widget which is used as row in kerberos aliases multivalued widget.
|
* Widget which is used as row in multivalued widget. Each row is just
|
||||||
* It contains only string where is the principal alias name and delete button.
|
* non-editable text field.
|
||||||
*
|
*
|
||||||
* @class
|
* @class
|
||||||
* @extends IPA.input_widget
|
* @extends IPA.input_widget
|
||||||
*/
|
*/
|
||||||
IPA.krb_principal_widget = function(spec) {
|
IPA.non_editable_row_widget = function(spec) {
|
||||||
spec = spec || {};
|
spec = spec || {};
|
||||||
|
|
||||||
var that = IPA.input_widget();
|
var that = IPA.input_widget();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prefix of CSS class of each row.
|
||||||
|
*/
|
||||||
|
that.data_name = spec.data_name || 'non-editable';
|
||||||
|
|
||||||
that.create = function(container) {
|
that.create = function(container) {
|
||||||
that.widget_create(container);
|
that.widget_create(container);
|
||||||
|
|
||||||
that.principal_text = $('<span />', {
|
that.data_text = $('<span />', {
|
||||||
'class': 'krb-principal-name',
|
'class': that.data_name + '-data',
|
||||||
text: ''
|
text: ''
|
||||||
}).appendTo(container);
|
}).appendTo(container);
|
||||||
|
|
||||||
@@ -1875,19 +1882,20 @@ IPA.krb_principal_widget = function(spec) {
|
|||||||
|
|
||||||
that.update = function(value) {
|
that.update = function(value) {
|
||||||
|
|
||||||
var principal_name = value[0] || '';
|
var single_value = value[0] || '';
|
||||||
|
|
||||||
that.principal_name = principal_name;
|
that.new_value = single_value;
|
||||||
that.update_text();
|
that.update_text();
|
||||||
};
|
};
|
||||||
|
|
||||||
that.update_text = function() {
|
that.update_text = function() {
|
||||||
that.principal_text.text(that.principal_name);
|
that.data_text.text(that.new_value);
|
||||||
};
|
};
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Option widget base
|
* Option widget base
|
||||||
*
|
*
|
||||||
@@ -7161,6 +7169,7 @@ exp.register = function() {
|
|||||||
w.register('html', IPA.html_widget);
|
w.register('html', IPA.html_widget);
|
||||||
w.register('link', IPA.link_widget);
|
w.register('link', IPA.link_widget);
|
||||||
w.register('multivalued', IPA.multivalued_widget);
|
w.register('multivalued', IPA.multivalued_widget);
|
||||||
|
w.register('non_editable_row', IPA.non_editable_row_widget);
|
||||||
w.register('custom_command_multivalued',
|
w.register('custom_command_multivalued',
|
||||||
IPA.custom_command_multivalued_widget);
|
IPA.custom_command_multivalued_widget);
|
||||||
w.register('krb_principal_multivalued',
|
w.register('krb_principal_multivalued',
|
||||||
|
|||||||
Reference in New Issue
Block a user