diff options
author | Adam Young <ayoung@redhat.com> | 2011-07-25 12:15:14 -0400 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-07-28 14:17:25 -0400 |
commit | b36df6e9b9c1104d37fe14782a7e21e57097a7c0 (patch) | |
tree | 1eca6d4b0f7127b01f2e366919981ed90090ee95 /install/ui/search.js | |
parent | 264ed38fa206537d7b160ea5d7586d071575c610 (diff) | |
download | freeipa-b36df6e9b9c1104d37fe14782a7e21e57097a7c0.tar.gz freeipa-b36df6e9b9c1104d37fe14782a7e21e57097a7c0.tar.xz freeipa-b36df6e9b9c1104d37fe14782a7e21e57097a7c0.zip |
removing setters setup and init
change widget and widget unit tests to hold on to entity, not entity name.
Replacing entity_name with entity.name in most places.
The one exception is columns for table_widget.
Widgets that refer to other entities have to have late resolution of the entity object, due to circular dependencies.
cleanup entity assignment.
removed template and layout,
merged setup into create
adder dialogs adjust height for external
removed init from widget, isection, association, facet, host and service
Make unit tests use factory.
fix functional tests to click find link correctly.
tweak to activation test, but still broken.
moved initialization code to the end
use --all for hbacrule find, so the type shows up now
fixed dns exception code and exception handling for get_entity
replace metadata look up with value from entity.
fixed author lines
removed duplicate columns in managed by facets.
tweak to nav fix in order to initialize tab.
more defensive code
update metadata for true false
one line init for entity_name in widget
move init code to end of constructor functions
moved constants to start of function for adder_dialog
external fields for dialogs initialized at dialog creation
sudo sections: move add fields and columns to widget definition.
The parameter validation in IPA.column ...This is precondition checking. Note that it merely throws an exception if the entity_name is not set. I want this stuff at the top of the function so that it is obvious to people looking to use them what is required. I added a comment to make this clear, but I'd like to keep precondition checking at the top of the function.
decreased the scope of the pkey_name and moved the initiailzation fof columns into the setup_column function for association_tables
return false at the end of click handler
removed blank labels in sudo command section
fix radio buttons for sudo category
fixed table side for adder dialogs with external fields
comments for future direction with add_columns
https://fedorahosted.org/freeipa/ticket/1451
https://fedorahosted.org/freeipa/ticket/1462
https://fedorahosted.org/freeipa/ticket/1493
https://fedorahosted.org/freeipa/ticket/1497
https://fedorahosted.org/freeipa/ticket/1532
https://fedorahosted.org/freeipa/ticket/1534
Diffstat (limited to 'install/ui/search.js')
-rw-r--r-- | install/ui/search.js | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/install/ui/search.js b/install/ui/search.js index fec394dea..fe0b07f72 100644 --- a/install/ui/search.js +++ b/install/ui/search.js @@ -29,10 +29,12 @@ IPA.search_facet = function(spec) { spec = spec || {}; spec.name = spec.name || 'search'; - spec.managed_entity_name = spec.managed_entity_name || spec.entity_name; + spec.managed_entity_name = spec.managed_entity_name || spec.entity.name; - spec.disable_breadcrumb = spec.disable_breadcrumb === undefined ? true : spec.disable_breadcrumb; - spec.disable_facet_tabs = spec.disable_facet_tabs === undefined ? true : spec.disable_facet_tabs; + spec.disable_breadcrumb = + spec.disable_breadcrumb === undefined ? true : spec.disable_breadcrumb; + spec.disable_facet_tabs = + spec.disable_facet_tabs === undefined ? true : spec.disable_facet_tabs; var that = IPA.table_facet(spec); @@ -45,19 +47,15 @@ IPA.search_facet = function(spec) { that.get_values = spec.get_values || get_values; - that.init = function() { - that.facet_init(); + function initialize_table_columns(){ that.managed_entity = IPA.get_entity(that.managed_entity_name); - that.init_table(that.managed_entity); - }; - - that.init_table = function(entity){ + var entity = that.managed_entity; that.table = IPA.table_widget({ 'class': 'content-table', name: 'search', label: entity.metadata.label, - entity_name: entity.name, + entity: entity, search_all: that.search_all, scrollable: true, selectable: that.selectable @@ -66,7 +64,7 @@ IPA.search_facet = function(spec) { var columns = that.columns.values; for (var i=0; i<columns.length; i++) { var column = columns[i]; - + column.entity = entity; var param_info = IPA.get_entity_param(entity.name, column.name); column.primary_key = param_info && param_info['primary_key']; column.link = column.primary_key; @@ -88,8 +86,13 @@ IPA.search_facet = function(spec) { that.table.refresh = function() { that.refresh(); }; + } - that.table.init(); + that.create_content = function(container) { + /*should be in the initialize section, but can not, due to + get_entity circular references.*/ + initialize_table_columns(); + that.table.create(container); }; that.create_header = function(container) { @@ -132,7 +135,9 @@ IPA.search_facet = function(spec) { label: IPA.messages.buttons.remove, icon: 'remove-icon', click: function() { - if (that.remove_button.hasClass('input_link_disabled')) return false; + if (that.remove_button.hasClass('input_link_disabled')) { + return false; + } that.remove(); return false; } @@ -149,17 +154,12 @@ IPA.search_facet = function(spec) { }).appendTo(that.controls); }; - that.create_content = function(container) { - - that.table.create(container); - that.table.setup(container); - }; that.show = function() { that.facet_show(); if (that.filter) { - var filter = IPA.nav.get_state(that.entity_name+'-filter'); + var filter = IPA.nav.get_state(that.entity.name+'-filter'); that.filter.val(filter); } }; @@ -213,8 +213,6 @@ IPA.search_facet = function(spec) { dialog.set_values(values); - dialog.init(); - dialog.open(that.container); }; @@ -290,9 +288,7 @@ IPA.search_facet = function(spec) { }; // methods that should be invoked by subclasses - that.search_facet_init = that.init; that.search_facet_create_content = that.create_content; - that.search_facet_setup = that.setup; return that; }; |