Skip to content

How to modify frontend editor files #76

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
guerreiropedr0 opened this issue Feb 20, 2024 · 1 comment
Closed

How to modify frontend editor files #76

guerreiropedr0 opened this issue Feb 20, 2024 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@guerreiropedr0
Copy link

I am trying to make it possible to view the entire collection_item records when the select input is empty, instead of showing no records. I wanted to override the js files so it triggers the fetch when it is empty

Is this currently possible?

@did did self-assigned this Mar 23, 2024
@did did added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 23, 2024
@did
Copy link
Contributor

did commented Mar 23, 2024

@guerreiropedr0 ATM, this is not possible to override a JS component.

I see 2 solutions to solve your problem:

  • tweak the current component app/frontend/editor/components/kit/collection-item-input.vue to change its behavior through a config option for instance (maybe display_all: true|false).
  • allow to create custom setting type (ruby + VueJS component).

The first solution is definitively the easiest one and if you know a bit about Ruby and JS, you should be able to do it.

The second one requires some intense thinking :-) Probably it would make sense to extract the editor JS code from the Maglev-core and create its own NPM package.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants