Icu 12590 add filtering pagination support for roles (#2204)
* feat: 🎸 add search & pagination for roles ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12590
This commit is contained in:
1 parent
a78522e09a
commit
8be4e93a3c
14 files changed
+328
-117
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
import { debounce } from 'core/decorators/debounce';
|
||||
|
||||
export default class ScopesScopeRolesIndexController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
queryParams = ['search', 'page', 'pageSize'];
|
||||
|
||||
@tracked search = '';
|
||||
@tracked page = 1;
|
||||
@tracked pageSize = 10;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Handles input on each keystroke and the search queryParam
|
||||
* @param {object} event
|
||||
*/
|
||||
@action
|
||||
@debounce(250)
|
||||
handleSearchInput(event) {
|
||||
const { value } = event.target;
|
||||
this.search = value;
|
||||
this.page = 1;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user