rollout-ui 0.5.0 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a1ec80944aa3ae6f4c7fc142dceb5b0f5f87d111a3a9cec771be3325d5996a8
4
- data.tar.gz: df9d961f8306cdfd1bd377d6bb6629238c4e2f8ea901c796f27442f03bfa85c1
3
+ metadata.gz: 6a421eaee6e20132c013892d216de0ea3edbccbed00b712fdb397ec038289d67
4
+ data.tar.gz: f48cfbc156ffd4ee4a16bf66dd66ab509d8cc842790c952ca70f211860e6c9b3
5
5
  SHA512:
6
- metadata.gz: 952b01c7614a32d8f2ecd7b94f54f02fe8b0483314c1861065c93400ffa7abd6bba639e47639a0ce084fc173ae3b002944ad21bce9bc504273a3cb7c6fa2785e
7
- data.tar.gz: 59bcfcb7bbfa61c371b16e692f14afe9b30b7b50b2072eede8849d8c9267b3d54012e1fd8db79571c009b55523f8bc450d13b125e766e9b7ed835c7bf28fc5cb
6
+ metadata.gz: 77f2ed7614eeefe496a559c6eeca1fa88307ef208c3e6854bece0b1b40f1fb02b23da9c9488e941ed8e467e6c765dd65a8461c8dfca8ad24512e1bb1b8bbd874
7
+ data.tar.gz: 3b382d382de581dcacfb45601e395916c538a85dc8ea316e711eaf40c92128d0cac4b6e83b5a1980f109f05442c9da38211c4b32ba8fa8791725d97b278918db
@@ -1,5 +1,5 @@
1
1
  class Rollout
2
2
  module UI
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.2"
4
4
  end
5
5
  end
@@ -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(
@@ -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.0
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-09-08 00:00:00.000000000 Z
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.3
223
+ rubygems_version: 3.3.21
224
224
  signing_key:
225
225
  specification_version: 4
226
226
  summary: ''