base_editing_bootstrap 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +11 -4
- data/app/views/base_editing/_editing_form_help_text.html.erb +16 -0
- data/app/views/base_editing/_form_field.html.erb +1 -0
- data/base_editing_bootstrap.gemspec +1 -1
- data/lib/base_editing_bootstrap/VERSION +1 -1
- data/lib/generators/base_editing_bootstrap/install/templates/initializer.rb +2 -2
- data/spec/support/external_shared/base_editing_controller_helpers.rb +7 -1
- metadata +5 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 8b84e9dad4cfafc627cd9615c427fe7668ebb638b80e2196e55fd16c4afcc33c
         | 
| 4 | 
            +
              data.tar.gz: a1bb90eb4aebe3fe952a41a384ba50d177db408f85a2884376fa06ab9f43f6f6
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: bbc195a2a2cdfbcb9ec6a42648d7f8a88f4643cee5260e038faaef90f3ee8a734f9c836b07f94b58717e6cc893520a4921bfc013d7b4db2435e3c7dd96055181
         | 
| 7 | 
            +
              data.tar.gz: 2b8c5a420ad067f2bdb43ee57df81ad5dd8e9b734a59274d9db2b44373c12d02706de0e80cad0b6723d40fda54ff4900a6eb758c192372517f5494ab7abe27c3
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -2,6 +2,24 @@ | |
| 2 2 | 
             
            All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
         | 
| 3 3 |  | 
| 4 4 | 
             
            - - -
         | 
| 5 | 
            +
            ## 0.13.0 - 2024-10-02
         | 
| 6 | 
            +
            #### Bug Fixes
         | 
| 7 | 
            +
            - Correct generator - (c3a5e60) - Marino Bonetti
         | 
| 8 | 
            +
            #### Features
         | 
