Skip to content

Commit

Permalink
Update template dialog element (#137)
Browse files Browse the repository at this point in the history
+ Gaurd against case where nothing is selected
  + Drop down returns "[]"
+ Gaurd against case where a tag has not been created
  + This case is unlikely based on dialog element that is feeding it
  + Including defensive check in case new "nothing selected" return value is introduced
  • Loading branch information
A-Beck authored and itewk committed Jan 26, 2019
1 parent 2dbaab5 commit f63a3c2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def error(msg)

# invalid if no location tags selected
location_tags.delete("null")
location_tags.delete("[]")
if location_tags.empty?
invalid_selection = true
value << "Destination location(s) must be selected to determine valid destination providers."
Expand All @@ -80,7 +81,8 @@ def error(msg)
tag = $evm.vmdb(:classification).find_by_name(provider_tag_name)
$evm.log(:info, "provider_tag_name => '#{provider_tag_name}', tag => #{tag}") if @DEBUG
invalid_selection = true
value << "Could not find Provider with Tag <#{tag.parent.description}: #{tag.description}>"
value << "Could not find Provider with Tag <#{tag.parent.description}: #{tag.description}>" unless tag.blank?
value << "Invalid location Tag provided: <#{provider_tag_name}>" if tag.blank?
else
providers_by_tag[provider_tag_name] = tagged_providers
end
Expand Down

0 comments on commit f63a3c2

Please sign in to comment.