rollout-ui 0.5.0 → 0.5.1

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: 23d80e49f2a5b8224f029c2f3345e19028947ae8e2db02c38240cb4b3a93b3a9
4
+ data.tar.gz: 4e1bf428271120df8b39f797b43cdb0031539779dfac48a9d1d2d8e4e117c364
5
5
  SHA512:
6
- metadata.gz: 952b01c7614a32d8f2ecd7b94f54f02fe8b0483314c1861065c93400ffa7abd6bba639e47639a0ce084fc173ae3b002944ad21bce9bc504273a3cb7c6fa2785e
7
- data.tar.gz: 59bcfcb7bbfa61c371b16e692f14afe9b30b7b50b2072eede8849d8c9267b3d54012e1fd8db79571c009b55523f8bc450d13b125e766e9b7ed835c7bf28fc5cb
6
+ metadata.gz: 0cb581a7d9caa5bf22d3fa404561dbbc221db7a39f0a85438a47c0033a293924c00484457e1fb5f11e995d8d1e61b7b8e2881eff094adad6265415aacd78d465
7
+ data.tar.gz: 8f8acc759b488724625a5b2c5ac147523db44ccf0f3105b4a4418f74d5f43a52fb1a23772636ec5dab13f0006a3b70d41136525050e3256dc5659037173663e5
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.0
1
+ 3.1.2
@@ -1,5 +1,5 @@
1
1
  class Rollout
2
2
  module UI
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
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] != feature_data['updated_at']
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.1
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-16 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: ''