Jakub Niedermertl has posted comments on this change. Change subject: webadmin, userportal: Prevent blank template sub-templates - frontend ......................................................................
Patch Set 2: (3 comments) https://gerrit.ovirt.org/#/c/40500/2/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java: Line 196: List<VmTemplate> baseWithoutBlank = filterOutBlank(keepBaseTemplates(templates)); Line 197: Line 198: if (baseWithoutBlank.isEmpty()) { Line 199: // it is not allowed to create sub-templates of Blank template Line 200: getModel().getIsSubTemplate().setEntity(false); > this and the same on line 206 - you can move it outside of the if Done Line 201: getModel().getIsSubTemplate().setIsChangeable(false, Line 202: constants.someNonDefaultTemplateHasToExistFirst()); Line 203: return; Line 204: } Line 215: new Linq.TemplatePredicate(currentTemplate.getBaseTemplateId()))); Line 216: } Line 217: Line 218: private List<VmTemplate> filterOutBlank(List<VmTemplate> templates) { Line 219: final ArrayList<VmTemplate> result = new ArrayList<>(); > List<VmTemplate>... Done Line 220: for (VmTemplate template : templates) { Line 221: if (!template.isBlank()) { Line 222: result.add(template); Line 223: } https://gerrit.ovirt.org/#/c/40500/2/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UserPortalNewTemplateVmModelBehavior.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UserPortalNewTemplateVmModelBehavior.java: Line 87: dataCenterWithCluster.getCluster().getArchitecture()); Line 88: Line 89: if (filteredTemplates.isEmpty()) { Line 90: // it is not allowed to create sub-templates of Blank template Line 91: getModel().getIsSubTemplate().setEntity(false); > please extract the getModel().getIsSubTemplate().setEntity(false); from her Done Line 92: getModel().getIsSubTemplate().setIsChangeable(false, Line 93: constants.someNonDefaultTemplateHasToExistFirst()); Line 94: return; Line 95: } -- To view, visit https://gerrit.ovirt.org/40500 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6b35a0f1b79a22ad25a26bb57acf5f5c68cf79c6 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Jakub Niedermertl <jnied...@redhat.com> Gerrit-Reviewer: Jakub Niedermertl <jnied...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Tomas Jelinek <tjeli...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches