Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to set PRs to default to Draft #4313

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
"default": "template",
"description": "%githubPullRequests.pullRequestDescription.description%"
},
"githubPullRequests.createDraft": {
"type": "boolean",
"default": false,
"description": "%githubPullRequests.createDraft%"
},
"githubPullRequests.logLevel": {
"type": "string",
"enum": [
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"githubPullRequests.pullRequestDescription.description": "The description used when creating pull requests.",
"githubPullRequests.pullRequestDescription.template": "Use a pull request template and commit description, or just use the commit description if no templates were found",
"githubPullRequests.pullRequestDescription.commit": "Use the latest commit message only",
"githubPullRequests.createDraft": "Whether the \"Draft\" checkbox will be checked by default when creating a pull request.",
"githubPullRequests.logLevel.description": "Logging for GitHub Pull Request extension. The log is emitted to the output channel named as GitHub Pull Request.",
"githubPullRequests.remotes.markdownDescription": "List of remotes, by name, to fetch pull requests from.",
"githubPullRequests.queries.markdownDescription": "Specifies what queries should be used in the GitHub Pull Requests tree. All queries are made against **the currently opened repos**. Each query object has a `label` that will be shown in the tree and a search `query` using [GitHub search syntax](https://help.github.com/en/articles/understanding-the-search-syntax). The variable `${user}` can be used to specify the logged in user within a search. By default these queries define the categories \"Waiting For My Review\", \"Assigned To Me\" and \"Created By Me\". If you want to preserve these, make sure they are still in the array when you modify the setting.",
Expand Down
1 change: 1 addition & 0 deletions src/common/settingKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const NOTIFICATION_SETTING = 'notifications';
export const POST_CREATE = 'postCreate';
export const QUERIES = 'queries';
export const FOCUSED_MODE = 'focusedMode';
export const CREATE_DRAFT = 'createDraft';

// git
export const GIT = 'git';
Expand Down
5 changes: 3 additions & 2 deletions src/github/createPRViewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { GitHubServerType } from '../common/authentication';
import Logger from '../common/logger';
import { Protocol } from '../common/protocol';
import { GitHubRemote } from '../common/remote';
import { ASSIGN_TO, PULL_REQUEST_DESCRIPTION, PUSH_BRANCH } from '../common/settingKeys';
import { ASSIGN_TO, CREATE_DRAFT, PULL_REQUEST_DESCRIPTION, PUSH_BRANCH } from '../common/settingKeys';
import { getNonce, IRequestMessage, WebviewViewBase } from '../common/webview';
import {
byRemoteName,
Expand Down Expand Up @@ -309,7 +309,8 @@ export class CreatePullRequestViewProvider extends WebviewViewBase implements vs
defaultMergeMethod: getDefaultMergeMethod(mergeConfiguration.mergeMethodsAvailability),
allowAutoMerge: mergeConfiguration.viewerCanAutoMerge,
mergeMethodsAvailability: mergeConfiguration.mergeMethodsAvailability,
createError: ''
createError: '',
isDraft: vscode.workspace.getConfiguration(SETTINGS_NAMESPACE).get(CREATE_DRAFT, false)
};

Logger.appendLine(`Initializing "create" view: ${JSON.stringify(params)}`, 'CreatePullRequestViewProvider');
Expand Down