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 +4 -4
- data/.ruby-version +1 -1
- 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: 23d80e49f2a5b8224f029c2f3345e19028947ae8e2db02c38240cb4b3a93b3a9
|
4
|
+
data.tar.gz: 4e1bf428271120df8b39f797b43cdb0031539779dfac48a9d1d2d8e4e117c364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cb581a7d9caa5bf22d3fa404561dbbc221db7a39f0a85438a47c0033a293924c00484457e1fb5f11e995d8d1e61b7b8e2881eff094adad6265415aacd78d465
|
7
|
+
data.tar.gz: 8f8acc759b488724625a5b2c5ac147523db44ccf0f3105b4a4418f74d5f43a52fb1a23772636ec5dab13f0006a3b70d41136525050e3256dc5659037173663e5
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.2
|
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] != 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.
|
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-
|
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.
|
223
|
+
rubygems_version: 3.3.21
|
224
224
|
signing_key:
|
225
225
|
specification_version: 4
|
226
226
|
summary: ''
|