Re: [Freeipa-devel] [PATCH] 252 Removed unnecessary HBAC/sudo rule category modification.

2011-08-25 Thread Endi Sukma Dewata

On 8/23/2011 12:12 PM, Petr Vobornik wrote:

On 08/22/2011 11:37 PM, Endi Sukma Dewata wrote:

Since the Add/Delete links in the association table are disabled when
the category is set to 'all', it's no longer necessary to check the
category before showing the add/delete dialogs and modify the category
before adding entries. Thus, the IPA.rule_association_table_widget is
no longer needed.

Ticket #1692

ACK


Pushed to master and ipa-2-1.

--
Endi S. Dewata

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 252 Removed unnecessary HBAC/sudo rule category modification.

2011-08-23 Thread Petr Vobornik

On 08/22/2011 11:37 PM, Endi Sukma Dewata wrote:

Since the Add/Delete links in the association table are disabled when
the category is set to 'all', it's no longer necessary to check the
category before showing the add/delete dialogs and modify the category
before adding entries. Thus, the IPA.rule_association_table_widget is
no longer needed.

Ticket #1692



___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

ACK

--
Petr Vobornik

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


[Freeipa-devel] [PATCH] 252 Removed unnecessary HBAC/sudo rule category modification.

2011-08-22 Thread Endi Sukma Dewata

Since the Add/Delete links in the association table are disabled when
the category is set to 'all', it's no longer necessary to check the
category before showing the add/delete dialogs and modify the category
before adding entries. Thus, the IPA.rule_association_table_widget is
no longer needed.

Ticket #1692

--
Endi S. Dewata
From eb4a9a4daac97da7356e59ad7f6a3323ec9716e7 Mon Sep 17 00:00:00 2001
From: Endi S. Dewata edew...@redhat.com
Date: Mon, 22 Aug 2011 15:06:00 -0500
Subject: [PATCH] Removed unnecessary HBAC/sudo rule category modification.

Since the Add/Delete links in the association table are disabled when
the category is set to 'all', it's no longer necessary to check the
category before showing the add/delete dialogs and modify the category
before adding entries. Thus, the IPA.rule_association_table_widget is
no longer needed.

Ticket #1692
---
 install/ui/association.js |   29 +--
 install/ui/hbac.js|   32 -
 install/ui/ipa.css|   11 +---
 install/ui/rule.js|   66 -
 install/ui/search.js  |9 +++---
 install/ui/sudo.js|   27 ++
 6 files changed, 40 insertions(+), 134 deletions(-)

diff --git a/install/ui/association.js b/install/ui/association.js
index 4ee36934d2a4f2f15e33aa3e7e096888dc2bb187..b79a18f061229e51cc9534aadea38b8e2636a984 100644
--- a/install/ui/association.js
+++ b/install/ui/association.js
@@ -350,32 +350,32 @@ IPA.association_table_widget = function (spec) {
 
 that.table_create(container);
 
-var button = IPA.action_button({
+var remove_button = IPA.action_button({
 name: 'remove',
 label: IPA.messages.buttons.remove,
 icon: 'remove-icon',
 click: function() {
-that.remove_handler();
+if (!remove_button.hasClass('action-button-disabled')) {
+that.remove_handler();
+}
 return false;
 }
 }).appendTo(that.buttons);
 
-button = IPA.action_button({
+var add_button = IPA.action_button({
 name: 'add',
 label: IPA.messages.buttons.add,
 icon: 'add-icon',
 click: function() {
-that.add_handler();
+if (!add_button.hasClass('action-button-disabled')) {
+that.add_handler();
+}
 return false;
 }
 }).appendTo(that.buttons);
 };
 
 that.add_handler = function() {
-if ($(this).hasClass('action-button-disabled')) {
-return;
-}
-
 var facet = that.entity.get_facet();
 
 if (facet.is_dirty()) {
@@ -396,10 +396,6 @@ IPA.association_table_widget = function (spec) {
 };
 
 that.remove_handler = function() {
-if ($(this).hasClass('action-button-disabled')) {
-return;
-}
-
 var facet = that.entity.get_facet();
 
 if (facet.is_dirty()) {
@@ -838,7 +834,6 @@ IPA.association_facet = function (spec) {
 that.facet_create_header(container);
 
 that.pkey = IPA.nav.get_state(that.entity.name+'-pkey');
-var other_label = IPA.metadata.objects[that.other_entity].label;
 
 if (!that.read_only) {
 that.remove_button = IPA.action_button({
@@ -846,7 +841,9 @@ IPA.association_facet = function (spec) {
 label: IPA.messages.buttons.remove,
 icon: 'remove-icon',
 click: function() {
-that.show_remove_dialog();
+if (!that.remove_button.hasClass('action-button-disabled')) {
+that.show_remove_dialog();
+}
 return false;
 }
 }).appendTo(that.controls);
@@ -856,7 +853,9 @@ IPA.association_facet = function (spec) {
 label: IPA.messages.buttons.enroll,
 icon: 'add-icon',
 click: function() {
-that.show_add_dialog();
+if (!that.add_button.hasClass('action-button-disabled')) {
+that.show_add_dialog();
+}
 return false;
 }
 }).appendTo(that.controls);
diff --git a/install/ui/hbac.js b/install/ui/hbac.js
index 274c52d6839c2ec39ed118ada49084563802aa74..3223e0f31c4fc0b6357a0b65288554b48bd4382a 100644
--- a/install/ui/hbac.js
+++ b/install/ui/hbac.js
@@ -181,22 +181,20 @@ IPA.hbacrule_details_facet = function(spec) {
 ]
 });
 
-var category = section.add_field(IPA.radio_widget({
+section.add_field(IPA.radio_widget({
 name: 'usercategory'
 }));
-section.add_field(IPA.rule_association_table_widget({
+section.add_field(IPA.association_table_widget({
 id: