From 0b210404d8befe2deb21e5156d823edcc0724c96 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Tue, 11 Jul 2023 13:13:08 +0200 Subject: ogcp.js: fix images selector in "images" section Any operation inside "Images" view fails with error message 'missing "image-server" key'. Operations under images view section are loading image info and "delete image". Previously, a hidden checkbox entry was added to support multiple ogServer images entries. This hidden checkbox value holds the corresponding ogServer address of some image list. This hidden 'image-server' checkbox is checked or unchecked whenever some visible image from this server is checked in the list by the user. Commit 70eb7389bb5d introduces checkImageServer javascript function that mainly attaches an onchange event to each image checkbox so that checking or unchecking it updates the hidden 'image-server' checkboxes holding the ogserver address associated with each ogserver entry list. When loading "Images" view each configured ogServer entry is collapsed (thus each image checkbox is hidden). The current selector is ignoring hidden checkboxes and thus checkImageServer is unable to attach the necessary onchange event to each image checkbox. The hidden 'image-server' checkbox is always hidden and does not need attaching any onchange event. Fix selector by not ignoring hidden elements and omitting any checkbox with name 'image-server'. Fixes: 70eb7389bb5d ("Add ogServer parameter to imagesForm") --- ogcp/static/js/ogcp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ogcp') diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js index 61d828d..6473373 100644 --- a/ogcp/static/js/ogcp.js +++ b/ogcp/static/js/ogcp.js @@ -293,7 +293,7 @@ function RemovePartition(evt) { } function checkImageServer() { - const images = $('input:checkbox[form|="imagesForm"]:not(:hidden)') + const images = $('input:checkbox[form|="imagesForm"][name!="image-server"]') images.on('change', function() { const selectedServer = $('#' + $.escapeSelector(this.dataset.server)); -- cgit v1.2.3-18-g5258