- Issue created by @glynster
- π¦πΉAustria fago Vienna
I agree that would be a very valuable addition.
I think a first step would be to make sure this is supported by passing through all the necessary information, such that the built-in view component can do the sorting + add its own custom filter form.
As a second, later step, we could look into shipping with working drupal-forms for exposed filters and sorts - after π Add support for forms Needs review landed.
That said, we don't currently have plans to work on this, since we are focussing on RC1 topics to get that out of the door, see https://www.drupal.org/project/lupus_decoupled/issues/3311105#comment-15... π [META] Roadmap Active
That said, of course contributions are welcome if you'd like to give it a go. I'd happy to chat and provide pointers for necessary changes.
- πΊπΈUnited States glynster
Great news and it make sense, due to the forms support. We have been playing around a little to get things working. This module and code provided some useful hints:
https://git.drupalcode.org/project/views_better_rest/-/blob/1.0.x/src/Pl...
If we get any success we would be happy to add this to a PR.
- πΊπΈUnited States glynster
I just ran a quick test with the module and this is exactly what you want.
- πΊπΈUnited States glynster
Added as a patch and works well. I was not sure how to do a PR. Let me know if I need to adjust anything.
- πΊπΈUnited States glynster
Is it possible for me to do a MR to help include the code better?
- Status changed to Needs work
4 months ago 12:47pm 8 March 2024 - π¦πΉAustria fago Vienna
@glynster: Sure! Everone can create MRs, just add an issue fork and push your code there!
thx for the patch. As I understand the code is taken from views_better_rest module?
I'm wondering whether we should include this information always or maybe better make some checkboxes in the style-plugin to allow turning it on and off? I guess someone not needing that information does not want to bloat the API response of the view.
+ foreach ($handlers as $id => $item) {
+ if (!empty($item['exposed'])) {
+ $info = $item['expose'];
+ if ($type === 'filter') {I see the code handles the filter case, but I miss 'sort'. Is that missing?
How are you handling things on the vue side? Anything we should document here then?
- πΊπΈUnited States glynster
@fago, I guess I missed the connection, I will go ahead and do the MR.
I don't think we need to to do a check as in views you have an option to expose. So if they never expose the filters then it should not return anything in the API output. To me this makes sense. Let me add in the if check and take it from there.
Once I have this done yes I can jump into the Vue side of things. We usually use something like vue multi-select. We have also been looking at Nuxt UI lately. Our current setup is Bootstrap 5.3. Totally off topic but would it make sense to offer a basic vue theme using Nuxt UI?
- πΊπΈUnited States glynster
Added to git now. As I have looked no filtering or sorting is added to the API unless it is set to expose in Views. So I think that works fine. Let me know.