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

fix: allow all chars on text filters #2093

Merged
merged 16 commits into from
Dec 12, 2023
Merged

Conversation

Paul-Bob
Copy link
Contributor

@Paul-Bob Paul-Bob commented Dec 9, 2023

Description

Fixes #2061

  1. Encode and decode filters on JS controller following mdn official documentation about "the unicode problem"
  2. Un-silence decoding errors, we had some suppressed errors, that makes some bugs hard to debug and understand.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@Paul-Bob Paul-Bob added the Fix label Dec 9, 2023
@Paul-Bob Paul-Bob self-assigned this Dec 9, 2023
@Paul-Bob Paul-Bob marked this pull request as draft December 9, 2023 16:57
Copy link

codeclimate bot commented Dec 9, 2023

Code Climate has analyzed commit 3ef10a8 and detected 0 issues on this pull request.

View more on Code Climate.

app/javascript/js/controllers/filter_controller.js Outdated Show resolved Hide resolved
app/javascript/js/controllers/filter_controller.js Outdated Show resolved Hide resolved
app/javascript/js/controllers/filter_controller.js Outdated Show resolved Hide resolved
app/javascript/js/controllers/filter_controller.js Outdated Show resolved Hide resolved
app/javascript/js/controllers/filter_controller.js Outdated Show resolved Hide resolved
app/javascript/js/controllers/filter_controller.js Outdated Show resolved Hide resolved
app/javascript/js/controllers/filter_controller.js Outdated Show resolved Hide resolved
app/javascript/js/controllers/filter_controller.js Outdated Show resolved Hide resolved
app/javascript/js/controllers/filter_controller.js Outdated Show resolved Hide resolved
app/javascript/js/controllers/filter_controller.js Outdated Show resolved Hide resolved
Paul-Bob and others added 13 commits December 9, 2023 19:02
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…hq/avo into fix/allow_all_chars_on_text_filters
@Paul-Bob Paul-Bob marked this pull request as ready for review December 9, 2023 17:26
@yuki-yogi
Copy link

@Paul-Bob
Thanks for creating the issue.
I was about to report this issue as well.

I am attaching a video just in case.
This issue also occurs at avo 3.1.0.

filters.not.work.mov
stimulus.js:2017 Error invoking action "keypress->text-filter#tryToSubmit"

URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at n.b64DecodeUnicode (filter_controller.js:38:12)
    at n.changeFilter (filter_controller.js:50:33)
    at n.tryToSubmit (text_filter_controller.js:12:19)
    at tse.invokeWithEvent (stimulus.js:362:25)
    at tse.handleEvent (stimulus.js:329:18)
    at Xae.handleEvent (stimulus.js:31:25)

{identifier: 'text-filter', controller: n, element: div, index: 0, event: KeyboardEvent}
controller
: 
n {context: fse}
element
: 
div
event
: 
KeyboardEvent {isTrusted: true, immediatePropagationStopped: false, params: {…}, key: 'Enter', stopImmediatePropagation: ƒ, …}
identifier
: 
"text-filter"
index
: 
0
[[Prototype]]
: 
Object

@Paul-Bob
Copy link
Contributor Author

@yuki-yogi this is actually an PR to fix this issue that was created by you! =))

@yuki-yogi
Copy link

@Paul-Bob
Ah, I understand!
Thanks for the PR response to the fix!

Looking forward to the next release.

@Paul-Bob Paul-Bob merged commit 83dd00e into main Dec 12, 2023
11 checks passed
@Paul-Bob Paul-Bob deleted the fix/allow_all_chars_on_text_filters branch December 12, 2023 20:29
Copy link
Contributor

This PR has been merged into main. The functionality will be available in the next release.

Please check the release guide for more information.

@Paul-Bob
Copy link
Contributor Author

@yuki-yogi this should be fixed on the last patch release ;)

@yuki-yogi
Copy link

@Paul-Bob
Understood. Thank you for your report!
The filter function is often used, so we look forward to seeing it fixed!

@Paul-Bob
Copy link
Contributor Author

@yuki-yogi let us know if it works as expected on 3.1.5

@yuki-yogi
Copy link

@Paul-Bob
We immediately deployed avo 3.1.5 to the production environment and confirmed that the problem was resolved!

Thank you so much for your help.
Thanks for solving this problem, I will add self.keep_filters_panel_open = true to each resourece so that users can use the filter function more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The TextFilter function cannot search for some characters
3 participants