Project

General

Profile

Actions

Refactor #21894

open

Simplify compute resource javascript

Added by Walden Raines over 6 years ago. Updated almost 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Web Interface
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

From Ori:

We have a js that reacts to selecting a template for the ovirt compute resource: https://github.com/theforeman/foreman/blob/develop/webpack/assets/javascripts/compute_resource/ovirt.js#L6

It is called from different places with different behavior:
- Virtual machine tab in Host form:
1) when the template is selected it updates the cores and memory fields and adds volumes
2) when an image is selected it disables the template field and selects the template that matches the image
3) when selecting a compute resource/profile
- Compute Profile - acts like case 1 of host

I need to check what happens when creating an image from the compute resource and selecting the template there.

This results in "ifs" in the template that tend to break on each change.

The other "fun" part is that adding volumes uses this js: https://github.com/theforeman/foreman/blob/develop/app/assets/javascripts/lookup_keys.js#L59
which has an "if" for lookup keys, lookup values and the rest.

This is not urgent but for me working mostly on lookup keys/values and ovirt it's a real pain point.

Actions #1

Updated by Walden Raines almost 6 years ago

  • Target version deleted (219)
Actions

Also available in: Atom PDF