profiler editor: keep record/content fields visible
- Seed one empty record row when record content is created or reset (filetype change or Contents None->Exact/Mask) via profilerEmptyRecordContent - Add per-record delete and '+ Record' add controls so the record view is always editable; delete is hidden on the last remaining row SW cache v47.
This commit is contained in:
@@ -21,7 +21,7 @@ function extractFunc(src, name) {
|
||||
return src.slice(m.index, i + 1);
|
||||
}
|
||||
|
||||
const FNS = ['profilerNormHex', 'profilerMatch', 'profilerMatchMin', 'profilerMaskPrefix4', 'profilerFileFields', 'profilerContentKindForFileType', 'profilerValidateProfile'];
|
||||
const FNS = ['profilerNormHex', 'profilerMatch', 'profilerMatchMin', 'profilerMaskPrefix4', 'profilerFileFields', 'profilerContentKindForFileType', 'profilerEmptyRecordContent', 'profilerValidateProfile'];
|
||||
let code = '';
|
||||
for (const f of FNS) code += extractFunc(html, f) + '\n';
|
||||
eval(code);
|
||||
@@ -92,6 +92,14 @@ test('profilerContentKindForFileType', () => {
|
||||
assert.strictEqual(profilerContentKindForFileType('df'), 'transparent');
|
||||
});
|
||||
|
||||
test('profilerEmptyRecordContent seeds one empty record row', () => {
|
||||
const c = profilerEmptyRecordContent('exact');
|
||||
assert.strictEqual(c.kind, 'record');
|
||||
assert.strictEqual(c.mode, 'exact');
|
||||
assert.strictEqual(c.records.length, 1);
|
||||
assert.deepStrictEqual(c.records[0], { num: 1, data: '' });
|
||||
});
|
||||
|
||||
test('profile validation', () => {
|
||||
assert.strictEqual(profilerValidateProfile(null), 'Not an object');
|
||||
assert.strictEqual(profilerValidateProfile({ name: 'x' }), 'Missing rules array');
|
||||
|
||||
Reference in New Issue
Block a user