Eldan Shachar has posted comments on this change. Change subject: userportal\webadmin: Editing of template version for stateless VMs and pools ......................................................................
Patch Set 3: (2 comments) http://gerrit.ovirt.org/#/c/36510/3/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java File frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java: Line 1644: Line 1645: object.getTemplateChanged().getEntityChangedEvent().addListener(new IEventListener<EventArgs>() { Line 1646: @Override Line 1647: public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { Line 1648: Boolean enabled = object.getTemplateChanged().getEntity(); > well, I don't understand the meaning of this part at all - why do you do al If a user edit a stateless VM and selects a different template-version then all edit options are disabled until the change is applied, that's because they now show the new template data which is not editable. if the user decides to change back to the original version then we need to re-enable all options, but not all options were enabled in the first place so we need to keep track of the original state. Line 1649: if (Boolean.TRUE.equals(enabled)) { Line 1650: tabsState = getAllTabsState(); Line 1651: disableAllTabs(); Line 1652: templateEditor.setEnabled(tabsState.get(templateEditor)); // if template editing was allowed -> keep it enabled http://gerrit.ovirt.org/#/c/36510/3/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingPoolModelBehavior.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingPoolModelBehavior.java: Line 93: } Line 94: updateRngDevice(template.getId()); Line 95: getModel().getCustomPropertySheet().deserialize(template.getCustomProperties()); Line 96: Line 97: if (!pool.getVmtGuid().equals(template.getId())) { > Why do you need different logic than for new pool? You should just normally it's based on the logic in NewPoolModelBehavior::template_SelectedItemChanged(), but new pool uses NewPoolInstanceTypeManager(getModel()) and existing pool uses ExistingPoolInstanceTypeManager(getModel(), pool) which is binded to the pool object and not just to the model. To avoid this it's possible to change the pool object which is sent to the manager but then we'll need to keep a copy of the old settings, or instead, edit ExistingPoolInstanceTypeManager to support this use case. Line 98: if (!templateVersionWasChanged) { Line 99: deactivateInstanceTypeManager(new InstanceTypeManager.ActivatedListener() { Line 100: @Override Line 101: public void activated() { -- To view, visit http://gerrit.ovirt.org/36510 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53686dae694f6ff826bdbeaada1e28fc55fd8d30 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Eldan Shachar <[email protected]> Gerrit-Reviewer: Arik Hadas <[email protected]> Gerrit-Reviewer: Eldan Shachar <[email protected]> Gerrit-Reviewer: Shahar Havivi <[email protected]> Gerrit-Reviewer: Tomas Jelinek <[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
