mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-20 09:30:59 +03:00
fix(web-test): strip dashes in fuzzy match for fillTableRow cell names
CamelCase cell IDs like "ИсходящиеБизнесПроцессПриемник" have no dashes, but user keys like "Бизнес-процесс приемник" do. The previous regex only stripped spaces, leaving the dash and causing match failure. Now strip both spaces and dashes with /[\s\-]+/g in both the Tab-loop path and the row/dblclick column-lookup path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
07be2bcafd
commit
21de2a4749
@@ -2342,7 +2342,7 @@ export async function fillTableRow(fields, { tab, add, row, table } = {}) {
|
|||||||
cols.push({ idx: i, text: ((t || box).innerText?.trim() || '').toLowerCase() });
|
cols.push({ idx: i, text: ((t || box).innerText?.trim() || '').toLowerCase() });
|
||||||
});
|
});
|
||||||
const kl = ${JSON.stringify(key.toLowerCase())};
|
const kl = ${JSON.stringify(key.toLowerCase())};
|
||||||
const klNoSpace = kl.replace(/\\s+/g, '');
|
const klNoSpace = kl.replace(/[\\s\\-]+/g, '');
|
||||||
let colIdx = -1;
|
let colIdx = -1;
|
||||||
const exact = cols.find(c => c.text === kl);
|
const exact = cols.find(c => c.text === kl);
|
||||||
if (exact) colIdx = exact.idx;
|
if (exact) colIdx = exact.idx;
|
||||||
@@ -2515,8 +2515,8 @@ export async function fillTableRow(fields, { tab, add, row, table } = {}) {
|
|||||||
matchedKey = key;
|
matchedKey = key;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// CamelCase cell names have no spaces — try matching without spaces
|
// CamelCase cell names have no spaces/dashes — try matching without spaces and dashes
|
||||||
const klNoSpace = kl.replace(/\s+/g, '');
|
const klNoSpace = kl.replace(/[\s\-]+/g, '');
|
||||||
if (klNoSpace && (cellLower.endsWith(klNoSpace) || cellLower.includes(klNoSpace))) {
|
if (klNoSpace && (cellLower.endsWith(klNoSpace) || cellLower.includes(klNoSpace))) {
|
||||||
matchedKey = key;
|
matchedKey = key;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user