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

Use super #550

Merged
merged 3 commits into from
Jul 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/admin/lookup/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ export default Ember.Controller.extend(IsUpdateDisabled, {
showUpdateButton: true,

updateButtonAction: 'update',
updateButtonText: function() {
let i18n = this.get('i18n');
if (this.get('model.isNew')) {
return i18n.t('buttons.add');
} else {
return i18n.t('buttons.update');
}
}.property('model.isNew'),

actions: {
cancel: function() {
Expand Down
2 changes: 1 addition & 1 deletion app/admin/lookup/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
isUpdateDisabled=isUpdateDisabled
title=(t (if model.isNew 'admin.lookup.edit.template.add_title' 'admin.lookup.edit.template.edit_title'))
updateButtonAction=updateButtonAction
updateButtonText=(t (if model.isNew 'admin.lookup.edit.template.update_button_text_add' 'admin.lookup.edit.template.update_button_text_update'))}}
updateButtonText= updateButtonText}}
{{#em-form model=model submitButton=false action="update" }}
{{em-input label=(t 'admin.lookup.edit.template.label_title') property="value" class="lookup-type-value"}}
{{/em-form}}
Expand Down
5 changes: 1 addition & 4 deletions app/inventory/request/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,8 @@ export default AbstractEditController.extend(FulfillRequest, InventoryLocations,
updateButtonText: function() {
if (this.get('isFulfilling')) {
return this.get('i18n').t('buttons.fulfill');
} else if (this.get('model.isNew')) {
return this.get('i18n').t('buttons.add');
} else {
return this.get('i18n').t('buttons.update');
}
return this._super();
}.property('model.isNew', 'isFulfilling'),

updateCapability: 'add_inventory_request',
Expand Down
5 changes: 1 addition & 4 deletions app/medication/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,8 @@ export default AbstractEditController.extend(InventorySelection, FulfillRequest,
return i18n.t('buttons.dispense');
} else if (this.get('isFulfilling')) {
return i18n.t('labels.fulfill');
} else if (this.get('model.isNew')) {
return i18n.t('buttons.add');
} else {
return i18n.t('buttons.update');
}
return this._super();
}.property('model.isNew', 'isFulfilling', 'model.hideFulfillRequest'),

actions: {
Expand Down
2 changes: 1 addition & 1 deletion app/patients/photo/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default Ember.Controller.extend({
if (isNew) {
return this.get('i18n').t('buttons.add');
} else {
return this.get('i18n').t('buttons.add');
return this.get('i18n').t('buttons.update');
}
}.property('model.isNew'),

Expand Down