activeadmin 4.0.0.beta8 → 4.0.0.beta9

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: a63b35e7f784fd50ba0471841cb52b10cf47f732c17e9a03b632303cedb922cf
4
- data.tar.gz: 54a8a264547063ddf0b1178310a4c8a00444aaa32796e4fe9abd72c04b2406aa
3
+ metadata.gz: 2f3c2998aa1c2b5375196a1f9ee0284c699e72a7637f9feab724c46ba0701cee
4
+ data.tar.gz: 670befa4df9c7d9634320c2735254a420adf7062789ec47ca4bdaa46c8915328
5
5
  SHA512:
6
- metadata.gz: 2f6a7cba813a4ce9af1f4192ab9dd96287b46044524927ab1c410875225f803ee970943658fe4942a59d6647791c61db30ab26479d87fa2db39fa92aeafb6258
7
- data.tar.gz: fe2b8edf174e2bafcc5efcf21d7cbd2f5f8aa5449aa2f66a2963f537116d41554d30cde07014230dcdfb100bd71f66071d3e96bb8a6ff487656df713c17d2693
6
+ metadata.gz: bc6cab08a78331723344a4307ac5259f30e090e69d6438433697fbf96d43df7a11ca5f5e88d19a3e0c7cf83f833a99d663e74df4f37122b8c1d71375c8c08bea
7
+ data.tar.gz: 927876e56533e12df325ab50e86058dce84cb47133924fc92559ce7329b376ef6d7f574ee35517ac4115f43cd49469a5ddc308716c51621fe726ff219895950f
data/README.md CHANGED
@@ -75,8 +75,8 @@ Thanks to [Tidelift][tidelift] and all our Tidelift subscribers.
75
75
  Thanks to [Open Collective][opencollective contributors] and all our Open Collective contributors.
76
76
 
77
77
  [Arbre]: https://github.com/activeadmin/arbre
78
- [Devise]: https://github.com/plataformatec/devise
79
- [Formtastic]: https://github.com/justinfrench/formtastic
78
+ [Devise]: https://github.com/heartcombo/devise
79
+ [Formtastic]: https://github.com/formtastic/formtastic
80
80
  [Inherited Resources]: https://github.com/activeadmin/inherited_resources
81
81
  [Kaminari]: https://github.com/kaminari/kaminari
82
82
  [Ransack]: https://github.com/activerecord-hackery/ransack
