rollout-ui 0.6.0 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4e0b2f55a41b0c8311c046f8fa8568cfc7001c7d5e59ad880686244918d33d2
4
- data.tar.gz: 07b7cf87b83e538d0ba502d8b57aa79a9f0327f32da9054a1ee728895610ba90
3
+ metadata.gz: 0ff86241a71a40f4c2300c7ba47119d6cc6e18aa1e1b3c68fb4d5b587daac0d7
4
+ data.tar.gz: 7b6ca985c2d7f31e8f436bca041c180d1a89a0bd80586ce8a916860a08b8a937
5
5
  SHA512:
6
- metadata.gz: e1e157706c74a2d14c824e665f6689559d61cb8aef37652ba2554de414df0260c588b015917206b4cd7071aab6718b15bfe7b533cffd93f9c83b98a6f7350afe
7
- data.tar.gz: 9ba68eca138d5090c9b3696cd036ddba211965f33c1ab28d5585696b79a641e84bef3f0a450cff3386f62157f9169f240358ff2cff790ee660d1434f57c65543
6
+ metadata.gz: 675cc0df4e5079e5d3b619a06ae44ef0cd703ef029ba0892d663ff3889fdde4955ecd2b44807d829e1bc9cb078b417b19cf26ae52e02fe6183aeced63820241d
7
+ data.tar.gz: 449b29ebeb854d4764c29947db9f84009e4e88e6d32db8bd3bed43dc58c72e58311d5eb47da885cdbe5d7864e96919a8be5840bf8fe22ebdf49aaf75d38d2e41
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /vendor/
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
data/README.md CHANGED
@@ -104,7 +104,7 @@ And visit [http://localhost:9292/](http://localhost:9292/).
104
104
  Alternatively you can also configure which Redis with:
105
105
 
106
106
  ```sh
107
- REDIS_HOST=localhost REDIS_PORT=6379 REDIS_DB=10 be rerun rackup
107
+ REDIS_HOST=localhost REDIS_PORT=6379 REDIS_DB=10 bundle exec rerun rackup
108
108
  ```
109
109
 
110
110
  ## License
@@ -9,14 +9,21 @@ module Rollout::UI
9
9
  instance
10
10
  actor
11
11
  actor_url
12
+ timestamp_format
12
13
  ].freeze
13
14
 
15
+ DEFAULT_VALUES = {
16
+ timestamp_format: '%Y-%m-%d %H:%M %Z'
17
+ }.freeze
18
+
14
19
  KEYS.each do |key|
15
20
  define_method(key) do |&block|
16
21
  @blocks ||= {}
17
22
 
18
23
  if block
19
24
  @blocks[key] = block
25
+ elsif DEFAULT_VALUES.key?(key)
26
+ DEFAULT_VALUES[key]
20
27
  else
21
28
  raise ArgumentError, "#{key}: block is required"
22
29
  end
@@ -29,7 +36,10 @@ module Rollout::UI
29
36
  @blocks ||= {}
30
37
  block = @blocks[key]
31
38
 
32
- return if block.nil?
39
+ if block.nil?
40
+ return DEFAULT_VALUES[key] if DEFAULT_VALUES.key?(key)
41
+ return nil
42
+ end
33
43
 
34
44
  if scope
35
45
  scope.instance_eval(&block)
@@ -39,7 +49,7 @@ module Rollout::UI
39
49
  end
40
50
 
41
51
  def defined?(key)
42
- !@blocks.nil? && @blocks.key?(key)
52
+ (@blocks&.key?(key)) || DEFAULT_VALUES.key?(key)
43
53
  end
44
54
  end
45
55
  end
@@ -1,5 +1,5 @@
1
1
  class Rollout
2
2
  module UI
3
- VERSION = "0.6.0"
3
+ VERSION = "0.7.0"
4
4
  end
5
5
  end
@@ -42,7 +42,7 @@ h2.font-semibold.text-xl.text-gray-500.pt-12.flex.items-center
42
42
  = feature.users.count
43
43
  - if @rollout.respond_to?(:logging)
44
44
  td.py-2.whitespace-no-wrap
45
- = time_ago(@rollout.logging.updated_at(feature_name))
45
+ span title=@rollout.logging.updated_at(feature_name).strftime(Rollout::UI.config.timestamp_format) = time_ago(@rollout.logging.updated_at(feature_name))
46
46
  td.flex.items-center.py-2.justify-end.whitespace-no-wrap.pl-3
47
47
  form action=activate_percentage_feature_path(feature_name, 100) method='POST'
48
48
  button.p-3.bg-gray-100.ml-1.rounded-sm.font-bold.leading-none.transition-colors.duration-150(class='hover:bg-gray-200' type='submit' onclick="return confirm('Are you sure you want activate #{sanitized_name(feature_name)} to 100%?')")
@@ -7,22 +7,22 @@
7
7
  .w-8.h-1.bg-gray-300.my-10
8
8
 
9
9
  .overflow-auto.scrolling-touch
10
- table.text-sm.w-100.text-left.w-full
10
+ table.text-sm.w-100.text-left.w-full.table-fixed
11
11
  - if show_header
12
12
  thead.font-semibold.text-gray-600.border-b.border-gray-200
13
13
  - if show_feature
14
- th.pb-2.pr-3 Feature
15
- th.pb-2.pr-3 Action
16
- th.pl-2
14
+ th.pb-2.pr-3.w-1/6 Feature
15
+ th.pb-2.pr-3.w-2/3 Action
16
+ th.pl-2.w-1/6
17
17
 
18
18
  tbody.text-gray-600.border-t.border-gray-200
19
19
  - events.each do |event|
20
20
  tr.border-b.border-gray-200
21
21
  - if show_feature
22
- td.py-2.whitespace-no-wrap
22
+ td.py-2.whitespace-no-wrap.w-1/6
23
23
  a.text-blue-600(href=feature_path(event.feature) class='hover:text-blue-700 hover:underline')
24
24
  = event.feature
25
- td.py-2.pr-3.whitespace-no-wrap
25
+ td.py-2.pr-3.whitespace-normal.w-2/3
26
26
  - if event.name == "update"
27
27
  - if event.context && event.context[:actor]
28
28
  - if config.defined?(:actor_url)
@@ -32,7 +32,7 @@
32
32
  ' #{event.context[:actor]}
33
33
  - else
34
34
  ' unidentified user
35
- - changes = event.data.fetch(:before).keys.map do |key|
35
+ - changes = event.data.fetch(:before).keys.reject { |key| key.to_s == 'data.updated_at' }.map do |key|
36
36
  - before = format_change_value(event.data.fetch(:before).fetch(key))
37
37
  - after = format_change_value(event.data.fetch(:after).fetch(key))
38
38
  - "#{format_change_key(key)} from #{before} to #{after}"
@@ -42,5 +42,5 @@
42
42
  - else
43
43
  = event.data
44
44
 
45
- td.flex.items-center.py-2.justify-end.whitespace-no-wrap.pl-3
46
- = time_ago(event.created_at)
45
+ td.py-2.text-right.whitespace-nowrap.pl-3.w-1/6
46
+ span title=event.created_at.strftime(Rollout::UI.config.timestamp_format) = time_ago(event.created_at)
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.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - FetLife
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-01 00:00:00.000000000 Z
11
+ date: 2025-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rollout
@@ -231,7 +231,7 @@ homepage: https://github.com/fetlife/rollout-ui
231
231
  licenses:
232
232
  - MIT
233
233
  metadata: {}
234
- post_install_message:
234
+ post_install_message:
235
235
  rdoc_options: []
236
236
  require_paths:
237
237
  - lib
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
247
  version: '0'
248
248
  requirements: []
249
249
  rubygems_version: 3.5.3
250
- signing_key:
250
+ signing_key:
251
251
  specification_version: 4
252
252
  summary: ''
253
253
  test_files: []