Skip to content

Commit

Permalink
fix(lint): fix lint issues in fiscal.js
Browse files Browse the repository at this point in the history
This commit ensures that the pull request passes lint tests by fixing
lint issues in fiscal.js.
  • Loading branch information
jniles committed Jun 24, 2016
1 parent ef7c7a2 commit 08e6626
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions client/src/partials/fiscal/fiscal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FiscalController.$inject = ['$state', 'FiscalService', 'ModalService', 'NotifySe

function FiscalController($state, fiscalService, ModalService, Notify) {
var vm = this;
var today = new Date();
var today = new Date();

// pagination configuration
/** @todo this should all be moved to a component */
Expand All @@ -18,12 +18,12 @@ function FiscalController($state, fiscalService, ModalService, Notify) {
vm.sort = sort;
vm.state = $state;

vm.sortByName = "ASC";
vm.sortByDateCreated = "ASC";
vm.sortByNumbrerOfMonth = "ASC";
vm.sortByName = 'ASC';
vm.sortByDateCreated = 'ASC';
vm.sortByNumbrerOfMonth = 'ASC';

// refreshFiscalYear
function refreshFiscalYear(){
function refreshFiscalYear() {
return fiscalService.read(null,{ detailed : 1 })
.then(function (fiscalYears) {

Expand All @@ -41,7 +41,7 @@ function FiscalController($state, fiscalService, ModalService, Notify) {
// switch to delete warning mode
function del(fiscal) {
ModalService.confirm('FORM.DIALOGS.CONFIRM_DELETE')
.then(function (bool){
.then(function (bool) {
// if the user clicked cancel, reset the view and return
if (!bool) {
return;
Expand All @@ -50,40 +50,40 @@ function FiscalController($state, fiscalService, ModalService, Notify) {
fiscalService.delete(fiscal.id)
.then(function () {
Notify.success('FORM.INFOS.DELETE_SUCCESS');
return refreshFiscalYear()
return refreshFiscalYear();
})
.catch(function (error) {
Notify.danger('FISCAL.CAN_NOT_DELETE_FY');
});
});
});
}

function sort(option){
function sort(option) {
vm.sorted = option.by;
option.detailed = 1;

if(option.by === "label" && option.order === "ASC"){
vm.sortByName = "DESC";
vm.nameDesc = "up";
} else if(option.by === "label" && option.order === "DESC"){
vm.sortByName = "ASC";
vm.nameDesc = "down";
if (option.by === 'label' && option.order === 'ASC') {
vm.sortByName = 'DESC';
vm.nameDesc = 'up';
} else if (option.by === 'label' && option.order === 'DESC') {
vm.sortByName = 'ASC';
vm.nameDesc = 'down';
}

if(option.by === "created_at" && option.order === "ASC"){
vm.sortByDateCreated = "DESC";
vm.dateDesc = "up";
} else if(option.by === "created_at" && option.order === "DESC"){
vm.sortByDateCreated = "ASC";
vm.dateDesc = "down";
if (option.by === 'created_at' && option.order === 'ASC') {
vm.sortByDateCreated = 'DESC';
vm.dateDesc = 'up';
} else if (option.by === 'created_at' && option.order === 'DESC') {
vm.sortByDateCreated = 'ASC';
vm.dateDesc = 'down';
}

if(option.by === "number_of_months" && option.order === "ASC"){
vm.sortByNumbrerOfMonth = "DESC";
vm.nbMonthDesc = "up";
} else if(option.by === "number_of_months" && option.order === "DESC"){
vm.sortByNumbrerOfMonth = "ASC";
vm.nbMonthDesc = "down";
if (option.by === 'number_of_months' && option.order === 'ASC') {
vm.sortByNumbrerOfMonth = 'DESC';
vm.nbMonthDesc = 'up';
} else if (option.by === 'number_of_months' && option.order === 'DESC') {
vm.sortByNumbrerOfMonth = 'ASC';
vm.nbMonthDesc = 'down';
}

fiscalService.read(null, option)
Expand All @@ -92,6 +92,6 @@ function FiscalController($state, fiscalService, ModalService, Notify) {
})
.catch(Notify.handleError);
}
refreshFiscalYear();

refreshFiscalYear();
}

0 comments on commit 08e6626

Please sign in to comment.