Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 85ebe91

Browse files
authored
feat(gui): prefill label for GitHub issue for wrong annotation (#799)
1 parent 48b9300 commit 85ebe91

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

api-editor/gui/src/features/reporting/issueURLBuilder.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const missingAnnotationURL = function (target: string): string {
1212
return `${baseMissingAnnotationURL}&url-hash=${urlHash}`;
1313
};
1414

15-
const baseWrongAnnotationURL = `${baseURL}?assignees=&labels=bug%2Cwrong+annotation&template=wrong_annotation.yml`;
15+
const baseWrongAnnotationURL = `${baseURL}?assignees=&template=wrong_annotation.yml&labels=bug%2Cwrong+annotation%2C`;
1616

1717
export const wrongAnnotationURL = function (annotationType: string, annotation: Annotation): string {
1818
const minimalAnnotation = { ...annotation };
@@ -22,10 +22,11 @@ export const wrongAnnotationURL = function (annotationType: string, annotation:
2222
// noinspection JSConstantReassignment
2323
delete minimalAnnotation.reviewers;
2424

25+
const label = encodeURIComponent(`@${annotationType}`);
2526
const urlHash = encodeURIComponent(`\`#/${annotation.target}\``);
2627
const actualAnnotationType = encodeURIComponent(`\`@${annotationType}\``);
2728
const actualAnnotationInputs = encodeURIComponent(
2829
`\`\`\`json5\n${JSON.stringify(minimalAnnotation, null, 4)}\n\`\`\``,
2930
);
30-
return `${baseWrongAnnotationURL}&url-hash=${urlHash}&actual-annotation-type=${actualAnnotationType}&actual-annotation-inputs=${actualAnnotationInputs}`;
31+
return `${baseWrongAnnotationURL}${label}&url-hash=${urlHash}&actual-annotation-type=${actualAnnotationType}&actual-annotation-inputs=${actualAnnotationInputs}`;
3132
};

0 commit comments

Comments
 (0)