feat: 🎸 implement sort for session recordings (#2837)

* feat: 🎸 implement sort for session recordings

* refactor: 💡 update selectors w/ pr feedback

* refactor: 💡 remove click in tests

* test: 💍 update selectors due to merge

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-17065
This commit is contained in:
Lisbet Alvarez authored and GitHub committed 2025-05-22 10:27:19 -07:00
1 parent 44bd5ee1c6
commit c12edc7f73
4 files changed
+240 -84

No files matched your search

@@ -24,6 +24,8 @@ export default class ScopesScopeSessionRecordingsIndexController extends Control
{ targets: { type: 'array' } },
'page',
'pageSize',
'sortAttribute',
'sortDirection',
];
now = new Date();
@@ -35,6 +37,8 @@ export default class ScopesScopeSessionRecordingsIndexController extends Control
@tracked targets = [];
@tracked page = 1;
@tracked pageSize = 10;
@tracked sortAttribute;
@tracked sortDirection;
/**
* Returns object of filters to be used for displaying selected filters
@@ -190,4 +194,16 @@ export default class ScopesScopeSessionRecordingsIndexController extends Control
refresh() {
this.send('refreshAll');
}
/**
* Sets sort values and sets page to 1
* @param {string} sortBy
* @param {string} sortOrder
*/
@action
onSort(sortBy, sortOrder) {
this.sortAttribute = sortBy;
this.sortDirection = sortOrder;
this.page = 1;
}
}