Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixes react UI issues which prevented host creation and edit #337

Merged
merged 8 commits into from
Aug 1, 2024

Conversation

Manisha15
Copy link
Contributor

No description provided.

@Manisha15 Manisha15 force-pushed the fixup_proxmox_ui branch 2 times, most recently from eac6fb6 to 8ae891b Compare July 29, 2024 07:07
@@ -118,7 +118,7 @@ def dhcp?(nic_compute_attributes, v6 = false)
def set_mac(nic_compute_attributes, mac, type)
mac_attr_name = { 'qemu' => :macaddr, 'lxc' => :hwaddr }
mac_key = mac_attr_name[type] || 'mac'
nic_compute_attributes[mac_key] = Net::Validations.normalize_mac(mac)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method does more like only downcase the MAC address. See: https://github.com/theforeman/foreman/blob/develop/lib/net/validations.rb#L122

would it be better to 1) run normalize_mac and afterwards do a upcase (if promox requires the mac address to be upcase?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, created another PR for it

@@ -22,7 +22,7 @@ const GeneralTabContent = ({
required
type="number"
value={general?.vmid?.value}
disabled={fromProfile}
disabled={!newVm || fromProfile}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for better tracking, we should have own PRs to fix different issues and to have commit message what the purpose of the PR / commit is.

extra_attrs = ActiveSupport::HashWithIndifferentAccess.new
attributes.each do |key, value|
camel_key = key.to_s.include?('_') ? snake_to_camel(key.to_s).to_sym : key
nested_key = vms_keys.include?(key) ? key : "config_attributes[#{key}]"
nested_key = vms_keys.include?(key) ? "config_attributes[#{key}]" : key
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some attributes are part of config_attributes hash within vm_attrs hash and some are direct vm_attributes hash. This loop assign names to them accordingly.

@Manisha15 Manisha15 changed the title fix: fixes mac capitalize issue and react UI issues fix: fixes react UI issues which prevented host creation and edit Jul 30, 2024
@Manisha15 Manisha15 merged commit a40c106 into theforeman:master Aug 1, 2024
22 checks passed
@Manisha15 Manisha15 deleted the fixup_proxmox_ui branch August 1, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants