Vojtech Szocs has posted comments on this change.

Change subject: webadmin: UI for gluster volume snapshots
......................................................................


Patch Set 11:

(6 comments)

This patch needs to be rebased on top of recent frontend infra changes [1].

[1] http://gerrit.ovirt.org/#/c/35492/

http://gerrit.ovirt.org/#/c/35082/11/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/help/HelpTag.java
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/help/HelpTag.java:

Line 475:     volume_retain_brick("volume_retain_brick", HelpTagType.WEBADMIN, 
"[gluster] Volumes main tab -> Bricks sub-tab -> 'Retain Bricks' dialog"), 
//$NON-NLS-1$ //$NON-NLS-2$
Line 476: 
Line 477:     volume_stop("volume_stop", HelpTagType.WEBADMIN, "Volumes Tab > 
Stop Volume"), //$NON-NLS-1$ //$NON-NLS-2$
Line 478: 
Line 479:     volume_snapshots("volume_snapshots", HelpTagType.UNKNOWN), 
//$NON-NLS-1$
Sorry if I miss something, but why UNKNOWN and why not WEBADMIN?
Line 480: 
Line 481:     new_role("new_role", HelpTagType.WEBADMIN), //$NON-NLS-1$
Line 482: 
Line 483:     edit_role("edit_role", HelpTagType.WEBADMIN), //$NON-NLS-1$


http://gerrit.ovirt.org/#/c/35082/11/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterVolumeSnapshotListModel.java
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterVolumeSnapshotListModel.java:

Line 97:     @Override
Line 98:     public void executeCommand(UICommand command) {
Line 99:         super.executeCommand(command);
Line 100: 
Line 101:         if (command.equals(getNewSnapshotCommand())) {//$NON-NLS-1$
Redundant NON-NLS marker.
Line 102:             newSnapshot();
Line 103:         } else if 
(command.getName().equalsIgnoreCase("onCreateSnapshot")) {//$NON-NLS-1$
Line 104:             onCreateSnapshot();
Line 105:         } else if (command.getName().equalsIgnoreCase("Cancel")) 
{//$NON-NLS-1$


http://gerrit.ovirt.org/#/c/35082/11/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/VolumeModule.java
File 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/VolumeModule.java:

Line 246:         bind(VolumeGeneralModel.class).in(Singleton.class);
Line 247:         bind(VolumeBrickListModel.class).in(Singleton.class);
Line 248:         bind(VolumeParameterListModel.class).in(Singleton.class);
Line 249:         bind(VolumeEventListModel.class).in(Singleton.class);
Line 250:         bind(new TypeLiteral<PermissionListModel<VolumeListModel>>() {
Hm, personally I'd prefer to avoid formatting GIN TypeLiteral bindings as it 
makes code less readable (unnecessary split over next line), what do you think?
Line 251:         }).in(Singleton.class);
Line 252:         
bind(GlusterVolumeSnapshotListModel.class).in(Singleton.class);
Line 253: 
Line 254:         // Form Detail Models


http://gerrit.ovirt.org/#/c/35082/11/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/GlusterVolumeSnapshotCreatePopupView.java
File 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/GlusterVolumeSnapshotCreatePopupView.java:

Line 72:     TextArea forceWarningLabel;
Line 73: 
Line 74:     ApplicationMessages messages;
Line 75:     ApplicationConstants constants;
Line 76:     CommonApplicationTemplates templates;
Can we make above fields private and final?
Line 77: 
Line 78:     private final Driver driver = GWT.create(Driver.class);
Line 79: 
Line 80:     @Inject


Line 118:         driver.edit(object);
Line 119: 
Line 120:         
forceWarningLabel.setVisible(object.getForceCreate().getEntity());
Line 121: 
Line 122:         
object.getForceCreate().getEntityChangedEvent().addListener(new 
IEventListener<EventArgs>() {
View.edit(model) should not add new listeners to model object.

This should be the responsibility of associated presenter - for example, in 
GlusterVolumeSnapshotCreatePopupPresenterWidget:

 @Override
 public void init(final GlusterVolumeSnapshotModel model) {
   super.init(model);
   model.getForceCreate().getEntityChangedEvent().addListener(...);
 }

View.edit() is responsible for populating UI from model data and can be 
potentially called multiple times. Model listener registration therefore 
doesn't belong here, but in AbstractModelBoundPopupPresenterWidget.init(model) 
method override.
Line 123:             @Override
Line 124:             public void eventRaised(Event<? extends EventArgs> ev, 
Object sender, EventArgs args) {
Line 125:                 
forceWarningLabel.setVisible(object.getForceCreate().getEntity());
Line 126:             }


http://gerrit.ovirt.org/#/c/35082/11/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/column/GlusterVolumeSnapshotStatusCell.java
File 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/column/GlusterVolumeSnapshotStatusCell.java:

Line 19:     ApplicationResources resources = 
ClientGinjectorProvider.getApplicationResources();
Line 20: 
Line 21:     ApplicationConstants constants = 
ClientGinjectorProvider.getApplicationConstants();
Line 22: 
Line 23:     ApplicationTemplates applicationTemplates = 
ClientGinjectorProvider.getApplicationTemplates();
Consider making above fields private, static and final.
Line 24: 
Line 25:     @Override
Line 26:     public void render(Context context, GlusterVolumeSnapshotEntity 
snapshot, SafeHtmlBuilder sb) {
Line 27:         // Nothing to render if no snapshot is provided:


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I823580ecb127e48e075c437668bfb19ff8ec4467
Gerrit-PatchSet: 11
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shubhendu Tripathi <shtri...@redhat.com>
Gerrit-Reviewer: Kanagaraj M <kmayi...@redhat.com>
Gerrit-Reviewer: Shubhendu Tripathi <shtri...@redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vsz...@redhat.com>
Gerrit-Reviewer: anmolbabu <anb...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to