Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit cc83ce7

Browse files
myan9starpit
authored andcommitted
feat(packages/core): allow controller to opt in/out recording table row onclicks when snapshot
Fixes #5565
1 parent 552fbef commit cc83ce7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

packages/core/src/webapp/models/table.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ export class Row {
6969

7070
rowCSS?: string | string[]
7171

72-
onclickSilence?: boolean
72+
onclickSilence?: boolean // opt in/out recording click events when snapshot
73+
74+
onclickIdempotent?: boolean
7375

7476
onclickExec?: 'pexec' | 'qexec'
7577

plugins/plugin-core-support/src/lib/cmds/replay.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ class FlightRecorder {
163163
? {
164164
completeEvent: _.completeEvent,
165165
onClicks: _.completeEvent.response.body
166-
.map((_, rowIdx) => (typeof _.onclick === 'string' ? { rowIdx, onClick: _.onclick } : undefined))
166+
.map((_, rowIdx) =>
167+
_.onclickIdempotent && typeof _.onclick === 'string' ? { rowIdx, onClick: _.onclick } : undefined
168+
)
167169
.filter(_ => _)
168170
}
169171
: undefined

plugins/plugin-kubectl/src/lib/view/formatTable.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ export const formatTable = async <O extends KubeOptions>(
318318
rowKey,
319319
fontawesome: idx !== 0 && rows[0].key === 'CURRENT' && 'fas fa-check',
320320
onclick: nameColumnIdx === 0 && onclick, // if the first column isn't the NAME column, no onclick; see onclick below
321+
onclickIdempotent: true,
321322
onclickSilence: true,
322323
css: firstColumnCSS + (rows[0].key === nameColumn ? ' kui--table-cell-is-name' : ''),
323324
rowCSS,

0 commit comments

Comments
 (0)