diff --git a/ui-pf4/src/main/webapp/src/Constants.tsx b/ui-pf4/src/main/webapp/src/Constants.tsx index a756bca9e..0129459b8 100644 --- a/ui-pf4/src/main/webapp/src/Constants.tsx +++ b/ui-pf4/src/main/webapp/src/Constants.tsx @@ -22,6 +22,7 @@ export const WINDUP_ENV_VARIABLES: WindupEnv = (window as any)[ ]; export const MERGED_CSV_FILENAME = "AllIssues.csv"; +export const ZIP_REPORT_FILENAME = "reports.zip"; export const getWindupRestBase = () => { let base = packageJson.proxy + API_BASE_URL; // Development @@ -62,6 +63,7 @@ export enum AdvancedOptionsFieldKey { // Switch EXPORT_CSV = "exportCSV", + EXPORT_ZIP_REPORT = "exportZipReport", TATTLETALE = "disableTattletale", CLASS_NOT_FOUND_ANALYSIS = "enableClassNotFoundAnalysis", COMPATIBLE_FILES_REPORT = "enableCompatibleFilesReport", diff --git a/ui-pf4/src/main/webapp/src/components/advanced-options-form/advanced-options-form.tsx b/ui-pf4/src/main/webapp/src/components/advanced-options-form/advanced-options-form.tsx index 7d301f556..16e009d16 100644 --- a/ui-pf4/src/main/webapp/src/components/advanced-options-form/advanced-options-form.tsx +++ b/ui-pf4/src/main/webapp/src/components/advanced-options-form/advanced-options-form.tsx @@ -48,6 +48,7 @@ interface FormValues { [AdvancedOptionsFieldKey.IGNORE_PATH]?: string; [AdvancedOptionsFieldKey.EXPORT_CSV]?: boolean; + [AdvancedOptionsFieldKey.EXPORT_ZIP_REPORT]?: boolean; [AdvancedOptionsFieldKey.TATTLETALE]?: boolean; [AdvancedOptionsFieldKey.CLASS_NOT_FOUND_ANALYSIS]?: boolean; [AdvancedOptionsFieldKey.COMPATIBLE_FILES_REPORT]?: boolean; diff --git a/ui-pf4/src/main/webapp/src/components/advanced-options-form/schema.ts b/ui-pf4/src/main/webapp/src/components/advanced-options-form/schema.ts index 73dad252d..4f7efcdc4 100644 --- a/ui-pf4/src/main/webapp/src/components/advanced-options-form/schema.ts +++ b/ui-pf4/src/main/webapp/src/components/advanced-options-form/schema.ts @@ -106,6 +106,13 @@ export const Fields: Map = new Map([ type: "switch", }, ], + [ + AdvancedOptionsFieldKey.EXPORT_ZIP_REPORT, + { + label: "Export ZIP report", + type: "switch", + }, + ], [ AdvancedOptionsFieldKey.TATTLETALE, { diff --git a/ui-pf4/src/main/webapp/src/pages/analysis-results/execution-details/overview/overview.tsx b/ui-pf4/src/main/webapp/src/pages/analysis-results/execution-details/overview/overview.tsx index 779f94ca7..24165b0fb 100644 --- a/ui-pf4/src/main/webapp/src/pages/analysis-results/execution-details/overview/overview.tsx +++ b/ui-pf4/src/main/webapp/src/pages/analysis-results/execution-details/overview/overview.tsx @@ -17,12 +17,17 @@ import { List, ListItem, } from "@patternfly/react-core"; -import { ChartBarIcon, DownloadIcon } from "@patternfly/react-icons"; +import { + ChartBarIcon, + DownloadIcon, + FileArchiveIcon, +} from "@patternfly/react-icons"; import { AdvancedOptionsFieldKey, getWindupStaticReportsBase, MERGED_CSV_FILENAME, + ZIP_REPORT_FILENAME, } from "Constants"; import { ExecutionStatusWithTime, @@ -162,6 +167,23 @@ export const Overview: React.FC = ({ match }) => { )} + {isOptionEnabledInExecution( + execution, + AdvancedOptionsFieldKey.EXPORT_ZIP_REPORT + ) && ( + + + ZIP report + + + )} ) : ( "Not available" diff --git a/ui-pf4/src/main/webapp/src/pages/analysis-results/execution-list/execution-list.tsx b/ui-pf4/src/main/webapp/src/pages/analysis-results/execution-list/execution-list.tsx index 93cb9331d..563775f80 100644 --- a/ui-pf4/src/main/webapp/src/pages/analysis-results/execution-list/execution-list.tsx +++ b/ui-pf4/src/main/webapp/src/pages/analysis-results/execution-list/execution-list.tsx @@ -26,6 +26,7 @@ import { DownloadIcon, CubesIcon, TrashIcon, + FileArchiveIcon, } from "@patternfly/react-icons"; import { RootState } from "store/rootReducer"; @@ -62,6 +63,7 @@ import { AdvancedOptionsFieldKey, getWindupStaticReportsBase, MERGED_CSV_FILENAME, + ZIP_REPORT_FILENAME, } from "Constants"; import { isNullOrUndefined } from "utils/utils"; import { @@ -131,6 +133,12 @@ const getCSVReportURL = (execution: WindupExecution) => { }/${MERGED_CSV_FILENAME}`; }; +const getZIPReportURL = (execution: WindupExecution) => { + return `${getWindupStaticReportsBase()}/${ + execution.id + }/${ZIP_REPORT_FILENAME}`; +}; + interface ExecutionListProps extends RouteComponentProps {} export const ExecutionList: React.FC = ({ match }) => { @@ -372,6 +380,22 @@ export const ExecutionList: React.FC = ({ match }) => { )} + {isOptionEnabledInExecution( + item, + AdvancedOptionsFieldKey.EXPORT_ZIP_REPORT + ) && ( + + + + + + )} )} {!isExecutionActive(item) && (