|
45 | 45 | projectId: string;
|
46 | 46 | stackId: string;
|
47 | 47 | branchName: string;
|
48 |
| - prNumber?: number; |
49 | 48 | reviewId?: string;
|
50 | 49 | onClose: () => void;
|
51 | 50 | };
|
52 | 51 |
|
53 |
| - const { projectId, stackId, branchName, prNumber, onClose }: Props = $props(); |
| 52 | + const { projectId, stackId, branchName, onClose }: Props = $props(); |
54 | 53 |
|
55 | 54 | const baseBranch = inject(BASE_BRANCH);
|
56 | 55 | const forge = inject(DEFAULT_FORGE_FACTORY);
|
|
80 | 79 | const commitsResult = $derived(stackService.commits(projectId, stackId, branchName));
|
81 | 80 | const commits = $derived(commitsResult.current.data || []);
|
82 | 81 |
|
83 |
| - const prResult = $derived(prNumber ? prService?.get(prNumber) : undefined); |
84 |
| - const pr = $derived(prResult?.current.data); |
85 |
| -
|
86 | 82 | const forgeBranch = $derived(branchName ? forge.current.branch(branchName) : undefined);
|
87 | 83 | const baseBranchName = $derived(baseBranch.shortName);
|
88 | 84 |
|
89 | 85 | const createDraft = persisted<boolean>(false, 'createDraftPr');
|
90 |
| - const createPullRequest = persisted<boolean>(true, 'createPullRequest'); |
91 | 86 |
|
92 | 87 | const pushBeforeCreate = $derived(
|
93 | 88 | !forgeBranch || (branchDetails ? requiresPush(branchDetails.pushStatus) : true)
|
|
111 | 106 | let isCreatingReview = $state<boolean>(false);
|
112 | 107 | const isExecuting = $derived(stackPush.current.isLoading || aiIsLoading || isCreatingReview);
|
113 | 108 |
|
114 |
| - const canPublishPR = $derived(!!(forge.current.authenticated && !pr)); |
115 |
| -
|
116 | 109 | async function getDefaultTitle(commits: Commit[]): Promise<string> {
|
117 | 110 | if (commits.length === 1) {
|
118 | 111 | const commitMessage = commits[0]!.message;
|
|
305 | 298 | }
|
306 | 299 | }
|
307 | 300 |
|
308 |
| - const isCreateButtonEnabled = $derived.by(() => { |
309 |
| - if (canPublishPR && $createPullRequest) { |
310 |
| - return true; |
311 |
| - } |
312 |
| - return false; |
313 |
| - }); |
314 |
| -
|
315 | 301 | async function onAiButtonClick() {
|
316 | 302 | if (!aiGenEnabled || aiIsLoading) return;
|
317 | 303 |
|
|
347 | 333 | }
|
348 | 334 |
|
349 | 335 | export const imports = {
|
350 |
| - get creationEnabled() { |
351 |
| - return isCreateButtonEnabled; |
352 |
| - }, |
353 | 336 | get isLoading() {
|
354 | 337 | return isExecuting;
|
355 | 338 | }
|
|
0 commit comments