rollout-ui 0.5.0 → 0.5.2
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/lib/rollout/ui/version.rb +1 -1
- data/lib/rollout/ui/views/features/show.slim +3 -0
- data/lib/rollout/ui/web.rb +6 -1
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 6a421eaee6e20132c013892d216de0ea3edbccbed00b712fdb397ec038289d67
         | 
| 4 | 
            +
              data.tar.gz: f48cfbc156ffd4ee4a16bf66dd66ab509d8cc842790c952ca70f211860e6c9b3
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 77f2ed7614eeefe496a559c6eeca1fa88307ef208c3e6854bece0b1b40f1fb02b23da9c9488e941ed8e467e6c765dd65a8461c8dfca8ad24512e1bb1b8bbd874
         | 
| 7 | 
            +
              data.tar.gz: 3b382d382de581dcacfb45601e395916c538a85dc8ea316e711eaf40c92128d0cac4b6e83b5a1980f109f05442c9da38211c4b32ba8fa8791725d97b278918db
         | 
    
        data/lib/rollout/ui/version.rb
    CHANGED
    
    
| @@ -1,12 +1,15 @@ | |
| 1 1 | 
             
            a.text-sm.text-blue-600(href=index_path class='hover:text-blue-700 hover:underline')
         | 
| 2 2 | 
             
              ' ← back to overview
         | 
| 3 3 |  | 
| 4 | 
            +
            - if params[:error]
         | 
| 5 | 
            +
              pre.text-red-500= params[:error]
         | 
| 4 6 | 
             
            h2.font-semibold.text-xl.text-gray-500.pt-12
         | 
| 5 7 | 
             
              = @feature.name
         | 
| 6 8 |  | 
| 7 9 | 
             
            .w-8.h-1.bg-gray-300.my-10
         | 
| 8 10 | 
             
            main.p-6.bg-gray-100.max-w-lg.w-full.text-sm.rounded-sm
         | 
| 9 11 | 
             
              form#updateFormSubmit action=feature_path(@feature.name) method='POST'
         | 
| 12 | 
            +
                input type='hidden' name='last_updated_at' value=(@feature.data['updated_at'])
         | 
| 10 13 | 
             
                .mb-5
         | 
| 11 14 | 
             
                  label.block.text-gray-500.mb-2(for='description') Description
         | 
| 12 15 | 
             
                  input.appearance-none.border.rounded-sm.w-full.py-2.px-4.text-gray-600.leading-relaxed.bg-white(
         | 
    
        data/lib/rollout/ui/web.rb
    CHANGED
    
    | @@ -49,7 +49,10 @@ module Rollout::UI | |
| 49 49 | 
             
                post '/features/:feature_name' do
         | 
| 50 50 | 
             
                  rollout = config.get(:instance)
         | 
| 51 51 | 
             
                  actor = config.get(:actor, scope: self)
         | 
| 52 | 
            -
             | 
| 52 | 
            +
                  feature_data = rollout.get(params[:feature_name]).data
         | 
| 53 | 
            +
                  if feature_data['updated_at'] && params[:last_updated_at].to_s != feature_data['updated_at'].to_s
         | 
| 54 | 
            +
                    redirect "#{feature_path(params[:feature_name])}?error=Rollout version outdated. Review changes below and try again."
         | 
| 55 | 
            +
                  end
         | 
| 53 56 | 
             
                  with_rollout_context(rollout, actor: actor) do
         | 
| 54 57 | 
             
                    rollout.with_feature(params[:feature_name]) do |feature|
         | 
| 55 58 | 
             
                      feature.percentage = params[:percentage].to_f.clamp(0.0, 100.0)
         | 
| @@ -58,6 +61,7 @@ module Rollout::UI | |
| 58 61 | 
             
                        feature.users = params[:users].split(',').map(&:strip).uniq.sort
         | 
| 59 62 | 
             
                      end
         | 
| 60 63 | 
             
                      feature.data.update(description: params[:description])
         | 
| 64 | 
            +
                      feature.data.update(updated_at: Time.now.to_i)
         | 
| 61 65 | 
             
                    end
         | 
| 62 66 | 
             
                  end
         | 
| 63 67 |  | 
| @@ -71,6 +75,7 @@ module Rollout::UI | |
| 71 75 | 
             
                  with_rollout_context(rollout, actor: actor) do
         | 
| 72 76 | 
             
                    rollout.with_feature(params[:feature_name]) do |feature|
         | 
| 73 77 | 
             
                      feature.percentage = params[:percentage].to_f.clamp(0.0, 100.0)
         | 
| 78 | 
            +
                      feature.data.update(updated_at: Time.now.to_i)
         | 
| 74 79 | 
             
                    end
         | 
| 75 80 | 
             
                  end
         | 
| 76 81 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rollout-ui
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.5. | 
| 4 | 
            +
              version: 0.5.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - FetLife
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2022- | 
| 11 | 
            +
            date: 2022-11-18 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rollout
         | 
| @@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 220 220 | 
             
                - !ruby/object:Gem::Version
         | 
| 221 221 | 
             
                  version: '0'
         | 
| 222 222 | 
             
            requirements: []
         | 
| 223 | 
            -
            rubygems_version: 3.3. | 
| 223 | 
            +
            rubygems_version: 3.3.21
         | 
| 224 224 | 
             
            signing_key:
         | 
| 225 225 | 
             
            specification_version: 4
         | 
| 226 226 | 
             
            summary: ''
         |