Fix: Hide webview context menu commands as needed.
This commit is contained in:
Родитель
f4fedaac3f
Коммит
90e4e7f57a
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "sarif-viewer",
|
||||
"version": "3.3.3",
|
||||
"version": "3.3.4",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "sarif-viewer",
|
||||
"version": "3.3.3",
|
||||
"version": "3.3.4",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/diff": "^5.0.2",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"description": "Adds support for viewing SARIF logs",
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
"version": "3.3.3",
|
||||
"version": "3.3.4",
|
||||
"publisher": "MS-SarifVSCode",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -122,15 +122,15 @@
|
|||
"webview/context": [
|
||||
{
|
||||
"command": "sarif.alertDismissFalsePositive",
|
||||
"when": "webviewId == 'sarif' && webviewSection == 'tableRow'"
|
||||
"when": "webviewId == 'sarif' && webviewSection == 'isGithubAlert'"
|
||||
},
|
||||
{
|
||||
"command": "sarif.alertDismissUsedInTests",
|
||||
"when": "webviewId == 'sarif' && webviewSection == 'tableRow'"
|
||||
"when": "webviewId == 'sarif' && webviewSection == 'isGithubAlert'"
|
||||
},
|
||||
{
|
||||
"command": "sarif.alertDismissWontFix",
|
||||
"when": "webviewId == 'sarif' && webviewSection == 'tableRow'"
|
||||
"when": "webviewId == 'sarif' && webviewSection == 'isGithubAlert'"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -84,6 +84,6 @@ export class ResultTableStore<G> extends TableStore<Result, G> {
|
|||
// If no alertNumber, then don't show the context menu (which contains the Dismiss Alert commands).
|
||||
if (!result.properties?.['github/alertNumber']) return undefined;
|
||||
|
||||
return { resultId: JSON.stringify(result._id) };
|
||||
return { webviewSection: 'isGithubAlert', resultId: JSON.stringify(result._id) };
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ interface TableProps<T, G> {
|
|||
const { columns, store, renderIconName, renderCell } = this.props;
|
||||
const { isLineThrough, isSelected, item, gridTemplateColumns, menuContext } = props;
|
||||
return <div className={css('svTableRow', 'svTableRowItem', isLineThrough && 'svLineThrough', isSelected && 'svItemSelected')} style={{ gridTemplateColumns }}
|
||||
data-vscode-context={JSON.stringify({ webviewSection: 'tableRow', ...menuContext })}
|
||||
data-vscode-context={JSON.stringify(menuContext)}
|
||||
ref={ele => { // TODO: ForwardRef for Group
|
||||
if (!isSelected || !ele) return;
|
||||
setTimeout(() => ele.scrollIntoView({ behavior: 'smooth', block: 'nearest' })); // requestAnimationFrame not working.
|
||||
|
|
Загрузка…
Ссылка в новой задаче