feat(repository): continue to work on RepositoryPullRequestCreateForm@@ -1,5 +1,5 @@
{
- "_generatedAtUnix": 1665170686793,
+ "_generatedAtUnix": 1665171143196,
"_hashAlgorithm": "sha1",
"_version": 2,
"islands": {
@@ -58,7 +58,7 @@
"pathSourceMap": "./public/.islands/RepositoryInitialSetup.bundle.js.map"
},
"RepositoryPullRequestCreateForm": {
- "hash": "2ac0d180c4a2671fe95215f22e02ad2149b93e16",
+ "hash": "4afb6f0d440189a20c78373cab3ecf5ef89a1276",
"pathSource": "./app/islands/RepositoryPullRequestCreateForm.tsx",
"pathBundle": "./public/.islands/RepositoryPullRequestCreateForm.bundle.js",
"pathSourceMap": "./public/.islands/RepositoryPullRequestCreateForm.bundle.js.map"
@@ -172,39 +172,59 @@ const RepositoryPullRequestCreateForm: ReactIsland<RepositoryPullRequestCreateFo
</select>
{/* VS. */}
- {data.initialTarget != null && (
- <>
- <div>
- <span>Target:</span>
- </div>
- <input
- disabled
- type={"text"}
- name={"target_parent_org_display_name"}
- value={
- data.initialTarget.parentOrg.displayName ||
- data.initialTarget.parentOrg.slug
- }
- />
- {" / "}
- <input
- disabled
- type={"text"}
- name={"target_repository_display_name"}
- value={
- data.initialTarget.repo.displayName ||
- data.initialTarget.repo.slug
- }
- />
- {" / "}
- <select name={"target_repository_from_branch"}>
- <option value={data.initialTarget.branch}>
- {data.initialTarget.branch}
- </option>
- </select>
- </>
- )}
+ <div>
+ <span>Target:</span>
+ </div>
+
+ <input
+ disabled
+ type={"text"}
+ name={"target_parent_org_display_name"}
+ value={
+ data.initialTarget?.parentOrg.displayName ||
+ data.initialTarget?.parentOrg.slug ||
+ data.source.parentOrg.displayName ||
+ data.source.parentOrg.slug
+ }
+ />
+ {" / "}
+ <input
+ disabled
+ type={"text"}
+ name={"target_repository_display_name"}
+ value={
+ data.initialTarget?.repo.displayName ||
+ data.initialTarget?.repo.slug ||
+ data.source.repo.displayName ||
+ data.source.repo.slug
+ }
+ />
+ {" / "}
+ <select
+ name={"target_repository_from_branch"}
+ defaultValue={
+ data.initialTarget != null
+ ? data.initialTarget.branch
+ : data.source.branches.length >= 1
+ ? data.source.branches[0]
+ : undefined
+ }
+ >
+ {data.initialTarget != null && (
+ <option
+ key={data.initialTarget.branch}
+ value={data.initialTarget.branch}
+ >
+ {data.initialTarget.branch}
+ </option>
+ )}
+ {data.source.branches.map((branch, idx) => (
+ <option key={[branch, idx].join(":")} value={branch}>
+ {branch}
+ </option>
+ ))}
+ </select>
<button type={"submit"}>Go to COMPARE step</button>
</form>