community-app/app/scripts/controllers/organization/RoleController.js
Alex Anto Navis L 6bc5426e08
Fixed #2904 - Recreated from another in-active PR (#3301)
* Fixed #2904 - Recreated from another in-active PR


- https://github.com/openMF/community-app/pull/2905
- Had merge conflicts and branch is inactive
- Tested the scenarios

* Fixed #2904 - Fixed the existing test
2020-08-25 10:21:03 -07:00

34 lines
1.2 KiB
JavaScript

(function (module) {
mifosX.controllers = _.extend(module, {
RoleController: function (scope, resourceFactory, location) {
scope.roles = [];
scope.routeTo = function (id) {
location.path('/admin/viewrole/' + id);
};
scope.RolesPerPage = 15;
resourceFactory.roleResource.getAllRoles({}, function (data) {
scope.roles = data;
});
scope.isRoleEnable = function(value) {
return value;
};
if (!scope.searchCriteria.rolesFilterText) {
scope.searchCriteria.rolesFilterText = null;
scope.saveSC();
}
scope.filterText = scope.searchCriteria.rolesFilterText || '';
scope.onFilter = function () {
scope.searchCriteria.rolesFilterText = scope.filterText;
scope.saveSC();
};
}
});
mifosX.ng.application.controller('RoleController', ['$scope', 'ResourceFactory', '$location', mifosX.controllers.RoleController]).run(function ($log) {
$log.info("RoleController initialized");
});
}(mifosX.controllers || {}));