-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Conversation
eac6fb6
to
8ae891b
Compare
@@ -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) |
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
8ae891b
to
656c885
Compare
656c885
to
8623b5d
Compare
…d disable conditions.
8623b5d
to
2cc40d9
Compare
No description provided.