Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions server/src/main/java/org/eclipse/openvsx/admin/ScanAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@ private void populateExtensionMetadata(ScanStatus scanStatus, ScanResultJson jso
json.setDisplayName(version.getDisplayName());

var isQuarantined = scanStatus == ScanStatus.QUARANTINED;
var isErrored = scanStatus == ScanStatus.ERRORED;
var fileTypes = isQuarantined ?
new String[] { FileResource.ICON } :
new String[] { FileResource.ICON, FileResource.DOWNLOAD };
Expand All @@ -931,9 +932,10 @@ private void populateExtensionMetadata(ScanStatus scanStatus, ScanResultJson jso
json.setExtensionIcon(iconUrl);
}

// if the extension is quarantined,
// if the extension is quarantined or errored,
// resolve the download location as the api endpoint will return 404.
if (isQuarantined) {
// TODO: this does not work when using local storage as in this case always an api url is returned
if (isQuarantined || isErrored) {
var downloadResource = repositories.findFileByType(version, FileResource.DOWNLOAD);
if (downloadResource != null) {
var url = storageUtil.getLocation(downloadResource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/

import { FC } from "react";
import { FC } from 'react';
import { Box, Typography, Collapse, Chip } from '@mui/material';
import { useTheme, Theme } from '@mui/material/styles';
import { ScanResult, Threat, ValidationFailure, CheckResult } from '../../../context/scan-admin';
Expand Down Expand Up @@ -63,7 +63,7 @@ const ThreatItem: FC<ThreatItemProps> = ({ threat }) => {
/**
* A single validation failure item in the expanded content.
*/
const ValidationFailureItem: React.FC<ValidationFailureItemProps> = ({ failure }) => {
const ValidationFailureItem: FC<ValidationFailureItemProps> = ({ failure }) => {
const theme = useTheme();
const isUnenforced = !failure.enforcedFlag;

Expand Down Expand Up @@ -119,7 +119,7 @@ const formatDuration = (ms: number | null): string | undefined => {
/**
* A single check result item showing what check was run and its outcome.
*/
const CheckResultItem: React.FC<CheckResultItemProps> = ({ checkResult }) => {
const CheckResultItem: FC<CheckResultItemProps> = ({ checkResult }) => {
const theme = useTheme();
const colors = getCheckResultColor(checkResult.result, theme);
const isPassed = checkResult.result === 'PASSED';
Expand Down Expand Up @@ -182,7 +182,7 @@ const CheckResultItem: React.FC<CheckResultItemProps> = ({ checkResult }) => {
* The expanded content section showing threats, validation failures, and check results.
* Each item's enforcedFlag controls its individual striping effect.
*/
export const ScanCardExpandedContent: React.FC<ScanCardExpandedContentProps> = ({ scan, expanded, onCollapseComplete }) => {
export const ScanCardExpandedContent: FC<ScanCardExpandedContentProps> = ({ scan, expanded, onCollapseComplete }) => {
const theme = useTheme();
const hasThreats = scan.threats.length > 0;
const hasValidationFailures = scan.validationFailures.length > 0;
Expand Down
2 changes: 1 addition & 1 deletion webui/src/components/scan-admin/scan-card/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export const shouldShowExpandButton = (scan: ScanResult): boolean => {
};

export const hasDownload = (scan: ScanResult): boolean => {
return scan.status === 'PASSED' || scan.status === 'QUARANTINED';
return scan.status === 'PASSED' || scan.status === 'QUARANTINED' || scan.status === 'ERROR';
};

export const getFileName = (url?: string): string => {
Expand Down
Loading