Skip to content
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

Update config.register_javascript with options support #7002

Merged

Conversation

lanzhiheng
Copy link
Contributor

@lanzhiheng lanzhiheng commented Jun 4, 2021

I have replace the turbolink with turbo in my project. so I think it will be better to generate <script> tag like below

<script src='assets/admin.js' data-turbo-track='reload'></script>

However, the method register_javascript don't support options like config.register_stylesheet

I think it will be a good idea to make it customizable

config.register_stylesheet 'active_admin.css', media: 'screen', 'data-turbo-track': 'reload'
config.register_javascript 'active_admin.js', 'data-turbo-track': 'reload'

@nitsujri
Copy link

Would love to get this one loaded as hotwire becomes more readily used.

@deivid-rodriguez deivid-rodriguez changed the title feat: Add options for registering javascripts. Add options for registering javascripts. Feb 25, 2022
Copy link
Member

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, can you rebase this to make sure CI is ok?

@javierjulio javierjulio force-pushed the add-option-to-javascript-tag branch from 0d18751 to e0a81ee Compare May 11, 2023 02:44
@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d4cd830) 99.01% compared to head (04f5a65) 99.01%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7002   +/-   ##
=======================================
  Coverage   99.01%   99.01%           
=======================================
  Files         197      197           
  Lines        4950     4950           
=======================================
  Hits         4901     4901           
  Misses         49       49           
Impacted Files Coverage Δ
lib/active_admin/asset_registration.rb 100.00% <100.00%> (ø)
lib/active_admin/engine.rb 100.00% <100.00%> (ø)
lib/active_admin/views/pages/base.rb 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@javierjulio javierjulio force-pushed the add-option-to-javascript-tag branch from e0a81ee to 2810c8c Compare May 14, 2023 22:37
@javierjulio javierjulio changed the title Add options for registering javascripts. Add options: support on config.register_javascript May 14, 2023
This was referenced May 14, 2023
@javierjulio javierjulio changed the title Add options: support on config.register_javascript Update register_javascript config with options support Jun 17, 2023
@javierjulio javierjulio self-assigned this Jun 17, 2023
Copy link
Member

@javierjulio javierjulio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@javierjulio javierjulio changed the title Update register_javascript config with options support Update config.register_javascript with options support Jun 18, 2023
@javierjulio javierjulio merged commit 10a1ec9 into activeadmin:master Jun 18, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants