Skip to content

Commit

Permalink
Add Default Mode Logic
Browse files Browse the repository at this point in the history
Signed-off-by: yael-spinner <[email protected]>
  • Loading branch information
yael-spinner committed Dec 11, 2024
1 parent dd1e029 commit 9fb1654
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ interface IAnalysisWizard {
isOpen: boolean;
}

const determineMode = (
applications: Application[]
):
| "binary"
| "source-code-deps"
| "source-code"
| "binary-upload"
| undefined => {
if (applications.length === 0) return undefined;
};
const defaultTaskData: TaskData = {
tagger: {
enabled: true,
Expand Down Expand Up @@ -163,7 +173,7 @@ export const AnalysisWizard: React.FC<IAnalysisWizard> = ({
const methods = useForm<AnalysisWizardFormValues>({
defaultValues: {
artifact: null,
mode: "source-code-deps",
mode: determineMode(applications),
formLabels: [],
selectedTargets: [],
// defaults will be passed as initialFilterValues to the table hook
Expand Down

0 comments on commit 9fb1654

Please sign in to comment.