Remote queries: No results view (#1048)

This commit is contained in:
Charis Kyriakou 2021-12-15 08:55:00 +00:00 коммит произвёл GitHub
Родитель e9e41e07d1
Коммит 4dbd15c66d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 21 добавлений и 7 удалений

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

@ -51,6 +51,22 @@ const AnalysisResultItem = (props: AnalysisResult) => (
</span>
);
const SummaryWithResults = (queryResult: RemoteQueryResult) => (
<div className="vscode-codeql__query-summary-container">
<h2 className="vscode-codeql__query-summary-title">Repositories with results ({queryResult.affectedRepositoryCount}):</h2>
<a className="vscode-codeql__summary-download-link vscode-codeql__download-link"
onClick={() => download(queryResult.downloadLink)}>
{octicons.download}Download all
</a>
</div>
);
const SummaryNoResults = () => (
<div className="vscode-codeql__query-summary-container">
<h2 className="vscode-codeql__query-summary-title">No results found</h2>
</div>
);
export function RemoteQueries(): JSX.Element {
const [queryResult, setQueryResult] = useState<RemoteQueryResult>(emptyQueryResult);
@ -111,13 +127,11 @@ export function RemoteQueries(): JSX.Element {
</span>
</p>
<div className="vscode-codeql__query-summary-container">
<h2 className="vscode-codeql__query-summary-title">Repositories with results ({queryResult.affectedRepositoryCount}):</h2>
<a className="vscode-codeql__summary-download-link vscode-codeql__download-link"
onClick={() => download(queryResult.downloadLink)}>
{octicons.download}Download all
</a>
</div>
{
queryResult.affectedRepositoryCount === 0
? <SummaryNoResults />
: <SummaryWithResults {...queryResult} />
}
<ul className="vscode-codeql__results-list">
{queryResult.results.slice(0, numOfReposToShow).map((result, i) =>