diff --git a/client/public/locales/en/translation.json b/client/public/locales/en/translation.json index 39c3aa55f..64d2901ea 100644 --- a/client/public/locales/en/translation.json +++ b/client/public/locales/en/translation.json @@ -495,6 +495,7 @@ }, "terms": { "advanced": "Advanced", + "advancedAnalysisDetails": "Enhanced analysis details", "analysisMode": "Analysis mode", "configureAnalysis": "Configure analysis", "customRules": "Custom rules", @@ -519,6 +520,9 @@ "title": { "advancedOptions": "Advanced options", "review": "Review analysis details" + }, + "tooltip": { + "advancedAnalysisDetails": "Enable enhanced analysis details to get more information about the analysis." } } } diff --git a/client/src/app/api/models.ts b/client/src/app/api/models.ts index a3211600a..8ae4ffcaa 100644 --- a/client/src/app/api/models.ts +++ b/client/src/app/api/models.ts @@ -324,6 +324,7 @@ export interface TaskData { tagger: { enabled: boolean; }; + verbosity: number; mode: { binary: boolean; withDeps: boolean; diff --git a/client/src/app/pages/applications/analysis-wizard/analysis-wizard.tsx b/client/src/app/pages/applications/analysis-wizard/analysis-wizard.tsx index a72942bea..2c40a8c6c 100644 --- a/client/src/app/pages/applications/analysis-wizard/analysis-wizard.tsx +++ b/client/src/app/pages/applications/analysis-wizard/analysis-wizard.tsx @@ -53,6 +53,7 @@ const defaultTaskData: TaskData = { tagger: { enabled: true, }, + verbosity: 0, mode: { binary: false, withDeps: false, @@ -178,6 +179,7 @@ export const AnalysisWizard: React.FC = ({ branch: "", rootPath: "", autoTaggingEnabled: true, + advancedAnalysisEnabled: false, }, resolver: yupResolver(allFieldsSchema), mode: "all", @@ -227,6 +229,7 @@ export const AnalysisWizard: React.FC = ({ tasks: analyzableApplications.map((app: Application) => initTask(app)), data: { ...defaultTaskData, + verbosity: fieldValues.advancedAnalysisEnabled ? 1 : 0, tagger: { enabled: fieldValues.autoTaggingEnabled, }, diff --git a/client/src/app/pages/applications/analysis-wizard/review.tsx b/client/src/app/pages/applications/analysis-wizard/review.tsx index 0adb0cd4d..4916385be 100644 --- a/client/src/app/pages/applications/analysis-wizard/review.tsx +++ b/client/src/app/pages/applications/analysis-wizard/review.tsx @@ -51,6 +51,7 @@ export const Review: React.FC = ({ applications, mode }) => { customRulesFiles, excludedRulesTags, autoTaggingEnabled, + advancedAnalysisEnabled, } = watch(); const hasIncludedPackages = withKnownLibs.includes("select"); @@ -192,11 +193,6 @@ export const Review: React.FC = ({ applications, mode }) => { - - - {t("wizard.terms.transactionReport")} - - {" "} {t("wizard.terms.autoTagging")} @@ -207,6 +203,16 @@ export const Review: React.FC = ({ applications, mode }) => { : t("wizard.terms.disabled")} + + + {t("wizard.terms.advancedAnalysisDetails")} + + + {advancedAnalysisEnabled + ? t("wizard.terms.enabled") + : t("wizard.terms.disabled")} + + ); diff --git a/client/src/app/pages/applications/analysis-wizard/schema.ts b/client/src/app/pages/applications/analysis-wizard/schema.ts index d9fa9c38d..13ad653be 100644 --- a/client/src/app/pages/applications/analysis-wizard/schema.ts +++ b/client/src/app/pages/applications/analysis-wizard/schema.ts @@ -157,6 +157,7 @@ const useCustomRulesStepSchema = (): yup.SchemaOf => { export interface OptionsStepValues { excludedRulesTags: string[]; autoTaggingEnabled: boolean; + advancedAnalysisEnabled: boolean; selectedSourceLabels: TargetLabel[]; } @@ -165,6 +166,7 @@ const useOptionsStepSchema = (): yup.SchemaOf => { return yup.object({ excludedRulesTags: yup.array().of(yup.string().defined()), autoTaggingEnabled: yup.bool().defined(), + advancedAnalysisEnabled: yup.bool().defined(), selectedSourceLabels: yup.array().of( yup.object().shape({ name: yup.string().defined(), diff --git a/client/src/app/pages/applications/analysis-wizard/set-options.tsx b/client/src/app/pages/applications/analysis-wizard/set-options.tsx index 66310ba0d..a3c895f7b 100644 --- a/client/src/app/pages/applications/analysis-wizard/set-options.tsx +++ b/client/src/app/pages/applications/analysis-wizard/set-options.tsx @@ -1,10 +1,13 @@ import * as React from "react"; import { Checkbox, + Flex, + FlexItem, Form, Text, TextContent, Title, + Tooltip, } from "@patternfly/react-core"; import { SelectVariant, @@ -25,6 +28,7 @@ import { getParsedLabel } from "@app/utils/rules-utils"; import { DEFAULT_SELECT_MAX_HEIGHT } from "@app/Constants"; import { useFetchTargets } from "@app/queries/targets"; import defaultSources from "./sources"; +import { QuestionCircleIcon } from "@patternfly/react-icons"; export const SetOptions: React.FC = () => { const { t } = useTranslation(); @@ -32,7 +36,12 @@ export const SetOptions: React.FC = () => { const { watch, control, setValue } = useFormContext(); - const { formLabels, excludedRulesTags, autoTaggingEnabled } = watch(); + const { + formLabels, + excludedRulesTags, + autoTaggingEnabled, + advancedAnalysisEnabled, + } = watch(); const [isSelectTargetsOpen, setSelectTargetsOpen] = React.useState(false); const [isSelectSourcesOpen, setSelectSourcesOpen] = React.useState(false); @@ -254,6 +263,30 @@ export const SetOptions: React.FC = () => { id="enable-auto-tagging-checkbox" name="autoTaggingEnabled" /> + + + + setValue("advancedAnalysisEnabled", !advancedAnalysisEnabled) + } + id="enable-advanced-analysis-details-checkbox" + name="advancedAnalysisDetailsEnabled" + /> + + + + + + + ); };