update app tokens search path

This commit is contained in:
John Mitchell 2018-05-11 13:54:25 -04:00
parent 0f98ed5046
commit a096051dc3
No known key found for this signature in database
GPG Key ID: FE6A9B5BD4EB5C94
2 changed files with 13 additions and 3 deletions

View File

@ -8,7 +8,9 @@ function ListApplicationsUsersController (
$scope,
Dataset,
resolvedModels,
strings
strings,
$stateParams,
GetBasePath
) {
const vm = this || {};
// const application = resolvedModels;
@ -21,9 +23,15 @@ function ListApplicationsUsersController (
$scope.list = { iterator, name, basePath: 'applications' };
$scope.collection = { iterator };
$scope.tokenBasePath = `${GetBasePath('applications')}${$stateParams.application_id}/tokens`;
$scope[key] = Dataset.data;
vm.usersCount = Dataset.data.count;
$scope[name] = Dataset.data.results;
$scope.$on('updateDataset', (e, dataset) => {
$scope[key] = dataset;
$scope[name] = dataset.results;
vm.usersCount = dataset.count;
});
vm.getLastUsed = user => {
const lastUsed = _.get(user, 'last_used');
@ -49,7 +57,9 @@ ListApplicationsUsersController.$inject = [
'$scope',
'Dataset',
'resolvedModels',
'ApplicationsStrings'
'ApplicationsStrings',
'$stateParams',
'GetBasePath'
];
export default ListApplicationsUsersController;

View File

@ -2,7 +2,7 @@
<smart-search
class="at-List-search"
django-model="users"
base-path="users"
base-path="{{ tokenBasePath }}"
iterator="user"
list="list"
dataset="user_dataset"