Alona Kaplan has posted comments on this change.

Change subject: aaa: Adding namespace dropdown list to "add user" dialog
......................................................................


Patch Set 9:

(2 comments)

http://gerrit.ovirt.org/#/c/30698/9/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/users/AdElementListModel.java
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/users/AdElementListModel.java:

Line 211:             public void onSuccess(Object model, Object result) {
Line 212:                 if (getProfile().getSelectedItem() != null) {
Line 213:                     namespacesMap = (HashMap<String, List<String>>) 
result;
Line 214:                     List<String> selectedNamespaces =
Line 215:                             namespacesMap.get(((ProfileEntry) 
(getProfile().getSelectedItem())).getAuthz());
I meant that 'namespacesMap.get(((ProfileEntry) 
(getProfile().getSelectedItem())).getAuthz()' is duplicated and can be part of 
'populateNamespaces(..)'
Line 216:                     populateNamespaces(selectedNamespaces);
Line 217:                 }
Line 218:             }
Line 219:         }));


Line 232:         getProfile().setItems(profiles);
Line 233:         getProfile().setSelectedItem(Linq.firstOrDefault(profiles));
Line 234:     }
Line 235: 
Line 236:     protected void populateNamespaces(List<String> namespaces) {
The implementation I suggest to 'populateNamespaces(..)'-
protected void populateNamespaces() {
        getNamespace().setItems(namespacesMap.get(((ProfileEntry) 
getProfile().getSelectedItem()).getAuthz()));        
}

getNamespace().setSelectedItem(..) is not necessary. Setting the first item as 
the selected is the default behavior, UiCommonVisitor->updateListEditor(..) 
takes care of it.
Line 237:         getNamespace().setItems(namespaces);
Line 238:         
getNamespace().setSelectedItem(Linq.firstOrDefault(namespaces));
Line 239:     }
Line 240: 


-- 
To view, visit http://gerrit.ovirt.org/30698
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic78559243c765271bf8e12abd035deba05226bda
Gerrit-PatchSet: 9
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to