blazer 3.5.0 → 3.5.2

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: ec2b494fc5ea15a06d18125d5c9d9173ee84adedb30016f935225904b31dbd65
4
- data.tar.gz: a6ea63deaff42cce760843f2171ef125e946b5a1f68f14f49ed2051b94f4d4d1
3
+ metadata.gz: a01073ea34e41fbb112471eee6d9508903d7f7219f61e3b04437156d18dc89ad
4
+ data.tar.gz: 32da14077b7ff332ffe23d31a966942ba1905939597ca101db42d608495613fe
5
5
  SHA512:
6
- metadata.gz: a777e72613329d828de10a17d6e43f2edeaf0ac9c84cc757372b19f8f63586c67866801e215aa67507a34c06b41c0e53c1c7316a5472d3a390addbec0c4259be
7
- data.tar.gz: 43621f36af5f8069184ace5f0519c051de42fa5b367353614c34a3344203984221909aeb4f36852247e8ac909c2f03e7d9269cca493c669b0dcaef254b741946
6
+ metadata.gz: 871a8b2d9202d5113452d6dd3586c926f203aa60a44508bbdd0679607a1a6b9313e917330a13836f5ad491d127001ea93d9b4125ce11f0c688d68e727986918a
7
+ data.tar.gz: f8230528c6a648b0c9044f0c6b228cbc41744fe1d7657ec3575e3d827149d0a2d653a27fc9cd2fa45e139d93c15ad2e6db5871026e08823fd42f18ff59693453
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 3.5.2 (2026-09-24)
2
+
3
+ - Fixed error message when status text not available
4
+
5
+ ## 3.5.1 (2026-07-31)
6
+
7
+ - Fixed delete buttons
8
+ - Fixed table preview and schema page for Postgres < 16
9
+ - Fixed error with Sass
10
+
1
11
  ## 3.5.0 (2026-07-27)
2
12
 
3
13
  - Fixed stored XSS vulnerability - [more info](https://github.com/ankane/blazer/security/advisories/GHSA-m5f6-4589-m89f)
@@ -58,10 +58,43 @@ document.addEventListener("click", function (e) {
58
58
  if (target) {
59
59
  if (!window.confirm(target.getAttribute("data-confirm"))) {
60
60
  e.preventDefault()
61
+ e.stopImmediatePropagation()
61
62
  }
62
63
  }
63
64
  })
64
65
 
66
+ function isSameOrigin(href) {
67
+ return new URL(href, window.location.href).origin === window.location.origin
68
+ }
69
+
70
+ document.addEventListener("click", function (e) {
71
+ const target = e.target.closest("a[data-method]")
72
+ if (target) {
73
+ e.preventDefault()
74
+
75
+ const form = document.createElement("form")
76
+ form.method = "post"
77
+ form.action = target.href
78
+ form.hidden = true
79
+
80
+ let params = {"_method": target.getAttribute("data-method")}
81
+ if (isSameOrigin(target.href)) {
82
+ params = csrfProtect(params)
83
+ }
84
+
85
+ for (const [k, v] of Object.entries(params)) {
86
+ const input = document.createElement("input")
87
+ input.type = "hidden"
88
+ input.name = k
89
+ input.value = v
90
+ form.append(input)
91
+ }
92
+
93
+ document.body.append(form)
94
+ form.submit()
95
+ }
96
+ })
97
+
65
98
  // make autofocus work with back button
66
99
  window.addEventListener("pageshow", function (e) {
67
100
  if (e.persisted) {
@@ -113,7 +146,7 @@ function getJSON(url, success, controller) {
113
146
  fetch(url, options)
114
147
  .then(function (response) {
115
148
  if (!response.ok) {
116
- throw new Error(response.statusText)
149
+ throw new Error(response.statusText || `An error occurred: ${response.status}`)
117
150
  }
118
151
  return response.json()
119
152
  })
@@ -37,7 +37,7 @@ function runQueryHelper(query) {
37
37
  fetch(Routes.run_queries_path(), {method: "POST", body: formdata, signal: controller.signal})
38
38
  .then(function (response) {
39
39
  if (!response.ok) {
40
- throw new Error(response.statusText)
40
+ throw new Error(response.statusText || `An error occurred: ${response.status}`)
41
41
  }
42
42
  return response.text()
43
43
  })
@@ -225,7 +225,7 @@
225
225
  cursor: pointer;
226
226
  }
227
227
  .plugin-clear_button.form-select .clear-button, .plugin-clear_button.single .clear-button {
228
- right: max(var(--ts-pr-caret), 8px);
228
+ right: Max(var(--ts-pr-caret), 8px);
229
229
  }
230
230
  .plugin-clear_button.focus.has-items .clear-button, .plugin-clear_button:not(.disabled):hover.has-items .clear-button {
231
231
  opacity: 1;
@@ -373,11 +373,11 @@
373
373
  }
374
374
 
375
375
  .ts-control:not(.rtl) {
376
- padding-right: max(var(--ts-pr-min), var(--ts-pr-clear-button) + var(--ts-pr-caret)) !important;
376
+ padding-right: Max(var(--ts-pr-min), calc(var(--ts-pr-clear-button) + var(--ts-pr-caret))) !important;
377
377
  }
378
378
 
379
379
  .ts-control.rtl {
380
- padding-left: max(var(--ts-pr-min), var(--ts-pr-clear-button) + var(--ts-pr-caret)) !important;
380
+ padding-left: Max(var(--ts-pr-min), calc(var(--ts-pr-clear-button) + var(--ts-pr-caret))) !important;
381
381
  }
382
382
 
383
383
  .ts-wrapper {
@@ -72,7 +72,7 @@
72
72
  </div>
73
73
  <% end %>
74
74
 
75
- <p class="text-muted">Notifications are sent when a check starts failing, and when it starts passing again.
75
+ <p class="text-muted">Notifications are sent when a check starts failing, and when it starts passing again.</p>
76
76
  <p>
77
77
  <% if @check.persisted? %>
78
78
  <%= link_to "Delete", check_path(@check), method: :delete, "data-confirm" => "Are you sure?", class: "btn btn-danger" %>
@@ -75,7 +75,7 @@ module Blazer
75
75
  if sqlite?
76
76
  "SELECT NULL, name FROM sqlite_master WHERE type IN ('table', 'view') ORDER BY name"
77
77
  elsif postgresql?
78
- add_schemas("SELECT * FROM (SELECT table_schema, table_name FROM information_schema.tables UNION ALL SELECT n.nspname AS table_schema, c.relname AS table_name FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE c.relkind = 'm' AND has_any_column_privilege(c.oid, 'SELECT'))")
78
+ add_schemas("SELECT * FROM (SELECT table_schema, table_name FROM information_schema.tables UNION ALL SELECT n.nspname AS table_schema, c.relname AS table_name FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE c.relkind = 'm' AND has_any_column_privilege(c.oid, 'SELECT')) AS tables")
79
79
  else
80
80
  add_schemas("SELECT table_schema, table_name FROM information_schema.tables")
81
81
  end
@@ -106,7 +106,7 @@ module Blazer
106
106
  if sqlite?
107
107
  "SELECT NULL, t.name, c.name, c.type, c.cid FROM sqlite_master t INNER JOIN pragma_table_info(t.name) c WHERE t.type IN ('table', 'view')"
108
108
  elsif postgresql?
109
- add_schemas("SELECT * FROM (SELECT table_schema, table_name, column_name, data_type, ordinal_position FROM information_schema.columns UNION ALL SELECT n.nspname AS table_schema, c.relname AS table_name, a.attname AS column_name, format_type(a.atttypid, a.atttypmod) AS data_type, a.attnum AS ordinal_position FROM pg_attribute a INNER JOIN pg_class c ON a.attrelid = c.oid INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE a.attnum > 0 AND NOT a.attisdropped AND c.relkind = 'm' AND has_column_privilege(c.oid, a.attnum, 'SELECT'))")
109
+ add_schemas("SELECT * FROM (SELECT table_schema, table_name, column_name, data_type, ordinal_position FROM information_schema.columns UNION ALL SELECT n.nspname AS table_schema, c.relname AS table_name, a.attname AS column_name, format_type(a.atttypid, a.atttypmod) AS data_type, a.attnum AS ordinal_position FROM pg_attribute a INNER JOIN pg_class c ON a.attrelid = c.oid INNER JOIN pg_namespace n ON c.relnamespace = n.oid WHERE a.attnum > 0 AND NOT a.attisdropped AND c.relkind = 'm' AND has_column_privilege(c.oid, a.attnum, 'SELECT')) AS columns")
110
110
  else
111
111
  add_schemas("SELECT table_schema, table_name, column_name, data_type, ordinal_position FROM information_schema.columns")
112
112
  end
@@ -1,3 +1,3 @@
1
1
  module Blazer
2
- VERSION = "3.5.0"
2
+ VERSION = "3.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blazer
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  - !ruby/object:Gem::Version
230
230
  version: '0'
231
231
  requirements: []
232
- rubygems_version: 4.0.14
232
+ rubygems_version: 4.0.20
233
233
  specification_version: 4
234
234
  summary: Explore your data with SQL. Easily create charts and dashboards, and share
235
235
  them with your team.