-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(purchase): implement feedback on PR
This commit implements the feedback from @sfount. 1. bhConstants is used to set the grid height at the initial module load. 2. The `purchases/new` path has been renamed to `purchases/create`. 3. The relevant `ui-grid` cells leverage `ui-grid-cell-contents` to ensure proper overflows, padding, and centering on small screens. 4. Resolved mixed aliases for `this` in services. 5. Ensure that the `currency_id` is set on the server, not the client.
- Loading branch information
Showing
17 changed files
with
51 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
|
||
angular.module('bhima.routes') | ||
.config(['$stateProvider', function ($stateProvider) { | ||
.config(['$stateProvider', function ($stateProvider) { | ||
|
||
$stateProvider | ||
.state('accounts', { | ||
abstract : true, | ||
url : '/accounts', | ||
controller: 'AccountsController as AccountsCtrl', | ||
templateUrl: 'partials/accounts/accounts.html' | ||
}) | ||
|
||
.state('accounts.create', { | ||
url : '/create', | ||
params : { | ||
parentId : { squash : true, value : null } | ||
}, | ||
onEnter :['$state', '$uibModal', accountsModal] | ||
onEnter :['$state', '$uibModal', accountsModal] | ||
}) | ||
.state('accounts.list', { | ||
url : '/:id', | ||
params : { | ||
params : { | ||
id : { squash : true, value : null } | ||
} | ||
}) | ||
.state('accounts.edit', { | ||
|
||
.state('accounts.edit', { | ||
url : '/:id/edit', | ||
params : { | ||
params : { | ||
id : { squash : true, value : null } | ||
}, | ||
onEnter :['$state', '$uibModal', accountsModal] | ||
}) | ||
}); | ||
}]); | ||
|
||
function accountsModal($state, $modal) { | ||
function accountsModal($state, $modal) { | ||
var instance = $modal.open({ | ||
keyboard : false, | ||
backdrop : 'static', | ||
templateUrl: 'partials/accounts/edit/accounts.edit.modal.html', | ||
controller: 'AccountEditController as AccountEditCtrl' | ||
}) | ||
instance.result.then(function (result) { | ||
// clean up action | ||
}); | ||
keyboard : false, | ||
backdrop : 'static', | ||
templateUrl: 'partials/accounts/edit/accounts.edit.modal.html', | ||
controller: 'AccountEditController as AccountEditCtrl' | ||
}); | ||
|
||
instance.result.then(function (result) { | ||
// clean up action | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
client/src/partials/purchases/create/templates/actions.tmpl.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<div style="padding : 5px;" class="text-center"> | ||
<div class="ui-grid-cell-contents text-center"> | ||
<a href="" ng-click="grid.appScope.order.removeItem(row.entity)" tabindex="-1"><i class="fa fa-trash-o text-danger"></i></a> | ||
</div> |
2 changes: 1 addition & 1 deletion
2
client/src/partials/purchases/create/templates/amount.tmpl.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<div style="padding : 5px; text-align : right;"> | ||
<div class="ui-grid-cell-contents" style="text-align:right;"> | ||
{{ row.entity.quantity * row.entity.unit_price | currency:grid.appScope.enterprise.currency_id }} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters