summaryrefslogtreecommitdiffstats
path: root/install/static/entity.js
Commit message (Collapse)AuthorAgeFilesLines
* HBAC Details PageEndi S. Dewata2010-11-041-16/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The UI framework has been extended to include a collection of widgets: - ipa_widget: base class - ipa_text_widget: text field - ipa_radio_widget: radio button - ipa_textarea_widget: textarea - ipa_button_widget: button - ipa_column_widget: column for table - ipa_table_widget: table These widgets can be used to create input controls. They can also be extended to create custom controls. The framework has also been enhanced to support custom layouts. This can be used to change the look of the application without changing the code. Initially this is only available in details section. Layout consists of a collection of HTML templates. Each template is a complete and valid HTML file representing a portion of a page. The template will be loaded and initialized by the code, then filled with the data from the server. The layouts are located in install/static/layouts/<name> folder. By default, if no templates are used, the fields in the details page are rendered vertically using dd/dt/dd tags. For pages that require different layout, a custom UI needs to be developed. There are two ways to do that: - write a custom widget to generate the UI dynamically - create an HTML template and write the initialization code For components that are quite complex or used frequently, it's might be better to use the first method. For simple pages that are used only in one location or need to support customization, the second method might be preferable. Other benefits of templates: - cleaner code and UI separation - more flexibility in customization - new pages can be developed quickly and require less coding - multiple templates can be used with the same initialization code - easier to maintain The HBAC details page has been implemented using both methods. By default it will use custom widgets to generate the page. To use a custom layout, add the following parameter to the URL, then reload the page: &layout=<name> Currently the only available layout is 'default' which produces the same look as the custom widgets. The HBAC details page is usable, but it still needs additional work. The access time is not working yet. There is no undo button, hint, or validation yet. The table in the association facet has also been changed to use ipa_association_widget which is derived from ipa_table_widget. The Makefile has been updated to include the layouts. The unit tests have been updated as well.
* Framework for custom UIEndi S. Dewata2010-10-281-213/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a new framework for implementing custom UI. It consists of the following classes: Main: - IPA: global namespace and object repository - ipa_entity: base class for entities - ipa_facet: base class for facets Add dialog: - ipa_add_dialog: default add dialog - ipa_add_field: the fields used in the dialog Search facet: - ipa_search_facet: default search facet - ipa_search_column: the columns in the search result Details facet: - ipa_details_facet: default details facet - ipa_details_section: the sections in the details facet - ipa_details_field: the fields in the details facet Association facet: - ipa_association_facet: default association facet - ipa_association_config: the association configurations To use this framework, create a class extending the ipa_entity (e.g. ipa_hbac). Use the create_* methods to create add dialog, search facet, details facet, and association facet. The fields/columns for the dialog and facets can be specified using the init() function. Custom UI can be defined by overwriting the base methods (e.g. setup, save, load). The entity must be added into the repository using IPA.add_entity(). The original ipa_entity_setup() has been generalized by moving facet- specific codes into the corresponding facet. Some facet names are still hard-coded. This will be fixed in follow-up patches. Some global variables have been removed because their function has been replaced by the object repository: - ipa_entity_add_list - ipa_entity_search_list - ipa_entity_details_list - window_hash_cache Some functions and variables have been moved into IPA namespace: - ipa_json_url -> IPA.json_url - ipa_use_static_files -> IPA.use_static_files - ipa_ajax_options -> IPA.ajax_options - ipa_objs -> IPA.metadata - ipa_messages -> IPA.messages - ipa_dialog -> IPA.error_dialog - ipa_init() -> IPA.init() Initially the HBAC and Service entities have been rewritten to use the new framework. The DNS is partially converted, the ipa_records_facet is used to define custom records facet. Other entities can still work using the old framework. The old framework has been modified to be a wrapper for the new framework. Eventually all entities will be converted to use the new framework. Some unit tests have been modified to use the new framework.
* dns workAdam Young2010-10-251-80/+129
| | | | | | | | without the details change including changes from Reviewboard https://fedorahosted.org/reviewboard/r/96/ Fixed pages that use unspecified (krb ticket policy, config) Facet name comes out of the facet, not hard coded.
* removing iconsAdam Young2010-10-191-9/+6
| | | | | We'll later replace them with a new scheme. For now, this is the simplest UI The intention is to look unfinished, so people don't comment on how poor it looks.
* multivalue fixesAdam Young2010-10-151-6/+6
| | | | | | | | | | | | metadata for phone numbers test date for users Undo works for multivalue JQuery UI buttons have custom classes inputs/fields are now managed inside of objects removed the use of .call. as it was confusing the issue of mismatched parameter lists. Fixed the parameter lists, too.
* Certificate management for services.Endi S. Dewata2010-10-121-21/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an initial implementation of certificate management for services. It addresses the mechanism required to view and update certificates. The complete UI implementation will be addressed in subsequent patches. On the server side, the service.py has been modified to define usercertificate in the service object's takes_params. This is needed to generate the proper JSON metadata which is needed by the UI. It also has been modified to accept null certificate for deletion. On the client side, the service details page has been modified to display the base64-encoded certificate in a text area. When the page is saved, the action handler will store the base64-encoded certificate in the proper JSON structure. Also the service name and service hostname are now displayed in separate fields. The details configuration has been modified to support displaying and updating certificates. The structure is changed to use maps to define sections and fields. A section contains name, label, and an array of fields. A field contains name, label, setup function, load function, and save function. This is used to implement custom interface and behavior for certificates. All other entities, test cases, and test data have been updated accordingly. Some functions and variables have been renamed to improve clarity and consistency.
* default searchAdam Young2010-10-071-3/+2
| | | | Populate the entity search pages with the results of a search with a blank filter even if no filter has been specified
* policy and configAdam Young2010-10-071-8/+15
| | | | | | | | Population of the policy and entites tabs. DNS and ACI are broken due to PLugin issues Fix for entities without search Added new files to Makefile.am used rolegroup.js file as the start point, renamed to serverconfig.js
* Tooltips for quick links.Endi S. Dewata2010-10-041-0/+3
| | | | | The ipa_entity_quick_links() has been modified to show tooltips when hovering on quick links.
* Entity association configuration.Endi S. Dewata2010-10-021-1/+18
| | | | | | | | | | | | The ipa_entity_set_association_definition() has been added to configure the association between 2 entitites. By default the associator is BulkAssociator and the method is add_member. The entities have been updated to use the right configurations. The ipa_cmd() has been modified to detect IPA errors and invoke the error handler. A bug in refresh_on_success() has been fixed as well.
* Autogenerating Quick Links.Endi S. Dewata2010-10-011-0/+47
| | | | | | | | ipa_entity_quick_links() has been added to generate quick links automatically from object's attribute_members, the same logic used for generating facet list. The search definition for each entity has been updated to use the new function. A unit test has been added for this function.
* Refactoring navigation.js.Endi S. Dewata2010-10-011-2/+45
| | | | | | | | | | | | | | | | | | | | | The navigation.js has been modified to make it more abstract, i.e. unaware of entity facets. The nav_update_tabs() has been modified such that it activates and updates the tabs based on the current state stored in the URL. The facets are now handled in entity.js. The ipa_entity_setup() has been modified to update the facets based on the current state and cached state. The navigation.js also has been modified to be more class-like. The nav_create() has been modified to store the tab configuration and the tab container in internal variables nav_tabs_lists and nav_container. The nav_update_tabs() now can be called without any parameters. Functions nav_push_state(), nav_get_state(), and nav_remove_state() have been added to wrap BBQ API. This is to allow unit tests to replace them with mockup functions to remove dependency on BBQ.
* Added error handler for ipa_cmd().Endi S. Dewata2010-09-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | The ipa_cmd() has been modified such that when an error occurs a dialog box will appear showing the error message with 2 buttons: Retry and Cancel. If Retry is clicked, it will attempt to execute the same operation again. If Cancel is clicked, the operation will be canceled and the control is returned to the caller. New unit tests have been added to test ipa_cmd() on successfull and unsuccessfull cases. The associate.js, details.js, entity.js, search.js, and webui.js have been modified to display the error message inside the page. This behavior can be changed in the future (e.g. redirect to error page). The navigation.js and webui.js have been modified to render only the visible tabs. This improves the performance and reduce hidden errors. The navigation unit test has been modified to reflect this behavior. Some variables/functions also have been renamed for consistency.
* Fix the 'add' buttonAdam Young2010-09-281-3/+7
| | | | | | THe Add button was located using the DOm, and the scheme used to find it was fragile enough to be broken by the I18N approach. This is a little more robust, using a JQuery selector based on the class of the controls, and the entity name. Also remove Makefile, which should be autogenerated
* Test suite for association.Endi Sukma Dewata2010-09-281-16/+16
| | | | | | | | | New test cases have been added to test SerialAssociator and BulkAssociator using mockup objects. Also fixed a bug in BulkAssociator. Moved switch_view() out of ipa_entity_generate_views() in entity.js to allow unit testing using mockup objects. Updated the test case to validate click event on facets.
* Modal dialog for enrollmentEndi Sukma Dewata2010-09-231-10/+2
| | | | | | | | | | | | | | | The enroll facet has been converted into a dialog box. This dialog box will appear when the user clicks the enroll button above the association list. When the user clicks the enroll button in the dialog box, the new associations will be created, then the list will be refreshed to show the changes. The SerialAssociator and BulkAssociator have been modified to accept an on_success function which will be called when the whole operation is completed successfully. This is used to refresh the list and close the dialog box appropriately. Some other changes were also made to improve code clarity.
* links and facet iconsAdam Young2010-09-201-3/+3
| | | | Enables the icons in the links and in the facets lists
* unbroke the facets linkAdam Young2010-09-171-6/+5
|
* css tabs and facetsAdam Young2010-09-171-5/+7
| | | | includes Makfile changes to get images to deploy
* Big webUI patch.Pavel Zuna2010-09-171-0/+163
Quick summary: - use jQuery UI and jQuery BBQ libraries - code restructuring The patch has so many changes they can't be listed here. Many parts of the code have been rewritten from scrach. See freeipa-devel mailing list: webUI code restructuring [wall of text, diagrams, ... you've been warned!] 2010-09-07