Skip to content

Commit

Permalink
fix(plugins/plugin-client-common): threshold for auto-grid is too low
Browse files Browse the repository at this point in the history
Fixes #5424
  • Loading branch information
starpit committed Aug 20, 2020
1 parent dbc5fc5 commit a5db367
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default class Scalar extends React.PureComponent<Props, State> {
)
} else if (isTable(response)) {
const renderBottomToolbar = true
const isLargeTable = response.body.length > 20
const isLargeTable = response.body.length >= 50
const isLargeMiniTable = this.props.isPartOfMiniSplit && response.body.length > 5
const renderGrid = !this.props.prefersTerminalPresentation && (isLargeTable || isLargeMiniTable)
return renderTable(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,122 @@ export const durationTable = (): Table => ({
{
name: 'test 21',
attributes: [{ value: 'foo' }, { value: '21000' }]
},
{
name: 'test 22',
attributes: [{ value: 'foo' }, { value: '22000' }]
},
{
name: 'test 23',
attributes: [{ value: 'foo' }, { value: '23000' }]
},
{
name: 'test 24',
attributes: [{ value: 'foo' }, { value: '24000' }]
},
{
name: 'test 25',
attributes: [{ value: 'foo' }, { value: '25000' }]
},
{
name: 'test 26',
attributes: [{ value: 'foo' }, { value: '26000' }]
},
{
name: 'test 27',
attributes: [{ value: 'foo' }, { value: '27000' }]
},
{
name: 'test 28',
attributes: [{ value: 'foo' }, { value: '28000' }]
},
{
name: 'test 29',
attributes: [{ value: 'foo' }, { value: '29000' }]
},
{
name: 'test 30',
attributes: [{ value: 'foo' }, { value: '30000' }]
},
{
name: 'test 31',
attributes: [{ value: 'foo' }, { value: '31000' }]
},
{
name: 'test 32',
attributes: [{ value: 'foo' }, { value: '32000' }]
},
{
name: 'test 33',
attributes: [{ value: 'foo' }, { value: '33000' }]
},
{
name: 'test 34',
attributes: [{ value: 'foo' }, { value: '34000' }]
},
{
name: 'test 35',
attributes: [{ value: 'foo' }, { value: '35000' }]
},
{
name: 'test 36',
attributes: [{ value: 'foo' }, { value: '36000' }]
},
{
name: 'test 37',
attributes: [{ value: 'foo' }, { value: '37000' }]
},
{
name: 'test 38',
attributes: [{ value: 'foo' }, { value: '38000' }]
},
{
name: 'test 39',
attributes: [{ value: 'foo' }, { value: '39000' }]
},
{
name: 'test 40',
attributes: [{ value: 'foo' }, { value: '40000' }]
},
{
name: 'test 41',
attributes: [{ value: 'foo' }, { value: '41000' }]
},
{
name: 'test 42',
attributes: [{ value: 'foo' }, { value: '42000' }]
},
{
name: 'test 43',
attributes: [{ value: 'foo' }, { value: '43000' }]
},
{
name: 'test 44',
attributes: [{ value: 'foo' }, { value: '44000' }]
},
{
name: 'test 45',
attributes: [{ value: 'foo' }, { value: '45000' }]
},
{
name: 'test 46',
attributes: [{ value: 'foo' }, { value: '46000' }]
},
{
name: 'test 47',
attributes: [{ value: 'foo' }, { value: '47000' }]
},
{
name: 'test 48',
attributes: [{ value: 'foo' }, { value: '48000' }]
},
{
name: 'test 49',
attributes: [{ value: 'foo' }, { value: '49000' }]
},
{
name: 'test 50',
attributes: [{ value: 'foo' }, { value: '50000' }]
}
]
})
Expand Down
31 changes: 30 additions & 1 deletion plugins/plugin-client-test/src/test/response/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,36 @@ new TestTable('should test duration table', {
{ name: 'test 18', attributes: [{ value: 'foo' }, { value: '18s' }] },
{ name: 'test 19', attributes: [{ value: 'foo' }, { value: '19s' }] },
{ name: 'test 20', attributes: [{ value: 'foo' }, { value: '20s' }] },
{ name: 'test 21', attributes: [{ value: 'foo' }, { value: '21s' }] }
{ name: 'test 21', attributes: [{ value: 'foo' }, { value: '21s' }] },
{ name: 'test 22', attributes: [{ value: 'foo' }, { value: '22s' }] },
{ name: 'test 23', attributes: [{ value: 'foo' }, { value: '23s' }] },
{ name: 'test 24', attributes: [{ value: 'foo' }, { value: '24s' }] },
{ name: 'test 25', attributes: [{ value: 'foo' }, { value: '25s' }] },
{ name: 'test 26', attributes: [{ value: 'foo' }, { value: '26s' }] },
{ name: 'test 27', attributes: [{ value: 'foo' }, { value: '27s' }] },
{ name: 'test 28', attributes: [{ value: 'foo' }, { value: '28s' }] },
{ name: 'test 29', attributes: [{ value: 'foo' }, { value: '29s' }] },
{ name: 'test 30', attributes: [{ value: 'foo' }, { value: '30s' }] },
{ name: 'test 31', attributes: [{ value: 'foo' }, { value: '31s' }] },
{ name: 'test 32', attributes: [{ value: 'foo' }, { value: '32s' }] },
{ name: 'test 33', attributes: [{ value: 'foo' }, { value: '33s' }] },
{ name: 'test 34', attributes: [{ value: 'foo' }, { value: '34s' }] },
{ name: 'test 35', attributes: [{ value: 'foo' }, { value: '35s' }] },
{ name: 'test 36', attributes: [{ value: 'foo' }, { value: '36s' }] },
{ name: 'test 37', attributes: [{ value: 'foo' }, { value: '37s' }] },
{ name: 'test 38', attributes: [{ value: 'foo' }, { value: '38s' }] },
{ name: 'test 39', attributes: [{ value: 'foo' }, { value: '39s' }] },
{ name: 'test 40', attributes: [{ value: 'foo' }, { value: '40s' }] },
{ name: 'test 41', attributes: [{ value: 'foo' }, { value: '41s' }] },
{ name: 'test 42', attributes: [{ value: 'foo' }, { value: '42s' }] },
{ name: 'test 43', attributes: [{ value: 'foo' }, { value: '43s' }] },
{ name: 'test 44', attributes: [{ value: 'foo' }, { value: '44s' }] },
{ name: 'test 45', attributes: [{ value: 'foo' }, { value: '45s' }] },
{ name: 'test 46', attributes: [{ value: 'foo' }, { value: '46s' }] },
{ name: 'test 47', attributes: [{ value: 'foo' }, { value: '47s' }] },
{ name: 'test 48', attributes: [{ value: 'foo' }, { value: '48s' }] },
{ name: 'test 49', attributes: [{ value: 'foo' }, { value: '49s' }] },
{ name: 'test 50', attributes: [{ value: 'foo' }, { value: '50s' }] }
]
},
validation: {
Expand Down

0 comments on commit a5db367

Please sign in to comment.