ideasbugs 1.3.1 → 1.4.1
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 +4 -4
- data/AGENTS.md +1 -1
- data/CHANGELOG.md +17 -0
- data/README.md +15 -7
- data/app/models/ideasbugs/feedback.rb +14 -0
- data/app/views/ideasbugs/feedbacks/_feedback_panel.html.erb +2 -2
- data/config/locales/ideasbugs.sl.yml +26 -0
- data/lib/generators/ideasbugs/author_type/author_type_generator.rb +34 -0
- data/lib/generators/ideasbugs/author_type/templates/add_author_type_to_ideasbugs_feedbacks.rb.tt +7 -0
- data/lib/generators/ideasbugs/install/templates/create_ideasbugs_feedbacks.rb.tt +1 -0
- data/lib/ideasbugs/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1fd8d6cfa91dc900cfb4bf42793dd5a1350542276fa192d5257eddd8b56eeb72
|
|
4
|
+
data.tar.gz: 67ee6556ea80666a3d540b52947ab0ee9ad4e833375433956ac1a5ea93201e5b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac6396cd88ec5e2f976782630a3219326cc876b01b9e014eace8890ccd42cca247ef56f9b48f5ce92e0a855656c336bb883001d01b07f956ee195e4d154c39a8
|
|
7
|
+
data.tar.gz: 72b228922f72020282b338d3761057987e95b50f3382cb1ccd64182a1fabf7f11cccaffbfdba78240f97a9a313a2a9e6732a3e814798593756700b984eba603d
|
data/AGENTS.md
CHANGED
|
@@ -155,7 +155,7 @@ Everything is optional; a fresh install works with zero config. Full list with c
|
|
|
155
155
|
| No Feedback button | `ideasbugs_tag` missing from the rendered layout, `config.enabled` false, or `show_button = false` with no opener of your own |
|
|
156
156
|
| Submissions rejected with an invalid-token error | The layout is missing `csrf_meta_tags` |
|
|
157
157
|
| No screenshot upload control | Active Storage not installed, or `screenshots = false` |
|
|
158
|
-
| `ideasbugs:tenant` fails on a duplicate column |
|
|
158
|
+
| `ideasbugs:tenant`, `ideasbugs:duplicates` or `ideasbugs:author_type` fails on a duplicate column | They are upgrade generators for older installs; a fresh install already has the column |
|
|
159
159
|
| `undefined local variable current_user` in the initializer | A gate lambda treated its argument as a controller. It is a `request` |
|
|
160
160
|
|
|
161
161
|
---
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
- Add Slovenian labels, validation messages, and confirmations to the feedback
|
|
6
|
+
widget. Hosts can use the locale through Rails I18n with no setup changes.
|
|
7
|
+
|
|
8
|
+
## [1.4.0] - 2026-11-10
|
|
9
|
+
|
|
10
|
+
- **Typed authors.** `Feedback.submit` and the widget store the author's class
|
|
11
|
+
in a new `author_type` column next to `author_id`, so a host that files
|
|
12
|
+
feedback from more than one kind of record (a user, an API token, an
|
|
13
|
+
organisation) can tell `User #7` from `Token #7`. Active Record models are
|
|
14
|
+
stored by `polymorphic_name`. The dashboard shows `User #7` when the host
|
|
15
|
+
stores no `author_label`.
|
|
16
|
+
- **Cost:** one nullable string column, no foreign key. Existing installs run
|
|
17
|
+
`bin/rails generate ideasbugs:author_type && bin/rails db:migrate`; until
|
|
18
|
+
then attribution works exactly as in 1.3. Existing rows keep a nil type,
|
|
19
|
+
because the gem cannot know which class their ids belong to: backfill it
|
|
20
|
+
yourself if they share one. No initializer change.
|
|
21
|
+
|
|
5
22
|
## [1.3.1] - 2026-11-10
|
|
6
23
|
|
|
7
24
|
- Fix the dashboard queue under Rails edge Ractor requests. 1.3.0's
|
data/README.md
CHANGED
|
@@ -78,7 +78,7 @@ the things it should not do. It ships inside the gem, so
|
|
|
78
78
|
| **Storage** | `ideasbugs_feedbacks` — ordinary Active Record rows you can query and export |
|
|
79
79
|
| **Deps** | None. Plain JS — no Tailwind, no Stimulus, no importmap, no build step |
|
|
80
80
|
| **Auth** | Lambdas over the raw request — Devise, Rails 8 auth, Basic auth, anything |
|
|
81
|
-
| **i18n** |
|
|
81
|
+
| **i18n** | 27 languages, RTL mirrored, English fallback |
|
|
82
82
|
| **Theme** | Follows system light/dark. No config |
|
|
83
83
|
| **Turbo** | Works with Turbo Drive out of the box |
|
|
84
84
|
| **CSP** | Carries the request nonce. Works under strict `script-src` |
|
|
@@ -222,7 +222,9 @@ end
|
|
|
222
222
|
|
|
223
223
|
Each row stores `kind`, `section`, `message`, `status` (`open` / `in_review` /
|
|
224
224
|
`resolved`), `page_url`, `user_agent`, an optional `tenant`, and optional
|
|
225
|
-
`author_id` / `author_label`.
|
|
225
|
+
`author_id` / `author_type` / `author_label`. `author_type` is the author's
|
|
226
|
+
class (`polymorphic_name` for Active Record models), so ids from different
|
|
227
|
+
kinds of author cannot be confused. Screenshots are Active Storage attachments
|
|
226
228
|
(`feedback.screenshots`). `duplicate_of_id` points a duplicate at its original.
|
|
227
229
|
|
|
228
230
|
## Duplicates
|
|
@@ -250,6 +252,11 @@ dashboard and keeps its own `status` for when it is unmarked.
|
|
|
250
252
|
`bin/rails generate ideasbugs:duplicates && bin/rails db:migrate`. Until then
|
|
251
253
|
the dashboard works as before, without duplicate controls.
|
|
252
254
|
|
|
255
|
+
**Upgrading from 1.3 or earlier:** run
|
|
256
|
+
`bin/rails generate ideasbugs:author_type && bin/rails db:migrate` to store
|
|
257
|
+
the author's class. Until then `author_type` stays empty. Existing rows keep a
|
|
258
|
+
nil type; backfill it if all your authors share one class.
|
|
259
|
+
|
|
253
260
|
## File feedback from your own API
|
|
254
261
|
|
|
255
262
|
The widget is one way in. If your app already has an API, one endpoint lets
|
|
@@ -297,7 +304,8 @@ curl -X POST https://app.example.com/api/feedback \
|
|
|
297
304
|
the record: check `persisted?` and `errors`. Your endpoint still owns:
|
|
298
305
|
|
|
299
306
|
- **Authentication.** The gem has no tokens of its own. Attribute feedback to
|
|
300
|
-
the token's user so the dashboard shows who sent it.
|
|
307
|
+
the token's user so the dashboard shows who sent it. A token that belongs to
|
|
308
|
+
no user can be the author itself: `author_type` records which it was.
|
|
301
309
|
- **The gates.** `config.enabled` and `config.rate_limit` guard the widget's
|
|
302
310
|
endpoint only. Apply the same rule and a throttle here.
|
|
303
311
|
- **The tenant.** Pass the key `config.tenant` would return for that user, or
|
|
@@ -358,7 +366,7 @@ The following are the model and integration contracts that 1.x will keep
|
|
|
358
366
|
stable under semantic versioning:
|
|
359
367
|
|
|
360
368
|
- `Ideasbugs::Feedback`, including `kind`, `section`, `message`, `status`,
|
|
361
|
-
`page_url`, `user_agent`, `tenant`, `author_id`, `author_label`, timestamps,
|
|
369
|
+
`page_url`, `user_agent`, `tenant`, `author_id`, `author_type`, `author_label`, timestamps,
|
|
362
370
|
`STATUSES`, status helpers/scopes, `newest_first`, `for_tenant`, gated
|
|
363
371
|
`screenshots`, `Feedback.submit`, and the duplicate API (`duplicate_of`,
|
|
364
372
|
`duplicates`, `duplicate?`, `originals`, `mark_duplicate_of!`,
|
|
@@ -377,7 +385,7 @@ first.
|
|
|
377
385
|
## Localization
|
|
378
386
|
|
|
379
387
|
Every string resolves through Rails I18n under `ideasbugs.*` and follows the
|
|
380
|
-
current `I18n.locale`.
|
|
388
|
+
current `I18n.locale`. 27 languages ship; missing keys fall back to English;
|
|
381
389
|
RTL locales render mirrored.
|
|
382
390
|
|
|
383
391
|
<details>
|
|
@@ -385,8 +393,8 @@ RTL locales render mirrored.
|
|
|
385
393
|
|
|
386
394
|
Arabic, Bengali, Bulgarian, Chinese (Simplified), Croatian, Dutch, English,
|
|
387
395
|
French, German, Greek, Hindi, Indonesian, Italian, Japanese, Korean,
|
|
388
|
-
Luxembourgish, Polish, Portuguese, Romanian, Russian,
|
|
389
|
-
Ukrainian, Urdu, Vietnamese.
|
|
396
|
+
Luxembourgish, Polish, Portuguese, Romanian, Russian, Slovenian, Spanish,
|
|
397
|
+
Thai, Turkish, Ukrainian, Urdu, Vietnamese.
|
|
390
398
|
|
|
391
399
|
Define the keys in your own locale files — yours win over the gem's:
|
|
392
400
|
|
|
@@ -55,6 +55,11 @@ module Ideasbugs
|
|
|
55
55
|
column_names.include?('duplicate_of_id')
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
# Installs before 1.4 lack the column until they run `ideasbugs:author_type`.
|
|
59
|
+
def self.tracks_author_type?
|
|
60
|
+
column_names.include?('author_type')
|
|
61
|
+
end
|
|
62
|
+
|
|
58
63
|
SUBMITTED_ATTRIBUTES = %i[kind section message page_url].freeze
|
|
59
64
|
|
|
60
65
|
# Files feedback the way the widget does: privacy-filtered page URL, author
|
|
@@ -140,9 +145,18 @@ module Ideasbugs
|
|
|
140
145
|
return unless author
|
|
141
146
|
|
|
142
147
|
self.author_id = author.id.to_s if author.respond_to?(:id)
|
|
148
|
+
klass = author.class
|
|
149
|
+
self.author_type = klass.try(:polymorphic_name) || klass.name if self.class.tracks_author_type?
|
|
143
150
|
self.author_label = Ideasbugs.config.author_label.call(author)
|
|
144
151
|
end
|
|
145
152
|
|
|
153
|
+
# What the dashboard shows when the host stores no label: "User #7".
|
|
154
|
+
def author_reference
|
|
155
|
+
return author_label if author_label.present?
|
|
156
|
+
|
|
157
|
+
[attributes['author_type'], "##{author_id}"].compact.join(' ') if author_id.present?
|
|
158
|
+
end
|
|
159
|
+
|
|
146
160
|
# Attaches uploads, or returns the error that rejects them. No screenshots
|
|
147
161
|
# at all is fine.
|
|
148
162
|
def attach_screenshots(files)
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
<dt><%= t('ideasbugs.section', default: 'Section') %></dt>
|
|
54
54
|
<dd><%= feedback.section %></dd>
|
|
55
55
|
<% end %>
|
|
56
|
-
<% if
|
|
56
|
+
<% if (author = feedback.author_reference) %>
|
|
57
57
|
<dt><%= t('ideasbugs.dashboard.from', default: 'From') %></dt>
|
|
58
|
-
<dd><%=
|
|
58
|
+
<dd><%= author %></dd>
|
|
59
59
|
<% end %>
|
|
60
60
|
<% if feedback.page_url.present? %>
|
|
61
61
|
<dt><%= t('ideasbugs.dashboard.page', default: 'Page') %></dt>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
sl:
|
|
2
|
+
ideasbugs:
|
|
3
|
+
button: "Povratne informacije"
|
|
4
|
+
title: "Prijavite napako ali predlagajte funkcijo"
|
|
5
|
+
kind: "Vrsta"
|
|
6
|
+
kinds:
|
|
7
|
+
bug: "Prijava napake"
|
|
8
|
+
feature: "Predlog funkcije"
|
|
9
|
+
other: "Drugo"
|
|
10
|
+
section: "Razdelek"
|
|
11
|
+
section_any: "Splošno"
|
|
12
|
+
message: "Vaše sporočilo"
|
|
13
|
+
message_placeholder: "Opišite napako ali napišite predlog…"
|
|
14
|
+
screenshots: "Posnetki zaslona"
|
|
15
|
+
screenshots_hint: "neobvezno, največ %{count} datotek, vsaka do %{size} MB"
|
|
16
|
+
submit: "Pošlji"
|
|
17
|
+
cancel: "Prekliči"
|
|
18
|
+
close: "Zapri"
|
|
19
|
+
thanks: "Hvala za povratne informacije!"
|
|
20
|
+
error_blank: "Vnesite sporočilo."
|
|
21
|
+
error_save: "Sporočila ni bilo mogoče poslati. Poskusite znova."
|
|
22
|
+
error_too_many: "Preveč posnetkov zaslona (največ %{count})."
|
|
23
|
+
error_too_large: "Posnetek zaslona je prevelik (največ %{size} MB)."
|
|
24
|
+
error_rate_limited: "Poslali ste preveč sporočil. Počakajte trenutek in poskusite znova."
|
|
25
|
+
dashboard:
|
|
26
|
+
title: "IdeasBugs"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'rails/generators'
|
|
4
|
+
require 'rails/generators/active_record'
|
|
5
|
+
require_relative '../migration_helpers'
|
|
6
|
+
|
|
7
|
+
module Ideasbugs
|
|
8
|
+
module Generators
|
|
9
|
+
# For apps that installed ideasbugs before 1.4: adds the nullable
|
|
10
|
+
# `author_type` column to ideasbugs_feedbacks, so `author_id` names a
|
|
11
|
+
# record of a known class. A fresh install already gets it. Existing rows
|
|
12
|
+
# keep a nil type; the gem cannot know which class their ids belong to.
|
|
13
|
+
#
|
|
14
|
+
# bin/rails generate ideasbugs:author_type && bin/rails db:migrate
|
|
15
|
+
class AuthorTypeGenerator < Rails::Generators::Base
|
|
16
|
+
include ActiveRecord::Generators::Migration
|
|
17
|
+
include MigrationHelpers
|
|
18
|
+
|
|
19
|
+
source_root File.expand_path('templates', __dir__)
|
|
20
|
+
|
|
21
|
+
desc 'Adds the author_type column to ideasbugs_feedbacks (author type upgrade).'
|
|
22
|
+
|
|
23
|
+
def create_migration_file
|
|
24
|
+
migration_template 'add_author_type_to_ideasbugs_feedbacks.rb.tt',
|
|
25
|
+
'db/migrate/add_author_type_to_ideasbugs_feedbacks.rb'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def post_install
|
|
29
|
+
say "\nauthor_type column queued. Run `rails db:migrate`. Existing rows keep", :green
|
|
30
|
+
say 'a nil type: backfill it yourself if all your authors share one class.'
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -10,6 +10,7 @@ class CreateIdeasbugsFeedbacks < ActiveRecord::Migration<%= migration_version %>
|
|
|
10
10
|
t.string :page_url
|
|
11
11
|
t.string :user_agent
|
|
12
12
|
t.string :author_id
|
|
13
|
+
t.string :author_type
|
|
13
14
|
t.string :author_label
|
|
14
15
|
t.string :tenant # opaque per-tenant key; nil = single global board
|
|
15
16
|
t.references :duplicate_of<%= reference_type_option %>, index: true
|
data/lib/ideasbugs/version.rb
CHANGED
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: 1.
|
|
4
|
+
version: 1.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yaroslav Shmarov
|
|
@@ -81,6 +81,7 @@ files:
|
|
|
81
81
|
- config/locales/ideasbugs.pt.yml
|
|
82
82
|
- config/locales/ideasbugs.ro.yml
|
|
83
83
|
- config/locales/ideasbugs.ru.yml
|
|
84
|
+
- config/locales/ideasbugs.sl.yml
|
|
84
85
|
- config/locales/ideasbugs.th.yml
|
|
85
86
|
- config/locales/ideasbugs.tr.yml
|
|
86
87
|
- config/locales/ideasbugs.uk.yml
|
|
@@ -99,6 +100,8 @@ files:
|
|
|
99
100
|
- docs/screenshots/dashboard-light.png
|
|
100
101
|
- docs/screenshots/widget-dark.png
|
|
101
102
|
- docs/screenshots/widget-light.png
|
|
103
|
+
- lib/generators/ideasbugs/author_type/author_type_generator.rb
|
|
104
|
+
- lib/generators/ideasbugs/author_type/templates/add_author_type_to_ideasbugs_feedbacks.rb.tt
|
|
102
105
|
- lib/generators/ideasbugs/duplicates/duplicates_generator.rb
|
|
103
106
|
- lib/generators/ideasbugs/duplicates/templates/add_duplicate_of_to_ideasbugs_feedbacks.rb.tt
|
|
104
107
|
- lib/generators/ideasbugs/install/install_generator.rb
|