Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Fixed selecting multiple labs/imaging on a new request
Browse files Browse the repository at this point in the history
Fixes #434
  • Loading branch information
jkleinsc committed Apr 25, 2016
1 parent d84a59f commit 841bb1e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 6 additions & 0 deletions app/imaging/edit/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ export default AbstractEditRoute.extend(ChargeRoute, PatientListRoute, {
newTitle: t('imaging.titles.new_title'),
pricingCategory: 'Imaging',

actions: {
returnToAllItems: function() {
this.controller.send('returnToAllItems');
}
},

getNewData: function() {
return Ember.RSVP.resolve({
selectPatient: true,
Expand Down
2 changes: 1 addition & 1 deletion app/labs/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default AbstractEditController.extend(ChargeActions, PatientSubmodule, {
alertMessage = i18n.t('labs.alerts.request_completed_message');
} else {
alertTitle = i18n.t('labs.alerts.request_saved_title');
alertMessage = i18n.t('labs.alerts.request_completed_message');
alertMessage = i18n.t('labs.alerts.request_saved_message');
}
if (multipleRecords) {
afterDialogAction = this.get('cancelAction');
Expand Down
6 changes: 6 additions & 0 deletions app/labs/edit/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ export default AbstractEditRoute.extend(ChargeRoute, PatientListRoute, {
newTitle: t('labs.new_title'),
pricingCategory: 'Lab',

actions: {
returnToAllItems: function() {
this.controller.send('returnToAllItems');
}
},

getNewData: function() {
return Ember.RSVP.resolve({
selectPatient: true,
Expand Down
5 changes: 1 addition & 4 deletions app/mixins/charge-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,7 @@ export default Ember.Mixin.create({
if (!Ember.isEmpty(selectedItem)) {
return new Ember.RSVP.Promise(function(resolve, reject) {
if (Ember.isArray(selectedItem)) {
var pricingIds = selectedItem.map(function(pricingItem) {
return pricingItem.id;
});
this.store.findByIds('pricing', pricingIds).then(resolve, reject);
this.store.findByIds('pricing', selectedItem).then(resolve, reject);
} else {
this.store.find('pricing', selectedItem.id).then(resolve, reject);
}
Expand Down

0 comments on commit 841bb1e

Please sign in to comment.