summaryrefslogtreecommitdiffstats
path: root/install/ui/src
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-02-11 12:56:35 +0100
committerPetr Vobornik <pvoborni@redhat.com>2013-04-10 09:24:46 +0200
commit7e088a83782de9204af0a5bc120b4c97daae2c72 (patch)
tree402b0e1bbcf4874b525b3e9e0d7bd0173d138b00 /install/ui/src
parentba76a9c431600ba36194242fdfac982306d55192 (diff)
downloadfreeipa-7e088a83782de9204af0a5bc120b4c97daae2c72.tar.gz
freeipa-7e088a83782de9204af0a5bc120b4c97daae2c72.tar.xz
freeipa-7e088a83782de9204af0a5bc120b4c97daae2c72.zip
Global trust config page
https://fedorahosted.org/freeipa/ticket/3333
Diffstat (limited to 'install/ui/src')
-rw-r--r--install/ui/src/freeipa/trust.js85
-rw-r--r--install/ui/src/freeipa/webui.js7
-rw-r--r--install/ui/src/freeipa/widget.js6
3 files changed, 96 insertions, 2 deletions
diff --git a/install/ui/src/freeipa/trust.js b/install/ui/src/freeipa/trust.js
index e4a227ab7..25ddb5cdf 100644
--- a/install/ui/src/freeipa/trust.js
+++ b/install/ui/src/freeipa/trust.js
@@ -193,7 +193,92 @@ IPA.trust.adder_dialog = function(spec) {
return that;
};
+IPA.trust.config_entity = function(spec) {
+
+ var that = IPA.entity(spec);
+
+ that.init = function() {
+ that.entity_init();
+
+ that.builder.details_facet({
+ factory: IPA.trust.config_details_facet,
+ trust_type: 'ad',
+ sections: [
+ {
+ name: 'details',
+ label: IPA.messages.objects.trustconfig.options,
+ fields: [
+ 'cn',
+ 'ipantsecurityidentifier',
+ 'ipantflatname',
+ 'ipantdomainguid',
+ {
+ type: 'trust_fallbackgroup_select',
+ name: 'ipantfallbackprimarygroup',
+ other_entity: 'group',
+ other_field: 'cn',
+ empty_option: false,
+ filter_options: {
+ posix: true
+ }
+ }
+ ]
+ }
+ ]
+ });
+ };
+
+ return that;
+};
+
+IPA.trust.config_details_facet = function(spec) {
+
+ spec = spec || {};
+
+ var that = IPA.details_facet(spec);
+
+ that.trust_type = spec.trust_type;
+
+ that.get_refresh_command_name = function() {
+ return that.entity.name+that.trust_type+'_show';
+ };
+
+ that.create_refresh_command = function() {
+
+ var command = that.details_facet_create_refresh_command();
+ command.set_option('trust_type', that.trust_type);
+
+ return command;
+ };
+
+ that.create_update_command = function() {
+
+ var command = that.details_facet_create_update_command();
+ command.set_option('trust_type', that.trust_type);
+
+ return command;
+ };
+
+ return that;
+};
+
+IPA.trust.fallbackgroup_select_widget = function(spec) {
+ var that = IPA.entity_select_widget(spec);
+
+ that.set_options = function(options) {
+ // always add 'Default SMB Group', it can't be obtained by group-find.
+ options.unshift('Default SMB Group');
+ that.entity_select_set_options(options);
+ };
+
+ return that;
+};
+
+IPA.widget_factories['trust_fallbackgroup_select'] = IPA.trust.fallbackgroup_select_widget;
+IPA.field_factories['trust_fallbackgroup_select'] = IPA.field_factories['entity_select'];
+
IPA.register('trust', IPA.trust.entity);
+IPA.register('trustconfig', IPA.trust.config_entity);
return {};
}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/webui.js b/install/ui/src/freeipa/webui.js
index 5315f3acf..db1dab07e 100644
--- a/install/ui/src/freeipa/webui.js
+++ b/install/ui/src/freeipa/webui.js
@@ -84,7 +84,12 @@ IPA.admin_navigation = function(spec) {
{entity: 'selfservice'},
{entity: 'delegation'},
{entity: 'idrange'},
- {entity: 'trust'},
+ {
+ name: 'trusts', label: IPA.messages.tabs.trust, children:[
+ {entity: 'trust'},
+ {entity: 'trustconfig'}
+ ]
+ },
{entity: 'config'}
]}];
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index 44b8611a3..17d9b8b77 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -2734,12 +2734,14 @@ IPA.entity_select_widget = function(spec) {
that.other_field = spec.other_field;
that.options = spec.options || [];
+ that.filter_options = spec.filter_options || {};
that.create_search_command = function(filter) {
return IPA.command({
entity: that.other_entity.name,
method: 'find',
- args: [filter]
+ args: [filter],
+ options: that.filter_options
});
};
@@ -2773,6 +2775,8 @@ IPA.entity_select_widget = function(spec) {
if (that.on_search_success) that.on_search_success.call(this, data, text_status, xhr);
};
+ that.entity_select_set_options = that.set_options;
+
return that;
};