Icu 17166 implement sort for auth methods (#2855)
* Implement sorting for auth methods
This commit is contained in:
1 parent
204bd10e04
commit
e685295d04
4 files changed
+234
-74
No files matched your search
@@ -28,6 +28,8 @@ export default class ScopesScopeAuthMethodsIndexController extends Controller {
|
||||
{ primary: { type: 'array' } },
|
||||
'page',
|
||||
'pageSize',
|
||||
'sortAttribute',
|
||||
'sortDirection',
|
||||
];
|
||||
|
||||
@tracked search;
|
||||
@@ -35,6 +37,8 @@ export default class ScopesScopeAuthMethodsIndexController extends Controller {
|
||||
@tracked primary = [];
|
||||
@tracked page = 1;
|
||||
@tracked pageSize = 10;
|
||||
@tracked sortAttribute;
|
||||
@tracked sortDirection;
|
||||
|
||||
/**
|
||||
* True if the current scope has a primary auth method set.
|
||||
@@ -326,4 +330,16 @@ export default class ScopesScopeAuthMethodsIndexController extends Controller {
|
||||
async changeState(authMethod, state) {
|
||||
await authMethod.changeState(state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set 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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user