Skip to content

Feat/ide 715 filter tree #226

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

Merged
merged 58 commits into from
Nov 27, 2024
Merged

Feat/ide 715 filter tree #226

merged 58 commits into from
Nov 27, 2024

Conversation

acke
Copy link
Contributor

@acke acke commented Nov 25, 2024

Description

The file tree can now use the viewmenus popup menu to select these filters:

  • Issue Severity will hide the issues with the deselected severity
  • Disable product scans, select or deselect the products to be scanned
  • Ignores, deselect ignores will hide ignored issues. If feature flag is false, then the filters will not show.
  • Open Source fixable, selecting this filter will hide all issues that can not be upgradable.
  • Ai Fix Fixable, selecting this filter will hide all issues that does not have a ai fix.

Additional work on filters will be done in this ticket
https://snyksec.atlassian.net/browse/IDE-782?atlOrigin=eyJpIjoiOGZhM2IzMjlkYzAyNDI4Njg1MWRkZDZiMDM1MGRlMTgiLCJwIjoiaiJ9

image

Checklist

  • Tests added and all succeed
  • Linted
  • CHANGELOG.md updated
  • README.md updated, if user-facing

Screenshots / GIFs

Visuals that may help the reviewer. Please add screenshots for any UI change. GIFs are most welcome!

acke and others added 30 commits November 12, 2024 15:49
…m-IaC,-Open-Source-and-Code,-using-a-local-cache (#215)

* chore: wip

* fix: add info nodes for no issues found and no fixable issues found

* fix: tests

* feat: add initial tree filling impl

* feat: display info nodes

* feat: add generic filter method to cache

* feat: show view when scanning
bastiandoetsch and others added 12 commits November 21, 2024 12:54
fix: tests on command line
* feat: prepending the treenodes for ignores and AI Fix with identifier

* fix: added space after ignore tag

* feat: add a call to read feature flags, and call that function to read snykCodeConsistentIgnores

* fix: expand treeviewer to show all issues.

* fix: wip remvoe ignores filters if needed

* fix: rename file

* fix: call featureflag service after auth and settings persistence

* fix: notifyProgress if param is null

* feat: taskprocessor for sending tasks after ls init

* fix: tests use current pref

* feat: filter issues based on ignore preferences

* fix: remove commands if ff for ignores are false

* fix: adding the handlers and commands for filters

* fix: adding an asyncExec on the ui updates

---------

Co-authored-by: Abdelrahman Shawki Hassan <[email protected]>
* wip: html provider

* fix: populate tree after snyk.Scan success

* refactor: use css from LS

* wip: html provider

* fix: merge conflicts

* fix: added HtmlProviderFactory tests

* fix: use comperator for sorting issues

* refactor: create BrowserHandler

* fix: cache theme instance
Co-authored-by: Abdelrahman Shawki Hassan <[email protected]>
@acke acke force-pushed the feat/IDE-715_filter-tree branch from 17800d7 to ef58e01 Compare November 25, 2024 14:57
@acke acke marked this pull request as ready for review November 26, 2024 08:59
@acke acke requested a review from a team as a code owner November 26, 2024 08:59
private boolean isIssueVisible(IssueTreeNode issueNode) {
Issue issue = issueNode.getIssue();
if (issue == null) {
return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

why would it be visible if null?

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 don't want to apply filters (and hide) tree elements if we don't match any filters.

@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof FileTreeNode) {
return hasVisibleChildren((FileTreeNode) element, viewer);
Copy link
Contributor

Choose a reason for hiding this comment

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

that looks good. I hope it wouldn't be a performance bottleneck tho.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, we only call the hasVisibleChildren if the node is a treenode, so its not called for all tree nodes. However this might be slow if a project has very many files.

@acke acke force-pushed the feat/IDE-715_filter-tree branch from db1aad9 to a95df80 Compare November 27, 2024 08:21
@acke acke merged commit cda022e into main Nov 27, 2024
7 checks passed
@acke acke deleted the feat/IDE-715_filter-tree branch November 27, 2024 09:03
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