Skip to content

Commit

Permalink
Merge pull request #1 from yael-spinner/s_y_change_deafault_mode
Browse files Browse the repository at this point in the history
Add Default Mode Logic
  • Loading branch information
shirael authored Dec 11, 2024
2 parents dd1e029 + 9fb1654 commit f4179ef
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 f4179ef

Please sign in to comment.