ICU-16785 sort admin scopes (#2842)

* feat: 🎸 add sorting to scopes/scope/scopes/index route

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-16785

* refactor: 💡 use direct hds components to support sorting

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-16785

* feat: 🎸 wire up sorting to the scopes table

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-16785

* test: 💍 add tests for sorting scopes

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-16785
This commit is contained in:
hashicc authored and GitHub committed 2025-06-03 09:40:32 -04:00
1 parent b06c396086
commit daa23f66c4
4 files changed
+177 -29

No files matched your search

@@ -10,11 +10,19 @@ import { tracked } from '@glimmer/tracking';
export default class ScopesScopeScopesIndexController extends Controller {
// =attributes
queryParams = ['search', 'page', 'pageSize'];
queryParams = [
'search',
'page',
'pageSize',
'sortAttribute',
'sortDirection',
];
@tracked search;
@tracked page = 1;
@tracked pageSize = 10;
@tracked sortAttribute;
@tracked sortDirection;
// =methods
@@ -28,4 +36,11 @@ export default class ScopesScopeScopesIndexController extends Controller {
this.search = value;
this.page = 1;
}
@action
sortBy(attribute, direction) {
this.sortAttribute = attribute;
this.sortDirection = direction;
this.page = 1;
}
}