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

Fixes #16025 - Fix ERB & params to import subnets from proxy #3716

Closed
wants to merge 1 commit into from

Conversation

dLobatog
Copy link
Member

@dLobatog dLobatog commented Aug 9, 2016

Before this commit, the ERB would just throw a 500 because it tried to
show @subnet.name in a template for a @subnet that was still undefined.

Aside from that, the create_multiple method in the controller didn't
send the right call to filter the params, hence making it impossible to
create the imported subnets even with the ERB fix.

<% id = 'subnet_fields_' + subnet.network_address.gsub('/','_').gsub('.','_') %>
<div class="panel panel-default">
<div class="panel-heading" >
<a class="panel-title" data-toggle="collapse" data-parent='#accordion1' href="<%= '#'+id %>" data-original-title='review' rel='twipsy' >
Copy link
Contributor

Choose a reason for hiding this comment

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

data-original-title should probably be removed here too, it just shows an untranslated tooltip saying "review" and isn't very helpful!

@domcleal
Copy link
Contributor

Could you also add a functional test for the import action itself, to check the page renders without errors based on some mocked proxy response?

@@ -55,77 +55,117 @@ def test_destroy
assert !Subnet.exists?(subnet.id)
end

def test_freeip_fails_no_subnet
Copy link
Member Author

Choose a reason for hiding this comment

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

This is just makeup, nothing changed

@dLobatog
Copy link
Member Author

Fixed - basically I added two tests for the import action in the controller & added back the h2 warning. Thanks for reviewing @domcleal !

@@ -1,19 +1,20 @@
<% title _("Import IPv4 subnets") %>

<h2><%= _("The following IPv4 subnets have been found") %></h2>

<h2><%= _("The following IPv4 subnets have been found. Please review the details before creating them.") %></h2>
Copy link
Contributor

@domcleal domcleal Aug 15, 2016

Choose a reason for hiding this comment

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

Could you drop this to regular paragraph text, or perhaps try h3 etc? The text is very nearly the same size as the main title.

@dLobatog
Copy link
Member Author

Updated to decrease the font-size of the subtitle to h3 , also added col-md-8 so that the h3 tag is aligned with the title and the rest of the form

@@ -1,19 +1,20 @@
<% title _("Import IPv4 subnets") %>

<h2><%= _("The following IPv4 subnets have been found") %></h2>

<h4 class='col-md-8'><%= _("The following IPv4 subnets have been found. Please review the details before creating them.") %></h4>
Copy link
Contributor

Choose a reason for hiding this comment

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

The col-md-8 adds a float: left to this element which causes it to overlap:

selection_003

Before this commit, the ERB would just throw a 500 because it tried to
show @subnet.name in a template for a @subnet that was still undefined.

Aside from that, the create_multiple method in the controller didn't
send the right call to filter the params, hence making it impossible to
create the imported subnets even with the ERB fix.
@dLobatog
Copy link
Member Author

Updated to remove the col-md-8 - sorry, I was trying it with the web inspector and I guess I disabled something and didn't realize, so the col-md looked fine.

@domcleal
Copy link
Contributor

[test] due to failed slave.

@domcleal
Copy link
Contributor

[test]

@domcleal
Copy link
Contributor

Merged as 4622318, thanks @dLobatog.

@domcleal domcleal closed this Aug 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants