mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-06-12 08:54:57 +03:00
fix(web-test): fillTableRow fuzzy match for CamelCase cell names
Cell IDs in 1C tables are CamelCase without spaces (e.g.
"ВариантыАрхитектурыВариантАрхитектуры"), but users pass keys with
spaces ("Вариант архитектуры"). Added space-stripped fallback to
fuzzy match so fillTableRow correctly maps user keys to grid cells.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2055,7 +2055,7 @@ export async function fillTableRow(fields, { tab, add, row } = {}) {
|
||||
}
|
||||
prevCellId = cell.id;
|
||||
|
||||
// Fuzzy match cell name to user field: exact → suffix → includes
|
||||
// Fuzzy match cell name to user field: exact → suffix → includes → no-space includes
|
||||
const cellLower = cell.fullName.toLowerCase();
|
||||
let matchedKey = null;
|
||||
for (const [key, info] of pending) {
|
||||
@@ -2065,6 +2065,12 @@ export async function fillTableRow(fields, { tab, add, row } = {}) {
|
||||
matchedKey = key;
|
||||
break;
|
||||
}
|
||||
// CamelCase cell names have no spaces — try matching without spaces
|
||||
const klNoSpace = kl.replace(/\s+/g, '');
|
||||
if (klNoSpace && (cellLower.endsWith(klNoSpace) || cellLower.includes(klNoSpace))) {
|
||||
matchedKey = key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!matchedKey) {
|
||||
|
||||
Reference in New Issue
Block a user