mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-06-11 08:24:57 +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:
@@ -2342,7 +2342,7 @@ export async function fillTableRow(fields, { tab, add, row, table } = {}) {
|
||||
cols.push({ idx: i, text: ((t || box).innerText?.trim() || '').toLowerCase() });
|
||||
});
|
||||
const kl = ${JSON.stringify(key.toLowerCase())};
|
||||
const klNoSpace = kl.replace(/\\s+/g, '');
|
||||
const klNoSpace = kl.replace(/[\\s\\-]+/g, '');
|
||||
let colIdx = -1;
|
||||
const exact = cols.find(c => c.text === kl);
|
||||
if (exact) colIdx = exact.idx;
|
||||
@@ -2515,8 +2515,8 @@ export async function fillTableRow(fields, { tab, add, row, table } = {}) {
|
||||
matchedKey = key;
|
||||
break;
|
||||
}
|
||||
// CamelCase cell names have no spaces — try matching without spaces
|
||||
const klNoSpace = kl.replace(/\s+/g, '');
|
||||
// CamelCase cell names have no spaces/dashes — try matching without spaces and dashes
|
||||
const klNoSpace = kl.replace(/[\s\-]+/g, '');
|
||||
if (klNoSpace && (cellLower.endsWith(klNoSpace) || cellLower.includes(klNoSpace))) {
|
||||
matchedKey = key;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user