activeadmin 4.0.0.beta3 → 4.0.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a88812de83608d40122d0287fed77af0d4656bbee68fadfd79c677454199f4a
4
- data.tar.gz: 34f685397087cba22f5e6cafd177408ed59a6f017d8a6547f12c0ee0729e99d4
3
+ metadata.gz: e198e3bd4e5f7b52e3f191631988c775aa5f9e20f0ecfd2077f0e877b21c371d
4
+ data.tar.gz: d84fdfbd6bb62bd3b0858c8e7eabb4ccd48fa7e925f93a84515df5304d946ae0
5
5
  SHA512:
6
- metadata.gz: 244c91983c690cfd851ef194b738034276a5d8f1b1d78006dcb9ae03b5c920c15a981e1b363b292282db4fa8952a463b6b9081ec1bcb2b38a6fa0376792e9982
7
- data.tar.gz: 4530d4d1123d312caf97bdee815beca6d2aa030de6c1e0a13f40258cefb5c6e04eec467ba304edfd4c917c41c3f93e564c8362889ceb842b83e8df5a180a4295
6
+ metadata.gz: 8824403283f1e085cee125f52536b43de4e863d1ec481b568af7e04c169d79c4a69ff54327e9569ef78c73b3ebca64ffadffbe49fa83eec0a0606833d5ea3d73
7
+ data.tar.gz: 4f1dd3d73411c0040931c7215c423a04084f3b242048d8b6734813a8f97709d748c283d0a57c867f3a3e430ee62edbd5415f3eda665f251655d8a0022e9ca129
data/CHANGELOG.md CHANGED
@@ -1,6 +1,22 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ [Future changelogs have moved to GitHub Releases](https://github.com/activeadmin/activeadmin/releases)
4
+
5
+ ## 3.2.0 [☰](https://github.com/activeadmin/activeadmin/compare/v3.1.0..v3.2.0)
6
+
7
+ ### Security Fixes
8
+
9
+ * Backport protect against CSV Injection. [#8167] by [@mgrunberg]
10
+
11
+ ### Enhancements
12
+
13
+ * Backport support citext column type in string filter. [#8165] by [@mgrunberg]
14
+ * Backport provide detail in DB statement timeout error for filters. [#8163] by [@mgrunberg]
15
+
16
+ ### Bug Fixes
17
+
18
+ * Backport make sure menu creation does not modify menu options. [#8166] by [@mgrunberg]
19
+ * Backport ransack error with filters when ActiveStorage is used. [#8164] by [@mgrunberg]
4
20
 
5
21
  ## 3.1.0 [☰](https://github.com/activeadmin/activeadmin/compare/v3.0.0..v3.1.0)
6
22
 
data/CONTRIBUTING.md CHANGED
@@ -92,15 +92,11 @@ A PR can only be merged into master by a maintainer if: CI is passing, approved
92
92
 
93
93
  Maintainers need to do the following to push out a release:
94
94
 
95
- * Switch to the master branch and make sure it's up to date.
96
- * Make sure you have [chandler] properly configured. Chandler is used to
97
- automatically submit github release notes from the changelog right after
98
- pushing the gem to rubygems.
99
- * Update the version in the `lib/active_admin/version.rb` file.
100
- * Run `bin/bundle` to update all gemfiles.
101
- * Update the `package.json` version. [Prerelease format is 1.0.0-beta1](https://github.com/rails/rails/blob/0d0c30e534af7f80ec8b18eb946aaa613ca30444/tasks/release.rb#L26).
102
- * Review and merge the PR. The generated changelog in the PR should include all user visible changes you intend to ship.
103
- * Run `bin/rake release` from the target branch once the PR is merged.
104
-
105
- [chandler]: https://github.com/mattbrictson/chandler#2-configure-credentials
95
+ * Create a feature branch from master and make sure it's up to date.
96
+ * Run `bin/prep-release [version]` and commit the changes. Use Ruby version format. NPM is handled automatically.
97
+ * Optional: To confirm the release contents, run `gem build` (extract contents) and `npm publish --dry-run`.
98
+ * Review and merge the PR.
99
+ * Run `bin/rake release` from the default branch once the PR is merged.
100
+ * [Create a GitHub Release](https://github.com/activeadmin/activeadmin/releases/new) by selecting the tag and generating the release notes.
101
+
106
102
  [new issue]: https://github.com/activeadmin/activeadmin/issues/new
data/UPGRADING.md CHANGED
@@ -8,14 +8,14 @@ ActiveAdmin v4 uses TailwindCSS. It has **mobile web, dark mode and RTL support*
8
8
 
9
9
  These instructions assume the `cssbundling-rails` and `importmap-rails` gems are already installed and you have run their install commands in your app. If you haven't done so, please do before continuing.
10
10
 
11
- Update your `Gemfile` with `gem "activeadmin", "4.0.0.beta2"` and then run `gem install activeadmin --pre`.
11
+ Update your `Gemfile` with `gem "activeadmin", "4.0.0.beta3"` and then run `gem install activeadmin --pre`.
12
12
 
13
13
  Now, run `rails generate active_admin:assets` to replace the old assets with the new files.
14
14
 
15
15
  Then add the npm package and update the `build:css` script.
16
16
 
17
17
  ```
18
- yarn add @activeadmin/activeadmin@4.0.0-beta2
18
+ yarn add @activeadmin/activeadmin@4.0.0-beta3
19
19
  npm pkg set scripts.build:css="tailwindcss -i ./app/assets/stylesheets/active_admin.css -o ./app/assets/builds/active_admin.css --minify -c tailwind-active_admin.config.js"
20
20
  ```
21
21
 
@@ -191,8 +191,7 @@ Note that `@post` can also be used here but make sure to call `authorize!` on it
191
191
  This release includes several locale changes. Please [reivew the en.yml locale](https://github.com/activeadmin/activeadmin/blob/master/config/locales/en.yml) for the latest translations.
192
192
 
193
193
  - The `dashboard_welcome`, `dropdown_actions`, `main_content` and `unsupported_browser` keys have been removed.
194
- - Overriding Kaminari's `previous` and `next` pagination keys to only use words and remove HTML entities.
195
- - The `active_admin.pagination` keys have been rewritten to be less verbose.
194
+ - The `active_admin.pagination` keys have been rewritten to be less verbose and include new entries: next and previous.
196
195
 
197
196
  ```diff
198
197
  - one: "Displaying <b>1</b> %{model}"
@@ -205,6 +204,8 @@ This release includes several locale changes. Please [reivew the en.yml locale](
205
204
  + multiple_without_total: "Showing <b>%{from}-%{to}</b>"
206
205
  - per_page: "Per page: "
207
206
  + per_page: "Per page "
207
+ + previous: "Previous"
208
+ + next: "Next"
208
209
  ```
209
210
 
210
211
  - The `search_status` key contents has multiple, breaking changes:
@@ -40,7 +40,7 @@ module ActiveAdmin
40
40
  case params[:action].to_sym
41
41
  when :index
42
42
  active_admin_config.get_page_presenter(params[:action], params[:as])
43
- when :new, :edit
43
+ when :new, :edit, :create, :update
44
44
  active_admin_config.get_page_presenter(:form)
45
45
  end || super
46
46
  end
@@ -8,7 +8,7 @@
8
8
  -%>
9
9
  <% unless current_page.last? %>
10
10
  <%= link_to url, rel: 'next', remote: remote, class: "flex items-center justify-center px-2.5 py-3 h-8 leading-tight text-gray-500 dark:text-gray-400 hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-800 dark:hover:text-white rounded no-underline" do %>
11
- <span class="sr-only"><%= t('views.pagination.next').html_safe %></span>
11
+ <span class="sr-only"><%= t('active_admin.pagination.next') %></span>
12
12
  <svg class="w-2.5 h-2.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 6 10">
13
13
  <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 9 4-4-4-4"/>
14
14
  </svg>
@@ -8,7 +8,7 @@
8
8
  -%>
9
9
  <% unless current_page.first? %>
10
10
  <%= link_to url, rel: 'prev', remote: remote, class: "flex items-center justify-center px-2.5 py-3 h-8 leading-tight text-gray-500 dark:text-gray-400 hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-800 dark:hover:text-white rounded no-underline" do %>
11
- <span class="sr-only"><%= t('views.pagination.previous').html_safe %></span>
11
+ <span class="sr-only"><%= t('active_admin.pagination.previous') %></span>
12
12
  <svg class="w-2.5 h-2.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 6 10">
13
13
  <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 1 1 5l4 4"/>
14
14
  </svg>
data/config/importmap.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  pin "flowbite", preload: true # downloaded from https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.2.1/flowbite.min.js
3
- pin "@rails/ujs", to: "https://ga.jspm.io/npm:@rails/ujs@7.1.2/app/assets/javascripts/rails-ujs.esm.js", preload: true
3
+ pin "@rails/ujs", to: "rails_ujs_esm.js", preload: true # downloaded from https://cdn.jsdelivr.net/npm/@rails/ujs@7.1.2/+esm
4
4
  pin "active_admin", to: "active_admin.js", preload: true
5
5
  pin_all_from File.expand_path("../app/javascript/active_admin", __dir__), under: "active_admin", preload: true
@@ -1,8 +1,4 @@
1
1
  en:
2
- views:
3
- pagination:
4
- previous: "Previous"
5
- next: "Next"
6
2
  activerecord:
7
3
  models:
8
4
  comment:
@@ -68,6 +64,8 @@ en:
68
64
  multiple: "Showing <b>%{from}-%{to}</b> of <b>%{total}</b>"
69
65
  multiple_without_total: "Showing <b>%{from}-%{to}</b>"
70
66
  per_page: "Per page "
67
+ previous: "Previous"
68
+ next: "Next"
71
69
  entry:
72
70
  one: "entry"
73
71
  other: "entries"
@@ -1,8 +1,4 @@
1
1
  fr:
2
- views:
3
- pagination:
4
- previous: "Précédent"
5
- next: "Suivant"
6
2
  activerecord:
7
3
  models:
8
4
  comment:
@@ -65,6 +61,8 @@ fr:
65
61
  multiple: "Affichage de <b>%{from}-%{to}</b> sur <b>%{total}</b>"
66
62
  multiple_without_total: "Affichage de <b>%{from}-%{to}</b>"
67
63
  per_page: "Par page "
64
+ previous: "Précédent"
65
+ next: "Suivant"
68
66
  entry:
69
67
  one: "entrée"
70
68
  other: "entrées"
@@ -1,8 +1,4 @@
1
1
  nl:
2
- views:
3
- pagination:
4
- previous: "Vorige"
5
- next: "Volgende"
6
2
  active_admin:
7
3
  dashboard: Dashboard
8
4
  view: "Bekijk"
@@ -52,6 +48,8 @@ nl:
52
48
  multiple: "Toont <b>%{from}-%{to}</b> van <b>%{total}</b>"
53
49
  multiple_without_total: "Toont <b>%{from}-%{to}</b>"
54
50
  per_page: "Per pagina: "
51
+ previous: "Vorige"
52
+ next: "Volgende"
55
53
  entry:
56
54
  one: "entry"
57
55
  other: "entries"
@@ -15,7 +15,10 @@ module ActiveAdmin
15
15
  end
16
16
  end
17
17
 
18
- initializer "active_admin.importmap", before: "importmap" do |app|
18
+ initializer "active_admin.importmap", after: "importmap" do |app|
19
+ # Skip if importmap-rails is not installed
20
+ next unless app.config.respond_to?(:importmap)
21
+
19
22
  ActiveAdmin.importmap.draw(Engine.root.join("config", "importmap.rb"))
20
23
  package_path = Engine.root.join("app/javascript")
21
24
  if app.config.respond_to?(:assets)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdmin
3
- VERSION = "4.0.0.beta3"
3
+ VERSION = "4.0.0.beta4"
4
4
  end
data/lib/active_admin.rb CHANGED
@@ -9,6 +9,12 @@ require "formtastic_i18n"
9
9
  require "inherited_resources"
10
10
  require "arbre"
11
11
 
12
+ begin
13
+ require "importmap-rails"
14
+ rescue LoadError
15
+ # importmap-rails is optional
16
+ end
17
+
12
18
  module ActiveAdmin
13
19
 
14
20
  autoload :VERSION, "active_admin/version"
@@ -57,7 +63,6 @@ module ActiveAdmin
57
63
  end
58
64
 
59
65
  def importmap
60
- require "importmap-rails"
61
66
  @importmap ||= Importmap::Map.new
62
67
  end
63
68
 
@@ -16,8 +16,12 @@ module ActiveAdmin
16
16
  @attributes ||= class_name.constantize.new.attributes.keys
17
17
  end
18
18
 
19
+ def primary_key
20
+ @primary_key ||= [class_name.constantize.primary_key].flatten
21
+ end
22
+
19
23
  def assignable_attributes
20
- @assignable_attributes ||= attributes - %w(id created_at updated_at)
24
+ @assignable_attributes ||= attributes - primary_key - %w(created_at updated_at)
21
25
  end
22
26
 
23
27
  def permit_params
@@ -33,7 +37,7 @@ module ActiveAdmin
33
37
  end
34
38
 
35
39
  def columns
36
- attributes.map { |a| column(a) }.join("\n ")
40
+ (attributes - primary_key).map { |a| column(a) }.join("\n ")
37
41
  end
38
42
 
39
43
  def column(name)
data/plugin.js CHANGED
@@ -513,10 +513,10 @@ module.exports = plugin(
513
513
  '@apply text-gray-500 mt-2': {}
514
514
  },
515
515
  '.formtastic :where(.errors)': {
516
- '@apply p-4 mb-2 rounded-lg bg-red-50 text-red-800 dark:bg-red-800 dark:text-red-300': {}
516
+ '@apply p-4 mb-6 rounded-md space-y-2 bg-red-50 text-red-800 dark:bg-red-800 dark:text-red-300': {}
517
517
  },
518
518
  '.formtastic :where(.errors > li)': {
519
- '@apply list-disc ms-4 mb-1': {}
519
+ '@apply list-disc ms-4': {}
520
520
  },
521
521
  '.formtastic :where(.inline-errors)': {
522
522
  '@apply font-bold mt-2 text-red-600 dark:text-red-300': {}
@@ -0,0 +1 @@
1
+ const t="a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",e={selector:"button[data-remote]:not([form]), button[data-confirm]:not([form])",exclude:"form button"},n="select[data-remote], input[data-remote], textarea[data-remote]",a="form:not([data-turbo=true])",o="form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",r="input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",i="input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",u="a[data-disable-with], a[data-disable]",c="button[data-remote][data-disable-with], button[data-remote][data-disable]";let s=null;const l=()=>{const t=document.querySelector("meta[name=csp-nonce]");return s=t&&t.content},d=()=>s||l(),m=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector,p=function(t,e){return e.exclude?m.call(t,e.selector)&&!m.call(t,e.exclude):m.call(t,e)},f="_ujsData",b=(t,e)=>t[f]?t[f][e]:void 0,h=function(t,e,n){return t[f]||(t[f]={}),t[f][e]=n},y=t=>Array.prototype.slice.call(document.querySelectorAll(t)),j=function(t){var e=!1;do{if(t.isContentEditable){e=!0;break}t=t.parentElement}while(t);return e},v=()=>{const t=document.querySelector("meta[name=csrf-token]");return t&&t.content},E=()=>{const t=document.querySelector("meta[name=csrf-param]");return t&&t.content},g=t=>{const e=v();if(e)return t.setRequestHeader("X-CSRF-Token",e)},w=()=>{const t=v(),e=E();if(t&&e)return y('form input[name="'+e+'"]').forEach((e=>e.value=t))},x={"*":"*/*",text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript",script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},S=t=>{t=k(t);var e=C(t,(function(){const n=T(null!=e.response?e.response:e.responseText,e.getResponseHeader("Content-Type"));return 2===Math.floor(e.status/100)?"function"==typeof t.success&&t.success(n,e.statusText,e):"function"==typeof t.error&&t.error(n,e.statusText,e),"function"==typeof t.complete?t.complete(e,e.statusText):void 0}));return!(t.beforeSend&&!t.beforeSend(e,t))&&(e.readyState===XMLHttpRequest.OPENED?e.send(t.data):void 0)};var k=function(t){return t.url=t.url||location.href,t.type=t.type.toUpperCase(),"GET"===t.type&&t.data&&(t.url.indexOf("?")<0?t.url+="?"+t.data:t.url+="&"+t.data),t.dataType in x||(t.dataType="*"),t.accept=x[t.dataType],"*"!==t.dataType&&(t.accept+=", */*; q=0.01"),t},C=function(t,e){const n=new XMLHttpRequest;return n.open(t.type,t.url,!0),n.setRequestHeader("Accept",t.accept),"string"==typeof t.data&&n.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.crossDomain||(n.setRequestHeader("X-Requested-With","XMLHttpRequest"),g(n)),n.withCredentials=!!t.withCredentials,n.onreadystatechange=function(){if(n.readyState===XMLHttpRequest.DONE)return e(n)},n},T=function(t,e){if("string"==typeof t&&"string"==typeof e)if(e.match(/\bjson\b/))try{t=JSON.parse(t)}catch(t){}else if(e.match(/\b(?:java|ecma)script\b/)){const e=document.createElement("script");e.setAttribute("nonce",d()),e.text=t,document.head.appendChild(e).parentNode.removeChild(e)}else if(e.match(/\b(xml|html|svg)\b/)){const n=new DOMParser;e=e.replace(/;.+/,"");try{t=n.parseFromString(t,e)}catch(t){}}return t};const A=function(t){const e=document.createElement("a");e.href=location.href;const n=document.createElement("a");try{return n.href=t,!((!n.protocol||":"===n.protocol)&&!n.host||e.protocol+"//"+e.host==n.protocol+"//"+n.host)}catch(t){return!0}};let D,{CustomEvent:M}=window;"function"!=typeof M&&(M=function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n},M.prototype=window.Event.prototype,({preventDefault:D}=M.prototype),M.prototype.preventDefault=function(){const t=D.call(this);return this.cancelable&&!this.defaultPrevented&&Object.defineProperty(this,"defaultPrevented",{get:()=>!0}),t});const L=(t,e,n)=>{const a=new M(e,{bubbles:!0,cancelable:!0,detail:n});return t.dispatchEvent(a),!a.defaultPrevented},R=t=>{L(t.target,"ujs:everythingStopped"),t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()},q=(t,e,n,a)=>t.addEventListener(n,(function(t){let{target:n}=t;for(;n instanceof Element&&!p(n,e);)n=n.parentNode;n instanceof Element&&!1===a.call(n,t)&&(t.preventDefault(),t.stopPropagation())})),H=t=>Array.prototype.slice.call(t),P=(t,e)=>{let n=[t];p(t,"form")&&(n=H(t.elements));const a=[];return n.forEach((function(t){t.name&&!t.disabled&&(p(t,"fieldset[disabled] *")||(p(t,"select")?H(t.options).forEach((function(e){e.selected&&a.push({name:t.name,value:e.value})})):(t.checked||-1===["radio","checkbox","submit"].indexOf(t.type))&&a.push({name:t.name,value:t.value})))})),e&&a.push(e),a.map((function(t){return t.name?`${encodeURIComponent(t.name)}=${encodeURIComponent(t.value)}`:t})).join("&")},O=(t,e)=>p(t,"form")?H(t.elements).filter((t=>p(t,e))):H(t.querySelectorAll(e));var I=function(t,e){let n;const a=t.getAttribute("data-confirm");if(!a)return!0;let o=!1;if(L(t,"confirm")){try{o=e.confirm(a,t)}catch(t){}n=L(t,"confirm:complete",[o])}return o&&n};const N=function(t){this.disabled&&R(t)},X=t=>{let e;if(t instanceof Event){if(K(t))return;e=t.target}else e=t;if(!j(e))return p(e,u)?F(e):p(e,c)||p(e,i)?z(e):p(e,a)?G(e):void 0},$=t=>{const e=t instanceof Event?t.target:t;if(!j(e))return p(e,u)?_(e):p(e,c)||p(e,r)?U(e):p(e,a)?Q(e):void 0};var _=function(t){if(b(t,"ujs:disabled"))return;const e=t.getAttribute("data-disable-with");return null!=e&&(h(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e),t.addEventListener("click",R),h(t,"ujs:disabled",!0)},F=function(t){const e=b(t,"ujs:enable-with");return null!=e&&(t.innerHTML=e,h(t,"ujs:enable-with",null)),t.removeEventListener("click",R),h(t,"ujs:disabled",null)},Q=t=>O(t,r).forEach(U),U=function(t){if(b(t,"ujs:disabled"))return;const e=t.getAttribute("data-disable-with");return null!=e&&(p(t,"button")?(h(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e):(h(t,"ujs:enable-with",t.value),t.value=e)),t.disabled=!0,h(t,"ujs:disabled",!0)},G=t=>O(t,i).forEach((t=>z(t))),z=function(t){const e=b(t,"ujs:enable-with");return null!=e&&(p(t,"button")?t.innerHTML=e:t.value=e,h(t,"ujs:enable-with",null)),t.disabled=!1,h(t,"ujs:disabled",null)},K=function(t){const e=t.detail?t.detail[0]:void 0;return e&&e.getResponseHeader("X-Xhr-Redirect")};const B=function(t){const e=this,{form:n}=e;if(n)return e.name&&h(n,"ujs:submit-button",{name:e.name,value:e.value}),h(n,"ujs:formnovalidate-button",e.formNoValidate),h(n,"ujs:submit-button-formaction",e.getAttribute("formaction")),h(n,"ujs:submit-button-formmethod",e.getAttribute("formmethod"))},J=function(t){const e=(this.getAttribute("data-method")||"GET").toUpperCase(),n=this.getAttribute("data-params"),a=(t.metaKey||t.ctrlKey)&&"GET"===e&&!n;(null!=t.button&&0!==t.button||a)&&t.stopImmediatePropagation()},V={$:y,ajax:S,buttonClickSelector:e,buttonDisableSelector:c,confirm:(t,e)=>window.confirm(t),cspNonce:d,csrfToken:v,csrfParam:E,CSRFProtection:g,delegate:q,disableElement:$,enableElement:X,fileInputSelector:"input[name][type=file]:not([disabled])",fire:L,formElements:O,formEnableSelector:i,formDisableSelector:r,formInputClickSelector:o,formSubmitButtonClick:B,formSubmitSelector:a,getData:b,handleDisabledElement:N,href:t=>t.href,inputChangeSelector:n,isCrossDomain:A,linkClickSelector:t,linkDisableSelector:u,loadCSPNonce:l,matches:p,preventInsignificantClick:J,refreshCSRFTokens:w,serializeElement:P,setData:h,stopEverything:R},W=(Y=V,function(t){I(this,Y)||R(t)});var Y;V.handleConfirm=W;const Z=(t=>function(e){const n=this,a=n.getAttribute("data-method");if(!a)return;if(j(this))return;const o=t.href(n),r=v(),i=E(),u=document.createElement("form");let c=`<input name='_method' value='${a}' type='hidden' />`;i&&r&&!A(o)&&(c+=`<input name='${i}' value='${r}' type='hidden' />`),c+='<input type="submit" />',u.method="post",u.action=o,u.target=n.target,u.innerHTML=c,u.style.display="none",document.body.appendChild(u),u.querySelector('[type="submit"]').click(),R(e)})(V);V.handleMethod=Z;const tt=(t=>function(o){let r,i,u;const c=this;if(!function(t){const e=t.getAttribute("data-remote");return null!=e&&"false"!==e}(c))return!0;if(!L(c,"ajax:before"))return L(c,"ajax:stopped"),!1;if(j(c))return L(c,"ajax:stopped"),!1;const s=c.getAttribute("data-with-credentials"),l=c.getAttribute("data-type")||"script";if(p(c,a)){const t=b(c,"ujs:submit-button");i=b(c,"ujs:submit-button-formmethod")||c.getAttribute("method")||"get",u=b(c,"ujs:submit-button-formaction")||c.getAttribute("action")||location.href,"GET"===i.toUpperCase()&&(u=u.replace(/\?.*$/,"")),"multipart/form-data"===c.enctype?(r=new FormData(c),null!=t&&r.append(t.name,t.value)):r=P(c,t),h(c,"ujs:submit-button",null),h(c,"ujs:submit-button-formmethod",null),h(c,"ujs:submit-button-formaction",null)}else p(c,e)||p(c,n)?(i=c.getAttribute("data-method"),u=c.getAttribute("data-url"),r=P(c,c.getAttribute("data-params"))):(i=c.getAttribute("data-method"),u=t.href(c),r=c.getAttribute("data-params"));S({type:i||"GET",url:u,data:r,dataType:l,beforeSend:(t,e)=>L(c,"ajax:beforeSend",[t,e])?L(c,"ajax:send",[t]):(L(c,"ajax:stopped"),!1),success:(...t)=>L(c,"ajax:success",t),error:(...t)=>L(c,"ajax:error",t),complete:(...t)=>L(c,"ajax:complete",t),crossDomain:A(u),withCredentials:null!=s&&"false"!==s}),R(o)})(V);V.handleRemote=tt;if(V.start=function(){if(window._rails_loaded)throw new Error("rails-ujs has already been loaded!");return window.addEventListener("pageshow",(function(){y(i).forEach((function(t){b(t,"ujs:disabled")&&X(t)})),y(u).forEach((function(t){b(t,"ujs:disabled")&&X(t)}))})),q(document,u,"ajax:complete",X),q(document,u,"ajax:stopped",X),q(document,c,"ajax:complete",X),q(document,c,"ajax:stopped",X),q(document,t,"click",J),q(document,t,"click",N),q(document,t,"click",W),q(document,t,"click",$),q(document,t,"click",tt),q(document,t,"click",Z),q(document,e,"click",J),q(document,e,"click",N),q(document,e,"click",W),q(document,e,"click",$),q(document,e,"click",tt),q(document,n,"change",N),q(document,n,"change",W),q(document,n,"change",tt),q(document,a,"submit",N),q(document,a,"submit",W),q(document,a,"submit",tt),q(document,a,"submit",(t=>setTimeout((()=>$(t)),13))),q(document,a,"ajax:send",$),q(document,a,"ajax:complete",X),q(document,o,"click",J),q(document,o,"click",N),q(document,o,"click",W),q(document,o,"click",B),document.addEventListener("DOMContentLoaded",w),document.addEventListener("DOMContentLoaded",l),window._rails_loaded=!0},"undefined"!=typeof jQuery&&jQuery&&jQuery.ajax){if(jQuery.rails)throw new Error("If you load both jquery_ujs and rails-ujs, use rails-ujs only.");jQuery.rails=V,jQuery.ajaxPrefilter((function(t,e,n){if(!t.crossDomain)return g(n)}))}export{V as default};
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.beta3
4
+ version: 4.0.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Maresh
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2024-01-06 00:00:00.000000000 Z
18
+ date: 2024-01-17 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: arbre
@@ -203,7 +203,6 @@ files:
203
203
  - app/views/active_admin/shared/_sidebar_sections.html.erb
204
204
  - app/views/layouts/active_admin.html.erb
205
205
  - app/views/layouts/active_admin_logged_out.html.erb
206
- - config/i18n-tasks.yml
207
206
  - config/importmap.rb
208
207
  - config/locales/ar.yml
209
208
  - config/locales/az.yml
@@ -365,6 +364,7 @@ files:
365
364
  - lib/generators/active_admin/views_generator.rb
366
365
  - plugin.js
367
366
  - vendor/javascript/flowbite.js
367
+ - vendor/javascript/rails_ujs_esm.js
368
368
  homepage: https://activeadmin.info
369
369
  licenses:
370
370
  - MIT
@@ -1,37 +0,0 @@
1
- # The "main" locale
2
- base_locale: en
3
-
4
- # Read and write translations
5
- data:
6
- yaml:
7
- write:
8
- # Do not wrap lines at 80 characters
9
- line_width: -1
10
-
11
- # Find translate calls
12
- search:
13
- # Paths or `File.find` patterns to search in
14
- paths:
15
- - app
16
- - lib
17
-
18
- # Files or `File.fnmatch` patterns to exclude from search
19
- exclude:
20
- - app/assets/images
21
- - tasks/tmp
22
-
23
- # Guess usages such as t("categories.#{category}.title")
24
- strict: false
25
-
26
- ignore_inconsistent_interpolations:
27
- - active_admin.new_model
28
- - active_admin.edit_model
29
- - active_admin.delete_model
30
- - active_admin.details
31
- - active_admin.has_many_new
32
- - active_admin.pagination.empty
33
- - active_admin.pagination.one
34
- - active_admin.pagination.one_page
35
- - active_admin.pagination.multiple
36
- - active_admin.pagination.multiple_without_total
37
- - active_admin.blank_slate.content