Add WAVE Analysis 'Fix in VS' Button (#54)

* Add WAVE Analysis 'Fix in VS' Button

* Fix indent

---------

Co-authored-by: Ali Mohamad <alimohamad@microsoft.com>
This commit is contained in:
Ali Mohamad 2024-11-08 14:42:10 -08:00 коммит произвёл GitHub
Родитель 87c5dea192
Коммит 3091115f1e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 26 добавлений и 15 удалений

Просмотреть файл

@ -1,18 +1,22 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { Link } from 'azure-devops-ui/Link';
import * as React from 'react'
import { Result } from 'sarif'
import './RunCard.renderCell.scss'
import * as React from 'react'
import { ActionProps } from './Viewer.Types';
import { Link } from 'azure-devops-ui/Link';
import { Result } from 'sarif'
const emptyPng = require('./assets/empty.png')
const vsCodePng = require('./assets/vscode-icon.png')
const vsPng = require('./assets/vs-icon.png')
const images = {
empty: emptyPng,
vscode: vsCodePng,
vs: vsPng
}
function renderAction(props: ActionProps) {

Просмотреть файл

@ -1,18 +1,17 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import {observable, autorun, computed, IObservableValue} from 'mobx'
import {Run, Result, Artifact} from 'sarif'
import {MobxFilter} from './FilterBar'
import {tryOr} from './try'
import {Rule, ResultOrRuleOrMore, RepositoryDetails} from './Viewer.Types'
import {SortOrder} from 'azure-devops-ui/Table'
import {ITreeItem} from 'azure-devops-ui/Utilities/TreeItemProvider'
import { getRepoUri } from './getRepoUri'
import {Artifact, Result, Run} from 'sarif'
import {IObservableValue, autorun, computed, observable} from 'mobx'
import {RepositoryDetails, ResultOrRuleOrMore, Rule} from './Viewer.Types'
import { getRepositoryDetailsFromRemoteUrl, isRepositoryDetailsComplete } from './getRepositoryDetailsFromRemoteUrl'
import {ITreeItem} from 'azure-devops-ui/Utilities/TreeItemProvider'
import {MobxFilter} from './FilterBar'
import {SortOrder} from 'azure-devops-ui/Table'
import { getRepoUri } from './getRepoUri'
import {tryOr} from './try'
declare module 'sarif' {
interface Run {
_index: number,
@ -82,13 +81,21 @@ export class RunStore {
if (isRepositoryDetailsComplete(repoDetails) && buildId && artifactName && filePath) {
const fixInVsCodeAction = {
text: 'Fix in VS Code',
linkUrl: `https://waveanalysis.microsoft.com/import?buildId=${buildId}&artifactName=${artifactName}&filePath=${filePath}&organization=${repoDetails.organizationName}&project=${repoDetails.projectName}&repoName=${repoDetails.repositoryName}&runIndex=${run._index}&resultIndex=${resultIndex++}&source=1esscans`,
linkUrl: `https://waveanalysis.microsoft.com/vscode/import?buildId=${buildId}&artifactName=${artifactName}&filePath=${filePath}&organization=${repoDetails.organizationName}&project=${repoDetails.projectName}&repoName=${repoDetails.repositoryName}&runIndex=${run._index}&resultIndex=${resultIndex++}&source=1esscans`,
imageName: 'vscode',
className: 'vscode-action'
}
const fixInVsAction = {
text: 'Fix in Visual Studio',
linkUrl: `https://waveanalysis.microsoft.com/vs/import?buildId=${buildId}&artifactName=${artifactName}&filePath=${filePath}&organization=${repoDetails.organizationName}&project=${repoDetails.projectName}&repoName=${repoDetails.repositoryName}&runIndex=${run._index}&resultIndex=${resultIndex++}&source=1esscans`,
imageName: 'vs',
className: 'vs-action'
}
result.actions = [
fixInVsCodeAction
fixInVsCodeAction,
fixInVsAction
]
}

Двоичные данные
components/assets/vs-icon.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.3 KiB