mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 11:36:48 +00:00
* 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
This commit is contained in:
parent
617c0b6502
commit
6bc5426e08
@ -14,6 +14,17 @@
|
||||
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) {
|
||||
|
||||
@ -3,31 +3,39 @@
|
||||
<li><a href="#/system">{{'label.anchor.system' | translate}}</a></li>
|
||||
<li class="active">{{'label.anchor.viewroles' | translate}}</li>
|
||||
</ul>
|
||||
<div class="pull-right">
|
||||
<a href="#/admin/addrole" class="btn btn-primary" has-permission='CREATE_ROLE'><i class="fa fa-plus "></i> {{'label.button.addrole' |
|
||||
translate}}</a>
|
||||
</div>
|
||||
<div class="card" data-ng-controller="RoleController">
|
||||
<br>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr class="graybg">
|
||||
<th>{{'label.heading.name' | translate}}</th>
|
||||
<th>{{'label.heading.description' | translate}}</th>
|
||||
<th>{{'label.heading.status' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="pointer-main" dir-paginate="role in roles | orderBy:'name':reverse | filter:filterText | itemsPerPage: RolesPerPage">
|
||||
<td class="pointer" data-ng-click="routeTo(role.id)">{{role.name}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(role.id)">{{role.description}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(role.id)">
|
||||
<div ng-if="!isRoleEnable(role.disabled)">{{'label.heading.enabledrole' | translate }}</div>
|
||||
<div ng-if="isRoleEnable(role.disabled)">{{'label.heading.disabled' | translate }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="content">
|
||||
<div class="toolbar"></div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<input ng-autofocus="true" ng-model="filterText" type="text" ng-keyup="onFilter()" class="form-control" placeholder="{{'label.input.filterbyname' | translate}}">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a href="#/admin/addrole" class="btn btn-primary pull-right" has-permission='CREATE_ROLE'><i class="fa fa-plus "></i> {{'label.button.addrole' | translate}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr class="graybg">
|
||||
<th>{{'label.heading.name' | translate}}</th>
|
||||
<th>{{'label.heading.description' | translate}}</th>
|
||||
<th>{{'label.heading.status' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="pointer-main" dir-paginate="role in roles | orderBy:'name':reverse | filter:filterText | itemsPerPage: RolesPerPage">
|
||||
<td class="pointer" data-ng-click="routeTo(role.id)">{{role.name}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(role.id)">{{role.description}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(role.id)">
|
||||
<div ng-if="!isRoleEnable(role.disabled)">{{'label.heading.enabledrole' | translate }}</div>
|
||||
<div ng-if="isRoleEnable(role.disabled)">{{'label.heading.disabled' | translate }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<dir-pagination-controls boundary-links="true" template-url="bower_components/angular-utils-pagination/dirPagination.tpl.html"></dir-pagination-controls>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -2,7 +2,9 @@ describe("RoleController", function () {
|
||||
var resourceCallback;
|
||||
|
||||
beforeEach(function () {
|
||||
this.scope = {};
|
||||
this.scope = jasmine.createSpyObj("$scope", ['saveSC']);
|
||||
this.scope.searchCriteria = {}
|
||||
|
||||
this.resourceFactory = { roleResource: {
|
||||
getAllRoles: jasmine.createSpy('roleResource.getAllRoles()').andCallFake(function (params, callback) {
|
||||
resourceCallback = callback;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user