-
Notifications
You must be signed in to change notification settings - Fork 31
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: display branch selection in the tree node [IDE-446] #489
Conversation
2c2bdc7
to
d608822
Compare
8ed8df4
to
fc3a11c
Compare
fc3a11c
to
4307560
Compare
0d1d525
to
0a7438b
Compare
async setBaseBranch(): Promise<void> { | ||
await this.executeCommand(SNYK_SET_BASE_BRANCH_COMMAND, this.authService.setBaseBranch.bind(this.authService)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will probably not stay like this, but use a setting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to wait until the LS side is implemented for correct integration. Correct me, if there's another story that handles the LS integration.
591ecee
to
731d15a
Compare
731d15a
to
e82fd27
Compare
if (!nIssues) { | ||
return '✅ Congrats! No issues found!'; | ||
} | ||
return `Snyk found ${nIssues} issue${nIssues === 1 ? '' : 's'}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"when": "view == 'snyk.views.analysis.code.security' || view == 'snyk.views.analysis.code.quality' || view == 'snyk.views.analysis.oss' || view == 'snyk.views.analysis.configuration'", | ||
"when": "view == 'snyk.views.analysis.code.security' || view == 'snyk.views.analysis.code.security.delta' || view == 'snyk.views.analysis.code.quality' || view == 'snyk.views.analysis.code.quality.delta' || view == 'snyk.views.analysis.oss' || view == 'snyk.views.analysis.configuration'", | ||
"group": "navigation" | ||
}, | ||
{ | ||
"command": "snyk.settings", | ||
"when": "view == 'snyk.views.analysis.code.security' || view == 'snyk.views.analysis.code.quality' || view == 'snyk.views.analysis.oss' || view == 'snyk.views.welcome' || view == 'snyk.views.analysis.configuration'", | ||
"when": "view == 'snyk.views.analysis.code.security' || view == 'snyk.views.analysis.code.security.delta' || view == 'snyk.views.analysis.code.quality' || view == 'snyk.views.analysis.code.quality.delta' || view == 'snyk.views.analysis.oss' || view == 'snyk.views.welcome' || view == 'snyk.views.analysis.configuration'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds the gear ⚙️ and play
@@ -42,18 +42,20 @@ export default class CodeSecurityIssueTreeProvider extends IssueTreeProvider { | |||
protected getIssueFoundText(nIssues: number, ignoredIssueCount: number): string { | |||
if (nIssues > 0) { | |||
let text; | |||
|
|||
if (nIssues === 1) { | |||
text = `${nIssues} vulnerability found by Snyk`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be issues, too?
text = `${nIssues} vulnerability found by Snyk`; | |
text = `${nIssues} issue found by Snyk`; |
@@ -42,18 +42,20 @@ export default class CodeSecurityIssueTreeProvider extends IssueTreeProvider { | |||
protected getIssueFoundText(nIssues: number, ignoredIssueCount: number): string { | |||
if (nIssues > 0) { | |||
let text; | |||
|
|||
if (nIssues === 1) { | |||
text = `${nIssues} vulnerability found by Snyk`; | |||
} else { | |||
text = `✋ ${nIssues} vulnerabilities found by Snyk`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text = `✋ ${nIssues} vulnerabilities found by Snyk`; | |
text = `✋ ${nIssues} issues found by Snyk`; |
getBaseBranch(): TreeNode | null { | ||
const deltaFindingsEnabled = this.configuration.getDeltaFindingsEnabled(); | ||
|
||
//TODO: get the actual base branch from Snyk Language Server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just ask a config setting, what's the base branch for the folder. LS sends a folderConfig notification for all known workspace folders when they are registered at LS.
e82fd27
to
ac09779
Compare
Description
This pr covers the UI parts of selecting a base branch for delta findings. No actually calls to language server for available local branches, or to set the choose branch is a part of this pr.
This PR handles tree view for Security Code and Code Quality depending on the Delta Findings feature flag. When enabled, the title for the tree node shows
Checklist
Screenshots / GIFs
code-and-quality-with-deltas.mp4