bug_reports_client 0.1.0 → 0.1.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/CHANGELOG.md +11 -0
- data/README.md +4 -2
- data/app/javascript/bug_reports_client/controllers/screenshot_dropzone_controller.js +10 -3
- data/lib/bug_reports_client/configuration.rb +5 -1
- data/lib/bug_reports_client/version.rb +1 -1
- data/lib/generators/bug_reports_client/install/templates/initializer.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2328f7788a059ba5cedf89c2b43e0aaf56cdac6f5a575b663e2f710ad3a0ef02
|
|
4
|
+
data.tar.gz: 22357aae7c221c4b41d20cfd56202b0b57679f96a53f11a8a4f9af04d1c81669
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d60b7fabf51873954b67dd8326a6904b6aa762d72c39c86e18068cdc9c1a83cdf72818c22e866215d57b4241184dde9cb201a39ad62d2e6dfa9d3c91c07f07c4
|
|
7
|
+
data.tar.gz: 222a8df13cb624d9c674b482fc2b6a5d63ec16d02937f927931cbb78dcd4beb173aa708a34fadca413c744f4d089d68000656ded24d1ebd7628ae6d597ec0df7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.1 (unreleased)
|
|
4
|
+
|
|
5
|
+
- The screenshot dropzone's drag-over highlight classes are configurable via
|
|
6
|
+
the `highlight-classes` Stimulus value, so dark-themed hosts can supply
|
|
7
|
+
theme-appropriate classes instead of the light slate defaults.
|
|
8
|
+
|
|
9
|
+
- `BUG_REPORT_APP_HOST` takes precedence over the shared `APP_HOST` env var
|
|
10
|
+
for the engine's public origin. `APP_HOST` is often owned by other host
|
|
11
|
+
concerns (mailers, OIDC issuers) in formats the engine cannot assume -
|
|
12
|
+
prefer the dedicated variable or an explicit `config.app_host`.
|
|
13
|
+
|
|
3
14
|
## 0.1.0 (23 July 2026)
|
|
4
15
|
|
|
5
16
|
- Initial release: mountable engine with a schema-driven report form
|
data/README.md
CHANGED
|
@@ -55,7 +55,7 @@ Environment variables (or set the equivalents in the initializer):
|
|
|
55
55
|
| `BUG_REPORT_API_URL` | Base URL of the bug-reports API, e.g. `https://bugs.example.com/api` |
|
|
56
56
|
| `BUG_REPORT_API_KEY` | This app's API token (Bearer auth) |
|
|
57
57
|
| `BUG_REPORT_WEBHOOK_SECRET` | This app's webhook secret (HMAC verification of closure callbacks) |
|
|
58
|
-
| `
|
|
58
|
+
| `BUG_REPORT_APP_HOST` | Public HTTPS origin of this app (callback URL + screenshot links). Falls back to `APP_HOST`; prefer this or `config.app_host` if `APP_HOST` serves other purposes |
|
|
59
59
|
|
|
60
60
|
On the API side, the app needs an `ApiKey` record and an entry in
|
|
61
61
|
`config/repo_mapping.yml` mapping its `source` name to a GitHub repository.
|
|
@@ -208,7 +208,9 @@ Three Stimulus controllers ship with the engine and are pinned into your
|
|
|
208
208
|
importmap automatically: `bug-reports-client--report-type` toggles the
|
|
209
209
|
bug/feature field groups, `bug-reports-client--screenshot-dropzone` powers
|
|
210
210
|
the drag-and-drop screenshot picker with thumbnail previews (the hidden file
|
|
211
|
-
input stays the submission source, so custom forms can ignore it
|
|
211
|
+
input stays the submission source, so custom forms can ignore it; its
|
|
212
|
+
drag-over highlight is themeable via the `highlight-classes` Stimulus
|
|
213
|
+
value), and
|
|
212
214
|
`bug-reports-client--file-limit` is a standalone file-count guard for
|
|
213
215
|
hand-rolled forms. Any standard Stimulus setup that loads controllers from
|
|
214
216
|
the importmap (`eagerLoadControllersFrom` / `lazyLoadControllersFrom`) picks
|
|
@@ -17,7 +17,10 @@ export default class extends Controller {
|
|
|
17
17
|
max: { type: Number, default: 5 },
|
|
18
18
|
maxBytes: { type: Number, default: 10_485_760 },
|
|
19
19
|
limitMessage: String,
|
|
20
|
-
sizeMessage: String
|
|
20
|
+
sizeMessage: String,
|
|
21
|
+
// Classes toggled on the zone while a file is dragged over it. Dark
|
|
22
|
+
// themes should override via the Stimulus value (space-separated).
|
|
23
|
+
highlightClasses: { type: String, default: "border-slate-500 bg-slate-100" }
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
connect() {
|
|
@@ -47,11 +50,15 @@ export default class extends Controller {
|
|
|
47
50
|
|
|
48
51
|
dragover(event) {
|
|
49
52
|
event.preventDefault()
|
|
50
|
-
this.zoneTarget.classList.add(
|
|
53
|
+
this.zoneTarget.classList.add(...this.highlightClassList())
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
dragleave() {
|
|
54
|
-
this.zoneTarget.classList.remove(
|
|
57
|
+
this.zoneTarget.classList.remove(...this.highlightClassList())
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
highlightClassList() {
|
|
61
|
+
return this.highlightClassesValue.split(/\s+/).filter(Boolean)
|
|
55
62
|
}
|
|
56
63
|
|
|
57
64
|
drop(event) {
|
|
@@ -54,7 +54,11 @@ module BugReportsClient
|
|
|
54
54
|
@api_url = ENV.fetch("BUG_REPORT_API_URL", "http://localhost:3002/api")
|
|
55
55
|
@api_key = ENV["BUG_REPORT_API_KEY"]
|
|
56
56
|
@webhook_secret = ENV["BUG_REPORT_WEBHOOK_SECRET"]
|
|
57
|
-
|
|
57
|
+
# A dedicated variable takes precedence: APP_HOST is commonly shared
|
|
58
|
+
# with other host-app concerns (mailers, OIDC issuers) in formats the
|
|
59
|
+
# engine cannot assume, so hosts can isolate the engine with
|
|
60
|
+
# BUG_REPORT_APP_HOST - or set config.app_host explicitly.
|
|
61
|
+
@app_host = ENV["BUG_REPORT_APP_HOST"] || ENV["APP_HOST"]
|
|
58
62
|
@app_name = nil
|
|
59
63
|
@source = nil
|
|
60
64
|
@mount_path = "/bug_reports"
|
|
@@ -8,7 +8,8 @@ BugReportsClient.configure do |config|
|
|
|
8
8
|
config.source = "<%= Rails.application.class.module_parent_name.underscore %>"
|
|
9
9
|
|
|
10
10
|
# The public HTTPS origin of this app, used for the closure callback URL and
|
|
11
|
-
# screenshot links in GitHub issues. Defaults to ENV["
|
|
11
|
+
# screenshot links in GitHub issues. Defaults to ENV["BUG_REPORT_APP_HOST"],
|
|
12
|
+
# then ENV["APP_HOST"] - set it explicitly if APP_HOST serves other purposes.
|
|
12
13
|
# config.app_host = "https://myapp.example.com"
|
|
13
14
|
|
|
14
15
|
# Who counts as an admin (can see /bug_reports/all).
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bug_reports_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- PSA Squash Tour
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
11
|
+
date: 2026-07-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|