Files view: a card-side change reads as its read, with a "Changed on card!" link (v2.6.4)
- a card-side change is discovered by a read operation, so the timeline row now reads "Read EF_IMSI" — the row keeps its warn colour and layout — with "Changed on card!" as the trailing underlined link that opens the change modal; an update row keeps the generic "Details" link - the 'Changed on card' verb string is gone; the new 'Changed on card!' key carries the Russian «Изменено на карте!» - tests: the verb/label cases updated (card_change -> Read, "Read EF_LOCI") and the Files-view wiring test pins the kind-dependent link label; 527 Python + 61 Node tests - README/README_RUS describe the new row wording; PWA_VERSION/pyproject/ version.py 2.6.4, SW cache simtrace-analyser-v78
This commit is contained in:
1 parent
475c136749
commit
be75be9ed2
8 files changed
+25
-18
No files matched your search
+5
-4
@@ -2136,7 +2136,8 @@ function fileOpClass(kind) {
|
||||
|
||||
function fileOpVerb(kind) {
|
||||
if (kind === 'update') return t('Update');
|
||||
if (kind === 'card_change') return t('Changed on card');
|
||||
// A card-side change is discovered by a read operation, so the row reads
|
||||
// as one ("Read EF_IMSI") with the change offered as a trailing link.
|
||||
return t('Read');
|
||||
}
|
||||
|
||||
@@ -2233,7 +2234,7 @@ async function renderFileView() {
|
||||
}
|
||||
view.innerHTML = timeline.map(op => {
|
||||
const diff = op.change_ref
|
||||
? `<button class="file-op-diff" data-diff="${escapeHtml(op.change_ref.file)}|${op.change_ref.idx}" title="${t('Show the change')}">${t('Details')}</button>`
|
||||
? `<button class="file-op-diff" data-diff="${escapeHtml(op.change_ref.file)}|${op.change_ref.idx}" title="${t('Show the change')}">${op.kind === 'card_change' ? t('Changed on card!') : t('Details')}</button>`
|
||||
: '';
|
||||
return `<div class="file-op ${fileOpClass(op.kind)}" data-idx="${op.index}">
|
||||
<span>${escapeHtml(fileOpLabel(op))}</span>${diff}
|
||||
@@ -3225,7 +3226,7 @@ function onFilterChange() {
|
||||
}
|
||||
|
||||
// ──────────────────── Versioning ────────────────────
|
||||
const PWA_VERSION = '2.6.3';
|
||||
const PWA_VERSION = '2.6.4';
|
||||
const MIN_SERVER_VERSION = '2.3.0';
|
||||
|
||||
function parseVersion(v) {
|
||||
@@ -3271,7 +3272,7 @@ const LANG_RU = {
|
||||
'Files': 'Файлы',
|
||||
'Read': 'Чтение',
|
||||
'Update': 'Запись',
|
||||
'Changed on card': 'Изменено картой',
|
||||
'Changed on card!': 'Изменено на карте!',
|
||||
'Change details': 'Подробности изменения',
|
||||
'Details': 'Подробнее',
|
||||
'changed': 'изменено',
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
const CACHE = 'simtrace-analyser-v77';
|
||||
const CACHE = 'simtrace-analyser-v78';
|
||||
|
||||
const PRECACHE = [
|
||||
'index.html',
|
||||
|
||||
@@ -292,10 +292,12 @@ test('Files view: operation kinds map to classes and verbs', () => {
|
||||
assert.equal(fileOpClass('card_change'), 'file-op-card');
|
||||
assert.equal(fileOpVerb('read'), 'Read');
|
||||
assert.equal(fileOpVerb('update'), 'Update');
|
||||
assert.equal(fileOpVerb('card_change'), 'Changed on card');
|
||||
// A card-side change is discovered by a read, so the row reads as a read
|
||||
// operation ("Read EF_LOCI") with the change as a trailing link.
|
||||
assert.equal(fileOpVerb('card_change'), 'Read');
|
||||
assert.equal(fileOpLabel({kind: 'read', file: {name: 'EF_ICCID'}}), 'Read EF_ICCID');
|
||||
assert.equal(fileOpLabel({kind: 'card_change', file: {name: 'EF_LOCI'}}),
|
||||
'Changed on card EF_LOCI');
|
||||
'Read EF_LOCI');
|
||||
assert.equal(fileOpLabel({kind: 'read', file: null}), 'Read ?');
|
||||
});
|
||||
|
||||
@@ -340,7 +342,9 @@ test('Files view: the view selector (topbar) and the timeline are wired', () =>
|
||||
assert.match(src, /\$on\('side-view-select', 'change'/);
|
||||
assert.match(src, /\$on\('file-view', 'click'/);
|
||||
assert.match(src, /API\.getSessionFiles\(sid\)/);
|
||||
assert.match(src, />\$\{t\('Details'\)\}<\/button>/);
|
||||
// The trailing link: "Changed on card!" for a card-side change (it opens
|
||||
// the change modal), the generic "Details" for an update row.
|
||||
assert.match(src, />\$\{op\.kind === 'card_change' \? t\('Changed on card!'\) : t\('Details'\)\}<\/button>/);
|
||||
assert.match(src, /API\.getSessionFileImage\(STATE\.sessionViewId, fileKey, idx\)/);
|
||||
assert.match(src, /getSessionFileImage\(id, key, change\)/);
|
||||
assert.match(src, /files\/image\?key=/);
|
||||
@@ -354,7 +358,7 @@ test('Files view: strings carry Russian translations', () => {
|
||||
for (const m of lang.matchAll(/'((?:[^'\\]|\\.)*)'\s*:/g)) {
|
||||
keys.add(m[1].replace(/\\(['\\])/g, '$1'));
|
||||
}
|
||||
for (const s of ['Files', 'Read', 'Update', 'Changed on card', 'Change details',
|
||||
for (const s of ['Files', 'Read', 'Update', 'Changed on card!', 'Change details',
|
||||
'Details', 'Close', 'Offset', 'Record', 'Before', 'After', 'Show the change',
|
||||
'changed', 'newly observed', 'never observed',
|
||||
'{c} bytes changed, {n} bytes newly observed',
|
||||
|
||||
Reference in new issue
Block a user