MCPcopy Create free account
hub / github.com/alephdata/aleph / onSortColumn

Method onSortColumn

ui/src/components/EntityTable/EntityTable.jsx:119–134  ·  view source on GitHub ↗
(newField)

Source from the content-addressed store, hash-verified

117 };
118
119 onSortColumn(newField) {
120 const { query, sort } = this.props;
121 const { field: currentField, direction } = sort;
122
123 if (currentField !== newField) {
124 return this.updateQuery(query.sortBy(`properties.${newField}`, 'asc'));
125 }
126
127 // Toggle through sorting states: ascending, descending, or unsorted.
128 this.updateQuery(
129 query.sortBy(
130 `properties.${currentField}`,
131 direction === 'asc' ? 'desc' : undefined
132 )
133 );
134 }
135
136 onSearchSubmit(queryText) {
137 const { query } = this.props;

Callers

nothing calls this directly

Calls 2

updateQueryMethod · 0.95
sortByMethod · 0.80

Tested by

no test coverage detected