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

Allow to import additional admin JS modules #2588

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Oct 3, 2023

In order to be able to import additional JS modules into the Alchemy admin UI you can use this.

Be sure to also pin the modules with Alchemy.importmap.

Example

Alchemy.importmap.pin "flatpickr/de",
  to: "https://ga.jspm.io/npm:flatpickr@4.6.13/dist/l10n/de.js"

Alchemy.admin_js_imports << "flatpickr/de"

@tvdeyen tvdeyen added the backport-to-7.0-stable Needs to be backported to 7.0-stable label Oct 3, 2023
@tvdeyen tvdeyen requested a review from a team October 3, 2023 20:15
Copy link
Contributor

@robinboening robinboening left a comment

Choose a reason for hiding this comment

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

looks like a nice feature to have 👍

@tvdeyen
Copy link
Member Author

tvdeyen commented Oct 4, 2023

looks like a nice feature to have 👍

Yeah. Actually it is a bug in Alchemy 7.0 for all non english speaking users, because the Flatpickr translations are not present anymore 🙈

@tvdeyen tvdeyen added the bug label Oct 4, 2023
In order to be able to import additional JS modules
into the Alchemy admin UI you can use this.

Be sure to also pin the modules with `Alchemy.importmap`.

\## Example

    Alchemy.importmap.pin "flatpickr/de",
      to: "https://ga.jspm.io/npm:flatpickr@4.6.13/dist/l10n/de.js"

    Alchemy.admin_js_imports << "flatpickr/de"
@tvdeyen tvdeyen merged commit 97a9ac5 into AlchemyCMS:main Oct 4, 2023
15 of 16 checks passed
@tvdeyen tvdeyen deleted the admin-js-imports branch October 4, 2023 13:21
@alchemycms-bot
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
7.0-stable

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

tvdeyen added a commit that referenced this pull request Oct 4, 2023
[7.0-stable] Merge pull request #2588 from tvdeyen/admin-js-imports
tvdeyen added a commit to AlchemyCMS/alchemy_i18n that referenced this pull request Oct 4, 2023
We need at least Alchemy 7.0.4 for the ability to
add additional admin JS module imports.

See AlchemyCMS/alchemy_cms#2588
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-7.0-stable Needs to be backported to 7.0-stable bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants