Lior Vernia has posted comments on this change. Change subject: webadmin: update "Edit network" flow with new mangement network logic ......................................................................
Patch Set 2: (5 comments) http://gerrit.ovirt.org/#/c/37026/2/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/EditNetworkModel.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/EditNetworkModel.java: Line 27 Line 28 Line 29 Line 30 Line 31 I'm not sure this should be removed, but maybe it can be. We need to discuss this. Line 52: Line 53: toggleProfilesAvailability(); Line 54: } Line 55: Line 56: private void initManagement() { This should run as part of syncWithBackend, which is triggered every time a different DC is chosen (because if the DC selection changes, the response could be different). Line 57: startProgress(null); Line 58: final AsyncQuery callback = new AsyncQuery(new INewAsyncCallback() { Line 59: @Override Line 60: public void onSuccess(Object model, Object returnValue) { Line 53: toggleProfilesAvailability(); Line 54: } Line 55: Line 56: private void initManagement() { Line 57: startProgress(null); This isn't required anymore, it'll be triggered automatically. However, if there's a chain of backend queries/actions, it might be better to startProgress() on the first one and stopProgress() on the last one (so the progress bar doesn't flicker). Line 58: final AsyncQuery callback = new AsyncQuery(new INewAsyncCallback() { Line 59: @Override Line 60: public void onSuccess(Object model, Object returnValue) { Line 61: management = (Boolean) returnValue; Line 58: final AsyncQuery callback = new AsyncQuery(new INewAsyncCallback() { Line 59: @Override Line 60: public void onSuccess(Object model, Object returnValue) { Line 61: management = (Boolean) returnValue; Line 62: stopProgress(); This neither, see last comment. Line 63: } Line 64: }); Line 65: AsyncDataProvider.getInstance().isManagementNetwork(callback, getNetwork().getId()); Line 66: } Line 117: getProfiles().setIsAvailable(getIsVmNetwork().getEntity() && !originallyVmNetwork); Line 118: } Line 119: Line 120: @Override Line 121: protected boolean isManagement() { This should reside wherever the warning popup code resides - either in NetworkModel, or the warning popup code should be moved here (see comment in NewNetworkModel). In my opinion, it's simplest to have this code in NetworkModel, as well as the management member, and have it initialized to false (or not initialized, which is the same) in NewNetworkModel. Line 122: return management; Line 123: } Line 124: -- To view, visit http://gerrit.ovirt.org/37026 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If53f73518214f9ac48affa4fba74750b047e25f9 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yevgeny Zaspitsky <yzasp...@redhat.com> Gerrit-Reviewer: Lior Vernia <lver...@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