2011-01-14 12:16:25 -05:00
|
|
|
/*jsl:import ipa.js */
|
|
|
|
|
|
2010-09-07 10:08:19 -04:00
|
|
|
/* Authors:
|
|
|
|
|
* Adam Young <ayoung@redhat.com>
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 2010 Red Hat
|
|
|
|
|
* see file 'COPYING' for use and warranty information
|
|
|
|
|
*
|
2010-12-09 13:59:11 +01: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-07 10:08:19 -04: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 13:59:11 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2010-09-16 10:28:07 -04:00
|
|
|
*/
|
2010-09-07 10:08:19 -04:00
|
|
|
|
|
|
|
|
/* REQUIRES: ipa.js */
|
2010-09-16 10:28:07 -04:00
|
|
|
/* CURRENTLY ALSO REQUIRES search.js, because it reuses it's code to create
|
|
|
|
|
* the AssociationList elements; IT NEEDS IT'S OWN CODE! */
|
2010-09-07 10:08:19 -04:00
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
IPA.associator = function (spec) {
|
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
|
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
|
|
|
|
|
var that = {};
|
|
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
that.entity = IPA.get_entity(spec.entity);
|
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
|
|
|
that.pkey = spec.pkey;
|
|
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
that.other_entity = IPA.get_entity(spec.other_entity);
|
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
|
|
|
that.values = spec.values;
|
|
|
|
|
|
|
|
|
|
that.method = spec.method;
|
|
|
|
|
|
|
|
|
|
that.on_success = spec.on_success;
|
|
|
|
|
that.on_error = spec.on_error;
|
|
|
|
|
|
|
|
|
|
that.execute = function() {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return that;
|
2011-01-14 12:16:25 -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
|
|
|
|
2010-09-07 10:08:19 -04:00
|
|
|
/**
|
|
|
|
|
*This associator is built for the case where each association requires a separate rpc
|
|
|
|
|
*/
|
2011-02-11 18:04:04 -06:00
|
|
|
IPA.serial_associator = function(spec) {
|
2010-09-07 10:08:19 -04: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
|
|
|
spec = spec || {};
|
2010-10-28 17:20:12 -04:00
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
var that = IPA.associator(spec);
|
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
|
|
|
|
|
|
|
|
that.execute = function() {
|
|
|
|
|
|
|
|
|
|
if (!that.values || !that.values.length) {
|
|
|
|
|
that.on_success();
|
|
|
|
|
return;
|
2010-10-28 17:20:12 -04:00
|
|
|
}
|
|
|
|
|
|
2011-08-25 14:57:44 +02:00
|
|
|
var batch = IPA.batch_command({
|
|
|
|
|
on_success: that.on_success,
|
2011-02-11 18:04:04 -06:00
|
|
|
on_error: that.on_error
|
|
|
|
|
});
|
|
|
|
|
|
2011-08-25 14:57:44 +02:00
|
|
|
var args, options, command;
|
|
|
|
|
|
|
|
|
|
for(var i=0; i < that.values.length; i++) {
|
|
|
|
|
args = [that.values[i]];
|
|
|
|
|
options = {};
|
|
|
|
|
options[that.entity.name] = that.pkey;
|
|
|
|
|
|
|
|
|
|
command = IPA.command({
|
2011-11-07 14:21:45 -06:00
|
|
|
entity: that.other_entity.name,
|
2011-08-25 14:57:44 +02:00
|
|
|
method: that.method,
|
|
|
|
|
args: args,
|
|
|
|
|
options: options
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
batch.add_command(command);
|
|
|
|
|
}
|
2011-02-11 18:04:04 -06:00
|
|
|
//alert(JSON.stringify(command.to_json()));
|
|
|
|
|
|
2011-08-25 14:57:44 +02:00
|
|
|
batch.execute();
|
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-28 17:20:12 -04: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
|
|
|
return that;
|
2011-02-11 18:04:04 -06:00
|
|
|
};
|
2010-10-28 17:20:12 -04:00
|
|
|
|
2010-09-07 10:08:19 -04:00
|
|
|
/**
|
|
|
|
|
*This associator is for the common case where all the asociations can be sent
|
|
|
|
|
in a single rpc
|
|
|
|
|
*/
|
2011-02-11 18:04:04 -06:00
|
|
|
IPA.bulk_associator = function(spec) {
|
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
|
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
var that = IPA.associator(spec);
|
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
|
|
|
|
|
|
|
|
that.execute = function() {
|
|
|
|
|
|
|
|
|
|
if (!that.values || !that.values.length) {
|
|
|
|
|
that.on_success();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-11 18:04:04 -06:00
|
|
|
var command = IPA.command({
|
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
2011-07-25 12:15:14 -04:00
|
|
|
entity: that.entity.name,
|
2011-04-12 02:13:30 -05:00
|
|
|
method: that.method,
|
2012-02-29 18:53:11 +01:00
|
|
|
args: [that.pkey],
|
|
|
|
|
options: { 'all': true },
|
2011-02-11 18:04:04 -06:00
|
|
|
on_success: that.on_success,
|
|
|
|
|
on_error: that.on_error
|
|
|
|
|
});
|
|
|
|
|
|
2012-02-29 18:53:11 +01:00
|
|
|
command.set_option(that.other_entity.name, that.values);
|
|
|
|
|
|
2011-02-11 18:04:04 -06:00
|
|
|
//alert(JSON.stringify(command.to_json()));
|
|
|
|
|
|
|
|
|
|
command.execute();
|
2010-10-28 17:20:12 -04: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
|
|
|
|
|
|
|
|
return that;
|
2011-02-11 18:04:04 -06:00
|
|
|
};
|
2010-09-07 10:08:19 -04:00
|
|
|
|
|
|
|
|
/**
|
2010-11-04 21:42:37 -05:00
|
|
|
* This dialog is used for adding associations between two entities.
|
2010-09-07 10:08:19 -04:00
|
|
|
*/
|
2011-09-19 18:51:43 -05:00
|
|
|
IPA.association_adder_dialog = function(spec) {
|
2010-09-23 16:57:11 -04: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
|
|
|
spec = spec || {};
|
2010-09-23 16:57:11 -04:00
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
var that = IPA.adder_dialog(spec);
|
2010-09-16 10:28:07 -04:00
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
that.entity = IPA.get_entity(spec.entity);
|
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
|
|
|
that.pkey = spec.pkey;
|
2011-11-07 14:21:45 -06:00
|
|
|
|
|
|
|
|
that.other_entity = IPA.get_entity(spec.other_entity);
|
2011-01-04 15:21:18 -05:00
|
|
|
that.attribute_member = spec.attribute_member;
|
2011-11-07 14:21:45 -06:00
|
|
|
|
2011-09-19 18:51:43 -05:00
|
|
|
that.exclude = spec.exclude || [];
|
|
|
|
|
|
|
|
|
|
var init = function() {
|
|
|
|
|
if (!that.get_columns().length) {
|
2011-11-07 14:21:45 -06:00
|
|
|
var pkey_name = that.other_entity.metadata.primary_key;
|
2011-09-19 18:51:43 -05:00
|
|
|
that.create_column({
|
|
|
|
|
entity: that.entity,
|
|
|
|
|
name: pkey_name,
|
2011-11-07 14:21:45 -06:00
|
|
|
label: that.other_entity.metadata.label,
|
2011-09-19 18:51:43 -05:00
|
|
|
primary_key: true,
|
|
|
|
|
width: '600px'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
2010-10-28 17:20:12 -04: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
|
|
|
that.search = function() {
|
2010-11-04 21:42:37 -05:00
|
|
|
function on_success(data, text_status, xhr) {
|
2011-09-19 18:51:43 -05:00
|
|
|
|
2010-11-04 21:42:37 -05:00
|
|
|
that.clear_available_values();
|
2010-09-23 16:57:11 -04:00
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
var pkey_attr = that.other_entity.metadata.primary_key;
|
2011-01-05 09:31:02 -05:00
|
|
|
|
2011-09-26 13:44:22 -05:00
|
|
|
var selected = that.get_selected_values();
|
|
|
|
|
|
2011-09-19 18:51:43 -05:00
|
|
|
var results = data.result;
|
2011-11-07 14:21:45 -06:00
|
|
|
var same_entity = that.entity === that.other_entity;
|
2011-09-19 18:51:43 -05:00
|
|
|
for (var i=0; i<results.count; i++) {
|
2010-09-16 10:28:07 -04:00
|
|
|
var result = results.result[i];
|
2011-09-19 18:51:43 -05:00
|
|
|
var pkey = result[pkey_attr][0];
|
|
|
|
|
|
2011-09-27 10:00:27 +02:00
|
|
|
if (same_entity && pkey === that.pkey) continue;
|
2011-09-26 13:44:22 -05:00
|
|
|
if (that.exclude.indexOf(pkey) >= 0) continue;
|
|
|
|
|
if (selected.indexOf(pkey) >= 0) continue;
|
|
|
|
|
|
|
|
|
|
that.add_available_value(result);
|
2010-09-16 10:28:07 -04:00
|
|
|
}
|
2010-10-27 22:32:30 -05:00
|
|
|
}
|
2010-09-16 10:28:07 -04:00
|
|
|
|
2011-08-17 14:54:08 -05:00
|
|
|
var options = { all: true };
|
2011-11-07 14:21:45 -06:00
|
|
|
var relationships = that.other_entity.metadata.relationships;
|
2011-08-17 14:54:08 -05:00
|
|
|
|
|
|
|
|
/* TODO: better generic handling of different relationships! */
|
|
|
|
|
var other_attribute_member = '';
|
|
|
|
|
if (that.attribute_member == 'member')
|
|
|
|
|
other_attribute_member = 'memberof';
|
|
|
|
|
else if (that.attribute_member == 'memberuser')
|
|
|
|
|
other_attribute_member = 'memberof';
|
|
|
|
|
else if (that.attribute_member == 'memberhost')
|
|
|
|
|
other_attribute_member = 'memberof';
|
|
|
|
|
else if (that.attribute_member == 'memberof')
|
|
|
|
|
other_attribute_member = 'member';
|
2011-12-09 15:01:06 -06:00
|
|
|
else if (that.attribute_member == 'managedby')
|
|
|
|
|
other_attribute_member = 'managing';
|
2011-08-17 14:54:08 -05:00
|
|
|
|
|
|
|
|
var relationship = relationships[other_attribute_member];
|
|
|
|
|
if (relationship) {
|
|
|
|
|
var param_name = relationship[2] + that.entity.name;
|
2012-06-04 12:29:27 +02:00
|
|
|
var cmd_opt = IPA.get_command_option(that.other_entity.name + '_find',
|
|
|
|
|
param_name);
|
|
|
|
|
if (cmd_opt) {
|
|
|
|
|
options[param_name] = that.pkey;
|
|
|
|
|
}
|
2011-01-04 15:21:18 -05:00
|
|
|
}
|
|
|
|
|
|
2011-04-12 02:13:30 -05:00
|
|
|
IPA.command({
|
2011-11-07 14:21:45 -06:00
|
|
|
entity: that.other_entity.name,
|
2011-04-12 02:13:30 -05:00
|
|
|
method: 'find',
|
|
|
|
|
args: [that.get_filter()],
|
|
|
|
|
options: options,
|
|
|
|
|
on_success: on_success
|
|
|
|
|
}).execute();
|
2010-12-06 13:51:49 -06:00
|
|
|
};
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-09-19 18:51:43 -05:00
|
|
|
init();
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
return that;
|
2011-01-14 12:16:25 -05:00
|
|
|
};
|
|
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-11-04 21:42:37 -05:00
|
|
|
/**
|
|
|
|
|
* This dialog is used for removing associations between two entities.
|
|
|
|
|
*/
|
2011-01-12 19:51:22 -05:00
|
|
|
IPA.association_deleter_dialog = function (spec) {
|
2010-10-27 22:32:30 -05:00
|
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
var that = IPA.deleter_dialog(spec);
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
that.entity = IPA.get_entity(spec.entity);
|
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
|
|
|
that.pkey = spec.pkey;
|
2011-11-07 14:21:45 -06:00
|
|
|
|
|
|
|
|
that.other_entity = IPA.get_entity(spec.other_entity);
|
2010-11-04 21:42:37 -05:00
|
|
|
that.values = spec.values;
|
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
|
|
|
|
|
|
|
|
that.associator = spec.associator;
|
|
|
|
|
that.method = spec.method || 'remove_member';
|
|
|
|
|
|
2010-11-04 21:42:37 -05:00
|
|
|
that.on_success = spec.on_success;
|
|
|
|
|
that.on_error = spec.on_error;
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-02-11 18:04:04 -06:00
|
|
|
that.execute = function() {
|
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 associator = that.associator({
|
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
2011-07-25 12:15:14 -04:00
|
|
|
entity: that.entity,
|
|
|
|
|
pkey: that.pkey,
|
|
|
|
|
other_entity: that.other_entity,
|
|
|
|
|
values: that.values,
|
|
|
|
|
method: that.method,
|
|
|
|
|
on_success: that.on_success,
|
|
|
|
|
on_error: that.on_error
|
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
|
|
|
});
|
|
|
|
|
|
|
|
|
|
associator.execute();
|
2010-10-27 22:32:30 -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
|
|
|
return that;
|
2011-01-14 12:16:25 -05:00
|
|
|
};
|
|
|
|
|
|
2010-09-07 10:08:19 -04:00
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
IPA.association_config = function (spec) {
|
2010-11-04 21:42:37 -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
|
|
|
spec = spec || {};
|
2010-10-27 22:32:30 -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 that = {};
|
2010-10-27 22:32:30 -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
|
|
|
that.name = spec.name;
|
|
|
|
|
that.associator = spec.associator;
|
|
|
|
|
that.add_method = spec.add_method;
|
2010-12-02 22:12:59 -06:00
|
|
|
that.remove_method = spec.remove_method;
|
2010-10-28 17:20:12 -04: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
|
|
|
return that;
|
2011-01-14 12:16:25 -05:00
|
|
|
};
|
|
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
IPA.association_table_widget = function (spec) {
|
2010-10-27 22:32:30 -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
|
|
|
spec = spec || {};
|
2011-08-19 10:20:40 -05:00
|
|
|
|
|
|
|
|
var index = spec.name.indexOf('_');
|
|
|
|
|
spec.attribute_member = spec.attribute_member || spec.name.substring(0, index);
|
|
|
|
|
spec.other_entity = spec.other_entity || spec.name.substring(index+1);
|
|
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
spec.managed_entity = IPA.get_entity(spec.other_entity);
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
var that = IPA.table_widget(spec);
|
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
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
that.other_entity = IPA.get_entity(spec.other_entity);
|
2011-01-04 15:21:18 -05:00
|
|
|
that.attribute_member = spec.attribute_member;
|
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
|
|
|
|
2011-02-11 18:04:04 -06:00
|
|
|
that.associator = spec.associator || IPA.bulk_associator;
|
2010-12-02 22:12:59 -06:00
|
|
|
that.add_method = spec.add_method || 'add_member';
|
|
|
|
|
that.remove_method = spec.remove_method || 'remove_member';
|
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
|
|
|
|
2011-08-19 10:20:40 -05:00
|
|
|
that.add_title = spec.add_title || IPA.messages.association.add.member;
|
|
|
|
|
that.remove_title = spec.remove_title || IPA.messages.association.remove.member;
|
|
|
|
|
|
2011-05-16 22:23:20 -05:00
|
|
|
that.adder_columns = $.ordered_map();
|
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
|
|
|
|
2011-12-15 13:40:29 +01:00
|
|
|
that.needs_refresh = IPA.observer();
|
|
|
|
|
|
2010-12-02 22:12:59 -06:00
|
|
|
that.get_adder_column = function(name) {
|
2011-05-16 22:23:20 -05:00
|
|
|
return that.adder_columns.get(name);
|
2010-12-02 22:12:59 -06:00
|
|
|
};
|
2010-11-19 23:52:33 -06:00
|
|
|
|
2010-12-02 22:12:59 -06:00
|
|
|
that.add_adder_column = function(column) {
|
2011-05-16 22:23:20 -05:00
|
|
|
that.adder_columns.put(column.name, column);
|
2010-12-02 22:12:59 -06:00
|
|
|
};
|
2010-11-19 23:52:33 -06:00
|
|
|
|
2010-12-02 22:12:59 -06:00
|
|
|
that.create_adder_column = function(spec) {
|
2011-11-07 14:21:45 -06:00
|
|
|
spec.entity = that.other_entity;
|
2011-01-12 19:51:22 -05:00
|
|
|
var column = IPA.column(spec);
|
2010-12-02 22:12:59 -06:00
|
|
|
that.add_adder_column(column);
|
|
|
|
|
return column;
|
|
|
|
|
};
|
2010-11-19 23:52:33 -06:00
|
|
|
|
2011-12-15 13:08:52 +01:00
|
|
|
that.create_columns = function() {
|
2010-12-02 22:12:59 -06:00
|
|
|
// create a column if none defined
|
|
|
|
|
if (!that.columns.length) {
|
|
|
|
|
that.create_column({
|
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
2011-07-25 12:15:14 -04:00
|
|
|
name: that.name,
|
2011-09-09 18:58:52 -05:00
|
|
|
label: that.label,
|
2011-11-07 14:21:45 -06:00
|
|
|
entity: that.other_entity,
|
2011-08-03 17:15:05 -05:00
|
|
|
primary_key: true,
|
|
|
|
|
link: true
|
2010-12-02 22:12:59 -06:00
|
|
|
});
|
2010-11-19 23:52:33 -06:00
|
|
|
}
|
2011-12-15 13:08:52 +01: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
|
|
|
|
2011-12-15 13:08:52 +01:00
|
|
|
that.init_columns = function() {
|
|
|
|
|
var column;
|
2011-05-16 22:23:20 -05:00
|
|
|
var columns = that.columns.values;
|
|
|
|
|
for (var i=0; i<columns.length; i++) {
|
|
|
|
|
column = columns[i];
|
2011-11-07 14:21:45 -06:00
|
|
|
column.entity = that.other_entity;
|
2011-06-13 23:18:57 -05:00
|
|
|
|
|
|
|
|
if (column.link) {
|
|
|
|
|
column.link_handler = function(value) {
|
2011-11-07 14:21:45 -06:00
|
|
|
IPA.nav.show_page(that.other_entity.name, 'default', value);
|
2011-06-13 23:18:57 -05:00
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
}
|
2010-12-06 13:51:49 -06:00
|
|
|
}
|
2011-12-15 13:08:52 +01:00
|
|
|
};
|
2010-12-06 13:51:49 -06:00
|
|
|
|
2011-12-15 13:08:52 +01:00
|
|
|
that.init_adder_columns = function() {
|
|
|
|
|
var column;
|
2011-05-16 22:23:20 -05:00
|
|
|
var adder_columns = that.adder_columns.values;
|
|
|
|
|
for (var j=0; j<adder_columns.length; j++) {
|
|
|
|
|
column = adder_columns[j];
|
2011-11-07 14:21:45 -06:00
|
|
|
column.entity = that.other_entity;
|
2010-12-06 13:51:49 -06:00
|
|
|
}
|
2011-12-15 13:08:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.init = function() {
|
|
|
|
|
|
|
|
|
|
that.create_columns();
|
|
|
|
|
that.init_columns();
|
|
|
|
|
that.init_adder_columns();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.create = function(container) {
|
|
|
|
|
|
|
|
|
|
that.init();
|
2010-12-06 13:51:49 -06:00
|
|
|
|
2010-12-01 14:51:39 -06:00
|
|
|
that.table_create(container);
|
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
|
|
|
|
2011-09-07 13:57:47 +02:00
|
|
|
that.remove_button = IPA.action_button({
|
2011-07-09 03:01:46 -05:00
|
|
|
name: 'remove',
|
|
|
|
|
label: IPA.messages.buttons.remove,
|
|
|
|
|
icon: 'remove-icon',
|
2011-09-07 13:57:47 +02:00
|
|
|
'class': 'action-button-disabled',
|
2011-07-09 03:01:46 -05:00
|
|
|
click: function() {
|
2011-09-07 13:57:47 +02:00
|
|
|
if (!that.remove_button.hasClass('action-button-disabled')) {
|
2011-08-22 15:06:00 -05:00
|
|
|
that.remove_handler();
|
|
|
|
|
}
|
2011-07-09 03:01:46 -05:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}).appendTo(that.buttons);
|
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
|
|
|
|
2011-09-07 13:57:47 +02:00
|
|
|
that.add_button = IPA.action_button({
|
2011-07-09 03:01:46 -05:00
|
|
|
name: 'add',
|
|
|
|
|
label: IPA.messages.buttons.add,
|
|
|
|
|
icon: 'add-icon',
|
|
|
|
|
click: function() {
|
2011-09-07 13:57:47 +02:00
|
|
|
if (!that.add_button.hasClass('action-button-disabled')) {
|
2011-08-22 15:06:00 -05:00
|
|
|
that.add_handler();
|
|
|
|
|
}
|
2011-07-09 03:01:46 -05:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}).appendTo(that.buttons);
|
|
|
|
|
};
|
2010-10-28 17:20:12 -04:00
|
|
|
|
2011-07-09 03:01:46 -05:00
|
|
|
that.add_handler = function() {
|
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
2011-07-25 12:15:14 -04:00
|
|
|
var facet = that.entity.get_facet();
|
2011-02-23 12:35:45 -06:00
|
|
|
|
2011-07-09 03:01:46 -05:00
|
|
|
if (facet.is_dirty()) {
|
|
|
|
|
var dialog = IPA.dirty_dialog({
|
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
2011-07-25 12:15:14 -04:00
|
|
|
entity:that.entity,
|
2011-07-09 03:01:46 -05:00
|
|
|
facet: facet
|
|
|
|
|
});
|
2011-05-26 17:57:39 -05:00
|
|
|
|
2011-07-09 03:01:46 -05:00
|
|
|
dialog.callback = function() {
|
|
|
|
|
that.show_add_dialog();
|
|
|
|
|
};
|
2011-05-26 17:57:39 -05:00
|
|
|
|
2011-07-09 03:01:46 -05:00
|
|
|
dialog.open(that.container);
|
2011-02-23 12:35:45 -06:00
|
|
|
|
2011-07-09 03:01:46 -05:00
|
|
|
} else {
|
|
|
|
|
that.show_add_dialog();
|
|
|
|
|
}
|
|
|
|
|
};
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2011-07-09 03:01:46 -05:00
|
|
|
that.remove_handler = function() {
|
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
2011-07-25 12:15:14 -04:00
|
|
|
var facet = that.entity.get_facet();
|
2011-05-26 17:57:39 -05:00
|
|
|
|
2011-07-09 03:01:46 -05:00
|
|
|
if (facet.is_dirty()) {
|
|
|
|
|
var dialog = IPA.dirty_dialog({
|
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
2011-07-25 12:15:14 -04:00
|
|
|
entity:that.entity,
|
2011-07-09 03:01:46 -05:00
|
|
|
facet: facet
|
|
|
|
|
});
|
2011-05-26 17:57:39 -05:00
|
|
|
|
2011-07-09 03:01:46 -05:00
|
|
|
dialog.callback = function() {
|
|
|
|
|
that.show_remove_dialog();
|
|
|
|
|
};
|
2011-05-26 17:57:39 -05:00
|
|
|
|
2011-07-09 03:01:46 -05:00
|
|
|
dialog.open(that.container);
|
2011-02-23 12:35:45 -06:00
|
|
|
|
2011-07-09 03:01:46 -05:00
|
|
|
} else {
|
|
|
|
|
that.show_remove_dialog();
|
|
|
|
|
}
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
|
|
|
|
|
2011-01-11 09:51:09 +07:00
|
|
|
that.set_enabled = function(enabled) {
|
|
|
|
|
that.table_set_enabled(enabled);
|
|
|
|
|
if (enabled) {
|
2011-09-07 13:57:47 +02:00
|
|
|
if(that.add_button) {
|
|
|
|
|
that.add_button.removeClass('action-button-disabled');
|
|
|
|
|
}
|
2011-01-11 09:51:09 +07:00
|
|
|
} else {
|
|
|
|
|
$('.action-button', that.table).addClass('action-button-disabled');
|
2011-09-07 13:57:47 +02:00
|
|
|
that.unselect_all();
|
|
|
|
|
}
|
2011-11-29 13:36:07 +01:00
|
|
|
that.enabled = enabled;
|
2011-09-07 13:57:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.select_changed = function() {
|
|
|
|
|
|
|
|
|
|
var values = that.get_selected_values();
|
|
|
|
|
|
|
|
|
|
if (that.remove_button) {
|
|
|
|
|
if (values.length === 0) {
|
|
|
|
|
that.remove_button.addClass('action-button-disabled');
|
|
|
|
|
} else {
|
|
|
|
|
that.remove_button.removeClass('action-button-disabled');
|
|
|
|
|
}
|
2011-01-11 09:51:09 +07:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-12-02 22:12:59 -06:00
|
|
|
that.load = function(result) {
|
|
|
|
|
that.values = result[that.name] || [];
|
2011-11-29 13:36:07 +01:00
|
|
|
that.update();
|
2011-08-18 13:46:44 +02:00
|
|
|
that.unselect_all();
|
2010-12-02 22:12:59 -06:00
|
|
|
};
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
that.update = function(values) {
|
|
|
|
|
|
2011-12-15 13:08:52 +01:00
|
|
|
if (values) that.values = values;
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2010-12-02 22:12:59 -06:00
|
|
|
that.empty();
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-12-15 13:08:52 +01:00
|
|
|
var i;
|
2011-05-16 22:23:20 -05:00
|
|
|
var columns = that.columns.values;
|
|
|
|
|
if (columns.length == 1) { // show pkey only
|
|
|
|
|
var name = columns[0].name;
|
2011-12-15 13:08:52 +01:00
|
|
|
for (i=0; i<that.values.length; i++) {
|
2010-12-02 22:12:59 -06:00
|
|
|
var record = {};
|
|
|
|
|
record[name] = that.values[i];
|
|
|
|
|
that.add_record(record);
|
|
|
|
|
}
|
2011-12-15 13:08:52 +01:00
|
|
|
} else {
|
|
|
|
|
for (i=0; i<that.values.length; i++) {
|
|
|
|
|
that.add_record(that.values[i]);
|
|
|
|
|
}
|
2010-12-02 22:12:59 -06:00
|
|
|
}
|
|
|
|
|
};
|
2010-11-19 23:52:33 -06:00
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
that.create_add_dialog = function() {
|
2011-09-08 09:44:17 -05:00
|
|
|
|
|
|
|
|
var entity_label = that.entity.metadata.label_singular;
|
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
2011-07-25 12:15:14 -04:00
|
|
|
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
2011-11-07 14:21:45 -06:00
|
|
|
var other_entity_label = that.other_entity.metadata.label;
|
2011-02-16 12:46:59 -06:00
|
|
|
|
2011-08-19 10:20:40 -05:00
|
|
|
var title = that.add_title;
|
2011-09-08 09:44:17 -05:00
|
|
|
title = title.replace('${entity}', entity_label);
|
2011-02-16 12:46:59 -06:00
|
|
|
title = title.replace('${primary_key}', pkey);
|
2011-09-08 09:44:17 -05:00
|
|
|
title = title.replace('${other_entity}', other_entity_label);
|
2010-12-02 22:12:59 -06:00
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
return IPA.association_adder_dialog({
|
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
2011-07-25 12:15:14 -04:00
|
|
|
title: title,
|
|
|
|
|
entity: that.entity,
|
|
|
|
|
pkey: pkey,
|
|
|
|
|
other_entity: that.other_entity,
|
|
|
|
|
attribute_member: that.attribute_member,
|
2011-09-19 18:51:43 -05:00
|
|
|
method: that.add_method,
|
|
|
|
|
exclude: that.values
|
2010-12-02 22:12:59 -06:00
|
|
|
});
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.show_add_dialog = function() {
|
|
|
|
|
|
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
2011-07-25 12:15:14 -04:00
|
|
|
var dialog = that.create_add_dialog({entity:that.entity});
|
2010-12-02 22:12:59 -06:00
|
|
|
|
2011-05-16 22:23:20 -05:00
|
|
|
var columns = that.adder_columns.values;
|
|
|
|
|
if (columns.length) {
|
|
|
|
|
dialog.set_columns(columns);
|
2010-11-09 14:22:31 -06:00
|
|
|
}
|
|
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
dialog.execute = function() {
|
2010-12-02 22:12:59 -06:00
|
|
|
that.add(
|
|
|
|
|
dialog.get_selected_values(),
|
|
|
|
|
function() {
|
|
|
|
|
that.refresh();
|
|
|
|
|
dialog.close();
|
|
|
|
|
},
|
|
|
|
|
function() {
|
|
|
|
|
that.refresh();
|
|
|
|
|
dialog.close();
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dialog.open(that.container);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.add = function(values, on_success, on_error) {
|
|
|
|
|
|
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
2011-07-25 12:15:14 -04:00
|
|
|
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
2010-12-02 22:12:59 -06:00
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
var command = IPA.command({
|
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
2011-07-25 12:15:14 -04:00
|
|
|
entity: that.entity.name,
|
2011-04-12 02:13:30 -05:00
|
|
|
method: that.add_method,
|
|
|
|
|
args: [pkey],
|
|
|
|
|
on_success: on_success,
|
|
|
|
|
on_error: on_error
|
2010-12-02 22:12:59 -06:00
|
|
|
});
|
2012-02-29 18:53:11 +01:00
|
|
|
command.set_option(that.other_entity.name, values);
|
2010-12-02 22:12:59 -06:00
|
|
|
|
|
|
|
|
command.execute();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.show_remove_dialog = function() {
|
|
|
|
|
|
|
|
|
|
var selected_values = that.get_selected_values();
|
|
|
|
|
|
|
|
|
|
if (!selected_values.length) {
|
2011-02-16 12:46:59 -06:00
|
|
|
var message = IPA.messages.dialogs.remove_empty;
|
|
|
|
|
alert(message);
|
2010-12-02 22:12:59 -06:00
|
|
|
return;
|
2010-11-09 14:22:31 -06:00
|
|
|
}
|
|
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
var entity_label = that.entity.metadata.label_singular;
|
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
2011-07-25 12:15:14 -04:00
|
|
|
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
2011-11-07 14:21:45 -06:00
|
|
|
var other_entity_label = that.other_entity.metadata.label;
|
2011-02-16 12:46:59 -06:00
|
|
|
|
2011-08-19 10:20:40 -05:00
|
|
|
var title = that.remove_title;
|
2011-11-07 14:21:45 -06:00
|
|
|
title = title.replace('${entity}', entity_label);
|
2011-02-16 12:46:59 -06:00
|
|
|
title = title.replace('${primary_key}', pkey);
|
2011-11-07 14:21:45 -06:00
|
|
|
title = title.replace('${other_entity}', other_entity_label);
|
2010-12-02 22:12:59 -06:00
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
var dialog = IPA.association_deleter_dialog({
|
2011-11-07 14:21:45 -06:00
|
|
|
title: title,
|
|
|
|
|
entity: that.entity,
|
|
|
|
|
pkey: pkey,
|
|
|
|
|
other_entity: that.other_entity,
|
|
|
|
|
values: selected_values,
|
2011-01-31 22:24:40 -06:00
|
|
|
method: that.remove_method
|
2010-12-02 22:12:59 -06:00
|
|
|
});
|
|
|
|
|
|
2011-02-11 18:04:04 -06:00
|
|
|
dialog.execute = function() {
|
2010-12-02 22:12:59 -06:00
|
|
|
that.remove(
|
|
|
|
|
selected_values,
|
|
|
|
|
function() {
|
|
|
|
|
that.refresh();
|
|
|
|
|
dialog.close();
|
|
|
|
|
},
|
|
|
|
|
function() {
|
|
|
|
|
that.refresh();
|
|
|
|
|
dialog.close();
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dialog.open(that.container);
|
2010-11-04 21:42:37 -05:00
|
|
|
};
|
2010-10-28 17:20:12 -04:00
|
|
|
|
2010-12-02 22:12:59 -06:00
|
|
|
that.remove = function(values, on_success, on_error) {
|
|
|
|
|
|
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
2011-07-25 12:15:14 -04:00
|
|
|
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
2010-12-02 22:12:59 -06:00
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
var command = IPA.command({
|
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
2011-07-25 12:15:14 -04:00
|
|
|
entity: that.entity.name,
|
2011-04-12 02:13:30 -05:00
|
|
|
method: that.remove_method,
|
|
|
|
|
args: [pkey],
|
|
|
|
|
on_success: on_success,
|
|
|
|
|
on_error: on_error
|
2010-12-02 22:12:59 -06:00
|
|
|
});
|
|
|
|
|
|
2012-02-29 18:53:11 +01:00
|
|
|
command.set_option(that.other_entity.name, values);
|
2010-12-02 22:12:59 -06:00
|
|
|
|
|
|
|
|
command.execute();
|
|
|
|
|
};
|
|
|
|
|
|
2011-05-23 17:48:37 -05:00
|
|
|
that.refresh = function() {
|
|
|
|
|
|
2011-12-15 13:40:29 +01:00
|
|
|
that.needs_refresh.notify([], that);
|
2011-05-23 17:48:37 -05:00
|
|
|
};
|
|
|
|
|
|
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
2011-07-25 12:15:14 -04:00
|
|
|
/*initialization code*/
|
|
|
|
|
/*this is duplicated in the facet... should be unified*/
|
|
|
|
|
var i;
|
|
|
|
|
if (spec.columns){
|
|
|
|
|
for (i = 0; i < spec.columns.length; i+= 1){
|
2011-11-07 14:21:45 -06:00
|
|
|
spec.columns[i].entity = spec.columns[i].entity || that.other_entity;
|
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
2011-07-25 12:15:14 -04:00
|
|
|
that.create_column(spec.columns[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (spec.adder_columns){
|
|
|
|
|
for (i = 0; i < spec.adder_columns.length; i+= 1){
|
|
|
|
|
that.create_adder_column(spec.adder_columns[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-02 22:12:59 -06:00
|
|
|
// methods that should be invoked by subclasses
|
2011-12-15 13:08:52 +01:00
|
|
|
that.association_table_widget_create_columns = that.create_columns;
|
2011-07-07 15:42:57 -04:00
|
|
|
that.association_table_widget_show_add_dialog = that.show_add_dialog;
|
|
|
|
|
that.association_table_widget_show_remove_dialog = that.show_remove_dialog;
|
2010-12-02 22:12:59 -06: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
|
|
|
return that;
|
2011-01-14 12:16:25 -05:00
|
|
|
};
|
|
|
|
|
|
2011-12-15 13:40:29 +01:00
|
|
|
IPA.association_table_field = function (spec) {
|
|
|
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
|
|
|
|
|
var that = IPA.field(spec);
|
|
|
|
|
|
|
|
|
|
that.refresh = function() {
|
|
|
|
|
|
|
|
|
|
function on_success(data, text_status, xhr) {
|
|
|
|
|
that.load(data.result.result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function on_error(xhr, text_status, error_thrown) {
|
|
|
|
|
that.widget.summary.text(error_thrown.name+': '+error_thrown.message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
|
|
|
|
IPA.command({
|
|
|
|
|
entity: that.entity.name,
|
|
|
|
|
method: 'show',
|
|
|
|
|
args: [pkey],
|
|
|
|
|
options: { all: true, rights: true },
|
|
|
|
|
on_success: on_success,
|
|
|
|
|
on_error: on_error
|
|
|
|
|
}).execute();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.widgets_created = function() {
|
|
|
|
|
|
|
|
|
|
that.field_widgets_created();
|
|
|
|
|
that.widget.needs_refresh.attach(that.refresh);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return that;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IPA.widget_factories['association_table'] = IPA.association_table_widget;
|
|
|
|
|
IPA.field_factories['association_table'] = IPA.association_table_field;
|
|
|
|
|
|
2010-09-29 00:52:56 -05:00
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
IPA.association_facet = function (spec) {
|
2010-10-28 17:20:12 -04: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
|
|
|
spec = spec || {};
|
2010-10-28 17:20:12 -04:00
|
|
|
|
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
2011-07-25 12:15:14 -04:00
|
|
|
/*
|
|
|
|
|
Link parameter is used to turn off the links in selfservice mode.
|
|
|
|
|
Default it to true if not set so that facets that would not otherwise
|
|
|
|
|
link by default get links set.
|
|
|
|
|
|
|
|
|
|
link must be set before the call to the base class, to affect the table.
|
|
|
|
|
*/
|
|
|
|
|
spec.link = spec.link === undefined ? true : spec.link;
|
2011-11-07 14:21:45 -06:00
|
|
|
spec.managed_entity = IPA.get_entity(spec.other_entity);
|
2011-08-19 10:20:40 -05:00
|
|
|
|
2011-06-16 11:00:01 -05:00
|
|
|
var that = IPA.table_facet(spec);
|
2010-10-28 17:20:12 -04:00
|
|
|
|
2011-05-13 20:05:35 -05:00
|
|
|
that.attribute_member = spec.attribute_member;
|
2011-06-16 16:35:13 -05:00
|
|
|
that.indirect_attribute_member = spec.indirect_attribute_member;
|
|
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
that.other_entity = IPA.get_entity(spec.other_entity);
|
2011-06-16 16:35:13 -05:00
|
|
|
|
|
|
|
|
that.association_type = 'direct';
|
2011-05-13 20:05:35 -05:00
|
|
|
that.facet_group = spec.facet_group;
|
2011-04-11 14:49:36 -04:00
|
|
|
|
2011-05-13 20:05:35 -05:00
|
|
|
that.read_only = spec.read_only;
|
2010-11-19 23:52:33 -06:00
|
|
|
|
2011-02-11 18:04:04 -06:00
|
|
|
that.associator = spec.associator || IPA.bulk_associator;
|
2010-12-01 14:51:39 -06:00
|
|
|
that.add_method = spec.add_method || 'add_member';
|
2010-12-02 22:12:59 -06:00
|
|
|
that.remove_method = spec.remove_method || 'remove_member';
|
2010-12-01 14:51:39 -06:00
|
|
|
|
2011-08-19 10:20:40 -05:00
|
|
|
that.add_title = spec.add_title || IPA.messages.association.add.member;
|
|
|
|
|
that.remove_title = spec.remove_title || IPA.messages.association.remove.member;
|
|
|
|
|
|
2011-05-16 22:23:20 -05:00
|
|
|
that.adder_columns = $.ordered_map();
|
2010-12-01 14:51:39 -06:00
|
|
|
|
|
|
|
|
that.get_adder_column = function(name) {
|
2011-05-16 22:23:20 -05:00
|
|
|
return that.adder_columns.get(name);
|
2010-12-01 14:51:39 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.add_adder_column = function(column) {
|
2011-11-07 14:21:45 -06:00
|
|
|
column.entity = that.other_entity;
|
2011-05-16 22:23:20 -05:00
|
|
|
that.adder_columns.put(column.name, column);
|
2010-12-01 14:51:39 -06:00
|
|
|
};
|
|
|
|
|
|
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
2011-07-25 12:15:14 -04:00
|
|
|
/*TODO try to reuse the association_table_widget in association_facet*/
|
2010-12-01 14:51:39 -06:00
|
|
|
that.create_adder_column = function(spec) {
|
2011-06-16 11:00:01 -05:00
|
|
|
var column;
|
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
2011-07-25 12:15:14 -04:00
|
|
|
var factory;
|
2011-06-16 11:00:01 -05:00
|
|
|
if (spec instanceof Object) {
|
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
2011-07-25 12:15:14 -04:00
|
|
|
factory = spec.factory || IPA.column;
|
2011-06-16 11:00:01 -05:00
|
|
|
} else {
|
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
2011-07-25 12:15:14 -04:00
|
|
|
factory = IPA.column;
|
|
|
|
|
spec = { name: spec };
|
2011-06-16 11:00:01 -05:00
|
|
|
}
|
2011-11-07 14:21:45 -06:00
|
|
|
spec.entity = that.other_entity;
|
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
2011-07-25 12:15:14 -04:00
|
|
|
column = factory(spec);
|
2010-12-01 14:51:39 -06:00
|
|
|
that.add_adder_column(column);
|
|
|
|
|
return column;
|
|
|
|
|
};
|
|
|
|
|
|
2011-11-04 20:43:39 -05:00
|
|
|
var init = function() {
|
|
|
|
|
|
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
2011-07-25 12:15:14 -04:00
|
|
|
var column;
|
|
|
|
|
var i;
|
2011-03-18 16:43:54 -04:00
|
|
|
|
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
2011-07-25 12:15:14 -04:00
|
|
|
var pkey_name;
|
2011-08-19 10:20:40 -05:00
|
|
|
if (that.other_entity) {
|
2011-11-07 14:21:45 -06:00
|
|
|
pkey_name = that.other_entity.metadata.primary_key;
|
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
2011-07-25 12:15:14 -04:00
|
|
|
}
|
2010-11-15 11:10:55 -06:00
|
|
|
|
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
2011-07-25 12:15:14 -04:00
|
|
|
if (!that.columns.length){
|
|
|
|
|
that.create_column({
|
2011-11-18 19:47:39 -06:00
|
|
|
name: pkey_name
|
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
2011-07-25 12:15:14 -04:00
|
|
|
});
|
|
|
|
|
}
|
2010-12-06 13:51:49 -06:00
|
|
|
|
2011-11-18 19:47:39 -06:00
|
|
|
var columns = that.columns.values;
|
|
|
|
|
for (i=0; i<columns.length; i++) {
|
|
|
|
|
column = columns[i];
|
|
|
|
|
column.link = spec.link;
|
|
|
|
|
}
|
|
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
that.init_table(that.other_entity);
|
2011-11-18 19:47:39 -06:00
|
|
|
|
|
|
|
|
var adder_columns = spec.adder_columns || [];
|
|
|
|
|
for (i=0; i<adder_columns.length; i++) {
|
|
|
|
|
that.create_adder_column(adder_columns[i]);
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-19 10:20:40 -05:00
|
|
|
if (!that.adder_columns.length) {
|
|
|
|
|
that.create_adder_column({
|
|
|
|
|
name: pkey_name,
|
|
|
|
|
primary_key: true
|
|
|
|
|
});
|
|
|
|
|
}
|
2010-09-29 00:52:56 -05:00
|
|
|
|
2011-11-04 20:43:39 -05:00
|
|
|
adder_columns = that.adder_columns.values;
|
2011-05-16 22:23:20 -05:00
|
|
|
for (i=0; i<adder_columns.length; i++) {
|
|
|
|
|
column = adder_columns[i];
|
2011-11-07 14:21:45 -06:00
|
|
|
column.entity = that.other_entity;
|
2010-12-06 13:51:49 -06:00
|
|
|
}
|
2011-11-04 20:43:39 -05:00
|
|
|
};
|
2011-09-07 13:57:47 +02:00
|
|
|
|
2011-11-04 20:43:39 -05:00
|
|
|
that.get_records_command_name = function() {
|
|
|
|
|
return that.entity.name+'_'+that.get_attribute_name();
|
|
|
|
|
};
|
2010-12-01 14:51:39 -06:00
|
|
|
|
2011-04-28 19:17:58 -05:00
|
|
|
that.create_header = function(container) {
|
|
|
|
|
|
|
|
|
|
that.facet_create_header(container);
|
2010-12-01 14:51:39 -06:00
|
|
|
|
2012-01-16 14:17:46 +01:00
|
|
|
that.refresh_button = IPA.action_button({
|
|
|
|
|
name: 'refresh',
|
|
|
|
|
href: 'refresh',
|
|
|
|
|
label: IPA.messages.buttons.refresh,
|
|
|
|
|
icon: 'reset-icon',
|
|
|
|
|
click: function() {
|
|
|
|
|
that.refresh();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}).appendTo(that.controls);
|
|
|
|
|
|
2011-05-16 14:40:09 -05:00
|
|
|
if (!that.read_only) {
|
|
|
|
|
that.remove_button = IPA.action_button({
|
2011-06-21 15:05:44 -05:00
|
|
|
name: 'remove',
|
2011-05-16 14:40:09 -05:00
|
|
|
label: IPA.messages.buttons.remove,
|
2011-06-21 11:58:26 -04:00
|
|
|
icon: 'remove-icon',
|
2011-09-07 13:57:47 +02:00
|
|
|
'class': 'action-button-disabled',
|
2011-05-16 14:40:09 -05:00
|
|
|
click: function() {
|
2011-08-22 15:06:00 -05:00
|
|
|
if (!that.remove_button.hasClass('action-button-disabled')) {
|
|
|
|
|
that.show_remove_dialog();
|
|
|
|
|
}
|
2011-05-16 14:40:09 -05:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}).appendTo(that.controls);
|
2010-11-09 20:04:49 -05:00
|
|
|
|
2011-05-16 14:40:09 -05:00
|
|
|
that.add_button = IPA.action_button({
|
2011-06-21 15:05:44 -05:00
|
|
|
name: 'add',
|
2011-10-24 19:20:14 -05:00
|
|
|
label: IPA.messages.buttons.add,
|
2011-06-21 11:58:26 -04:00
|
|
|
icon: 'add-icon',
|
2011-05-16 14:40:09 -05:00
|
|
|
click: function() {
|
2011-08-22 15:06:00 -05:00
|
|
|
if (!that.add_button.hasClass('action-button-disabled')) {
|
|
|
|
|
that.show_add_dialog();
|
|
|
|
|
}
|
2011-05-16 14:40:09 -05:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}).appendTo(that.controls);
|
|
|
|
|
}
|
2011-06-16 16:35:13 -05:00
|
|
|
|
|
|
|
|
if (that.indirect_attribute_member) {
|
2012-01-16 14:17:46 +01:00
|
|
|
|
|
|
|
|
var div = $('<div/>', {
|
2011-06-21 15:05:44 -05:00
|
|
|
'class': 'right-aligned-facet-controls'
|
2011-06-16 16:35:13 -05:00
|
|
|
}).appendTo(that.controls);
|
|
|
|
|
|
2012-01-16 14:17:46 +01:00
|
|
|
div.append(IPA.messages.association.show_results);
|
|
|
|
|
div.append(' ');
|
2011-06-16 16:35:13 -05:00
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
var name = that.entity.name+'-'+that.attribute_member+'-'+that.other_entity.name+'-type-radio';
|
2011-10-24 14:53:29 +02:00
|
|
|
var direct_id = name + '-direct';
|
2011-09-30 21:25:47 -05:00
|
|
|
|
2011-06-16 16:35:13 -05:00
|
|
|
that.direct_radio = $('<input/>', {
|
2011-09-30 21:25:47 -05:00
|
|
|
id: direct_id,
|
2011-06-16 16:35:13 -05:00
|
|
|
type: 'radio',
|
2011-10-24 14:53:29 +02:00
|
|
|
name: name,
|
2011-06-16 16:35:13 -05:00
|
|
|
value: 'direct',
|
|
|
|
|
click: function() {
|
|
|
|
|
that.association_type = $(this).val();
|
|
|
|
|
that.refresh();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2012-01-16 14:17:46 +01:00
|
|
|
}).appendTo(div);
|
2011-06-16 16:35:13 -05:00
|
|
|
|
2011-09-30 21:25:47 -05:00
|
|
|
$('<label/>', {
|
2011-10-24 19:20:14 -05:00
|
|
|
text: IPA.messages.association.direct_membership,
|
2011-09-30 21:25:47 -05:00
|
|
|
'for': direct_id
|
2012-01-16 14:17:46 +01:00
|
|
|
}).appendTo(div);
|
2011-09-30 21:25:47 -05:00
|
|
|
|
2012-01-16 14:17:46 +01:00
|
|
|
div.append(' ');
|
2011-06-16 16:35:13 -05:00
|
|
|
|
2011-10-24 14:53:29 +02:00
|
|
|
var indirect_id = name + '-indirect';
|
2011-09-30 21:25:47 -05:00
|
|
|
|
2011-06-16 16:35:13 -05:00
|
|
|
that.indirect_radio = $('<input/>', {
|
2011-09-30 21:25:47 -05:00
|
|
|
id: indirect_id,
|
2011-06-16 16:35:13 -05:00
|
|
|
type: 'radio',
|
2011-10-24 14:53:29 +02:00
|
|
|
name: name,
|
2011-06-16 16:35:13 -05:00
|
|
|
value: 'indirect',
|
|
|
|
|
click: function() {
|
|
|
|
|
that.association_type = $(this).val();
|
|
|
|
|
that.refresh();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2012-01-16 14:17:46 +01:00
|
|
|
}).appendTo(div);
|
2011-06-16 16:35:13 -05:00
|
|
|
|
2011-09-30 21:25:47 -05:00
|
|
|
$('<label/>', {
|
2011-10-24 19:20:14 -05:00
|
|
|
text: IPA.messages.association.indirect_membership,
|
2011-09-30 21:25:47 -05:00
|
|
|
'for': indirect_id
|
2012-01-16 14:17:46 +01:00
|
|
|
}).appendTo(div);
|
2011-06-16 16:35:13 -05:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.get_attribute_name = function() {
|
|
|
|
|
if (that.association_type == 'direct') {
|
2011-11-07 14:21:45 -06:00
|
|
|
return that.attribute_member+'_'+that.other_entity.name;
|
2011-06-16 16:35:13 -05:00
|
|
|
} else {
|
2011-11-07 14:21:45 -06:00
|
|
|
return that.indirect_attribute_member+'_'+that.other_entity.name;
|
2011-06-16 16:35:13 -05:00
|
|
|
}
|
2011-04-28 19:17:58 -05:00
|
|
|
};
|
2011-04-11 14:49:36 -04:00
|
|
|
|
2011-04-28 19:17:58 -05:00
|
|
|
that.show = function() {
|
|
|
|
|
that.facet_show();
|
2010-12-02 22:12:59 -06:00
|
|
|
|
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
2011-07-25 12:15:14 -04:00
|
|
|
that.pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
2011-06-21 15:05:44 -05:00
|
|
|
that.header.set_pkey(that.pkey);
|
2010-10-27 22:32:30 -05:00
|
|
|
};
|
|
|
|
|
|
2010-12-02 22:12:59 -06:00
|
|
|
that.show_add_dialog = function() {
|
2010-12-01 14:51:39 -06:00
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
var entity_label = that.entity.metadata.label_singular;
|
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
2011-07-25 12:15:14 -04:00
|
|
|
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
2011-11-07 14:21:45 -06:00
|
|
|
var other_entity_label = that.other_entity.metadata.label;
|
2011-02-16 12:46:59 -06:00
|
|
|
|
2011-08-19 10:20:40 -05:00
|
|
|
var title = that.add_title;
|
2011-11-07 14:21:45 -06:00
|
|
|
title = title.replace('${entity}', entity_label);
|
2011-02-16 12:46:59 -06:00
|
|
|
title = title.replace('${primary_key}', pkey);
|
2011-11-07 14:21:45 -06:00
|
|
|
title = title.replace('${other_entity}', other_entity_label);
|
2010-12-01 14:51:39 -06:00
|
|
|
|
2011-11-18 19:47:39 -06:00
|
|
|
var pkeys = that.data.result.result[that.get_attribute_name()];
|
2011-09-19 18:51:43 -05:00
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
var dialog = IPA.association_adder_dialog({
|
2011-09-19 18:51:43 -05:00
|
|
|
title: title,
|
|
|
|
|
entity: that.entity,
|
|
|
|
|
pkey: pkey,
|
|
|
|
|
other_entity: that.other_entity,
|
|
|
|
|
attribute_member: that.attribute_member,
|
|
|
|
|
exclude: pkeys
|
2010-12-01 14:51:39 -06:00
|
|
|
});
|
|
|
|
|
|
2011-05-16 22:23:20 -05:00
|
|
|
var adder_columns = that.adder_columns.values;
|
|
|
|
|
if (adder_columns.length) {
|
|
|
|
|
dialog.set_columns(adder_columns);
|
2010-12-01 14:51:39 -06:00
|
|
|
}
|
|
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
dialog.execute = function() {
|
2010-12-02 22:12:59 -06:00
|
|
|
|
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
2011-07-25 12:15:14 -04:00
|
|
|
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
2010-12-02 22:12:59 -06:00
|
|
|
|
|
|
|
|
var associator = that.associator({
|
2011-11-07 14:21:45 -06:00
|
|
|
entity: that.entity,
|
|
|
|
|
pkey: pkey,
|
|
|
|
|
other_entity: that.other_entity,
|
|
|
|
|
values: dialog.get_selected_values(),
|
|
|
|
|
method: that.add_method,
|
|
|
|
|
on_success: function() {
|
2010-12-02 22:12:59 -06:00
|
|
|
that.refresh();
|
|
|
|
|
dialog.close();
|
|
|
|
|
},
|
2011-11-07 14:21:45 -06:00
|
|
|
on_error: function() {
|
2010-12-02 22:12:59 -06:00
|
|
|
that.refresh();
|
|
|
|
|
dialog.close();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
associator.execute();
|
|
|
|
|
};
|
|
|
|
|
|
2010-12-01 14:51:39 -06:00
|
|
|
dialog.open(that.container);
|
|
|
|
|
};
|
|
|
|
|
|
2010-12-02 22:12:59 -06:00
|
|
|
that.show_remove_dialog = function() {
|
2010-12-01 14:51:39 -06:00
|
|
|
|
|
|
|
|
var values = that.table.get_selected_values();
|
|
|
|
|
|
|
|
|
|
if (!values.length) {
|
2011-02-16 12:46:59 -06:00
|
|
|
var message = IPA.messages.dialogs.remove_empty;
|
|
|
|
|
alert(message);
|
2010-12-01 14:51:39 -06:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
var entity_label = that.entity.metadata.label_singular;
|
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
2011-07-25 12:15:14 -04:00
|
|
|
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
2011-11-07 14:21:45 -06:00
|
|
|
var other_entity_label = that.other_entity.metadata.label;
|
2011-02-16 12:46:59 -06:00
|
|
|
|
2011-08-19 10:20:40 -05:00
|
|
|
var title = that.remove_title;
|
2011-11-07 14:21:45 -06:00
|
|
|
title = title.replace('${entity}', entity_label);
|
2011-02-16 12:46:59 -06:00
|
|
|
title = title.replace('${primary_key}', pkey);
|
2011-11-07 14:21:45 -06:00
|
|
|
title = title.replace('${other_entity}', other_entity_label);
|
2010-12-01 14:51:39 -06:00
|
|
|
|
2011-01-12 19:51:22 -05:00
|
|
|
var dialog = IPA.association_deleter_dialog({
|
2011-02-11 18:04:04 -06:00
|
|
|
title: title,
|
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
2011-07-25 12:15:14 -04:00
|
|
|
entity: that.entity,
|
2011-02-11 18:04:04 -06:00
|
|
|
pkey: pkey,
|
|
|
|
|
other_entity: that.other_entity,
|
|
|
|
|
values: values
|
2010-12-01 14:51:39 -06:00
|
|
|
});
|
|
|
|
|
|
2011-02-11 18:04:04 -06:00
|
|
|
dialog.execute = function() {
|
|
|
|
|
|
|
|
|
|
var associator = that.associator({
|
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
2011-07-25 12:15:14 -04:00
|
|
|
entity: that.entity,
|
2011-02-11 18:04:04 -06:00
|
|
|
pkey: pkey,
|
|
|
|
|
other_entity: that.other_entity,
|
|
|
|
|
values: values,
|
|
|
|
|
method: that.remove_method,
|
|
|
|
|
on_success: function() {
|
|
|
|
|
that.refresh();
|
|
|
|
|
dialog.close();
|
|
|
|
|
},
|
|
|
|
|
on_error: function() {
|
|
|
|
|
that.refresh();
|
|
|
|
|
dialog.close();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
associator.execute();
|
|
|
|
|
};
|
|
|
|
|
|
2010-12-01 14:51:39 -06:00
|
|
|
dialog.open(that.container);
|
|
|
|
|
};
|
|
|
|
|
|
2012-01-17 15:50:49 -06:00
|
|
|
that.get_records_map = function(data) {
|
|
|
|
|
|
|
|
|
|
var records_map = $.ordered_map();
|
|
|
|
|
var association_name = that.get_attribute_name();
|
|
|
|
|
var pkey_name = that.managed_entity.metadata.primary_key;
|
|
|
|
|
|
|
|
|
|
var pkeys = data.result.result[association_name];
|
|
|
|
|
for (var i=0; pkeys && i<pkeys.length; i++) {
|
|
|
|
|
var pkey = pkeys[i];
|
|
|
|
|
var record = {};
|
|
|
|
|
record[pkey_name] = pkey;
|
|
|
|
|
records_map.put(pkey, record);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return records_map;
|
2011-06-23 11:44:44 -05:00
|
|
|
};
|
|
|
|
|
|
2010-12-02 22:12:59 -06:00
|
|
|
that.refresh = function() {
|
|
|
|
|
|
2011-06-16 16:35:13 -05:00
|
|
|
if (that.association_type == 'direct') {
|
|
|
|
|
if (that.direct_radio) that.direct_radio.attr('checked', true);
|
2012-01-16 14:17:46 +01:00
|
|
|
if (that.add_button) that.add_button.css('display', 'inline-block');
|
|
|
|
|
if (that.remove_button) that.remove_button.css('display', 'inline-block');
|
2011-06-16 16:35:13 -05:00
|
|
|
} else {
|
|
|
|
|
if (that.indirect_radio) that.indirect_radio.attr('checked', true);
|
|
|
|
|
if (that.add_button) that.add_button.css('display', 'none');
|
|
|
|
|
if (that.remove_button) that.remove_button.css('display', 'none');
|
|
|
|
|
}
|
|
|
|
|
|
2011-09-19 18:51:43 -05:00
|
|
|
var pkey = that.entity.get_primary_key();
|
2011-05-06 17:04:09 -04:00
|
|
|
|
2011-06-23 11:44:44 -05:00
|
|
|
var command = IPA.command({
|
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
2011-07-25 12:15:14 -04:00
|
|
|
entity: that.entity.name,
|
2011-04-12 02:13:30 -05:00
|
|
|
method: 'show',
|
2011-06-23 11:44:44 -05:00
|
|
|
args: pkey
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
command.on_success = function(data, text_status, xhr) {
|
2011-11-18 19:47:39 -06:00
|
|
|
that.load(data);
|
2012-03-16 14:44:11 +01:00
|
|
|
that.show_content();
|
2011-06-23 11:44:44 -05:00
|
|
|
};
|
|
|
|
|
|
2011-11-18 19:47:39 -06:00
|
|
|
command.on_error = function(xhr, text_status, error_thrown) {
|
|
|
|
|
that.redirect_error(error_thrown);
|
|
|
|
|
that.report_error(error_thrown);
|
|
|
|
|
};
|
2011-06-23 11:44:44 -05:00
|
|
|
|
|
|
|
|
command.execute();
|
2010-11-19 23:52:33 -06:00
|
|
|
};
|
|
|
|
|
|
2011-10-24 14:53:29 +02:00
|
|
|
that.clear = function() {
|
|
|
|
|
that.header.clear();
|
|
|
|
|
that.table.clear();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.needs_update = function() {
|
2011-11-03 16:02:32 -05:00
|
|
|
if (that._needs_update !== undefined) return that._needs_update;
|
2011-11-03 23:43:58 -05:00
|
|
|
|
2011-10-24 14:53:29 +02:00
|
|
|
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
2011-11-03 23:43:58 -05:00
|
|
|
if (that.pkey !== pkey) return true;
|
|
|
|
|
|
2011-11-07 14:21:45 -06:00
|
|
|
var page = parseInt(IPA.nav.get_state(that.entity.name+'-page'), 10) || 1;
|
2011-11-03 23:43:58 -05:00
|
|
|
if (that.table.current_page !== page) return true;
|
|
|
|
|
|
2012-03-22 17:03:57 +01:00
|
|
|
return that.facet_needs_update();
|
2011-10-24 14:53:29 +02:00
|
|
|
};
|
|
|
|
|
|
2011-11-04 20:43:39 -05:00
|
|
|
init();
|
|
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
return that;
|
2011-01-14 12:16:25 -05:00
|
|
|
};
|