| 9 | 
            +
            - Rails Matrix versions (#4) - (1deaa4e) - Marino Bonetti
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            - - -
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            ## 0.12.0 - 2024-10-01
         | 
| 14 | 
            +
            #### Documentation
         | 
| 15 | 
            +
            - Update documentation - (e49af20) - Marino Bonetti
         | 
| 16 | 
            +
            #### Features
         | 
| 17 | 
            +
            - Add Rendering of HelpText - (35ceb69) - Marino Bonetti
         | 
| 18 | 
            +
            #### Miscellaneous Chores
         | 
| 19 | 
            +
            - Fix Ask for otp - (0f4e66b) - Marino Bonetti
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            - - -
         | 
| 22 | 
            +
             | 
| 5 23 | 
             
            ## 0.11.0 - 2024-09-05
         | 
| 6 24 | 
             
            #### Features
         | 
| 7 25 | 
             
            - Add clear search button - (f989c17) - Marino Bonetti
         | 
    
        data/README.md
    CHANGED
    
    | @@ -117,10 +117,17 @@ Utilizzo per modello base, in questo esempio prendiamo come modello Post come es | |
| 117 117 | 
             
              end
         | 
| 118 118 |  | 
| 119 119 | 
             
              ```
         | 
| 120 | 
            -
            - [OPTIONAL]  | 
| 121 | 
            -
               | 
| 122 | 
            -
             | 
| 123 | 
            -
             | 
| 120 | 
            +
            - [OPTIONAL] FORM overrides:
         | 
| 121 | 
            +
              - nel caso si volesse fare override dei campi della form chiamare il generatore:
         | 
| 122 | 
            +
                ```shell
         | 
| 123 | 
            +
                rails g base_editing_bootstrap:field_override ModelName field1 field2:type
         | 
| 124 | 
            +
                ```
         | 
| 125 | 
            +
              - è possibile customizzare 
         | 
| 126 | 
            +
                - un text help per ogni campo andando ad aggiungere nelle traduzioni la relativa 
         | 
| 127 | 
            +
                  traduzione nella posizione: `it.activerecord.attributes.MODEL.FIELD/help_text`
         | 
| 128 | 
            +
                - un blocco per l'unità di misura accanto al campo aggiungendo alle traduzioni: 
         | 
| 129 | 
            +
                  `it.activerecord.attributes.MODEL.FIELD/unit`
         | 
| 130 | 
            +
                  
         | 
| 124 131 | 
             
            - [OPTIONAL] la medesima cosa è possibile fare con il rendering dei campi
         | 
| 125 132 | 
             
              delle celle della tabella
         | 
| 126 133 | 
             
              ```shell
         | 
| @@ -0,0 +1,16 @@ | |
| 1 | 
            +
            <%
         | 
| 2 | 
            +
              # LOCALS disponibili per rendering del testo dell'help del campo se presente
         | 
| 3 | 
            +
              # nelle traduzioni in field/help_text
         | 
| 4 | 
            +
              # object: classe active_model che mi serve per cercare l'help text
         | 
| 5 | 
            +
              # field: campo per cui stampare l'help
         | 
| 6 | 
            +
            %>
         | 
| 7 | 
            +
            <%# locals: (object:,field:) -%>
         | 
| 8 | 
            +
            <%
         | 
| 9 | 
            +
              help_text = object.class.human_attribute_name("#{field}/help_text", default: "")
         | 
| 10 | 
            +
              unless help_text.blank?
         | 
| 11 | 
            +
            %>
         | 
| 12 | 
            +
              <div class="form-text"><%= help_text %></div>
         | 
| 13 | 
            +
            <%
         | 
| 14 | 
            +
              end
         | 
| 15 | 
            +
            %>
         | 
| 16 | 
            +
             | 
| @@ -38,7 +38,7 @@ Gem::Specification.new do |spec| | |
| 38 38 | 
             
              spec.add_dependency 'kaminari', ['~> 1.2', '>= 1.2.2']
         | 
| 39 39 | 
             
              spec.add_dependency 'kaminari-i18n', '~> 0.5'
         | 
| 40 40 |  | 
| 41 | 
            -
              spec.add_development_dependency "rspec-rails", '~>  | 
| 41 | 
            +
              spec.add_development_dependency "rspec-rails", '~> 7.0'
         | 
| 42 42 | 
             
              spec.add_development_dependency "factory_bot_rails", '~> 6.4'
         | 
| 43 43 | 
             
              spec.add_development_dependency 'faker', '~> 3.3'
         | 
| 44 44 | 
             
              spec.add_development_dependency "puma", '~> 6.4'
         | 
| @@ -1 +1 @@ | |
| 1 | 
            -
            0. | 
| 1 | 
            +
            0.13.0
         | 
| @@ -11,12 +11,12 @@ BaseEditingBootstrap.configure do |config| | |
| 11 11 | 
             
              # Configurazione per alterare lo standard di azione post aggiornamento record
         | 
| 12 12 | 
             
              # il default è andare nella pagina di editing del record
         | 
| 13 13 | 
             
              # possibili valori :edit , :index
         | 
| 14 | 
            -
              # config. | 
| 14 | 
            +
              # config.after_success_update_redirect = :edit
         | 
| 15 15 |  | 
| 16 16 | 
             
              ##
         | 
| 17 17 | 
             
              # Configurazione per alterare lo standard di azione post creazione record
         | 
| 18 18 | 
             
              # il default è andare nella pagina di editing del record
         | 
| 19 19 | 
             
              # possibili valori :edit , :index
         | 
| 20 | 
            -
              # config. | 
| 20 | 
            +
              # config.after_success_create_redirect = :edit
         | 
| 21 21 |  | 
| 22 22 | 
             
            end
         | 
| @@ -190,7 +190,13 @@ default_unathorized_failure = -> { raise "TODO - passare proc con richiesta che | |
| 190 190 |  | 
| 191 191 | 
             
            RSpec.shared_examples "fail with unauthorized" do |request: default_unathorized_failure|
         | 
| 192 192 | 
             
              it "is expected to redirect to root" do
         | 
| 193 | 
            -
             | 
| 193 | 
            +
             | 
| 194 | 
            +
                if Gem::Version.create( Pundit::VERSION) < Gem::Version.create('2.3.2')
         | 
| 195 | 
            +
                  allow(Pundit).to receive(:authorize).with(user, any_args).and_raise(Pundit::NotAuthorizedError)
         | 
| 196 | 
            +
                else
         | 
| 197 | 
            +
                  allow_any_instance_of(Pundit::Context).to receive(:authorize).and_raise(Pundit::NotAuthorizedError)
         | 
| 198 | 
            +
                end
         | 
| 199 | 
            +
             | 
| 194 200 | 
             
                instance_exec(&request)
         | 
| 195 201 | 
             
                expect(response).to redirect_to(root_path)
         | 
| 196 202 | 
             
                expect(flash[:error]).not_to be_nil
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: base_editing_bootstrap
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.13.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Marino Bonetti
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2024- | 
| 11 | 
            +
            date: 2024-10-02 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         | 
| @@ -110,14 +110,14 @@ dependencies: | |
| 110 110 | 
             
                requirements:
         | 
| 111 111 | 
             
                - - "~>"
         | 
| 112 112 | 
             
                  - !ruby/object:Gem::Version
         | 
| 113 | 
            -
                    version: ' | 
| 113 | 
            +
                    version: '7.0'
         | 
| 114 114 | 
             
              type: :development
         | 
| 115 115 | 
             
              prerelease: false
         | 
| 116 116 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 117 117 | 
             
                requirements:
         | 
| 118 118 | 
             
                - - "~>"
         | 
| 119 119 | 
             
                  - !ruby/object:Gem::Version
         | 
| 120 | 
            -
                    version: ' | 
| 120 | 
            +
                    version: '7.0'
         | 
| 121 121 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 122 122 | 
             
              name: factory_bot_rails
         | 
| 123 123 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -312,6 +312,7 @@ files: | |
| 312 312 | 
             
            - app/policies/base_model_policy.rb
         | 
| 313 313 | 
             
            - app/views/.keep
         | 
| 314 314 | 
             
            - app/views/base_editing/_edit_page_title_header.html.erb
         | 
| 315 | 
            +
            - app/views/base_editing/_editing_form_help_text.html.erb
         | 
| 315 316 | 
             
            - app/views/base_editing/_editing_form_measure_unit.html.erb
         | 
| 316 317 | 
             
            - app/views/base_editing/_form.html.erb
         | 
| 317 318 | 
             
            - app/views/base_editing/_form_field.html.erb
         |