Skip to content

Changed form validation to support Bootstrap 4.0.0.beta#345

Closed
CyberDeck wants to merge 19 commits intobootstrap-ruby:bootstrap-v4from
CyberDeck:bootstrap-v4
Closed

Changed form validation to support Bootstrap 4.0.0.beta#345
CyberDeck wants to merge 19 commits intobootstrap-ruby:bootstrap-v4from
CyberDeck:bootstrap-v4

Conversation

@CyberDeck
Copy link
Copy Markdown
Contributor

Bugfix:

  • form-control-danger is replaced with is-invalid for Bootstrap 4.0.0.beta
  • form-control-feedback is replaced with invalid-feedback for Bootstrap 4.0.0.beta
  • help texts are rendered with tag instead of tag, i.e. like in Bootstrap 4.0.0.beta

Features:

  • is-valid will be applied to validated form field (i.e. not on unchanged or new records)

desheikh and others added 11 commits February 15, 2017 14:44
)

* Support :prepend and :append for the `select` helper
Fixes bootstrap-ruby#147

* Bootstrap 4 has renamed `control-label` to `form-control-label`
  - form-control-danger is replaced with is-invalid for Bootstrap 4.0.0.beta
  - form-control-feedback is replaced with invalid-feedback for Bootstrap 4.0.0.beta
  - help texts are rendered with <small> tag instead of <span> tag, i.e. like in Bootstrap 4.0.0.beta

Features:
  - is-valid will be applied to validated form field (i.e. not on unchanged or new records)
@CyberDeck
Copy link
Copy Markdown
Contributor Author

Any ideas how I can get the Travis CI build tests passed?
If you look through the failures (sometime indention, sometimes a

wrap around a hidden field) I have really no clue how to tackle the problem...

And yeah, locally it runs all tests fine (TM).

Btw, my PR includes the changes from #340.

Comment thread test/bootstrap_checkbox_test.rb Outdated
test 'collection_check_boxes renders the form_group correctly' do
collection = [Address.new(id: 1, street: 'Foobar')]
expected = %{<input id="user_misc" multiple="multiple" name="user[misc][]" type="hidden" value="" /><div class="form-group"><label class="form-control-label" for="user_misc">This is a checkbox collection</label><div class="form-check"><label class="form-check-label" for="user_misc_1"><input class="form-check-input" id="user_misc_1" name="user[misc][]" type="checkbox" value="1" /> Foobar</label></div><span class="form-text text-muted">With a help!</span></div>}
expected = %{<input id="user_misc" multiple="multiple" name="user[misc][]" type="hidden" value="" /><div class="form-group"><label class="form-control-label" for="user_misc">This is a checkbox collection</label><div class="form-check"><label class="form-check-label" for="user_misc_1"><input class="form-check-input" id="user_misc_1" name="user[misc][]" type="checkbox" value="1" /> Foobar</label></div><small class="form-text text-muted">With a help!</span></div>}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here an a number of other places you changed the <span> to a <small>, but the closing tag is still a </span>. I doubt that's causing your Travis problem, but it's worth noting.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I fixed these issues with commit 6085f8c.
However, I needed to change more in test/test_helper.rb to get "rake test" for all versions working. Probably the branch bootstrap-v4 should include latest changes from "master" to resolve all Travis test issues?!

@CyberDeck
Copy link
Copy Markdown
Contributor Author

After merging current head of master, all checks are passed successfully. However, I am unsure about my changes to the test/test_helper.rb file... Do they make sense for you?

@CyberDeck CyberDeck closed this Sep 20, 2017
@CyberDeck CyberDeck reopened this Sep 20, 2017
@kirkelifson
Copy link
Copy Markdown

Can this be merged into bootstrap-v4? :)

@kylefox
Copy link
Copy Markdown

kylefox commented Oct 19, 2017

Would be awesome to have this merged 👍

@kylefox
Copy link
Copy Markdown

kylefox commented Oct 19, 2017

I found a bug where forms for new records may appear as "validated" by default (details). Not sure where the best place to report it is...

@donv
Copy link
Copy Markdown
Collaborator

donv commented Nov 9, 2017

How is this looking now?

@desheikh desheikh added this to the 4.0.0 milestone Jan 8, 2018
@lcreid
Copy link
Copy Markdown
Contributor

lcreid commented Jan 9, 2018

Thanks for your contribution! As you may have read about in issue #361, we got a bit behind in merging PRs (please read that issue if you haven't yet). Sorry!

The master branch is now where we're working on Bootstrap 4 support. I've been told that the best thing to do is submit a new PR for these changes against master, and close this one (@mattbrictson, is that true?). However, if you know an easier way, by all means go ahead. Please note that a number of overlapping PRs had built up over the last six months, so some of this PR may have already been addressed by other PRs.

Apologies again for the delay in responding.

@mattbrictson
Copy link
Copy Markdown
Contributor

Yes, all things considered it might be easier to recreate this PR against master since rebasing and resolving the conflicts is a lot to deal with.

Are you still interested in getting the PR cleaned up and ready, @CyberDeck? We'd very much appreciate the help. Thanks, and again sorry for the slow response on our part!

@CyberDeck
Copy link
Copy Markdown
Contributor Author

Count me in. I will prepare a new PR against master. For the meantime, I will close this one.

@CyberDeck CyberDeck closed this Jan 10, 2018
CyberDeck added a commit to CyberDeck/rails-bootstrap-forms that referenced this pull request Jan 11, 2018
mattbrictson pushed a commit that referenced this pull request Jan 13, 2018
#370)

* New PR to replace PR #345

* Removed has_danger and form-control-label

* Removed 'is-valid'

* Removed wrong line from Changelog

* Update html help test with latest v4 help markup
lcreid pushed a commit to lcreid/rails-bootstrap-forms that referenced this pull request Jun 4, 2018
…strap-ruby#345) (bootstrap-ruby#370)

* New PR to replace PR bootstrap-ruby#345

* Removed has_danger and form-control-label

* Removed 'is-valid'

* Removed wrong line from Changelog

* Update html help test with latest v4 help markup
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.

7 participants