Skip to content

Commit b659c16

Browse files
committed
Add Git branch field to course creator
1 parent 1e3b993 commit b659c16

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/pages/CourseCreator.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { useCreate } from "../components/Hooks"
2121

2222
export default function CourseCreator({
2323
slug = "",
24+
repositoryBranch = "",
2425
repository = "",
2526
repositoryUser = "",
2627
repositoryPassword = "",
@@ -34,6 +35,7 @@ export default function CourseCreator({
3435
const { mutate, isLoading } = useCreate(slug)
3536
const [course, setCourse] = useState({
3637
slug: slug,
38+
repositoryBranch: repositoryBranch,
3739
repository: repository,
3840
repositoryUser: repositoryUser,
3941
repositoryPassword: repositoryPassword,
@@ -75,6 +77,20 @@ export default function CourseCreator({
7577
type="text"
7678
/>
7779
</FormControl>
80+
<Text color="gray.600" lineHeight={1.5}>
81+
Which Git branch should the course be loaded from? Leave empty to
82+
use the repository's default branch.
83+
</Text>
84+
<FormControl>
85+
<FormLabel>Git branch:</FormLabel>
86+
<Input
87+
value={course.repositoryBranch}
88+
onChange={(e) =>
89+
setCourse({ ...course, repositoryBranch: e.target.value })
90+
}
91+
type="text"
92+
/>
93+
</FormControl>
7894
<Text color="gray.600" lineHeight={1.5}>
7995
You may manually set a course slug. This makes sense if you want
8096
to import the same course more than once. If you leave this field

src/types.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ declare interface CourseMetaProps {
3434
description?: string
3535
slug?: string
3636
repository?: string
37+
repositoryBranch?: string
3738
repositoryUser?: string
3839
repositoryPassword?: string
3940
webhookSecret?: string

0 commit comments

Comments
 (0)