Skip to content

Commit

Permalink
perf(cleanning): cleanning code and removing es6 code form the client
Browse files Browse the repository at this point in the history
  • Loading branch information
DedrickEnc committed Jun 3, 2017
1 parent d1b7e30 commit 73649e6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
17 changes: 10 additions & 7 deletions client/src/modules/employees/registration/employees.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
<ui-select-match placeholder="{{ 'FORM.SELECT.GRADE' | translate }}">
<span>{{$select.selected.format}}</span>
</ui-select-match>
<ui-select-choices ui-select-focus-patch repeat="g.uuid as g in EmployeeCtrl.grades | filter:{format : $select.search} | orderBy:'text'">
<ui-select-choices ui-select-focus-patch repeat="g.uuid as g in EmployeeCtrl.grades | filter:{format : $select.search}">
<span ng-bind-html="g.format | highlight:$select.search"></span>
</ui-select-choices>
</ui-select>
Expand Down Expand Up @@ -439,12 +439,15 @@ <h4 translate>FORM.LABELS.CURRENT_LOCATION</h4>

<label class="col-md-3 control-label" translate>FORM.LABELS.DAILY_SALARY</label>
<div class="col-md-9">
<input
type="number"
class="form-control"
name="daily_salary"
ng-model="EmployeeCtrl.employee.daily_salary"
autocomplete="off">
<div class="input-group">
<span class="input-group-addon text-uppercase">{{ EmployeeCtrl.enterprise.currencySymbol || '...' }}</span>
<input
type="number"
class="form-control"
name="daily_salary"
ng-model="EmployeeCtrl.employee.daily_salary"
autocomplete="off">
</div>
<div class="help-block" ng-messages="DetailForm.daily_salary.$error" ng-show="EmployeeRegistrationForm.$submitted">
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
</div>
Expand Down
7 changes: 4 additions & 3 deletions client/src/modules/employees/registration/employees.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ angular.module('bhima.controllers')
EmployeeController.$inject = [
'EmployeeService', 'ServiceService', 'GradeService', 'FunctionService',
'CreditorGroupService', 'DebtorGroupService', 'util', 'NotifyService',
'bhConstants', 'ReceiptModal'
'bhConstants', 'ReceiptModal', 'SessionService'
];

function EmployeeController(Employees, Services, Grades, Functions, CreditorGroups, DebtorGroups, util, Notify, bhConstants, Receipts) {
function EmployeeController(Employees, Services, Grades, Functions, CreditorGroups, DebtorGroups, util, Notify, bhConstants, Receipts, Session) {
var vm = this;
vm.enterprise = Session.enterprise;

// Expose lenths from util
vm.length20 = util.length20;
Expand All @@ -27,7 +28,7 @@ function EmployeeController(Employees, Services, Grades, Functions, CreditorGrou
vm.submit = submit;

// Loading Grades
Grades.read(null, { detailed : 1 }).then((data) => {
Grades.read(null, { detailed : 1 }).then(function (data) {
data.forEach(function (g){
g.format = g.code + ' - ' + g.text;
});
Expand Down
8 changes: 4 additions & 4 deletions client/src/modules/employees/registry/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ angular.module('bhima.controllers')
.controller('EmployeeRegistryController', EmployeeRegistryController);

EmployeeRegistryController.$inject = [
'$state', 'EmployeeService', 'NotifyService', 'AppCache',
'util', 'ReceiptModal', 'uiGridConstants', '$translate',
'EmployeeService', 'NotifyService',
'util', 'ReceiptModal', 'uiGridConstants',
'GridColumnService', 'bhConstants', 'FilterService'
];

Expand All @@ -12,8 +12,8 @@ EmployeeRegistryController.$inject = [
*
* This module is responsible for the management of Employe Registry.
*/
function EmployeeRegistryController($state, Employees, Notify, AppCache,
util, Receipts, uiGridConstants, $translate,
function EmployeeRegistryController(Employees, Notify,
util, Receipts, uiGridConstants,
Columns, bhConstants, Filters) {
var vm = this;

Expand Down
2 changes: 1 addition & 1 deletion client/src/modules/employees/registry/search.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function EmployeeRegistryModalController(ModalInstance, Functions, Grades, bhCon
var changes = new Store({identifier : 'key'});

vm.filters = filters;
vm.serchQueries = {};
vm.searchQueries = {};
vm.defaultQueries = {};
vm.today = new Date();

Expand Down
1 change: 0 additions & 1 deletion client/src/modules/templates/bhCurrencyInput.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
required>
</div>


<!-- validation messages -->
<p class="help-block" ng-messages="bhCurrencyInputForm.currencyInputValue.$error" ng-show="$ctrl.validationTrigger">

Expand Down
2 changes: 1 addition & 1 deletion server/controllers/payroll/employees/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function list(req, res, next) {
.then((rows) => {
res.status(200).json(rows);
})
.catch(function (err){console.log(err);})
.catch(next)
.done();
}

Expand Down

0 comments on commit 73649e6

Please sign in to comment.