Skip to content

Add ability to filter DB view by language#2856

Merged
shati-patel merged 2 commits intomainfrom
shati-patel/db-language-filter
Sep 26, 2023
Merged

Add ability to filter DB view by language#2856
shati-patel merged 2 commits intomainfrom
shati-patel/db-language-filter

Conversation

@shati-patel
Copy link
Copy Markdown
Contributor

@shati-patel shati-patel commented Sep 25, 2023

Adds a language menu to the databases view:

db-language-filter.mp4

Reviewing notes

  • A lot of the changes are command-wrangling. The main changes are in local-databases-ui.ts.
  • This still needs quite a lot of polishing (see internal issue as well) and testing, but I'm keen for any initial feedback on the approach, and then I can polish stuff in follow-up PRs! 💅🏼

Checklist

⚠️ I've hidden the new language menu behind the canary flag, since it's still WIP. No user-facing changes yet.

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@shati-patel shati-patel force-pushed the shati-patel/db-language-filter branch from d6db8f2 to 750c1be Compare September 25, 2023 13:04
Comment on lines +63 to +73
enum LanguageFilter {
All = "All",
Cpp = QueryLanguage.Cpp,
CSharp = QueryLanguage.CSharp,
Go = QueryLanguage.Go,
Java = QueryLanguage.Java,
Javascript = QueryLanguage.Javascript,
Python = QueryLanguage.Python,
Ruby = QueryLanguage.Ruby,
Swift = QueryLanguage.Swift,
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It would be nice to avoid duplicating this language list again, but I wasn't sure how to do that 🙈

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think (from a quick skim on StackOverflow) you can do something like

type LanguageFilter = QueryLanguage | 'All'

to reuse the constants, then you have to reference the constants in the code as either QueryLanguage.<language> or All.

@shati-patel shati-patel marked this pull request as ready for review September 25, 2023 13:10
@shati-patel shati-patel requested review from a team as code owners September 25, 2023 13:10
Copy link
Copy Markdown
Contributor

@charisk charisk left a comment

Choose a reason for hiding this comment

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

LGTM!

@shati-patel shati-patel enabled auto-merge (squash) September 26, 2023 09:00
@shati-patel shati-patel merged commit 3be7eb9 into main Sep 26, 2023
@shati-patel shati-patel deleted the shati-patel/db-language-filter branch September 26, 2023 09:20
@starcke starcke mentioned this pull request Oct 16, 2023
3 tasks
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.

3 participants