Skip to content

Commit

Permalink
default branch support
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed Feb 11, 2025
1 parent 9653cc5 commit c501bcc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/pages/tools/templatelib/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { useEffect } from "react";
import { Grid, Divider, Typography, CircularProgress, Alert, Chip, Link } from "@mui/material";
import { useForm, useWatch } from "react-hook-form";
import { Layout as DashboardLayout } from "/src/layouts/index.js";
Expand Down Expand Up @@ -48,6 +48,15 @@ const TemplateLibrary = () => {
};
};

useEffect(() => {
if (templateRepo?.value) {
formControl.setValue("templateRepoBranch", {
label: templateRepo.addedFields.branch,
value: templateRepo.addedFields.branch,
});
}
}, [templateRepo?.value]);

return (
<CippFormPage
formControl={formControl}
Expand Down Expand Up @@ -121,6 +130,9 @@ const TemplateLibrary = () => {
dataKey: "Results",
valueField: "FullName",
labelField: (option) => `${option.Name} (${option.URL})`,
addedField: {
branch: "DefaultBranch",
},
}}
formControl={formControl}
multiple={false}
Expand Down

0 comments on commit c501bcc

Please sign in to comment.