data/UPGRADING.md CHANGED
@@ -224,3 +224,4 @@ This release includes several locale changes. Please [reivew the en.yml locale](
224
224
  - The `comments.title_content` text has been updated with an "All " prefix.
225
225
  - The `comments.delete_confirmation` text has been fixed to use singular form.
226
226
  - Inconsistent use of login/sign-in related terms so text now uses "Sign in", Sign out", and "Sign up" throughout.
227
+ - The `toggle_dark_mode`, `toggle_main_navigation_menu`, `toggle_section`, and `toggle_user_menu` keys have been added.
@@ -1,10 +1,10 @@
1
- <div id="main-menu" class="fixed top-0 xl:top-16 bottom-0 start-0 z-40 w-72 xl:w-60 p-4 overflow-y-auto transition-transform duration-200 -translate-x-full xl:translate-x-0 bg-white dark:bg-gray-950 xl:border-e xl:border-gray-200 xl:dark:border-white/10" tabindex="-1" aria-labelledby="drawer-navigation-label">
1
+ <div id="main-menu" class="fixed top-0 xl:top-16 bottom-0 start-0 z-40 w-72 xl:w-60 p-4 overflow-y-auto transition-transform duration-200 -translate-x-full xl:translate-x-0 bg-white dark:bg-gray-950 xl:border-e xl:border-gray-200 xl:dark:border-white/10" tabindex="-1">
2
2
  <ul role="list" class="flex flex-1 flex-col space-y-1.5">
3
3
  <% current_menu.items(self).each do |item| %>
4
4
  <% children = item.items(self).presence %>
5
5
  <li <%= current_menu_item?(item) && "data-open" %> class="group" data-item-id="<%= item.id %>">
6
6
  <% if children %>
7
- <button data-menu-button class="text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white flex items-center w-full rounded-md p-2 gap-x-2 text-sm">
7
+ <button data-menu-button class="text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white flex items-center w-full rounded-md p-2 gap-x-2 text-sm" aria-label="<%= t('active_admin.toggle_section') %>">
8
8
  <%= item.label(self) %>
9
9
  <svg class="group-data-[open]:rotate-90 group-data-[open]:rtl:-rotate-90 ms-auto h-5 w-5 shrink-0 rtl:-scale-x-100" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
10
10
  <path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" />
@@ -1,5 +1,5 @@
1
1
  <div class="border-b border-gray-200 dark:border-white/10 dark:bg-gray-950/75 px-4 py-2 flex items-center sticky top-0 z-20 h-16 w-full backdrop-blur-md">
2
- <button class="xl:hidden pe-3 inline-flex items-center w-8 h-8 justify-center text-sm text-gray-500 dark:text-gray-400 focus-visible:outline-none focus-visible:ring-ring focus-visible:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0" data-drawer-target="main-menu" data-drawer-show="main-menu" aria-controls="drawer-navigation">
2
+ <button class="xl:hidden pe-3 inline-flex items-center w-8 h-8 justify-center text-sm text-gray-500 dark:text-gray-400 focus-visible:outline-none focus-visible:ring-ring focus-visible:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0" data-drawer-target="main-menu" data-drawer-show="main-menu" aria-controls="main-menu" aria-label="<%= t('active_admin.toggle_main_navigation_menu') %>">
3
3
  <svg class="w-5 h-5 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 17 14"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 1h15M1 7h15M1 13h15"/></svg>
4
4
  </button>
5
5
 
@@ -9,12 +9,12 @@
9
9
  </h1>
10
10
  </div>
11
11
 
12
- <button type="button" class="dark-mode-toggle flex items-center w-9 h-9 justify-center me-1 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400 focus:outline-none text-sm">
12
+ <button type="button" class="dark-mode-toggle flex items-center w-9 h-9 justify-center me-1 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400 focus:outline-none text-sm" aria-label="<%= t('active_admin.toggle_dark_mode') %>">
13
13
  <svg class="hidden dark:block w-5 h-5 rtl:-scale-x-100" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 20"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.509 5.75c0-1.493.394-2.96 1.144-4.25h-.081a8.5 8.5 0 1 0 7.356 12.746A8.5 8.5 0 0 1 8.509 5.75Z"/></svg>
14
14
  <svg class="dark:hidden w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 3V1m0 18v-2M5.05 5.05 3.636 3.636m12.728 12.728L14.95 14.95M3 10H1m18 0h-2M5.05 14.95l-1.414 1.414M16.364 3.636 14.95 5.05M14 10a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"/></svg>
15
15
  </button>
16
16
 
17
- <button id="user-menu-button" class="flex items-center w-9 h-9 justify-center text-sm text-gray-500 focus:outline-none dark:text-gray-200" data-dropdown-toggle="user-menu" data-dropdown-offset-distance="3" data-dropdown-placement="bottom-end">
17
+ <button id="user-menu-button" class="flex items-center w-9 h-9 justify-center text-sm text-gray-500 focus:outline-none dark:text-gray-200" data-dropdown-toggle="user-menu" data-dropdown-offset-distance="3" data-dropdown-placement="bottom-end" aria-label="<%= t('active_admin.toggle_user_menu') %>">
18
18
  <svg class="w-7 h-7" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 0a10 10 0 1 0 10 10A10.011 10.011 0 0 0 10 0Zm0 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm0 13a8.949 8.949 0 0 1-4.951-1.488A3.987 3.987 0 0 1 9 13h2a3.987 3.987 0 0 1 3.951 3.512A8.949 8.949 0 0 1 10 18Z"/></svg>
19
19
  </button>
20
20
 
@@ -52,6 +52,10 @@ en:
52
52
  "yes": "Yes"
53
53
  "no": "No"
54
54
  "unset": "Unknown"
55
+ toggle_dark_mode: Toggle dark mode
56
+ toggle_main_navigation_menu: Toggle main navigation menu
57
+ toggle_section: Toggle section
58
+ toggle_user_menu: Toggle user menu
55
59
  logout: "Sign out"
56
60
  powered_by: "Powered by %{active_admin} %{version}"
57
61
  sidebars:
@@ -52,6 +52,10 @@ it:
52
52
  "yes": "Sì"
53
53
  "no": "No"
54
54
  "unset": "Vuoto"
55
+ toggle_dark_mode: Attiva/Disattiva tema scuro
56
+ toggle_main_navigation_menu: Espandi/Riduci menu di navigazione principale
57
+ toggle_section: Espandi/Riduci sezione
58
+ toggle_user_menu: Espandi/Riduci menu utente
55
59
  logout: "Esci"
56
60
  powered_by: "Powered by %{active_admin} %{version}"
57
61
  sidebars:
@@ -42,7 +42,7 @@ module ActiveAdmin
42
42
  end
43
43
 
44
44
  def format_action(action, subject)
45
- # https://github.com/varvet/pundit/blob/master/lib/generators/pundit/install/templates/application_policy.rb
45
+ # https://github.com/varvet/pundit/blob/main/lib/generators/pundit/install/templates/application_policy.rb
46
46
  case action
47
47
  when Auth::READ then subject.is_a?(Class) ? :index? : :show?
48
48
  when Auth::DESTROY then subject.is_a?(Class) ? :destroy_all? : :destroy?
@@ -37,7 +37,14 @@ module ActiveAdmin
37
37
  end
38
38
 
39
39
  def counter_cache_col?(c)
40
- c.name.end_with?("_count")
40
+ # This helper is called inside a loop. Let's memoize the result.
41
+ @counter_cache_columns ||= begin
42
+ resource_class.reflect_on_all_associations(:has_many)
43
+ .select(&:has_cached_counter?)
44
+ .map(&:counter_cache_column)
45
+ end
46
+
47
+ @counter_cache_columns.include?(c.name)
41
48
  end
42
49
 
43
50
  def filtered_col?(c)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdmin
3
- VERSION = "4.0.0.beta8"
3
+ VERSION = "4.0.0.beta9"
4
4
  end
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.beta8
4
+ version: 4.0.0.beta9
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-07-27 00:00:00.000000000 Z
18
+ date: 2024-08-04 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: arbre