Skip to content

Commit e676543

Browse files
committed
Explicitly specify columns for all DetailsTable uses, added noHeader option.
1 parent b39eaf0 commit e676543

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

src/components/Tabs/Performance/Timeline.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</span>
1717
</div>
1818

19-
<details-table :items="$request.timeline" :filter="filter" filter-example="database query duration:>50">
19+
<details-table :columns="['Timeline', 'Duration', 'Description']" :items="$request.timeline" :filter="filter" filter-example="database query duration:>50">
2020
<template slot="header" slot-scope="{ filter }">
2121
<th>Timeline</th>
2222
<th class="timeline-duration">Duration</th>

src/components/Tabs/RequestTab.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
<sidebar-section title="Middleware" name="middleware" :items="$request.middleware" filter-example="auth:admin" v-show="$request.middleware.length">
4848
<template slot="table" slot-scope="{ items, filter, filterExample, expanded }">
49-
<details-table :items="items" :filter="filter" :filter-example="filterExample" v-show="expanded">
49+
<details-table :columns="['Value']" :items="items" :filter="filter" :filter-example="filterExample" :no-header="true" v-show="expanded">
5050
<template slot="header" slot-scope="{ filter }">
5151
</template>
5252
<template slot="body" slot-scope="{ items }">

src/components/UI/DetailsTable.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<table class="details-table">
33
<thead>
4-
<tr>
4+
<tr v-if="! noHeader">
55
<slot name="header" :filter="filter">
66
<th v-for="column, index in columns" @click="filter.sortBy(column.sortBy || column.toLowerCase())">
77
{{ column.name || column }}
@@ -11,7 +11,7 @@
1111
</slot>
1212
</tr>
1313
<tr class="filter" v-show="filter.shown">
14-
<td :colspan="columns ? columns.length : 2">
14+
<td :colspan="columns.length">
1515
<label>
1616
<font-awesome-icon icon="search"></font-awesome-icon>
1717
<input type="search" placeholder="Filter..." v-model="filter.input" ref="filterInput">
@@ -43,7 +43,7 @@ import PrettyPrint from './PrettyPrint'
4343
export default {
4444
name: 'DetailsTable',
4545
components: { DetailsTableFilterToggle, PrettyPrint },
46-
props: [ 'columns', 'filter', 'filterExample', 'items' ],
46+
props: [ 'columns', 'filter', 'filterExample', 'items', 'noHeader' ],
4747
data: () => ({
4848
showItemsCount: 30,
4949
showItemsFirst: 0

src/components/UI/SidebarSection.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
<slot name="above-table"></slot>
1313
</div>
1414
<slot name="table" :items="items" :filter="filter" :filter-example="filterExample" :expanded="expanded">
15-
<details-table :items="items" :filter="filter" :filter-example="filterExample" v-show="expanded">
16-
<template slot="header" slot-scope="{ filter }">
17-
</template>
15+
<details-table :columns="['Key', 'Value']" :items="items" :filter="filter" :filter-example="filterExample" :no-header="true" v-show="expanded">
1816
<template slot="body" slot-scope="{ items }">
1917
<tr v-for="item, index in items" :key="`${$request.id}-${index}`">
2018
<td colspan="2">

0 commit comments

Comments
 (0)