-
Notifications
You must be signed in to change notification settings - Fork 1
add support of active admin v4 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,11 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| source "https://rubygems.org" | ||
|
|
||
| gemspec | ||
|
|
||
| default_rails_version = "7.2.0" | ||
| default_activeadmin_version = "3.5.0" | ||
|
|
||
| rails_version = ENV.fetch("RAILS", default_rails_version) | ||
| activeadmin_version = ENV.fetch("AA", default_activeadmin_version) | ||
| # 0.6.x uses openid_connect 1.x (httpclient, no faraday) — required for | ||
| # host apps still on faraday 1.x. 0.7.x uses openid_connect 2.x (faraday 2.x). | ||
| ooidc_version = ENV["OOIDC"] | ||
|
|
||
| gem "rails", "~> #{rails_version}" | ||
| gem "activerecord", "~> #{rails_version}" | ||
| gem "activeadmin", "~> #{activeadmin_version}" | ||
| gem "omniauth_openid_connect", "~> #{ooidc_version}" if ooidc_version | ||
| # Local development and `rake spec:all` (run without BUNDLE_GEMFILE) | ||
| # default to the ActiveAdmin 3.5 stack. CI selects a specific stack via | ||
| # BUNDLE_GEMFILE — see gemfiles/activeadmin_3.5.gemfile (Sprockets/Sassc) | ||
| # and gemfiles/activeadmin_4.0.gemfile (Propshaft/importmap/Tailwind). | ||
| # | ||
| # eval_gemfile keeps a single source of truth: the `gemspec path: ".."` | ||
| # inside the eval'd file resolves relative to gemfiles/, i.e. this repo | ||
| # root, exactly as it does when CI loads the gemfile directly. | ||
| eval_gemfile File.expand_path("gemfiles/activeadmin_3.5.gemfile", __dir__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,24 @@ | ||
| <div id="login"> | ||
| <h2><%= active_admin_application.site_title(self) %></h2> | ||
| <% if ActiveAdmin::Oidc.aa_v4? %> | ||
| <div class="p-6 sm:p-8 space-y-4 md:space-y-6 w-full sm:max-w-md bg-white sm:rounded-md shadow dark:border dark:bg-gray-800/50 dark:border-gray-800"> | ||
| <h2 class="text-xl font-bold text-gray-900 md:text-2xl dark:text-white flex gap-2 items-center"> | ||
| <%= site_title %> <%= set_page_title t('active_admin.devise.login.title') %> | ||
| </h2> | ||
|
|
||
| <%= form_tag omniauth_authorize_path(resource_name, :oidc), method: :post, data: { turbo: false } do %> | ||
| <%= submit_tag ActiveAdmin::Oidc.config.login_button_label %> | ||
| <% end %> | ||
| </div> | ||
| <%= button_to ActiveAdmin::Oidc.config.login_button_label, | ||
| "/admin/auth/oidc", | ||
| method: :post, | ||
| class: "activeadmin-oidc-login-button w-full", | ||
| form_class: 'formtastic', | ||
| data: { turbo: false } %> | ||
| </div> | ||
| <% else %> | ||
| <div id="login"> | ||
| <h2><%= active_admin_application.site_title(self) %></h2> | ||
|
|
||
| <%= button_to ActiveAdmin::Oidc.config.login_button_label, | ||
| "/admin/auth/oidc", | ||
| method: :post, | ||
| class: "activeadmin-oidc-login-button", | ||
| data: { turbo: false } %> | ||
| </div> | ||
| <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| source "https://rubygems.org" | ||
|
|
||
| gemspec path: ".." | ||
|
|
||
| # ActiveAdmin 3.5 line: classic Sprockets + Sassc asset pipeline. | ||
| gem "activeadmin", "~> 3.5.0" | ||
| gem "rails", "~> 7.2.0" | ||
|
|
||
| # openid_connect 1.x line (httpclient-based, no faraday dep). Pinning the | ||
| # 0.6.x series here keeps CI exercising the pre-faraday strategy path. | ||
| gem "omniauth_openid_connect", "~> 0.6.0" | ||
|
|
||
| gem "sprockets-rails", ">= 3.4" | ||
| gem "sassc-rails", ">= 2.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| source "https://rubygems.org" | ||
|
|
||
| gemspec path: ".." | ||
|
|
||
| # ActiveAdmin 4.0 line (currently shipping as 4.0.0.beta*). AA 4 replaces | ||
| # the Sprockets/Sassc pipeline with Propshaft + importmap + cssbundling + | ||
| # Tailwind, so the asset gems differ entirely from the 3.5 gemfile. | ||
| gem "activeadmin", ">= 4.0.0.beta", "< 5" | ||
| gem "rails", "~> 8.0.0" | ||
|
|
||
| # openid_connect 2.x line (faraday 2.x). | ||
| gem "omniauth_openid_connect", "~> 0.8.0" | ||
|
|
||
| gem "propshaft" | ||
| gem "importmap-rails" | ||
| gem "cssbundling-rails" | ||
| gem "tailwindcss-rails", "~> 4.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
lib/generators/active_admin/oidc/install/templates/sessions_new_v4.html.erb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <div class="p-6 sm:p-8 space-y-4 md:space-y-6 w-full sm:max-w-md bg-white sm:rounded-md shadow dark:border dark:bg-gray-800/50 dark:border-gray-800"> | ||
| <h2 class="text-xl font-bold text-gray-900 md:text-2xl dark:text-white flex gap-2 items-center"> | ||
| <%%= site_title %> <%%= set_page_title t('active_admin.devise.login.title') %> | ||
| </h2> | ||
|
|
||
| <%%= button_to ActiveAdmin::Oidc.config.login_button_label, | ||
| "/admin/auth/oidc", | ||
| method: :post, | ||
| class: "activeadmin-oidc-login-button w-full", | ||
| form_class: 'formtastic', | ||
| data: { turbo: false } %> | ||
| </div> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.