Skip to content

Commit cb87cdd

Browse files
committed
feat(ui): improvements to provisioners ViewWorkers
1 parent ac148e4 commit cb87cdd

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

changelog/issue-5433.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
audience: users
2+
level: patch
3+
reference: issue 5433
4+
---
5+
Show workers from last recently active. Also, removed the deprecated prop `onChangePage` and replaced with `onPageChange`.

ui/src/components/ConnectionDataTable/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export default class ConnectionDataTable extends Component {
247247
nextIconButtonProps={{
248248
'aria-label': 'Next Page',
249249
}}
250-
onChangePage={this.handlePageChange}
250+
onPageChange={this.handlePageChange}
251251
/>
252252
);
253253
};

ui/src/components/DataTable/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export default class DataTable extends Component {
199199
nextIconButtonProps={{
200200
'aria-label': 'Next Page',
201201
}}
202-
onChangePage={this.handlePageChange}
202+
onPageChange={this.handlePageChange}
203203
/>
204204
)}
205205
</Fragment>

ui/src/components/WorkersTable/index.jsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,24 @@ export default class WorkersTable extends Component {
118118
return mapping[query.sortBy];
119119
}
120120

121+
componentDidMount() {
122+
const query = parse(this.props.location.search.slice(1));
123+
124+
if (query.sortBy) return;
125+
126+
this.props.history.replace({
127+
search: stringify(
128+
{ sortBy: 'Last Active', sortDirection: 'desc' },
129+
{ addQueryPrefix: true }
130+
),
131+
});
132+
}
133+
121134
render() {
122135
const query = parse(this.props.location.search.slice(1));
123136
const { sortBy, sortDirection } = query.sortBy
124137
? query
125-
: { sortBy: null, sortDirection: null };
138+
: { sortBy: 'Last Active', sortDirection: 'desc' };
126139
const {
127140
provisionerId,
128141
workerType,

0 commit comments

Comments
 (0)