Skip to content

Allow filtering variations by alias - #1319

Open
cpruijsen wants to merge 1 commit into
wger-project:masterfrom
cpruijsen:fix/issue-382-fbb97b67
Open

cpruijsen wants to merge 1 commit into
wger-project:masterfrom
cpruijsen:fix/issue-382-fbb97b67

Conversation

@cpruijsen

Copy link
Copy Markdown

Title: Allow filtering variations by alias

# Proposed Changes

- The variation search now matches exercise aliases as well as the exercise name, in both `src/components/Exercises/screens/Add/Step2Variations.tsx` (add exercise) and `src/components/Exercises/forms/VariationSelect.tsx` (edit exercise).
- The alias match is a case-insensitive substring match, the same as the name match.
- The filter checks the aliases of all translations, not only the displayed one. The filter exists to find duplicates, and an alias in another language still identifies the same exercise. If you prefer the displayed translation only, it is a one-line change.
- Added a test for each component. Both tests fail without the change and pass with it.

## Related Issue(s)

Closes #382

@JustATurtleDuck asked to work on this issue in 2025 and I found no PR from them. I will step aside if they still want it.

## Please check that the PR fulfills these requirements

- [x] Tests for the changes have been added (for bug fixes / features)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant