2010-09-29 15:57:07 -05:00
|
|
|
/* Authors:
|
|
|
|
* Adam Young <ayoung@redhat.com>
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Red Hat
|
|
|
|
* see file 'COPYING' for use and warranty information
|
|
|
|
*
|
2010-12-09 06:59:11 -06:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2010-09-29 15:57:07 -05:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2010-12-09 06:59:11 -06:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2010-09-29 15:57:07 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2011-01-19 20:10:18 -06:00
|
|
|
module('details', {
|
|
|
|
setup: function() {
|
|
|
|
var obj_name = 'user';
|
2011-01-26 12:46:49 -06:00
|
|
|
IPA.entity_factories.user=
|
2011-01-19 20:10:18 -06:00
|
|
|
function(){
|
|
|
|
return IPA.entity({name:obj_name});
|
2011-01-26 12:46:49 -06:00
|
|
|
};
|
|
|
|
IPA.start_entities();
|
2011-01-19 20:10:18 -06:00
|
|
|
},
|
|
|
|
teardown: function() {
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2010-10-25 18:55:57 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
test("Testing IPA.details_section.create().", function() {
|
2010-09-29 15:57:07 -05:00
|
|
|
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
IPA.ajax_options.async = false;
|
|
|
|
|
|
|
|
IPA.init(
|
|
|
|
"data",
|
|
|
|
true,
|
|
|
|
function(data, text_status, xhr) {
|
|
|
|
ok(true, "ipa_init() succeeded.");
|
|
|
|
},
|
|
|
|
function(xhr, text_status, error_thrown) {
|
|
|
|
ok(false, "ipa_init() failed: "+error_thrown);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var section = IPA.stanza({name:'IDIDID', label:'NAMENAMENAME'}).
|
2010-12-07 12:17:12 -06:00
|
|
|
input({name:'cn'}).
|
|
|
|
input({name:'description'}).
|
|
|
|
input({name:'number'});
|
2010-10-13 12:07:43 -05:00
|
|
|
|
|
|
|
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
var fields = section.fields;
|
|
|
|
var container = $("<div/>");
|
2010-11-09 14:22:31 -06:00
|
|
|
section.create(container);
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-11-16 18:10:40 -06:00
|
|
|
var dl = $('dl', container);
|
2010-10-13 12:07:43 -05:00
|
|
|
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
same(
|
|
|
|
dl.length, 1,
|
|
|
|
'Checking dl tag'
|
|
|
|
);
|
|
|
|
|
|
|
|
same(
|
|
|
|
dl.attr('id'), section.name,
|
|
|
|
'Checking section name'
|
|
|
|
);
|
|
|
|
|
|
|
|
var dts = $('dt', dl);
|
|
|
|
same(
|
|
|
|
dts.length, fields.length, // each field generates dt & dd
|
|
|
|
'Checking number of children'
|
|
|
|
);
|
|
|
|
|
|
|
|
for (var i=0; i<fields.length; i++) {
|
2010-11-16 18:10:40 -06:00
|
|
|
var field = fields[i];
|
|
|
|
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
var dt = dts.get(i);
|
|
|
|
same(
|
2010-11-16 18:10:40 -06:00
|
|
|
dt.innerHTML, field.label+':',
|
|
|
|
'Checking field '+field.name+'\'s label'
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
);
|
|
|
|
|
2010-11-16 18:10:40 -06:00
|
|
|
var span = $('span[name='+field.name+']', dl);
|
|
|
|
|
|
|
|
ok(
|
|
|
|
span.length,
|
|
|
|
'Checking span tag for field '+field.name
|
|
|
|
);
|
|
|
|
|
|
|
|
var dd = $('dd', span);
|
|
|
|
|
|
|
|
ok(
|
|
|
|
dd.length == 0,
|
|
|
|
'Checking dd tag for field '+field.name
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
2010-10-13 12:07:43 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
test("Testing details lifecycle: create, setup, load.", function(){
|
2010-10-13 12:07:43 -05:00
|
|
|
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
IPA.ajax_options.async = false;
|
2010-10-13 12:07:43 -05:00
|
|
|
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
IPA.init(
|
|
|
|
"data",
|
|
|
|
true,
|
|
|
|
function(data, text_status, xhr) {
|
|
|
|
ok(true, "ipa_init() succeeded.");
|
|
|
|
},
|
|
|
|
function(xhr, text_status, error_thrown) {
|
|
|
|
ok(false, "ipa_init() failed: "+error_thrown);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
var result = {};
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.cmd(
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
'user_show',
|
|
|
|
['kfrog'],
|
|
|
|
{},
|
|
|
|
function(data, text_status, xhr) {
|
|
|
|
result = data.result.result;
|
2011-01-12 18:51:22 -06:00
|
|
|
ok(true, "IPA.cmd() succeeded.");
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
},
|
|
|
|
function(xhr, text_status, error_thrown) {
|
2011-01-12 18:51:22 -06:00
|
|
|
ok(false, "IPA.cmd() failed: "+error_thrown);
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
}
|
|
|
|
);
|
2010-10-13 12:07:43 -05:00
|
|
|
|
|
|
|
var setup_status_called = false;
|
|
|
|
var save_password_called= false;
|
|
|
|
var load_manager_called = false;
|
|
|
|
var load_success_called = false;
|
|
|
|
var load_failure_called = false;
|
|
|
|
var update_success_called = false;
|
|
|
|
var update_failure_called = false;
|
|
|
|
|
|
|
|
function setup_status(){
|
|
|
|
setup_status_called = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
function save_password(){
|
|
|
|
save_password_called = true;
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
function load_manager(){
|
|
|
|
load_manager_called = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
function setup_st(){
|
|
|
|
}
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
var container = $("<div/>");
|
2011-01-19 20:10:18 -06:00
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
var obj_name = 'user';
|
2011-01-19 20:10:18 -06:00
|
|
|
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.entity_set_details_definition(obj_name, [
|
|
|
|
IPA.stanza({name:'identity', label:'Identity Details'}).
|
2010-12-07 12:17:12 -06:00
|
|
|
input({name:'title'}).
|
|
|
|
input({name:'givenname'}).
|
|
|
|
input({name:'sn'}).
|
|
|
|
input({name:'cn'}).
|
|
|
|
input({name:'displayname'}).
|
|
|
|
input({name:'initials'}),
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.stanza({name:'account', label:'Account Details'}).
|
2010-12-07 12:17:12 -06:00
|
|
|
input({name:'status', setup: setup_status}).
|
|
|
|
input({name:'uid'}).
|
|
|
|
input({name:'userpassword', save: save_password}).
|
|
|
|
input({name:'uidnumber'}).
|
|
|
|
input({name:'gidnumber'}).
|
|
|
|
input({name:'homedirectory'}),
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.stanza({name:'contact', label:'Contact Details'}).
|
2010-12-07 12:17:12 -06:00
|
|
|
input({name:'mail'}).
|
|
|
|
input({name:'telephonenumber'}),
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.stanza({name:'address'}).
|
2010-12-07 12:17:12 -06:00
|
|
|
input({name:'street'}).
|
|
|
|
input({name:'location'}).
|
|
|
|
input({name:'state', setup: setup_st}).
|
|
|
|
input({name:'postalcode'}),
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.stanza({name:'employee', label:'Employee Information'}).
|
2010-12-07 12:17:12 -06:00
|
|
|
input({name:'ou'}).
|
|
|
|
input({name:'manager', load: load_manager}),
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.stanza({name:'misc', label:'Misc. Information'}).
|
2010-12-07 12:17:12 -06:00
|
|
|
input({name:'carlicense'})
|
2010-10-13 12:07:43 -05:00
|
|
|
]);
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var entity = IPA.fetch_entity(obj_name);
|
2010-10-27 22:32:30 -05:00
|
|
|
var facet = entity.get_facet('details');
|
2010-11-09 14:22:31 -06:00
|
|
|
facet.create(container);
|
|
|
|
facet.setup(container);
|
2010-11-18 20:17:14 -06:00
|
|
|
facet.load(result);
|
2010-10-13 12:07:43 -05:00
|
|
|
|
|
|
|
var contact = container.find('dl#contact.entryattrs');
|
|
|
|
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
ok(
|
|
|
|
contact,
|
|
|
|
'dl tag for contact is created'
|
|
|
|
);
|
2010-10-13 12:07:43 -05:00
|
|
|
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
var identity = container.find('dl#identity.entryattrs');
|
2010-10-13 12:07:43 -05:00
|
|
|
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
ok(
|
|
|
|
identity,
|
|
|
|
'dl tag for identity is created'
|
|
|
|
);
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-11-16 18:10:40 -06:00
|
|
|
var dts = identity.find('dt');
|
2010-10-13 12:07:43 -05:00
|
|
|
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
same(
|
|
|
|
dts.length, 6,
|
|
|
|
'Checking dt tags for identity'
|
|
|
|
);
|
2010-10-13 12:07:43 -05:00
|
|
|
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
container.attr('id','user');
|
2010-10-13 12:07:43 -05:00
|
|
|
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
ok (
|
|
|
|
setup_status_called,
|
|
|
|
'Setup status called'
|
|
|
|
);
|
2010-10-13 12:07:43 -05:00
|
|
|
|
HBAC Details Page
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.
2010-11-02 20:16:55 -05:00
|
|
|
ok (load_manager_called, 'load manager called');
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
facet.update(
|
|
|
|
function(){update_success_called = true},
|
|
|
|
function(){update_failure_called = true}
|
|
|
|
);
|
2010-10-13 12:07:43 -05:00
|
|
|
|
|
|
|
ok (update_success_called,'update success called');
|
|
|
|
ok (!update_failure_called,'update failure not called');
|
|
|
|
ok (save_password_called, 'save password called');
|
2010-09-29 15:57:07 -05:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2011-01-12 21:00:38 -06:00
|
|
|
test("Testing create_input().", function() {
|
2010-09-29 15:57:07 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var field = IPA.details_field({
|
2010-11-16 18:10:40 -06:00
|
|
|
'name': "name"
|
|
|
|
});
|
|
|
|
|
2010-09-29 15:57:07 -05:00
|
|
|
var name = "name";
|
|
|
|
var value="value";
|
2010-11-05 12:11:56 -05:00
|
|
|
var rights = 'rscwo'
|
2011-01-12 21:00:38 -06:00
|
|
|
var input = field.create_input(value, null, rights);
|
2010-09-29 15:57:07 -05:00
|
|
|
ok(input,"input not null");
|
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
var text = input.find('input');
|
|
|
|
ok(text);
|
2010-09-29 15:57:07 -05:00
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
same(text[0].name,name );
|
|
|
|
same(text[0].value,value );
|
|
|
|
same(text[0].type,"text" );
|
|
|
|
});
|
2010-11-05 12:11:56 -05:00
|
|
|
|
2011-01-12 21:00:38 -06:00
|
|
|
test("Testing create_input() read only .", function() {
|
2010-11-05 12:11:56 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var field = IPA.details_field({
|
2010-11-16 18:10:40 -06:00
|
|
|
'name': "name"
|
|
|
|
});
|
|
|
|
|
2010-11-05 12:11:56 -05:00
|
|
|
var name = "name";
|
|
|
|
var value="value";
|
|
|
|
var rights = 'rsc'
|
2011-01-12 21:00:38 -06:00
|
|
|
var input = field.create_input(value, null, rights);
|
2010-11-05 12:11:56 -05:00
|
|
|
ok(input,"input not null");
|
|
|
|
|
|
|
|
var text = input.find('input');
|
|
|
|
ok(text);
|
|
|
|
|
|
|
|
same(text[0].name,name );
|
|
|
|
same(text[0].value,value );
|
|
|
|
same(text[0].type,"text" );
|
|
|
|
ok(text[0].disabled);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
test("Testing IPA.details_section_setup again()",function(){
|
2010-11-05 12:11:56 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var section = IPA.stanza({name: 'IDIDID', label: 'NAMENAMENAME'}).
|
2010-11-05 12:11:56 -05:00
|
|
|
input({name:'cn', label:'Entity Name'}).
|
|
|
|
input({name:'description', label:'Description'}).
|
|
|
|
input({name:'number', label:'Entity ID'});
|
|
|
|
var fields = section.fields;
|
|
|
|
var container = $("<div title='entity'/>");
|
|
|
|
var details = $("<div/>");
|
|
|
|
container.append(details);
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
var result = {};
|
|
|
|
|
|
|
|
section.create(container);
|
|
|
|
section.setup(container);
|
2010-11-15 11:10:55 -06:00
|
|
|
section.load(result);
|
2010-11-05 12:11:56 -05:00
|
|
|
|
|
|
|
//var h2= container.find('h2');
|
|
|
|
//ok(h2);
|
|
|
|
//ok(h2[0].innerHTML.indexOf(section.label) > 1,"find name in html");
|
|
|
|
|
2010-11-16 18:10:40 -06:00
|
|
|
var dl = $('dl', container);
|
2010-11-15 11:10:55 -06:00
|
|
|
ok(
|
|
|
|
dl.length,
|
|
|
|
'dl is created'
|
|
|
|
);
|
|
|
|
|
2010-11-16 18:10:40 -06:00
|
|
|
var dt = $('dt', dl);
|
2010-11-15 11:10:55 -06:00
|
|
|
same(
|
2010-11-16 18:10:40 -06:00
|
|
|
dt.length, 3,
|
|
|
|
'3 dt'
|
2010-11-15 11:10:55 -06:00
|
|
|
);
|
|
|
|
|
2010-11-16 18:10:40 -06:00
|
|
|
var span = dt.next();
|
2010-11-15 11:10:55 -06:00
|
|
|
same(
|
2010-11-16 18:10:40 -06:00
|
|
|
span.length, 3,
|
|
|
|
'3 span'
|
2010-11-15 11:10:55 -06:00
|
|
|
);
|
2010-11-05 12:11:56 -05:00
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
same(
|
2010-11-16 18:10:40 -06:00
|
|
|
dl[0].id, section.name,
|
|
|
|
'checking section name'
|
2010-11-15 11:10:55 -06:00
|
|
|
);
|
|
|
|
|
|
|
|
same(
|
2010-11-16 18:10:40 -06:00
|
|
|
dt[0].innerHTML, fields[0].label+":",
|
2010-11-15 11:10:55 -06:00
|
|
|
'inner HTML matches label'
|
|
|
|
);
|
2010-11-16 18:10:40 -06:00
|
|
|
|
|
|
|
var dd = $('dd', span[0]);
|
2010-11-15 11:10:55 -06:00
|
|
|
same(
|
2010-11-16 18:10:40 -06:00
|
|
|
dd.length, 1,
|
|
|
|
'1 dd'
|
2010-11-15 11:10:55 -06:00
|
|
|
);
|
2010-11-05 12:11:56 -05:00
|
|
|
});
|