In the access and security tab, for adding new rules, required port field is not marked with an asterisk
Bug #1292165 reported by
mariam john
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
Low
|
Akihiro Motoki |
Bug Description
To recreate this, follow the link: Projects -> Access and Security -> Edit Rules (on any security group that has been created). The Port field is a required field but doesnt contain the asterisk symbol. I have attached a screen shot. Thank you.
Changed in horizon: | |
assignee: | nobody → Cristian Fiorentino (cristian-fiorentino) |
Changed in horizon: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in horizon: | |
assignee: | Cristian Fiorentino (cristian-fiorentino) → nobody |
Changed in horizon: | |
assignee: | nobody → mariam john (mariamj) |
Changed in horizon: | |
assignee: | mariam john (mariamj) → Swati Shukla (swati-shukla1) |
status: | Confirmed → In Progress |
summary: |
- In the access and security tab, for adding new rules, reuired port field - is not marked with an asterisk + In the access and security tab, for adding new rules, required port + field is not marked with an asterisk |
Changed in horizon: | |
milestone: | none → kilo-rc1 |
Changed in horizon: | |
milestone: | kilo-rc1 → liberty-1 |
milestone: | liberty-1 → next |
Changed in horizon: | |
assignee: | Swati Sharma (swati-shukla1) → vaibhav (vaibhav-j10) |
Changed in horizon: | |
assignee: | vaibhav (vaibhav-j10) → nobody |
Changed in horizon: | |
assignee: | nobody → vaibhav (vaibhav-j10) |
Changed in horizon: | |
assignee: | vaibhav (vaibhav-j10) → srikanth (k1039485) |
Changed in horizon: | |
assignee: | srikanth (k1039485) → nobody |
Changed in horizon: | |
milestone: | next → rocky-1 |
To post a comment you must log in.
Having analyzed the issue, the problem is a little more complex and impacts not only the "Port" field but others in this form and in other Horizon forms.
Taking into account the Edit/Add Rules form, if 'Port Range' is selected in "Open Port" choice (instead of 'Port'), the missing asterisk is still missing in "From Port" and "To Port" fields.
Asterisks are painted making use of the CSS class for fields set as "required", as described in: /review. openstack. org/#/c/ 44091/
https:/
Setting the fields as "required" in this case is not straightforward, given that some logic is required: if 'Port' is selected in "Open Port" choice only the "Port" field needs to be selected as "required"; on the other hand if 'Port Range' is selected "From Port" and "To Port" fields need to be set as required, but not the "Port" field.
But the previous fields switching is implemented in Horizon using the swithchable-fields approach as described in the following link, and as I could see this aproach may only manage hiding/unhiding the fields: http:// docs.openstack. org/developer/ horizon/ ref/forms. html#switchable -fields.
Besides the missing asterisk, required fields are properly validated using the Django "cleaning" mechanism, but this mechanism is activated once the Form is submitted (in this case after "Add" button is pressed): https:/ /docs.djangopro ject.com/ en/dev/ ref/forms/ validation/
I have tried an approach to fix this managing self.fields[ 'field_ name'] in the __init__ function, but this is probably a hack and would replicate some behavior already implemented in the "Cleaning" mechanism.
I would appreciate any comments on the recommended approach for handling this case, as it seems deeper modification should be applied here (i.e. to modify the swithchable-fields approach for switching among required fields). Thanks.