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

feat: filter by tags #5163

Merged
merged 2 commits into from
Oct 26, 2023
Merged

feat: filter by tags #5163

merged 2 commits into from
Oct 26, 2023

Conversation

kwasniew
Copy link
Contributor

About the changes

Filter by tags

Important files

Discussion points

@vercel
Copy link

vercel bot commented Oct 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 26, 2023 3:13pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Oct 26, 2023 3:13pm

Copy link
Contributor

@FredrikOseberg FredrikOseberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nits, otherwise LG.

Comment on lines 78 to 80
?.map((t) => t.split(':'))
.filter((t) => t.length === 2);
const features = await this.featureSearchService.search({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
?.map((t) => t.split(':'))
.filter((t) => t.length === 2);
const features = await this.featureSearchService.search({
?.map((tag) => tag.split(':'))
.filter((tag) => tag.length === 2);
const features = await this.featureSearchService.search({

const userId = req.user.id;
const normalizedTag = tag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually tags since it's an array?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have to decide whether our query params use singular or plural form. Currently I stick to singular because in the url it looks like this: tag[]=simple:tag1&tag[]=simple:tag2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we decide to make plural then I'll adjust all query params in one go. For now I prefer consistency

@@ -542,6 +543,13 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
.whereILike('features.name', `%${queryString}%`)
.orWhereIn('features.name', tagQuery);
}
if (tag && tag.length > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, plural here?

@kwasniew kwasniew merged commit 46d7cb2 into main Oct 26, 2023
10 of 12 checks passed
@kwasniew kwasniew deleted the filter-by-tag branch October 26, 2023 15:20
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.

2 participants