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

ISSUE-326: Advanced search community needs #327

Merged
merged 13 commits into from
Jun 23, 2023
Merged

ISSUE-326: Advanced search community needs #327

merged 13 commits into from
Jun 23, 2023

Conversation

DiegoPino
Copy link
Member

@DiegoPino DiegoPino commented Jun 21, 2023

See #326

First one:
Submit on enter (not add one/remove one on Enter)

So much code for such a simple thing @alliomeria . Stuff is: Browsers will always pick the first submit found, so rendering order leads. If i put search first then other stuff like adding a + button by each one will still fail (future needs). Also Drupal will make all buttons input type=submit (if we want to pass stuff via form state) so i have to alter the form, intercept the Enter and trigger the only and only one (staring at the moon) button i care for (i care of other things, like plants and some people and trees and moonshine)

Second: no more stuck keywords on remove one, add one. I changed the whole logic, drupal is so buggy. Now Add more/remove one act on pure JS, change values and then autosubmit (via drupal). Which in theory means in the near future I can have add more/remove without any submits at all.. (not today). Also no more ghost "previous" values appearing

Third: Fields to be searched can have their Labels rewritten (don't like Rendered HTML? you can name them Pikachu field and done

Fourth: You can define a min of initial fields. Don't like a single one? Start with 2!

Need to show you this so you can find more bugs tomorrow, but I feel release is ready to roll if all goes well/passes your checks

So much code for such a simple thing @alliomeria . Stuff is: Browsers will always pick the first submit found, so rendering order leads. If i put search first then other stuff like adding a + button by each one will still fail (future needs). Also Drupal will make all  buttons input type=submit (if we want to pass stuff via form state) so i have to alter the form, intercept the Enter and trigger the only and only one (staring at the moon) button i care for (i care of other things, like plants and people)
@DiegoPino DiegoPino added this to the 1.1.0 milestone Jun 21, 2023
@DiegoPino DiegoPino added enhancement New feature or request Javascript Favourite language of a PHP developer Release duties UX Like UI but with an X Search and Discovery Mess around and find out Drupal Views Ask and you should receive Search API Sub Modules When you need more .info.yml files to keep life organized labels Jun 21, 2023
@DiegoPino DiegoPino self-assigned this Jun 21, 2023
Still a debug statement here. Now the hard part. How to submit without querying?
Or said differently, (bc i can) how to submit without querying new fields, if previously the user pressed "search", add one/delete one should not "delete the results" neither... i hate this
I mean, almost. The issue is i can not not submit the value so what happens is basically the facet summary for queries gets offset (uses the submitted value)... gosh...
I will try with a pure JS option now but want to keep this around in case i need to rollback
This will eventually in the future allow what users want... 80's Advanced Searches. Gets around Drupal's Core bug that does not allow #ajax actions to work on exposed form filters bc the Filter logic removes the $form_id needed for the caching system to work (throwing an invisible error so weird... like max file upload reached? c'mon drupal)
What is not YET working?
The View is caching old Submit values. Means when i delete one and re-add one, the old "search" term reappears ... as a default. Who knows why? I will never know why. But i basically need to intervene either here or in the Ajax Controller to avoid non-accepted/not-parsed values to be take by the Filter as valid/kept around...
@alliomeria i did it.

2AM. Done for the day!
Just the minimal, each theme can override this
@DiegoPino DiegoPino merged commit 715eb8f into 1.1.0 Jun 23, 2023
@alliomeria
Copy link
Contributor

🚀 🌟 Woohoo! So many great advanced search toolings @DiegoPino! 🧰 🤓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Drupal Views Ask and you should receive enhancement New feature or request Javascript Favourite language of a PHP developer Release duties Search and Discovery Mess around and find out Search API Sub Modules When you need more .info.yml files to keep life organized UX Like UI but with an X
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants