ideasbugs 0.5.3 → 0.5.5

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: 29449ba188f3e7da8299dd22ff9f03795cd5b645734596619eb5318535c8a809
4
- data.tar.gz: 6d5853b6e7db868f7caa5203575d09fef1d1fde2a9823ee32e09e6dbf82f9f05
3
+ metadata.gz: 7daeda7248ec104695faa1a51fbe03595836171b4a8188404c1a26801740e906
4
+ data.tar.gz: 1334a427213528ddc38ebddf99f7e82ca9f0debb69fe7e77173d87e93e2684c7
5
5
  SHA512:
6
- metadata.gz: 7fbd87765283a0c53e058c50d8a94318b0ddd79b4abb43c14fcf4782b1041c6b984bb4740e927f5d4fb8a9451718a3676afa42dfb4d1ffb686cb20afb981cee2
7
- data.tar.gz: 60fc9116964d2035b5640201eedbfa4ffefd766c517f89fb0a1aab03e2178365bfc53856f220706631638be6f6b09e9e345fc881a82daf869c8774c694ca1a59
6
+ metadata.gz: 5d33ab91a108070a71ea6bb55a6f4b0d1f31ec794910d0987259034c09ffad7d893a3c3914d9809b1f847b8fabfe85ae87f774761cf7f85347647dfef1c2e04e
7
+ data.tar.gz: bc50e8601b2f5dff8af7b570a9feb04158e325db04988eff7817544c17d1438820026b36003339c8bff797608b3adef476f1acf89e7ab6f5922da3bc51b0ec7f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.5 (2026-07-25)
4
+
5
+ - The dashboard's **Section** column now only appears when it carries
6
+ information — when sections are configured (`config.sections`) or some
7
+ record already has one. Apps that don't use sections no longer see a
8
+ permanently blank column.
9
+
10
+ ## 0.5.4 (2026-07-25)
11
+
12
+ - Docs: show how to wire current_user with Rails 8's built-in authentication
13
+ (bin/rails generate authentication), alongside the existing Devise/Warden
14
+ example — in the README and the generated initializer.
15
+
3
16
  ## 0.5.3 (2026-07-25)
4
17
 
5
18
  - The widget's dynamic messages are now announced to screen readers: the
data/README.md CHANGED
@@ -163,6 +163,20 @@ Ideasbugs.configure do |config|
163
163
  end
164
164
  ```
165
165
 
166
+ `current_user` (and any admin gate) receives the raw request, so it works
167
+ with whatever auth you have:
168
+
169
+ ```ruby
170
+ # Devise / Warden:
171
+ config.current_user = ->(request) { request.env["warden"]&.user }
172
+
173
+ # Rails 8 built-in auth (bin/rails generate authentication):
174
+ config.current_user = lambda do |request|
175
+ token = request.cookies["session_token"]
176
+ Session.find_signed(token)&.user if token
177
+ end
178
+ ```
179
+
166
180
  ### Opening the form from your own UI
167
181
 
168
182
  Prefer a nav item over the floating button? Add `data-ideasbugs-open` to
@@ -35,6 +35,11 @@ module Ideasbugs
35
35
  @feedbacks = scope.newest_first.offset((@page - 1) * PER_PAGE).limit(PER_PAGE + 1).to_a
36
36
  @more = @feedbacks.size > PER_PAGE
37
37
  @feedbacks = @feedbacks.first(PER_PAGE)
38
+
39
+ # Only surface the Section column when it can carry information: the host
40
+ # configured sections, or some record already has one (e.g. sections were
41
+ # configured historically). Otherwise it's a permanently blank column.
42
+ @show_section = Ideasbugs.config.sections.any? || @feedbacks.any? { |f| f.section.present? }
38
43
  end
39
44
 
40
45
  def show; end
@@ -33,7 +33,9 @@
33
33
  <tr>
34
34
  <th><%= t('ideasbugs.kind', default: 'Type') %></th>
35
35
  <th><%= t('ideasbugs.dashboard.message', default: 'Message') %></th>
36
- <th><%= t('ideasbugs.section', default: 'Section') %></th>
36
+ <% if @show_section %>
37
+ <th><%= t('ideasbugs.section', default: 'Section') %></th>
38
+ <% end %>
37
39
  <th><%= t('ideasbugs.dashboard.from', default: 'From') %></th>
38
40
  <th><%= t('ideasbugs.dashboard.filed', default: 'Filed') %></th>
39
41
  </tr>
@@ -52,7 +54,9 @@
52
54
  <div class="muted">📎 <%= feedback.screenshots.count %></div>
53
55
  <% end %>
54
56
  </td>
55
- <td><%= feedback.section %></td>
57
+ <% if @show_section %>
58
+ <td><%= feedback.section %></td>
59
+ <% end %>
56
60
  <td><%= feedback.author_label %></td>
57
61
  <td class="muted" title="<%= feedback.created_at %>">
58
62
  <%= time_ago_in_words(feedback.created_at) %>
@@ -11,7 +11,14 @@ Ideasbugs.configure do |config|
11
11
 
12
12
  # Attribute feedback to a user (optional). Return an object responding to
13
13
  # #id, or nil. Receives the request.
14
+ # Devise / Warden:
14
15
  # config.current_user = ->(request) { request.env["warden"]&.user }
16
+ #
17
+ # Rails 8 built-in auth (bin/rails generate authentication):
18
+ # config.current_user = lambda do |request|
19
+ # token = request.cookies["session_token"]
20
+ # Session.find_signed(token)&.user if token
21
+ # end
15
22
 
16
23
  # Label stored for the author and shown in the dashboard.
17
24
  # config.author_label = ->(user) { user.try(:email) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ideasbugs
4
- VERSION = '0.5.3'
4
+ VERSION = '0.5.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ideasbugs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Shmarov