Show caret for sorted column
This commit is contained in:
parent
bfc6766caa
commit
63da76b4a3
@ -66,12 +66,14 @@ export default {
|
|||||||
{
|
{
|
||||||
displayName: 'Name',
|
displayName: 'Name',
|
||||||
attr: 'name',
|
attr: 'name',
|
||||||
sortFunc: alphabeticalSort
|
sortFunc: alphabeticalSort,
|
||||||
|
width: "50%"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Environments',
|
displayName: 'Environments',
|
||||||
attr: 'num_env',
|
attr: 'num_env',
|
||||||
sortFunc: numericSort
|
sortFunc: numericSort,
|
||||||
|
class: "table-cell--align-right"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Status',
|
displayName: 'Status',
|
||||||
@ -118,5 +120,8 @@ export default {
|
|||||||
|
|
||||||
this.sortInfo.columnName = columnName
|
this.sortInfo.columnName = columnName
|
||||||
},
|
},
|
||||||
|
getColumns: function() {
|
||||||
|
return Object.values(this.sortInfo.columns)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
{% from "components/empty_state.html" import EmptyState %}
|
{% from "components/empty_state.html" import EmptyState %}
|
||||||
{% from "components/alert.html" import Alert %}
|
{% from "components/alert.html" import Alert %}
|
||||||
|
{% from "components/icon.html" import Icon %}
|
||||||
|
|
||||||
{% block workspace_content %}
|
{% block workspace_content %}
|
||||||
|
|
||||||
@ -82,10 +83,15 @@
|
|||||||
<table v-if='searchedList && searchedList.length'>
|
<table v-if='searchedList && searchedList.length'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th @click="updateSort('Name')" scope="col" width="50%">Name</th>
|
<th v-for="col in getColumns()" @click="updateSort(col.displayName)" :width="col.width" :class="col.class" scope="col">
|
||||||
<th @click="updateSort('Environments')" scope="col" class="table-cell--align-right">Environments</th>
|
!{ col.displayName }
|
||||||
<th @click="updateSort('Status')" scope="col">Status</th>
|
<span v-if="col.displayName === sortInfo.columnName && sortInfo.isAscending">
|
||||||
<th @click="updateSort('Workspace Role')" scope="col">Workspace Role</th>
|
{{ Icon("caret_down") }}
|
||||||
|
</span>
|
||||||
|
<span v-if="col.displayName === sortInfo.columnName && !sortInfo.isAscending">
|
||||||
|
{{ Icon("caret_up") }}
|
||||||
|
</span>
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user