Skip to content

Commit bd32ced

Browse files
authored
Clean up hide column terminology (#4304)
1 parent 9d70e6f commit bd32ced

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

extension/src/experiments/webview/messages.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ export class WebviewMessages {
8686
})
8787
case MessageFromWebviewType.TOGGLE_EXPERIMENT_STAR:
8888
return this.setExperimentStars(message.payload)
89-
case MessageFromWebviewType.HIDE_EXPERIMENTS_TABLE_COLUMN:
90-
return this.hideTableColumn(message.payload)
89+
case MessageFromWebviewType.EXPERIMENTS_TABLE_HIDE_COLUMN_PATH:
90+
return this.hideColumnPath(message.payload)
9191
case MessageFromWebviewType.EXPERIMENTS_TABLE_MOVE_TO_START:
9292
return this.movePathToStart(message.payload)
9393
case MessageFromWebviewType.OPEN_PARAMS_FILE_TO_THE_SIDE:
@@ -382,13 +382,13 @@ export class WebviewMessages {
382382
return commandPromise
383383
}
384384

385-
private hideTableColumn(path: string) {
385+
private hideColumnPath(path: string) {
386386
this.columns.unselect(path)
387387

388388
this.notifyChanged()
389389

390390
sendTelemetryEvent(
391-
EventName.VIEWS_EXPERIMENTS_TABLE_HIDE_COLUMN,
391+
EventName.VIEWS_EXPERIMENTS_TABLE_HIDE_COLUMN_PATH,
392392
{ path },
393393
undefined
394394
)

extension/src/telemetry/constants.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export const EventName = Object.assign(
4343
'views.experimentsTable.focusFiltersTree',
4444
VIEWS_EXPERIMENTS_TABLE_FOCUS_SORTS_TREE:
4545
'views.experimentsTable.focusSortsTree',
46-
VIEWS_EXPERIMENTS_TABLE_HIDE_COLUMN: 'views.experimentsTable.columnHidden',
46+
VIEWS_EXPERIMENTS_TABLE_HIDE_COLUMN_PATH:
47+
'views.experimentsTable.hideColumnPath',
4748
VIEWS_EXPERIMENTS_TABLE_MOVE_TO_START: 'views.experimentsTable.moveToStart',
4849
VIEWS_EXPERIMENTS_TABLE_OPEN_PARAMS_FILE:
4950
'views.experimentsTable.paramsFileOpened',
@@ -247,7 +248,7 @@ export interface IEventNamePropertyMapping {
247248
}
248249
[EventName.VIEWS_EXPERIMENTS_TABLE_CREATED]: undefined
249250
[EventName.VIEWS_EXPERIMENTS_TABLE_FOCUS_CHANGED]: WebviewFocusChangedProperties
250-
[EventName.VIEWS_EXPERIMENTS_TABLE_HIDE_COLUMN]: {
251+
[EventName.VIEWS_EXPERIMENTS_TABLE_HIDE_COLUMN_PATH]: {
251252
path: string
252253
}
253254
[EventName.VIEWS_EXPERIMENTS_TABLE_MOVE_TO_START]: { path: string }

extension/src/test/suite/experiments/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,14 +477,14 @@ suite('Experiments Test Suite', () => {
477477

478478
mockMessageReceived.fire({
479479
payload: mockColumnId,
480-
type: MessageFromWebviewType.HIDE_EXPERIMENTS_TABLE_COLUMN
480+
type: MessageFromWebviewType.EXPERIMENTS_TABLE_HIDE_COLUMN_PATH
481481
})
482482

483483
expect(mockUnselect).to.be.calledOnce
484484
expect(mockUnselect).to.be.calledWithExactly(mockColumnId)
485485

486486
expect(mockSendTelemetryEvent).to.be.calledWithExactly(
487-
EventName.VIEWS_EXPERIMENTS_TABLE_HIDE_COLUMN,
487+
EventName.VIEWS_EXPERIMENTS_TABLE_HIDE_COLUMN_PATH,
488488
{ path: mockColumnId },
489489
undefined
490490
)

extension/src/webview/contract.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export enum MessageFromWebviewType {
4848
SORT_COLUMN = 'sort-column',
4949
TOGGLE_EXPERIMENT = 'toggle-experiment',
5050
TOGGLE_EXPERIMENT_STAR = 'toggle-experiment-star',
51-
HIDE_EXPERIMENTS_TABLE_COLUMN = 'hide-experiments-table-column',
51+
EXPERIMENTS_TABLE_HIDE_COLUMN_PATH = 'experiments-table-hide-column-path',
5252
EXPERIMENTS_TABLE_MOVE_TO_START = 'experiments-table-move-to-start',
5353
SELECT_EXPERIMENTS = 'select-experiments',
5454
SELECT_COLUMNS = 'select-columns',
@@ -132,7 +132,7 @@ export type MessageFromWebview =
132132
payload: string[]
133133
}
134134
| {
135-
type: MessageFromWebviewType.HIDE_EXPERIMENTS_TABLE_COLUMN
135+
type: MessageFromWebviewType.EXPERIMENTS_TABLE_HIDE_COLUMN_PATH
136136
payload: string
137137
}
138138
| {

webview/src/experiments/components/App.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ describe('App', () => {
781781
.map(item => item.textContent)
782782

783783
expect(menuitems).toStrictEqual([
784-
'Hide Column',
784+
'Hide',
785785
'Move to Start',
786786
'Set Max Header Height',
787787
'Select Columns',
@@ -888,7 +888,7 @@ describe('App', () => {
888888
fireEvent.contextMenu(placeholder, { bubbles: true })
889889
advanceTimersByTime(100)
890890

891-
const hideOption = screen.getByText('Hide Column')
891+
const hideOption = screen.getByText('Hide')
892892

893893
mockPostMessage.mockClear()
894894

@@ -897,7 +897,7 @@ describe('App', () => {
897897
expect(mockPostMessage).toHaveBeenCalledTimes(1)
898898
expect(mockPostMessage).toHaveBeenCalledWith({
899899
payload: 'Created',
900-
type: MessageFromWebviewType.HIDE_EXPERIMENTS_TABLE_COLUMN
900+
type: MessageFromWebviewType.EXPERIMENTS_TABLE_HIDE_COLUMN_PATH
901901
})
902902
})
903903
})

webview/src/experiments/components/table/header/ContextMenuContent.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ export const getMenuOptions = (
9595
const menuOptions: MessagesMenuOptionProps[] = [
9696
{
9797
disabled: isFromExperimentColumn(header),
98-
id: 'hide-column',
99-
label: 'Hide Column',
98+
id: 'hide',
99+
label: 'Hide',
100100
message: {
101101
payload: leafColumn.id,
102-
type: MessageFromWebviewType.HIDE_EXPERIMENTS_TABLE_COLUMN
102+
type: MessageFromWebviewType.EXPERIMENTS_TABLE_HIDE_COLUMN_PATH
103103
}
104104
},
105105
{

0 commit comments

Comments
 (0)