activeadmin 4.0.0.beta18 → 4.0.0.beta20
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/CONTRIBUTING.md +4 -0
- data/UPGRADING.md +40 -7
- data/app/controllers/active_admin/base_controller/menu.rb +2 -2
- data/app/javascript/active_admin/features/main_menu.js +3 -2
- data/app/views/active_admin/_main_navigation.html.erb +27 -10
- data/app/views/active_admin/_page_header.html.erb +2 -2
- data/app/views/active_admin/_site_footer.html.erb +1 -1
- data/app/views/active_admin/_site_header.html.erb +4 -4
- data/app/views/active_admin/shared/_resource_comments.html.erb +6 -6
- data/lib/active_admin/async_count.rb +1 -3
- data/lib/active_admin/menu.rb +2 -2
- data/lib/active_admin/orm/active_record/comments.rb +4 -4
- data/lib/active_admin/resource.rb +1 -1
- data/lib/active_admin/version.rb +1 -1
- data/lib/generators/active_admin/assets/templates/active_admin.css +3 -3
- data/lib/generators/active_admin/assets/templates/tailwind.config.js +2 -1
- data/plugin.js +22 -17
- metadata +4 -5
- data/vendor/bundle/offense.rb +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 15f9525d6a02bc6ebaef19b65cd6a455ac13349659993bbc7bd4ca2b078015a9
|
|
4
|
+
data.tar.gz: 405bc3808117da8f1111eb80fc0b67fed6d7f251b0e1fae0bf45731c69f87638
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 769deda0cc56d1fdf0d4d50d8a8fb29952eb23c04fd7539f17cbf7538b8b22e2e5f6fd701fcbf82a341cc941d7ffc0c646a05878bebd462058fd7a16161ab2b8
|
|
7
|
+
data.tar.gz: db187d391063e6628600d0eb26cb7f9e6d0ae42c08ee2340655905eeee02485ba7aa1afb2e99f532435544a1afa3ed85cc974425ff09c55be60e7921db970d55
|
data/CONTRIBUTING.md
CHANGED
|
@@ -84,6 +84,10 @@ At this point, if your changes look good and tests are passing, you are ready to
|
|
|
84
84
|
Github Actions will run our test suite against all supported Rails versions. It's possible that your changes pass tests in one Rails version but fail in another. In that case, you'll have to setup your development
|
|
85
85
|
environment with the Gemfile for the problematic Rails version, and investigate what's going on.
|
|
86
86
|
|
|
87
|
+
## Commit messages
|
|
88
|
+
|
|
89
|
+
Try your best to follow these [seven rules for a great commit message](https://cbea.ms/git-commit/#seven-rules).
|
|
90
|
+
|
|
87
91
|
## Merging a PR (maintainers only)
|
|
88
92
|
|
|
89
93
|
A PR can only be merged into master by a maintainer if: CI is passing, approved by another maintainer and is up to date with the default branch. Any maintainer is allowed to merge a PR if all of these conditions ae met.
|
data/UPGRADING.md
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
## From v3 to v4 (beta)
|
|
4
4
|
|
|
5
|
-
ActiveAdmin v4 uses Tailwind CSS
|
|
5
|
+
ActiveAdmin v4 uses Tailwind CSS v4. It has **mobile web, dark mode and RTL support** with a default theme that can be customized through partials and CSS. This release assumes `cssbundling-rails` and `importmap-rails` is installed and configured in the host app. Partials can be modified to include a different asset library, e.g. shakapacker.
|
|
6
6
|
**IMPORTANT**: there is **no sortable functionality for has-many forms** in this release so if needed, **do not upgrade**. We are [open to community proposals](https://github.com/activeadmin/activeadmin/discussions/new?category=ideas). The add/remove functionality for has-many forms remains supported.
|
|
7
7
|
|
|
8
8
|
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.
|
|
9
9
|
|
|
10
|
-
Update your `Gemfile` with `gem "activeadmin", "4.0.0.
|
|
10
|
+
Update your `Gemfile` with `gem "activeadmin", "4.0.0.beta20"` and then run `gem install activeadmin --pre`.
|
|
11
11
|
|
|
12
12
|
Now, run `rails generate active_admin:assets` to replace the old assets with the new files.
|
|
13
13
|
|
|
14
14
|
Then add the npm package and update the `build:css` script.
|
|
15
15
|
|
|
16
16
|
```
|
|
17
|
-
yarn add @activeadmin/activeadmin@4.0.0-
|
|
18
|
-
npm pkg set scripts.build:css="tailwindcss -i ./app/assets/stylesheets/active_admin.css -o ./app/assets/builds/active_admin.css --minify
|
|
17
|
+
yarn add @activeadmin/activeadmin@4.0.0-beta20
|
|
18
|
+
npm pkg set scripts.build:css="npx @tailwindcss/cli -i ./app/assets/stylesheets/active_admin.css -o ./app/assets/builds/active_admin.css --minify"
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
If you are already using Tailwind in your app, then update the `build:css` script to chain the above command to your existing one, e.g. `"tailwindcss ... && tailwindcss ..."`, so both stylesheets are generated.
|
|
21
|
+
If you are already using Tailwind in your app, then update the `build:css` script to chain the above command to your existing one, e.g. `"npx @tailwindcss/cli ... && npx @tailwindcss/cli ..."`, so both stylesheets are generated.
|
|
22
22
|
|
|
23
23
|
Many configs have been removed (meta tags, asset registration, utility nav, etc.) that can now be modified more naturally through partials.
|
|
24
24
|
|
|
@@ -46,12 +46,45 @@ Note that the templates can and will change across releases. There are additiona
|
|
|
46
46
|
|
|
47
47
|
With the setup complete, please review the Breaking Changes section and resolve any that may or may not impact your integration.
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
### Upgrading from an earlier 4.x beta release
|
|
50
50
|
|
|
51
|
+
When upgrading from any earlier 4.0.0 beta release, please apply the changes outlined below.
|
|
52
|
+
|
|
53
|
+
There were important template changes in 4.0.0.beta16. See [PR #8727](https://github.com/activeadmin/activeadmin/pull/8727) for details.
|
|
51
54
|
- The `_site_header.html.erb` partial has changed its main container class from `sticky` to `fixed`.
|
|
52
55
|
- The main layout for `active_admin.html.erb` now includes the `pt-16` utility class.
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
Starting with 4.0.0.beta19, we've migrated to Tailwind CSS v4 which requires several updates.
|
|
58
|
+
|
|
59
|
+
Update your `active_admin.css` file:
|
|
60
|
+
|
|
61
|
+
```diff
|
|
62
|
+
-@tailwind base;
|
|
63
|
+
-@tailwind components;
|
|
64
|
+
-@tailwind utilities;
|
|
65
|
+
+@import "tailwindcss";
|
|
66
|
+
+
|
|
67
|
+
+@config "../../../tailwind-active_admin.config.js";
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Update the `build:css` script in your `package.json`:
|
|
71
|
+
|
|
72
|
+
```diff
|
|
73
|
+
-"build:css": "tailwindcss -i ./app/assets/stylesheets/active_admin.css -o ./app/assets/builds/active_admin.css --minify -c tailwind-active_admin.config.js"
|
|
74
|
+
+"build:css": "npx @tailwindcss/cli -i ./app/assets/stylesheets/active_admin.css -o ./app/assets/builds/active_admin.css --minify"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
You may see the following warning when upgrading:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
[MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of tailwind-active_admin.config.js is not specified and it doesn't parse as CommonJS.
|
|
81
|
+
Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
|
|
82
|
+
To eliminate this warning, add "type": "module" to ./package.json.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The Tailwind config file now uses ES module syntax. To fix it, either:
|
|
86
|
+
- Rename `tailwind-active_admin.config.js` to `tailwind-active_admin.config.mjs`; or
|
|
87
|
+
- Add `"type": "module"` to your `package.json` (your application may already be compatible with ESM).
|
|
55
88
|
|
|
56
89
|
### Breaking Changes
|
|
57
90
|
- jQuery and jQuery UI have been removed.
|
|
@@ -17,8 +17,8 @@ module ActiveAdmin
|
|
|
17
17
|
active_admin_config.navigation_menu
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
def current_menu_item?(item)
|
|
21
|
-
item.current?(@current_menu_item)
|
|
20
|
+
def current_menu_item?(item, children: true)
|
|
21
|
+
item.current?(@current_menu_item, children: children)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def set_current_menu_item
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import Rails from '@rails/ujs';
|
|
2
2
|
|
|
3
|
-
const toggleMenu = function(
|
|
4
|
-
const parent = this.parentNode
|
|
3
|
+
const toggleMenu = function() {
|
|
4
|
+
const parent = this.closest([`[data-item-id="${this.dataset.parentId}"]`]) || this.parentNode
|
|
5
|
+
|
|
5
6
|
if (!("open" in parent.dataset)) {
|
|
6
7
|
parent.dataset.open = ""
|
|
7
8
|
} else {
|
|
@@ -2,25 +2,42 @@
|
|
|
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
|
+
<% url = item.url(self) %>
|
|
6
|
+
<% label = capture do %>
|
|
7
|
+
<% if url.present? %>
|
|
8
|
+
<%= link_to item.label(self), url, item.html_options.merge(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 no-underline #{(current_menu_item?(item, children: false) ? "bg-gray-100 dark:bg-white/5 text-gray-900 dark:text-white selected" : "")}") %>
|
|
9
|
+
<% else %>
|
|
10
|
+
<%= item.label(self) %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<% end %>
|
|
5
13
|
<li <%= current_menu_item?(item) && "data-open" %> class="group" data-item-id="<%= item.id %>">
|
|
6
14
|
<% if children %>
|
|
7
|
-
|
|
8
|
-
<%=
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
<% if url.present? && url == "#" %>
|
|
16
|
+
<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') %>">
|
|
17
|
+
<%= item.label(self) %>
|
|
18
|
+
<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">
|
|
19
|
+
<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" />
|
|
20
|
+
</svg>
|
|
21
|
+
</button>
|
|
22
|
+
<% elsif url.present? && url != "#" %>
|
|
23
|
+
<div data-parent-id="<%= item.id %>" data-menu-button class="flex">
|
|
24
|
+
<%= label %>
|
|
25
|
+
<button class="text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white flex items-center p-2 text-sm" aria-label="<%= t('active_admin.toggle_section') %>">
|
|
26
|
+
<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">
|
|
27
|
+
<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" />
|
|
28
|
+
</svg>
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
<% end %>
|
|
32
|
+
<ul role="list" class="mt-1 space-y-1 hidden group-data-open:block ms-1 ps-2 border-s-2 border-gray-100 dark:border-white/5">
|
|
14
33
|
<% children.each do |j| %>
|
|
15
34
|
<li data-item-id="<%= j.id %>">
|
|
16
35
|
<%= link_to j.label(self), j.url(self), j.html_options.merge(class: "text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white block rounded-md py-1.5 px-2 text-sm no-underline #{(current_menu_item?(j) ? "bg-gray-100 dark:bg-white/5 text-gray-900 dark:text-white selected" : "")}") %>
|
|
17
36
|
</li>
|
|
18
37
|
<% end %>
|
|
19
38
|
</ul>
|
|
20
|
-
<% elsif url = item.url(self) %>
|
|
21
|
-
<%= link_to item.label(self), url, item.html_options.merge(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 no-underline #{(current_menu_item?(item) ? "bg-gray-100 dark:bg-white/5 text-gray-900 dark:text-white selected" : "")}") %>
|
|
22
39
|
<% else %>
|
|
23
|
-
<%=
|
|
40
|
+
<%= label %>
|
|
24
41
|
<% end %>
|
|
25
42
|
</li>
|
|
26
43
|
<% end %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div data-test-page-header class="bg-gray-50 border-b p-4 mb-8 flex flex-col gap-4 md:flex-row md:items-center justify-between dark:border-gray-800/50 dark:bg-inherit">
|
|
1
|
+
<div data-test-page-header class="bg-gray-50 border-b border-gray-200 p-4 mb-8 flex flex-col gap-4 md:flex-row md:items-center justify-between dark:border-gray-800/50 dark:bg-inherit">
|
|
2
2
|
<div class="flex flex-col gap-3 pt-1">
|
|
3
3
|
<% breadcrumb_links = build_breadcrumb_links(request.path, class: "text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 no-underline") %>
|
|
4
4
|
<% if breadcrumb_links.present? %>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<% breadcrumb_links.each_with_index do |link, index| %>
|
|
8
8
|
<li class="inline-flex items-center h-5 gap-1">
|
|
9
9
|
<% if index > 0 %>
|
|
10
|
-
<svg class="h-5 w-5 text-gray-300 dark:text-gray-700
|
|
10
|
+
<svg class="h-5 w-5 text-gray-300 dark:text-gray-700 shrink-0 rtl:rotate-180" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
11
11
|
<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"/>
|
|
12
12
|
</svg>
|
|
13
13
|
<% end %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="text-sm text-center mt-16 mx-8 pt-9 pb-12 text-gray-500 border-t dark:border-gray-800">
|
|
1
|
+
<div class="text-sm text-center mt-16 mx-8 pt-9 pb-12 text-gray-500 border-t border-gray-200 dark:border-gray-800">
|
|
2
2
|
<%= I18n.t(
|
|
3
3
|
"active_admin.powered_by",
|
|
4
4
|
active_admin: link_to("Active Admin", "https://activeadmin.info", class: "text-gray-500 dark:text-gray-500 hover:text-gray-900 dark:hover:text-gray-400 no-underline"),
|
|
@@ -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 fixed 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-
|
|
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-hidden 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,16 +9,16 @@
|
|
|
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-
|
|
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-hidden 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-
|
|
17
|
+
<button id="user-menu-button" class="flex items-center w-9 h-9 justify-center text-sm text-gray-500 focus:outline-hidden 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
|
|
|
21
|
-
<div id="user-menu" class="z-50 hidden min-w-max rounded shadow-lg outline outline-
|
|
21
|
+
<div id="user-menu" class="z-50 hidden min-w-max rounded shadow-lg outline outline-black/5 dark:-outline-offset-1 dark:outline-white/10 focus:outline-hidden py-1 text-sm bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300" aria-labelledby="user-menu-button">
|
|
22
22
|
<ul>
|
|
23
23
|
<% if current_active_admin_user? %>
|
|
24
24
|
<li><%= auto_link current_active_admin_user, class: "block px-2.5 py-2 no-underline text-gray-700 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-white/5 dark:hover:text-white" %></li>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<div class="max-w-[700px]">
|
|
2
|
-
<div class="font-bold py-3 border-b dark:border-gray-600">
|
|
1
|
+
<div id="active-admin-comments-form" class="max-w-[700px]">
|
|
2
|
+
<div class="font-bold py-3 border-b border-gray-200 dark:border-gray-600">
|
|
3
3
|
<%= ActiveAdmin::Comment.model_name.human(count: 2.1) %>
|
|
4
4
|
</div>
|
|
5
5
|
<% if authorized?(ActiveAdmin::Auth::NEW, ActiveAdmin::Comment) %>
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
end
|
|
16
16
|
%>
|
|
17
17
|
<% end %>
|
|
18
|
-
<div class="font-bold py-3 border-b dark:border-gray-600">
|
|
18
|
+
<div class="font-bold py-3 border-b border-gray-200 dark:border-gray-600">
|
|
19
19
|
<%= I18n.t "active_admin.comments.title_content", count: comments.total_count %>
|
|
20
20
|
</div>
|
|
21
21
|
<% if comments.any? %>
|
|
22
22
|
<% comments.each do |comment| %>
|
|
23
|
-
<div class="border-b dark:border-gray-600 py-6 max-w-[700px]" id="<%= dom_id(comment, :active_admin) %>" data-test-comment-container>
|
|
23
|
+
<div class="border-b border-gray-200 dark:border-gray-600 py-6 max-w-[700px]" id="<%= dom_id(comment, :active_admin) %>" data-test-comment-container>
|
|
24
24
|
<div class="flex gap-4 items-end mb-2">
|
|
25
25
|
<span class="font-semibold">
|
|
26
26
|
<%= comment.author ? auto_link(comment.author) : I18n.t("active_admin.comments.author_missing") %>
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
<% end %>
|
|
38
38
|
</div>
|
|
39
39
|
<% end %>
|
|
40
|
-
<div class="
|
|
40
|
+
<div class="py-2 lg:py-4 flex flex-col-reverse lg:flex-row gap-4 items-center justify-between">
|
|
41
41
|
<div>
|
|
42
42
|
<%= page_entries_info(comments).html_safe %>
|
|
43
43
|
</div>
|
|
44
44
|
<%= paginate(comments, views_prefix: :active_admin, outer_window: 1, window: 2) %>
|
|
45
45
|
</div>
|
|
46
46
|
<% else %>
|
|
47
|
-
<div class="
|
|
47
|
+
<div class="py-8 text-center">
|
|
48
48
|
<%= I18n.t("active_admin.comments.no_comments_yet") %>
|
|
49
49
|
</div>
|
|
50
50
|
<% end %>
|
data/lib/active_admin/menu.rb
CHANGED
|
@@ -66,8 +66,8 @@ module ActiveAdmin
|
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
# Used in the UI to visually distinguish which menu item is selected.
|
|
69
|
-
def current?(item)
|
|
70
|
-
self == item || include?(item)
|
|
69
|
+
def current?(item, children: true)
|
|
70
|
+
self == item || (children && include?(item))
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
# Returns sorted array of menu items that should be displayed in this context.
|
|
@@ -93,13 +93,13 @@ ActiveAdmin.after_load do |app|
|
|
|
93
93
|
|
|
94
94
|
index do
|
|
95
95
|
column I18n.t("active_admin.comments.resource_type"), :resource_type
|
|
96
|
-
column I18n.t("active_admin.comments.resource"), :resource, class: "min-w-
|
|
96
|
+
column I18n.t("active_admin.comments.resource"), :resource, class: "min-w-28"
|
|
97
97
|
column I18n.t("active_admin.comments.author_type"), :author_type
|
|
98
98
|
column I18n.t("active_admin.comments.author"), :author
|
|
99
|
-
column I18n.t("active_admin.comments.body"), :body, class: "min-w-
|
|
100
|
-
truncate(comment.body, length:
|
|
99
|
+
column I18n.t("active_admin.comments.body"), :body, class: "min-w-52" do |comment|
|
|
100
|
+
truncate(comment.body, length: 50, separator: " ")
|
|
101
101
|
end
|
|
102
|
-
column I18n.t("active_admin.comments.created_at"), :created_at, class: "min-w-
|
|
102
|
+
column I18n.t("active_admin.comments.created_at"), :created_at, class: "min-w-52"
|
|
103
103
|
actions
|
|
104
104
|
end
|
|
105
105
|
end
|
|
@@ -71,7 +71,7 @@ module ActiveAdmin
|
|
|
71
71
|
module Base
|
|
72
72
|
def initialize(namespace, resource_class, options = {})
|
|
73
73
|
@namespace = namespace
|
|
74
|
-
@resource_class_name = "::#{resource_class.name}"
|
|
74
|
+
@resource_class_name = resource_class.respond_to?(:name) ? "::#{resource_class.name}" : resource_class.to_s
|
|
75
75
|
@options = options
|
|
76
76
|
@sort_order = options[:sort_order]
|
|
77
77
|
@member_actions = []
|
data/lib/active_admin/version.rb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
3
|
-
@tailwind
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
@config "../../../tailwind-active_admin.config.js";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { execSync } from 'child_process';
|
|
2
2
|
import activeAdminPlugin from '@activeadmin/activeadmin/plugin';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// Always use the last line of output since Bundler's DEBUG env will print additional lines.
|
|
5
|
+
const activeAdminPath = execSync('bundle show activeadmin', { encoding: 'utf-8' }).trim().split(/\r?\n/).pop();
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
content: [
|
data/plugin.js
CHANGED
|
@@ -47,6 +47,7 @@ export default plugin(
|
|
|
47
47
|
'textarea',
|
|
48
48
|
'select',
|
|
49
49
|
]]: {
|
|
50
|
+
'@apply dark:scheme-dark': {},
|
|
50
51
|
'appearance': 'none',
|
|
51
52
|
'padding': `${spacing[2]} ${spacing[3]}`,
|
|
52
53
|
'--tw-shadow': '0 0 #0000',
|
|
@@ -164,7 +165,11 @@ export default plugin(
|
|
|
164
165
|
)}")`,
|
|
165
166
|
'print-color-adjust': `exact`,
|
|
166
167
|
},
|
|
167
|
-
[
|
|
168
|
+
[[
|
|
169
|
+
`button:not(:disabled)`,
|
|
170
|
+
`[role='button']:not(:disabled)`,
|
|
171
|
+
`[type='file']`,
|
|
172
|
+
]]: {
|
|
168
173
|
cursor: 'pointer',
|
|
169
174
|
},
|
|
170
175
|
[`[type=file]::file-selector-button`]: {
|
|
@@ -181,7 +186,7 @@ export default plugin(
|
|
|
181
186
|
'@apply bg-white/5 border-white/5 text-white hover:bg-white/10': {}
|
|
182
187
|
},
|
|
183
188
|
'[type=checkbox]': {
|
|
184
|
-
'@apply w-4 h-4 bg-gray-100 border border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-white/5 dark:border-white/10': {}
|
|
189
|
+
'@apply w-4 h-4 bg-gray-100 border border-gray-300 rounded-sm focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-white/5 dark:border-white/10': {}
|
|
185
190
|
},
|
|
186
191
|
'[type=radio]': {
|
|
187
192
|
'@apply w-4 h-4 bg-gray-100 border border-gray-300 rounded-full focus:ring-2 focus:ring-blue-300 dark:focus:ring-blue-600 dark:focus:bg-blue-600 dark:bg-white/5 dark:border-white/10': {}
|
|
@@ -195,7 +200,7 @@ export default plugin(
|
|
|
195
200
|
});
|
|
196
201
|
addComponents({
|
|
197
202
|
'.action-item-button': {
|
|
198
|
-
'@apply py-2 px-3 text-sm font-medium no-underline text-gray-900 focus:outline-
|
|
203
|
+
'@apply py-2 px-3 text-sm font-medium no-underline text-gray-900 focus:outline-hidden bg-white rounded-md border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-700 dark:hover:text-white dark:hover:bg-gray-700': {}
|
|
199
204
|
},
|
|
200
205
|
'.index-data-table-toolbar': {
|
|
201
206
|
'@apply flex flex-col lg:flex-row gap-4 mb-4': {}
|
|
@@ -220,7 +225,7 @@ export default plugin(
|
|
|
220
225
|
'@apply inline-flex items-center justify-center rounded-full bg-indigo-100 text-indigo-700 dark:bg-indigo-800/60 dark:text-indigo-400 px-1.5 py-1 text-xs font-normal ms-2 leading-none': {}
|
|
221
226
|
},
|
|
222
227
|
'.paginated-collection': {
|
|
223
|
-
'@apply border border-gray-200 dark:border-gray-800 rounded-md shadow-
|
|
228
|
+
'@apply border border-gray-200 dark:border-gray-800 rounded-md shadow-xs overflow-hidden': {}
|
|
224
229
|
},
|
|
225
230
|
'.paginated-collection-contents': {
|
|
226
231
|
'@apply overflow-x-auto': {}
|
|
@@ -241,7 +246,7 @@ export default plugin(
|
|
|
241
246
|
'@apply w-full text-sm text-gray-800 dark:text-gray-300': {}
|
|
242
247
|
},
|
|
243
248
|
'.data-table :where(thead > tr > th)': {
|
|
244
|
-
'@apply px-3 py-3.5
|
|
249
|
+
'@apply px-3 py-3.5 font-semibold text-start text-xs uppercase border-b border-gray-200 text-gray-700 bg-gray-50 dark:bg-gray-950/50 dark:border-gray-800 dark:text-white': {}
|
|
245
250
|
},
|
|
246
251
|
'.data-table :where(thead > tr > th > a)': {
|
|
247
252
|
'@apply text-inherit no-underline inline-flex items-center gap-2': {}
|
|
@@ -256,7 +261,7 @@ export default plugin(
|
|
|
256
261
|
'@apply rotate-180': {}
|
|
257
262
|
},
|
|
258
263
|
'.data-table :where(tbody > tr)': {
|
|
259
|
-
'@apply border-b dark:border-gray-800 last:border-b-0': {}
|
|
264
|
+
'@apply border-b border-gray-200 dark:border-gray-800 last:border-b-0': {}
|
|
260
265
|
},
|
|
261
266
|
'.data-table :where(td)': {
|
|
262
267
|
'@apply px-3 py-4': {}
|
|
@@ -286,7 +291,7 @@ export default plugin(
|
|
|
286
291
|
'@apply flex gap-2 items-center': {}
|
|
287
292
|
},
|
|
288
293
|
'.filters-form-submit': {
|
|
289
|
-
'@apply min-w-
|
|
294
|
+
'@apply min-w-24 font-bold text-white bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:outline-hidden focus:ring-blue-300 rounded-md px-3 py-2 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 cursor-pointer': {}
|
|
290
295
|
},
|
|
291
296
|
'.filters-form-clear': {
|
|
292
297
|
'@apply rounded-md px-3 py-2 font-semibold text-gray-700 hover:bg-gray-100 no-underline dark:text-gray-400 dark:hover:bg-inherit dark:hover:text-gray-100 dark:focus:ring-blue-800': {}
|
|
@@ -307,13 +312,13 @@ export default plugin(
|
|
|
307
312
|
'@apply w-2.5 h-2.5': {}
|
|
308
313
|
},
|
|
309
314
|
'.batch-actions-dropdown-menu': {
|
|
310
|
-
'@apply z-10 hidden min-w-
|
|
315
|
+
'@apply z-10 hidden min-w-28 bg-white rounded-md shadow-lg ring-1 ring-black/5 focus:outline-hidden dark:bg-gray-800 py-1 text-sm text-gray-700 dark:text-gray-200': {}
|
|
311
316
|
},
|
|
312
317
|
'.batch-actions-dropdown-menu :where(li > a)': {
|
|
313
318
|
'@apply block px-2.5 py-2 no-underline text-gray-700 hover:bg-gray-100 hover:text-gray-900 dark:text-white dark:hover:bg-gray-700 dark:hover:text-white': {}
|
|
314
319
|
},
|
|
315
320
|
'.panel': {
|
|
316
|
-
'@apply mb-6 border border-gray-200 rounded-md shadow-
|
|
321
|
+
'@apply mb-6 border border-gray-200 rounded-md shadow-xs dark:border-gray-800': {}
|
|
317
322
|
},
|
|
318
323
|
'.panel-title': {
|
|
319
324
|
'@apply font-bold bg-gray-100 dark:bg-gray-950/50 rounded-t-md p-3': {}
|
|
@@ -322,13 +327,13 @@ export default plugin(
|
|
|
322
327
|
'@apply py-5 px-3': {}
|
|
323
328
|
},
|
|
324
329
|
'.attributes-table': {
|
|
325
|
-
'@apply overflow-hidden mb-6 border border-gray-200 rounded-md shadow-
|
|
330
|
+
'@apply overflow-hidden mb-6 border border-gray-200 rounded-md shadow-xs dark:border-gray-800': {}
|
|
326
331
|
},
|
|
327
332
|
'.attributes-table > :where(table)': {
|
|
328
333
|
'@apply w-full text-sm text-gray-800 dark:text-gray-300': {}
|
|
329
334
|
},
|
|
330
335
|
'.attributes-table :where(tbody > tr)': {
|
|
331
|
-
'@apply border-b dark:border-gray-800 last:border-b-0 align-baseline': {}
|
|
336
|
+
'@apply border-b border-gray-200 dark:border-gray-800 last:border-b-0 align-baseline': {}
|
|
332
337
|
},
|
|
333
338
|
'.attributes-table :where(tbody > tr > th)': {
|
|
334
339
|
'@apply w-32 sm:w-40 text-start text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-950/50 dark:text-gray-300': {}
|
|
@@ -349,8 +354,11 @@ export default plugin(
|
|
|
349
354
|
'.formtastic': {
|
|
350
355
|
'@apply text-sm': {}
|
|
351
356
|
},
|
|
357
|
+
'.formtastic :where(.inputs,.has-many-fields)': {
|
|
358
|
+
'@apply mb-6': {}
|
|
359
|
+
},
|
|
352
360
|
'.formtastic :where(.fieldset-title, .has-many-fields-title)': {
|
|
353
|
-
'@apply block w-full mb-3 border-b font-bold text-lg': {}
|
|
361
|
+
'@apply block w-full mb-3 border-b border-gray-200 dark:border-gray-800 font-bold text-lg': {}
|
|
354
362
|
},
|
|
355
363
|
'.formtastic :where(.label)': {
|
|
356
364
|
'@apply block mb-1.5': {}
|
|
@@ -395,16 +403,13 @@ export default plugin(
|
|
|
395
403
|
'@apply flex items-center gap-6': {}
|
|
396
404
|
},
|
|
397
405
|
'.formtastic :where([type=submit], [type=button], button)': {
|
|
398
|
-
'@apply font-bold text-white bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:outline-
|
|
406
|
+
'@apply font-bold text-white bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:outline-hidden focus:ring-blue-300 rounded-lg px-4 py-2 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 cursor-pointer': {}
|
|
399
407
|
},
|
|
400
408
|
'.formtastic :where(.actions .cancel-link)': {
|
|
401
409
|
'@apply font-semibold leading-6 text-gray-900 dark:text-white no-underline': {}
|
|
402
410
|
},
|
|
403
411
|
'.formtastic :where(.has-many-add)': {
|
|
404
|
-
'@apply inline-block py-3': {}
|
|
405
|
-
},
|
|
406
|
-
'.formtastic :where(.has-many-container)': {
|
|
407
|
-
'@apply space-y-8': {}
|
|
412
|
+
'@apply inline-block py-3 mb-3': {}
|
|
408
413
|
},
|
|
409
414
|
'.formtastic :where(.has-many-fields)': {
|
|
410
415
|
'@apply ps-3 border-s-4 border-s-gray-200 dark:border-s-gray-700': {}
|
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.
|
|
4
|
+
version: 4.0.0.beta20
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Charles Maresh
|
|
@@ -106,14 +106,14 @@ dependencies:
|
|
|
106
106
|
requirements:
|
|
107
107
|
- - ">="
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: '7.
|
|
109
|
+
version: '7.2'
|
|
110
110
|
type: :runtime
|
|
111
111
|
prerelease: false
|
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
|
113
113
|
requirements:
|
|
114
114
|
- - ">="
|
|
115
115
|
- !ruby/object:Gem::Version
|
|
116
|
-
version: '7.
|
|
116
|
+
version: '7.2'
|
|
117
117
|
- !ruby/object:Gem::Dependency
|
|
118
118
|
name: ransack
|
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -375,7 +375,6 @@ files:
|
|
|
375
375
|
- lib/generators/active_admin/resource/templates/resource.rb.erb
|
|
376
376
|
- lib/generators/active_admin/views_generator.rb
|
|
377
377
|
- plugin.js
|
|
378
|
-
- vendor/bundle/offense.rb
|
|
379
378
|
- vendor/javascript/flowbite.js
|
|
380
379
|
- vendor/javascript/rails_ujs_esm.js
|
|
381
380
|
homepage: https://activeadmin.info
|
|
@@ -404,7 +403,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
404
403
|
- !ruby/object:Gem::Version
|
|
405
404
|
version: '0'
|
|
406
405
|
requirements: []
|
|
407
|
-
rubygems_version: 3.
|
|
406
|
+
rubygems_version: 3.7.2
|
|
408
407
|
specification_version: 4
|
|
409
408
|
summary: Active Admin is a Ruby on Rails plugin for generating administration style
|
|
410
409
|
interfaces. It abstracts common business application patterns to make it simple
|
data/vendor/bundle/offense.rb
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
puts "Ciao"
|