feat: unify enterToApply and checkBoxFilterClickTrigger into autoApplyFilters#2313
Open
feat: unify enterToApply and checkBoxFilterClickTrigger into autoApplyFilters#2313
Conversation
…g(condition), text/multiselect filters and search boxes
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- There is an
it.onlyindatasets-general.cy.jswhich will prevent the rest of the Cypress suite from running; this should be removed before merging. - The per-test configuration override and
cy.interceptsetup forenterToApplyin the new dataset test could be moved into abeforeEachhelper to avoid repetition if other tests need the same config flag.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- There is an `it.only` in `datasets-general.cy.js` which will prevent the rest of the Cypress suite from running; this should be removed before merging.
- The per-test configuration override and `cy.intercept` setup for `enterToApply` in the new dataset test could be moved into a `beforeEach` helper to avoid repetition if other tests need the same config flag.
## Individual Comments
### Comment 1
<location path="src/app/shared/modules/search-parameters-dialog/search-parameters-dialog.component.ts" line_range="151-157" />
<code_context>
return this.humanNameMap[key] || "";
}
+
+ onEnterToApply(event: Event) {
+ if (this.appConfig.enterToApply === false) {
+ return;
+ }
+ event.preventDefault();
+ this.add();
+ }
}
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Treating `enterToApply` as true when undefined may cause unintended activation of the feature flag.
Because the guard only checks `=== false`, any `undefined` value (e.g. from older configs) will enable Enter-to-apply. If the feature should be opt‑in, consider inverting the condition (e.g. `if (!this.appConfig.enterToApply) return;`) or setting an explicit default for `enterToApply` in the config service so the intended behavior is clear.
```suggestion
onEnterToApply(event: Event) {
if (!this.appConfig.enterToApply) {
return;
}
event.preventDefault();
this.add();
}
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
src/app/shared/modules/search-parameters-dialog/search-parameters-dialog.component.ts
Outdated
Show resolved
Hide resolved
…ers-dialog.component.ts Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR started by adding enterToApply config flag to support applying using Enter key with hints.
Then it was unified by merging enterToApply and checkBoxFilterClickTrigger into one config flag: autoApplyFilters.
Hint for search box:


Hint for Filters:
Motivation
Background on use case, changes needed
Fixes:
Please provide a list of the fixes implemented in this PR
Changes:
Please provide a list of the changes implemented by this PR
Tests included
Documentation
official documentation info
If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included
Backend version
Summary by Sourcery
Add configurable support for applying filters and searches with the Enter key and surface UI hints where this behavior is available.
New Features:
Enhancements:
Tests: