Parser fixes for blank IDs and APPORTAL IDs
This commit is contained in:
+23
-4
@@ -12,7 +12,7 @@ export function clearIssues() {
|
||||
}
|
||||
|
||||
let socialRefsByIssueId = new Map();
|
||||
const ISSUE_ID_LINE_PATTERN = /^((?:[A-Z]{2,6}|WF500)-\d{4,8})\s*[:\-]?\s*(.*)$/i;
|
||||
const ISSUE_ID_LINE_PATTERN = /^([A-Z][A-Z0-9]{1,15}-\d{3,8})\s*[:\-]?\s*(.*)$/i;
|
||||
const socialRefsReady = loadSocialRefs();
|
||||
const issueFileDataCache = new Map();
|
||||
const issueFilePromiseCache = new Map();
|
||||
@@ -409,11 +409,13 @@ function dedupeIssues(issues, versionKey) {
|
||||
const caveat = (issue.caveat || '').trim();
|
||||
if (!id) return;
|
||||
|
||||
if (!map.has(id)) {
|
||||
map.set(id, { id, summary, resolved, caveat, [versionKey]: [] });
|
||||
const dedupeKey = getIssueDedupeKey(id, summary, resolved, caveat);
|
||||
|
||||
if (!map.has(dedupeKey)) {
|
||||
map.set(dedupeKey, { id, summary, resolved, caveat, [versionKey]: [] });
|
||||
}
|
||||
|
||||
const entry = map.get(id);
|
||||
const entry = map.get(dedupeKey);
|
||||
if (!entry.summary && summary) {
|
||||
entry.summary = summary;
|
||||
}
|
||||
@@ -433,6 +435,23 @@ function dedupeIssues(issues, versionKey) {
|
||||
return Array.from(map.values()).sort((a, b) => b.id.localeCompare(a.id));
|
||||
}
|
||||
|
||||
function getIssueDedupeKey(id, summary, resolved, caveat) {
|
||||
const normalizedId = String(id || '').trim().toUpperCase();
|
||||
|
||||
if (normalizedId !== 'BLANK-000000') {
|
||||
return normalizedId;
|
||||
}
|
||||
|
||||
const normalizedSummary = normalizeWhitespace(String(summary || ''));
|
||||
const normalizedResolved = normalizeWhitespace(String(resolved || ''));
|
||||
const normalizedCaveat = normalizeWhitespace(String(caveat || ''));
|
||||
return `${normalizedId}|${normalizedSummary}|${normalizedResolved}|${normalizedCaveat}`;
|
||||
}
|
||||
|
||||
function normalizeWhitespace(text) {
|
||||
return String(text || '').replace(/\s+/g, ' ').trim();
|
||||
}
|
||||
|
||||
function parseIssueLine(text) {
|
||||
const value = String(text || '').trim();
|
||||
const match = value.match(ISSUE_ID_LINE_PATTERN);
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@ if (typeof document !== 'undefined') {
|
||||
|
||||
let activeDownloadUrl = null;
|
||||
const PROCESS_FORM_STATE_KEY = 'bugmedley.process.formState.v1';
|
||||
const ISSUE_ID_PATTERN = /((?:[A-Z]{2,6}|WF500)-\d{3,8})/i;
|
||||
const ISSUE_ID_LIST_PREFIX_PATTERN = /^\s*((?:(?:[A-Z]{2,6}|WF500)-\d{3,8})(?:\s*(?:,|and|&)\s*(?:(?:[A-Z]{2,6}|WF500)-\d{3,8}))*)/i;
|
||||
const ISSUE_ID_PATTERN = /([A-Z][A-Z0-9]{1,15}-\d{3,8})/i;
|
||||
const ISSUE_ID_LIST_PREFIX_PATTERN = /^\s*((?:[A-Z][A-Z0-9]{1,15}-\d{3,8})(?:\s*(?:,|and|&)\s*(?:[A-Z][A-Z0-9]{1,15}-\d{3,8}))*)/i;
|
||||
const BLOCK_CONTAINER_TAGS = new Set(['ARTICLE', 'ASIDE', 'BLOCKQUOTE', 'DIV', 'P', 'PRE', 'SECTION']);
|
||||
const TEXT_NODE = 3;
|
||||
const ELEMENT_NODE = 1;
|
||||
|
||||
Reference in New Issue
Block a user