Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bootstrap-ruby/bootstrap_form
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: bootstrap-ruby/bootstrap_form
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bootstrap-5
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 15 commits
  • 47 files changed
  • 7 contributors

Commits on Jun 19, 2020

  1. Start README for Bootstrap 5

    lcreid committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    cb4255d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ef3d030 View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2020

  1. Preliminary support for Bootstrap 5 (#567)

    * Switch demo bootstrap JS include URL
    
    * Remove "custom-control" support from radios and check boxes
    
    In 5.0 they are consolidated into the .form-check class, and no longer
    need to be treated as separate cases. Relevant tests will be fixed or
    removed in the next commit.
    
    * Remove "custom-control" tests for radios and check boxes
    
    * Rename ".custom-file" to ".form-file"
    
    * Change all ".form-group" uses to ".mb-3"
    
    Bootstrap 5 is now recommending using bottom margin utilities to
    control group spacing, and has removed ".form-group" entirely.
    
    * Replace ".form-row" with gutter utils (".g-3")
    
    Some methods in FormGroup were refactored to meet a RuboCop lint
    complexity requirement. I don't personally think the refactor is
    necessary but it won't pass CI without it.
    
    * Replace ".form-inline" where necessary
    
    Bootstrap 5 removes ".form-inline" in favor of the usage of ".col-auto"
    and the new gutter utilities.
    
    * Remove wrapper divs for elements prepended/appended to input groups
    
    Bootstrap 5 removes ".input-group-prepend" and ".input-group-append",
    they are no longer necessary. You can now add buttons and
    ".input-group-text" as direct children of the input groups.
    
    * Add ".form-label" to all generated label tags
    
    * Fix broken tests after label class change
    
    * Fix switch style check boxes
    
    My heavy-handedness with the previous commits removed the ability to use
    switch style checkboxes when I removed the custom check box classes.
    
    * Update switch checkbox syntax in README.md
    
    * Add anchors for stricter #classes_include_gutters?
    
    * Handle string or array of classes for check boxes and radio buttons
    
    The Rails view helpers that accept a `class` option accept both single
    strings and arrays of strings, so this change makes the CSS class array
    builder agnostic to the input type.
    
    I'm now also noticing that the result already had `#flatten` called on
    it, so this probably wasn't an issue, but this is nicer!
    
    * Use only form-check-label class for check box and radio button labels
    
    Thanks to @thimo for catching this one.
    
    * Change select box class from "form-control" to "form-select"
    
    This required some extra effort because all the select forms inherited
    their control class from the base input class.
    taylorthurlow authored Jun 21, 2020
    Configuration menu
    Copy the full SHA
    c2039e0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9ade720 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2020

  1. Remove role="form" (#571)

    lcreid authored Jun 27, 2020
    Configuration menu
    Copy the full SHA
    2828cd9 View commit details
    Browse the repository at this point in the history

Commits on Jan 13, 2021

  1. Configuration menu
    Copy the full SHA
    69eddc0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2a63f20 View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2021

  1. Fix tests in bootstrap-5 branch. Fixes #582 (#583)

    * Fix tests for Rails updates
    
    * Fix Rubocop offenses
    
    Dangerfile:48:3: C: [Correctable] Style/SoleNestedConditional: Consider merging nested conditions into outer if conditions.
      if IO.read("CHANGELOG.md").scan(/^\s*[-\*] Your contribution here/i).count < 3
      ^^
    Dangerfile:48:42: C: [Correctable] Style/RedundantRegexpEscape: Redundant escape inside regexp literal
      if IO.read("CHANGELOG.md").scan(/^\s*[-\*] Your contribution here/i).count < 3
                                             ^^
    bootstrap_form.gemspec:27:3: W: Lint/ConstantDefinitionInBlock: Do not define constants this way within a block. (https://rubystyle.guide#no-constant-definition-in-block)
      REQUIRED_RAILS_VERSION = ">= 5.2".freeze
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    demo/config/puma.rb:7:21: C: [Correctable] Style/RedundantFetchBlock: Use fetch("RAILS_MAX_THREADS", 5) instead of fetch("RAILS_MAX_THREADS") { 5 }. (https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code)
    threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    demo/config/puma.rb:12:17: C: [Correctable] Style/RedundantFetchBlock: Use fetch("PORT", 3000) instead of fetch("PORT") { 3000 }. (https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code)
    port        ENV.fetch("PORT") { 3000 }
                    ^^^^^^^^^^^^^^^^^^^^^^
    lib/bootstrap_form.rb:5:11: C: [Correctable] Style/StringConcatenation: Prefer string interpolation to string concatenation. (https://rubystyle.guide#string-interpolation)
      require Gem::Specification.find_by_name("actiontext").gem_dir + ...
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    lib/bootstrap_form/components/validation.rb:17:22: C: [Correctable] Style/ClassEqualityComparison: Use instance_of?(Class) instead of comparing classes. (https://rubystyle.guide#instance-of-vs-class-comparison)
            target = obj.class == Class ? obj : obj.class
                         ^^^^^^^^^^^^^^
    lib/bootstrap_form/form_builder.rb:48:5: W: [Correctable] Lint/RedundantCopDisableDirective: Unnecessary disabling of Metrics/AbcSize.
        # rubocop:disable Metrics/AbcSize
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    lib/bootstrap_form/form_group_builder.rb:24:9: C: [Correctable] Style/ExplicitBlockArgument: Consider using explicit block argument in the surrounding method's signature over yield. (https://rubystyle.guide#block-argument)
            form_group(method, form_group_options) { yield }
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    lib/bootstrap_form/form_group_builder.rb:32:59: C: [Correctable] Style/SoleNestedConditional: Consider merging nested conditions into outer unless conditions.
            options[:required] = form_group_required(options) if options.key?(:skip_required)
                                                              ^^
    lib/bootstrap_form/form_group_builder.rb:60:7: C: [Correctable] Style/RedundantAssignment: Redundant assignment before returning detected.
          hash = { ...
          ^^^^^^^^
    lib/bootstrap_form/helpers/bootstrap.rb:25:44: W: [Correctable] Lint/RedundantCopDisableDirective: Unnecessary disabling of Metrics/AbcSize.
          def alert_message(title, options={}) # rubocop:disable Metrics/AbcSize
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    test/test_helper.rb:7:18: C: [Correctable] Style/RedundantFileExtensionInRequire: Redundant .rb file extension detected. (https://rubystyle.guide#no-explicit-rb-to-require)
    require_relative "../demo/config/environment.rb"
    
    * Update CHANGELOG
    
    * Add gemfile for Rails 6.1
    
    * Run Travis against latest Ruby versions
    
    * Update tests to both handle Rails 5.2/6 and Rails 6.1
    
    * Step down 1 minor version for Ruby as Travis is not yet ready
    
    * Update changelog
    thimo authored Apr 10, 2021
    Configuration menu
    Copy the full SHA
    0ddfa0c View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2021

  1. Support Bootstrap 5 floating labels. Fixes #573 (#584)

    * Support floating labels
    
    * Add tests for floating labels
    
    * Update demo app with floating labels section
    
    * Add floating labels to CHANGELOG
    
    * Describe floating labels in README
    
    * Fix rubop offense for block length
    
    lib/bootstrap_form/inputs/base.rb:8:7: C: Metrics/BlockLength: Block has too many lines. [26/25]
          class_methods do ...
          ^^^^^^^^^^^^^^^^
    
    * Fix capitalization
    
    * Use <<~ instead of strip_heredoc
    thimo authored Apr 11, 2021
    Configuration menu
    Copy the full SHA
    b0b86ab View commit details
    Browse the repository at this point in the history
  2. Simplify rendering of file_field for Bootstrap 5. Fixes #572 (#581)

    * Use Bootstrap 5 beta 3 CDN libraries in demo app
    
    Links to both CSS and JS libraries taken from https://getbootstrap.com/docs/5.0/getting-started/introduction/
    
    * Remove linking ../images
    
    Folder doesn’t exist and causes the error "ActionView::Template::Error (link_tree argument must be a directory)"
    
    * Cleanup generated HTML for file upload  as per Bootstrap 5
    
    See #572
    
    * Update tests for new file upload rendering
    
    * Add changelog entry
    
    * Fix Rubocop offense on whitespace
    
    lib/bootstrap_form/inputs/file_field.rb:10:52: C: [Correctable] Layout/SpaceAroundEqualsInParameterDefault: Surrounding space detected in default value assignment. (https://rubystyle.guide#spaces-around-equals)
            def file_field_with_bootstrap(name, options = {})
                                                       ^^^
    
    Co-authored-by: Larry Reid <lcreid@jadesystems.ca>
    thimo and lcreid authored Apr 11, 2021
    Configuration menu
    Copy the full SHA
    b0e53cd View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2021

  1. Get rid of heredoc on bootstrap-5 branch (#591)

    * Ignore RubyMine config directory
    
    * Initial setup of GitHb Actions
    
    * Run tests for rails 5 and rails 6
    
    * Run tests for rails 5 and rails 6 + run lint job
    
    * GH Actions: Correct gemfile names
    
    * GH Actions: Only run the test task in the matrix.  rubocop is run in the separate Lint job.
    
    * GH Actions: Separate the Danger run for better output
    
    * GH Actions: Run rubocop directly instead of as a Rake task.  Allow autocorrectable offences.
    
    * GH Actions: Only run Danger for pull requests
    
    * GH Actions: Try to calm RuboCop
    
    * Use the default Gemfile to pick up rubocop.yml
    
    * GH Actions: Ignore the vendor directory for rubocop
    
    * Forward the options as keyword arguments
    
    * Test Rails 6.1 and skip Rails 5.2 + Ruby 3.0
    
    * Fix Rails 6.1 tests on master (#586)
    
    * Fix tests for Rails 6.1
    
    * Fix Rubocop offenses
    
    bootstrap_form.gemspec:27:29: C: Gemspec/RequiredRubyVersion: required_ruby_version (2.5, declared in bootstrap_form.gemspec) and TargetRubyVersion (2.7, which may be specified in .rubocop.yml) should be equal.
      s.required_ruby_version = ">= 2.5"
                                ^^^^^^^^
    lib/bootstrap_form/form_group.rb:14:30: C: [Correctable] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line. (https://rubystyle.guide#no-double-indent)
                                 :input_group_class, :label_col, :control_col,
                                 ^^^^^^^^^^^^^^^^^^
    lib/bootstrap_form/form_group.rb:15:30: C: [Correctable] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line. (https://rubystyle.guide#no-double-indent)
                                 :add_control_col_class, :layout, :prepend)) do
                                 ^^^^^^^^^^^^^^^^^^^^^^
    test/bootstrap_form_test.rb:123:103: C: [Correctable] Style/IfUnlessModifier: Modifier form of if makes the line too long. (https://rubystyle.guide#if-as-a-modifier)
            <form accept-charset="UTF-8" action="/users" method="post" role="form" #{'data-remote="true"' if ::Rails::VERSION::STRING < "6.1"}>
                                                                                                          ^^
    test/bootstrap_form_test.rb:123:133: C: [Correctable] Style/StringLiteralsInInterpolation: Prefer single-quoted strings inside interpolations.
            <form accept-charset="UTF-8" action="/users" method="post" role="form" #{'data-remote="true"' if ::Rails::VERSION::STRING < "6.1"}>
                                                                                                                                        ^^^^^
    test/bootstrap_rich_text_area_test.rb:23:54: C: [Correctable] Style/StringLiteralsInInterpolation: Prefer single-quoted strings inside interpolations.
          "http://test.host/rails/active_storage/blobs/#{"redirect/" if ::Rails::VERSION::STRING >= "6.1"}:signed_id/:filename"
                                                         ^^^^^^^^^^^
    test/bootstrap_rich_text_area_test.rb:23:97: C: [Correctable] Style/StringLiteralsInInterpolation: Prefer single-quoted strings inside interpolations.
          "http://test.host/rails/active_storage/blobs/#{"redirect/" if ::Rails::VERSION::STRING >= "6.1"}:signed_id/:filename"
                                                                                                    ^^^^^
    
    * Include Rails 6.1 in Travis tests + update Ruby versions
    
    * Update CHANGELOG
    
    * Rails Edge requires Ruby 2.7+
    
    * Remove rubocop_todo and fix Rubocop offenses
    
    * Replace strip_heredoc with <<~ (#587)
    
    * Replace strip_heredoc with <<~
    
    Also fix newly detected Rubocop offenses on indentation
    
    * Update CHANGELOG
    
    * Simplify Dockerfile and add documentation (#588)
    
    * Simplify Dockerfile and add documentation
    
    * A few more additions to .gitignore
    
    * Ignore gems placed when using Dockerfile (#590)
    
    * Fix formatting and heredoc
    
    * Fix bad merge
    
    Co-authored-by: Uwe Kubosch <uwe@kubosch.no>
    Co-authored-by: Uwe Kubosch <donv@users.noreply.github.com>
    Co-authored-by: Thimo Jansen <thimo@defrog.nl>
    4 people authored Apr 16, 2021
    Configuration menu
    Copy the full SHA
    46d9b5b View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2021

  1. Cherry pick some commits from main (#594)

    * Change default branch to `main` (#592)
    
    * Change default branch to `main`
    
    * Add GitHub token for Danger
    
    * Change default branch to `main` (#592)
    
    * Change default branch to `main`
    
    * Add GitHub token for Danger
    
    * Fix deprecation that I broke again
    lcreid authored Apr 21, 2021
    Configuration menu
    Copy the full SHA
    efbdff8 View commit details
    Browse the repository at this point in the history

Commits on May 5, 2021

  1. Errors on invalid feedback (#580)

    * Use "invalid-feedback" class name for errors_on
    
    * Add custom class option for errors_on helper
    
    * Improve tests, docs and changelog
    
    Co-authored-by: Larry Reid <lcreid@jadesystems.ca>
    cseelus and lcreid authored May 5, 2021
    Configuration menu
    Copy the full SHA
    e3d03df View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2021

  1. README: Use GH Actions badge, drop Travis badge, configuration file (#…

    …600)
    
    * README: Use GH Actions badge, drop Travis badge
    
    * Delete unused TravisCI configuration file
    olleolleolle authored and lcreid committed Aug 24, 2021
    Configuration menu
    Copy the full SHA
    dd64827 View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2021

  1. Configuration menu
    Copy the full SHA
    80265fa View commit details
    Browse the repository at this point in the history
Loading