Admin > Create Image, Image File & Image Location not marked as required

Bug #1393727 reported by Rob Cresswell
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Unassigned

Bug Description

Admin > Images > Create Image

The Image Location or Image File fields are not marked, yet they are required fields for image creation.

This appears to be because the horizon.images.js is not applied to the Admin Create Images form.

Changed in horizon:
assignee: nobody → Rob Cresswell (robcresswell)
description: updated
Revision history for this message
Alan Fung (alanfung) wrote :

Hi Rob,

Are you referring to the missing "*" for "Image Location" and "Image File" to mark them as required? If so, I have a fix for this, please let me know if I can be assigned this bug.

Thank you.

Revision history for this message
Alan Fung (alanfung) wrote :

I've attached the suggested patch as mentioned in my last comment.

I believe "copy_from" and "image_file" are not previously marked as "required" in the "CreateImageForm" class due to it being conditional, i.e. exactly one of "copy_from" and "image_file" is required.

In the suggested patch, we re-implement "conditionally required" without working around setting "required" to "False". This is possibly an improvement because it does not compromise the benefits of having a field set as required.

Possibly an even better solution is to implement a "conditionally required" property for a form field, but that can be an overkill.

Revision history for this message
Rob Cresswell (robcresswell-deactivatedaccount) wrote :

I was actually curious as to why this patch (https://review.openstack.org/#/c/124712/) doesn't fix the issue. I was under the impression that admin inherited directly from project here, but it seems to be inconsistent, hence my comment about the .js file.

Revision history for this message
Alan Fung (alanfung) wrote :

Hi Rob,

Thanks for clarifying.

You are correct about the inconsistency issue between the following the templates:

/openstack_dashboard/dashboards/admin/images/templates/images/_create.html
/openstack_dashboard/dashboards/project/images/templates/images/_create.html

For the issue described here, we can change "ng_controller" for the element "#create_image_form" from "DummyCtrl" to "ImageFormCtrl".

This actually fixes the issue where the effect of https://bugs.launchpad.net/horizon/+bug/1324192 is not applied to the admin version as well.

I attached a patch as a suggestion. Perhaps an additional bug should be created to address the inconsistency between the two forms.

Revision history for this message
Rob Cresswell (robcresswell-deactivatedaccount) wrote :

https://bugs.launchpad.net/horizon/+bug/1395689

I'll push a patch in a few minutes and address both. Thanks for pointing it out.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/136744

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/136744
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=4ab0d6c16b733815d5e27b20a76e7b469cf666a2
Submitter: Jenkins
Branch: master

commit 4ab0d6c16b733815d5e27b20a76e7b469cf666a2
Author: Rob Cresswell <email address hidden>
Date: Mon Nov 24 03:50:34 2014 -0800

    Applies ImageFormCtrl to Admin > Images

    This patch fixes inconsistencies between Project > Images > Create Image
    and its Admin equivalent by applying the same JS to both. Specifically,
    it fixes missing asterisks and file format detection.

    Change-Id: I84f98dfcff6cd38161e23bbb60c3b4b8419240f8
    Closes-Bug: 1393727
    Closes-Bug: 1395689

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-3 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.