|
53 | 53 | if (!$project) return;
|
54 | 54 |
|
55 | 55 | const mutableProject: Project & { unset_forge_override?: boolean } = structuredClone($project);
|
| 56 | +
|
56 | 57 | if (selectedOption === 'default') {
|
57 | 58 | mutableProject.unset_forge_override = true;
|
58 | 59 | } else {
|
|
62 | 63 | }
|
63 | 64 | </script>
|
64 | 65 |
|
65 |
| -<Spacer /> |
66 |
| -<SectionCard> |
67 |
| - <h3 class="text-bold text-15">Forge override</h3> |
68 |
| - {#if $determinedForgeType === 'default'} |
69 |
| - <p class="text-13"> |
70 |
| - We were unable to determine what forge you were using. In order to make use of a forge |
71 |
| - integration, select your forge of it from the dropdown below. |
72 |
| - </p> |
73 |
| - <p class="text-13"> |
74 |
| - Please note that only the GitHub and GitLab support PR creation at the moment. |
75 |
| - </p> |
76 |
| - <Select |
77 |
| - value={selectedOption} |
78 |
| - options={forgeOptions} |
79 |
| - wide |
80 |
| - onselect={(value) => { |
81 |
| - selectedOption = value as ForgeName; |
82 |
| - handleSelectionChange(selectedOption); |
83 |
| - }} |
84 |
| - > |
85 |
| - {#snippet itemSnippet({ item, highlighted })} |
86 |
| - <SelectItem selected={item.value === selectedOption} {highlighted}> |
87 |
| - {item.label} |
88 |
| - </SelectItem> |
89 |
| - {/snippet} |
90 |
| - </Select> |
91 |
| - {:else} |
92 |
| - <p class="text-13"> |
93 |
| - We have determined that you are currently using <code>{$determinedForgeType}</code>. We |
94 |
| - currently do not support overriding an automatically determined forge type. |
95 |
| - </p> |
96 |
| - {/if} |
97 |
| -</SectionCard> |
| 66 | +<div> |
| 67 | + <SectionCard roundedBottom={forge.current.name !== 'gitlab'}> |
| 68 | + {#snippet title()} |
| 69 | + Forge override |
| 70 | + {/snippet} |
98 | 71 |
|
99 |
| -{#if forge.current.name === 'gitlab'} |
100 |
| - <Spacer /> |
101 |
| - <SectionCard> |
102 |
| - <h3 class="text-bold text-15">Configure GitLab Integration</h3> |
103 |
| - <p class="text-13"> |
104 |
| - Learn how find your GitLab Personal Token and Project ID in our <Link |
105 |
| - href="https://docs.gitbutler.com/features/gitlab-integration">documentation</Link |
106 |
| - > |
107 |
| - </p> |
108 |
| - <p class="text-13"> |
109 |
| - The Fork Project ID should be the project that your branches get pushed to, and the Upstream |
110 |
| - Project ID should be project where you want the Merge Requests to be created. |
111 |
| - </p> |
| 72 | + {#snippet caption()} |
| 73 | + {#if $determinedForgeType === 'default'} |
| 74 | + We couldn't detect which Forge you're using. |
| 75 | + <br /> |
| 76 | + To enable Forge integration, please select your Forge from the dropdown below. |
| 77 | + <br /> |
| 78 | + <span class="text-bold">Note:</span> Currently, only GitHub and GitLab support pull request creation. |
| 79 | + {:else} |
| 80 | + We’ve detected that you’re using <span class="text-bold" |
| 81 | + >{$determinedForgeType.toUpperCase()}</span |
| 82 | + >. |
| 83 | + <br /> |
| 84 | + At the moment, it’s not possible to manually override the detected forge type. |
| 85 | + {/if} |
| 86 | + {/snippet} |
112 | 87 |
|
113 |
| - <Textbox label="Personal Token" value={$token} oninput={(value) => ($token = value)} /> |
114 |
| - <Textbox |
115 |
| - label="Your Fork's Project ID" |
116 |
| - value={$forkProjectId} |
117 |
| - oninput={(value) => ($forkProjectId = value)} |
118 |
| - /> |
119 |
| - <Textbox |
120 |
| - label="Upstream Project ID" |
121 |
| - value={$upstreamProjectId} |
122 |
| - oninput={(value) => ($upstreamProjectId = value)} |
123 |
| - /> |
124 |
| - <Textbox |
125 |
| - label="Instance URL" |
126 |
| - value={$instanceUrl} |
127 |
| - oninput={(value) => ($instanceUrl = value)} |
128 |
| - /> |
129 |
| - <p class="text-13"> |
130 |
| - If you use a custom GitLab instance (not gitlab.com), you will need to add it as a custom CSP |
131 |
| - entry so that GitButler trusts connecting to that host. Read more in the <Link |
132 |
| - href="https://docs.gitbutler.com/troubleshooting/custom-csp">docs</Link |
| 88 | + {#if $determinedForgeType === 'default'} |
| 89 | + <Select |
| 90 | + value={selectedOption} |
| 91 | + options={forgeOptions} |
| 92 | + wide |
| 93 | + onselect={(value) => { |
| 94 | + selectedOption = value as ForgeName; |
| 95 | + handleSelectionChange(selectedOption); |
| 96 | + }} |
133 | 97 | >
|
134 |
| - </p> |
| 98 | + {#snippet itemSnippet({ item, highlighted })} |
| 99 | + <SelectItem selected={item.value === selectedOption} {highlighted}> |
| 100 | + {item.label} |
| 101 | + </SelectItem> |
| 102 | + {/snippet} |
| 103 | + </Select> |
| 104 | + {:else}{/if} |
135 | 105 | </SectionCard>
|
136 |
| -{/if} |
| 106 | + |
| 107 | + {#if forge.current.name === 'gitlab'} |
| 108 | + <SectionCard roundedTop={false} roundedBottom={false}> |
| 109 | + {#snippet title()} |
| 110 | + Configure GitLab integration |
| 111 | + {/snippet} |
| 112 | + |
| 113 | + {#snippet caption()} |
| 114 | + Learn how find your GitLab Personal Token and Project ID in our <Link |
| 115 | + href="https://docs.gitbutler.com/features/gitlab-integration">docs</Link |
| 116 | + > |
| 117 | + <br /> |
| 118 | + The Fork Project ID is where your branches will be pushed, and the Upstream Project ID is where |
| 119 | + you want merge requests to be created. |
| 120 | + <br /> |
| 121 | + {/snippet} |
| 122 | + |
| 123 | + <Textbox label="Personal token" value={$token} oninput={(value) => ($token = value)} /> |
| 124 | + <Textbox |
| 125 | + label="Your fork's project ID" |
| 126 | + value={$forkProjectId} |
| 127 | + oninput={(value) => ($forkProjectId = value)} |
| 128 | + /> |
| 129 | + <Textbox |
| 130 | + label="Upstream project ID" |
| 131 | + value={$upstreamProjectId} |
| 132 | + oninput={(value) => ($upstreamProjectId = value)} |
| 133 | + /> |
| 134 | + <Textbox |
| 135 | + label="Instance URL" |
| 136 | + value={$instanceUrl} |
| 137 | + oninput={(value) => ($instanceUrl = value)} |
| 138 | + /> |
| 139 | + </SectionCard> |
| 140 | + |
| 141 | + <SectionCard roundedTop={false}> |
| 142 | + {#snippet caption()} |
| 143 | + If you use a custom GitLab instance (not gitlab.com), you will need to add it as a custom |
| 144 | + CSP entry so that GitButler trusts connecting to that host. Read more in the <Link |
| 145 | + href="https://docs.gitbutler.com/troubleshooting/custom-csp">docs</Link |
| 146 | + > |
| 147 | + {/snippet} |
| 148 | + </SectionCard> |
| 149 | + {/if} |
| 150 | +</div> |
| 151 | +<Spacer /> |
0 commit comments