Skip to content

Commit

Permalink
Suppress ctx menu sorting options for unsortable headers (#2583)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolmir authored Oct 13, 2022
1 parent 8ff8585 commit 298ef70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions webview/src/experiments/components/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -702,9 +702,7 @@ describe('App', () => {
const itemLabels = menuitems.map(item => item.textContent)
expect(itemLabels).toStrictEqual([
'Open to the Side',
'Set Max Header Height',
'Sort Ascending',
'Sort Descending'
'Set Max Header Height'
])
})

Expand All @@ -717,7 +715,7 @@ describe('App', () => {
jest.advanceTimersByTime(100)

const menuitems = screen.getAllByRole('menuitem')
expect(menuitems).toHaveLength(4)
expect(menuitems).toHaveLength(2)

fireEvent.keyDown(paramsFileHeader, { bubbles: true, key: 'Escape' })
expect(screen.queryAllByRole('menuitem')).toHaveLength(0)
Expand Down
4 changes: 2 additions & 2 deletions webview/src/experiments/components/table/TableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const TableHeader: React.FC<TableHeaderProps> = ({
menuContent={
<div>
<MessagesMenu options={contextMenuOptions} />
{
{isSortable && (
<>
<VSCodeDivider />
<MessagesMenu
Expand Down Expand Up @@ -149,7 +149,7 @@ export const TableHeader: React.FC<TableHeaderProps> = ({
]}
/>
</>
}
)}
</div>
}
/>
Expand Down

0 comments on commit 298ef70

Please sign in to comment.