Skip to content

Commit c0724bd

Browse files
committed
feat: add configurable issue url
1 parent 623b924 commit c0724bd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/decap-cms-core/src/components/UI/ErrorBoundary.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import copyToClipboard from 'copy-text-to-clipboard';
88
import { localForage } from 'decap-cms-lib-util';
99
import { buttons, colors } from 'decap-cms-ui-default';
1010

11-
const ISSUE_URL = 'https://github.com/decaporg/decap-cms/issues/new?';
11+
const ISSUE_URL = 'https://github.com/decaporg/decap-cms/issues/new';
1212

1313
function getIssueTemplate({ version, provider, browser, config }) {
1414
return `
@@ -52,6 +52,7 @@ function buildIssueTemplate({ config }) {
5252
}
5353

5454
function buildIssueUrl({ title, config }) {
55+
const issueUrl = config?.issue_reports?.url ?? ISSUE_URL;
5556
try {
5657
const body = buildIssueTemplate({ config });
5758

@@ -60,10 +61,10 @@ function buildIssueUrl({ title, config }) {
6061
params.append('body', truncate(body, { length: 4000, omission: '\n...' }));
6162
params.append('labels', 'type: bug');
6263

63-
return `${ISSUE_URL}${params.toString()}`;
64+
return `${issueUrl}?${params.toString()}`;
6465
} catch (e) {
6566
console.log(e);
66-
return `${ISSUE_URL}template=bug_report.md`;
67+
return `${issueUrl}?template=bug_report.md`;
6768
}
6869
}
6970

0 commit comments

Comments
 (0)