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

Commit

Permalink
Merge pull request #809 from btecu/object-shorthand
Browse files Browse the repository at this point in the history
[Cleanup] eslint `prefer-shorthand`
  • Loading branch information
jkleinsc authored Nov 17, 2016
2 parents ae0b162 + 817ef8a commit d0dfb25
Show file tree
Hide file tree
Showing 199 changed files with 754 additions and 754 deletions.
4 changes: 2 additions & 2 deletions app/adapters/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default Adapter.extend(PouchAdapterUtils, {
return haveSpecialCharacters;
},

_startChangesToStoreListener: function() {
_startChangesToStoreListener() {
let db = this.get('db');
if (db) {
this.changes = db.changes({
Expand All @@ -134,7 +134,7 @@ export default Adapter.extend(PouchAdapterUtils, {
}
},

generateIdForRecord: function() {
generateIdForRecord() {
return uuid.v4();
},

Expand Down
20 changes: 10 additions & 10 deletions app/adapters/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default DS.RESTAdapter.extend(UserSession, {
defaultSerializer: 'couchdb',
oauthHeaders: Ember.computed.alias('database.oauthHeaders'),

ajaxError: function(jqXHR) {
ajaxError(jqXHR) {
let error = this._super(jqXHR);
if (jqXHR && jqXHR.status === 401) {
let jsonErrors = Ember.$.parseJSON(jqXHR.responseText);
Expand All @@ -27,7 +27,7 @@ export default DS.RESTAdapter.extend(UserSession, {
@param {Object} options
@return {Object} hash
*/
ajaxOptions: function(url, type, options) {
ajaxOptions(url, type, options) {
options = options || {};
options.xhrFields = { withCredentials: true };
return this._super(url, type, options);
Expand All @@ -49,7 +49,7 @@ export default DS.RESTAdapter.extend(UserSession, {
@param {DS.Model} record
@returns {Promise} promise
*/
createRecord: function(store, type, record) {
createRecord(store, type, record) {
return this.updateRecord(store, type, record);
},

Expand All @@ -61,7 +61,7 @@ export default DS.RESTAdapter.extend(UserSession, {
@param {DS.Snapshot} record
@returns {Promise} promise
*/
deleteRecord: function(store, type, snapshot) {
deleteRecord(store, type, snapshot) {
return this.updateRecord(store, type, snapshot, true);
},

Expand All @@ -80,7 +80,7 @@ export default DS.RESTAdapter.extend(UserSession, {
@param {String} id
@returns {Promise} promise
*/
find: function(store, type, id) {
find(store, type, id) {
let findUrl = this.endpoint + id;
return this.ajax(findUrl, 'GET');
},
Expand Down Expand Up @@ -111,7 +111,7 @@ export default DS.RESTAdapter.extend(UserSession, {
@param {boolean} deleteUser true if we are deleting the user.
@returns {Promise} promise
*/
updateRecord: function(store, type, record, deleteUser) {
updateRecord(store, type, record, deleteUser) {
let data = {};
let serializer = store.serializerFor(record.modelName);
serializer.serializeIntoHash(data, type, record, { includeId: true });
Expand All @@ -127,7 +127,7 @@ export default DS.RESTAdapter.extend(UserSession, {
data = this._cleanPasswordAttrs(data);
let putURL = `${this.endpoint}${Ember.get(record, 'id')}`;
return this.ajax(putURL, 'PUT', {
data: data
data
});
},

Expand All @@ -145,7 +145,7 @@ export default DS.RESTAdapter.extend(UserSession, {
@param {String} sinceToken //currently unused
@returns {Promise} promise
*/
findAll: function() {
findAll() {
let ajaxData = {
data: {
include_docs: true,
Expand All @@ -159,7 +159,7 @@ export default DS.RESTAdapter.extend(UserSession, {
/**
Remove null/empty password fields from payload sent to server
*/
_cleanPasswordAttrs: function(data) {
_cleanPasswordAttrs(data) {
let attrsToCheck = [
'derived_key',
'password',
Expand All @@ -176,7 +176,7 @@ export default DS.RESTAdapter.extend(UserSession, {
return data;
},

shouldReloadAll: function() {
shouldReloadAll() {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion app/admin/address/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default AbstractEditController.extend({
hideCancelButton: true,
updateCapability: 'update_config',

afterUpdate: function() {
afterUpdate() {
this.displayAlert(this.get('i18n').t('admin.address.titles.optionsSaved'), this.get('i18n').t('admin.address.messages.addressSaved'));
}
});
2 changes: 1 addition & 1 deletion app/admin/address/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default AbstractEditRoute.extend({
hideNewButton: true,
newTitle: t('admin.address.newTitle'),
editTitle: t('admin.address.editTitle'),
model: function() {
model() {
return new Ember.RSVP.Promise(function(resolve) {
this.get('store').find('option', 'address_options').then(function(addressOptions) {
resolve(addressOptions);
Expand Down
2 changes: 1 addition & 1 deletion app/admin/loaddb/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default Ember.Controller.extend(ModalHelper, ProgressDialog, {
fileImportedName: null,

actions: {
loadFile: function() {
loadFile() {
let fileSystem = this.get('fileSystem');
let fileToImport = this.get('importFile');
if (!fileToImport || !fileToImport.type) {
Expand Down
4 changes: 2 additions & 2 deletions app/admin/loaddb/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ export default AbstractEditRoute.extend(UserSession, {
hideNewButton: true,
editTitle: t('admin.loaddb.editTitle'),

beforeModel: function() {
beforeModel() {
if (!this.currentUserCan('load_db')) {
this.transitionTo('application');
}
},

// No model needed for import.
model: function() {
model() {
return Ember.RSVP.resolve(Ember.Object.create({}));
}
});
16 changes: 8 additions & 8 deletions app/admin/lookup/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export default Ember.Controller.extend(BillingCategories, EKMixin,
return (!Ember.isEmpty(lookupType) && lookupType.indexOf('pricing_types') > 0);
}.property('model.lookupType'),

_canDeleteValue: function(value) {
_canDeleteValue(value) {
let lookupType = this.get('model.lookupType');
switch (lookupType) {
case 'inventory_types': {
Expand Down Expand Up @@ -309,7 +309,7 @@ export default Ember.Controller.extend(BillingCategories, EKMixin,
return true;
},

_sortValues: function(a, b) {
_sortValues(a, b) {
return Ember.compare(a.toLowerCase(), b.toLowerCase());
},

Expand All @@ -323,20 +323,20 @@ export default Ember.Controller.extend(BillingCategories, EKMixin,
}),

actions: {
addValue: function() {
addValue() {
this.send('openModal', 'admin.lookup.edit', Ember.Object.create({
isNew: true
}));
},
deleteValue: function(value) {
deleteValue(value) {
let lookupTypeList = this.get('lookupTypeList');
let lookupTypeValues = lookupTypeList.get('value');
if (this._canDeleteValue(value)) {
lookupTypeValues.removeObject(value.toString());
lookupTypeList.save();
}
},
editValue: function(value) {
editValue(value) {
if (!Ember.isEmpty(value)) {
this.send('openModal', 'admin.lookup.edit', Ember.Object.create({
isNew: false,
Expand All @@ -345,7 +345,7 @@ export default Ember.Controller.extend(BillingCategories, EKMixin,
}));
}
},
importList: function() {
importList() {
let fileSystem = this.get('fileSystem');
let fileToImport = this.get('importFile');
let lookupTypeList = this.get('lookupTypeList');
Expand Down Expand Up @@ -377,7 +377,7 @@ export default Ember.Controller.extend(BillingCategories, EKMixin,
}.bind(this));
}
},
updateList: function() {
updateList() {
let lookupTypeList = this.get('lookupTypeList');
lookupTypeList.set('userCanAdd', this.get('model.userCanAdd'));
lookupTypeList.set('organizeByType', this.get('model.organizeByType'));
Expand All @@ -388,7 +388,7 @@ export default Ember.Controller.extend(BillingCategories, EKMixin,
);
}.bind(this));
},
updateValue: function(valueObject) {
updateValue(valueObject) {
let updateList = false;
let lookupTypeList = this.get('lookupTypeList');
let lookupTypeValues = this.get('lookupTypeValues');
Expand Down
4 changes: 2 additions & 2 deletions app/admin/lookup/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export default Ember.Controller.extend(IsUpdateDisabled, {
}.property('model.isNew'),

actions: {
cancel: function() {
cancel() {
this.send('closeModal');
},

update: function() {
update() {
if (!Ember.isEmpty(this.get('model.value'))) {
this.get('editController').send('updateValue', this.get('model'));
this.send('closeModal');
Expand Down
6 changes: 3 additions & 3 deletions app/admin/lookup/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import { translationMacro as t } from 'ember-i18n';
export default AbstractIndexRoute.extend({
hideNewButton: true,
pageTitle: t('admin.lookup.pageTitle'),
model: function() {
model() {
return this.store.findAll('lookup');
},

afterModel: function(model) {
afterModel(model) {
model.set('lookupType', 'anesthesia_types');
},

actions: {
refreshLookupLists: function() {
refreshLookupLists() {
this.refresh();
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/admin/query/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default Ember.Controller.extend(EditPanelProps, {
objectTypes: Ember.computed.map('objectTypeList', SelectValues.selectValuesMap),

actions: {
query: function() {
query() {
let fieldName = this.get('fieldName');
let objectType = this.get('objectType');
let queryValue = this.get('queryValue');
Expand Down
2 changes: 1 addition & 1 deletion app/admin/query/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-rout
import Ember from 'ember';
import UserSession from 'hospitalrun/mixins/user-session';
export default Ember.Route.extend(UserSession, AuthenticatedRouteMixin, {
beforeModel: function() {
beforeModel() {
if (!this.currentUserCan('query_db')) {
this.transitionTo('application');
}
Expand Down
2 changes: 1 addition & 1 deletion app/admin/roles/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default AbstractEditController.extend(UserRoles, UserSession, {
let mappedCapabilities = [];
section.capabilities.forEach((key) => {
mappedCapabilities.push({
key: key,
key,
name: this.get('i18n').t(`admin.roles.capability.${key}`)
});
});
Expand Down
2 changes: 1 addition & 1 deletion app/admin/roles/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default AbstractEditRoute.extend({
hideNewButton: true,
newTitle: t('admin.userRoles'),
editTitle: t('admin.userRoles'),
model: function() {
model() {
return this.get('store').findAll('user-role');
}
});
2 changes: 1 addition & 1 deletion app/admin/workflow/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default AbstractEditController.extend({
hideCancelButton: true,
updateCapability: 'update_config',

afterUpdate: function() {
afterUpdate() {
this.displayAlert(this.get('i18n').t('admin.workflow.titles.optionsSaved'), this.get('i18n').t('admin.workflow.messages.optionsSaved'));
}
});
2 changes: 1 addition & 1 deletion app/admin/workflow/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default AbstractEditRoute.extend({
hideNewButton: true,
editTitle: t('admin.workflow.editTitle'),

model: function() {
model() {
let store = this.get('store');
return store.find('option', 'workflow_options').catch(function() {
// create a new workflow_option if none exists
Expand Down
10 changes: 5 additions & 5 deletions app/appointments/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ export default AbstractEditController.extend(AppointmentStatuses, PatientSubmodu

updateCapability: 'add_appointment',

afterUpdate: function() {
afterUpdate() {
this.send(this.get('cancelAction'));
},

beforeUpdate: function() {
beforeUpdate() {
this._updateAppointmentDates();
return Ember.RSVP.Promise.resolve();
},
Expand Down Expand Up @@ -130,14 +130,14 @@ export default AbstractEditController.extend(AppointmentStatuses, PatientSubmodu
this._updateDate('startMinute', 'startDate');
}.observes('startMinute'),

_updateAllTimes: function() {
_updateAllTimes() {
this.endHourChanged();
this.endMinuteChanged();
this.startMinuteChanged();
this.startHourChanged();
},

_updateAppointmentDates: function() {
_updateAppointmentDates() {
let allDay = this.get('model.allDay');
let isAdmissionAppointment = this.get('isAdmissionAppointment');
let appointmentDate = this.get('model.appointmentDate');
Expand All @@ -150,7 +150,7 @@ export default AbstractEditController.extend(AppointmentStatuses, PatientSubmodu
}
},

_updateDate: function(fieldName, dateFieldName) {
_updateDate(fieldName, dateFieldName) {
let model = this.get('model');
let fieldValue = this.get(fieldName);
let dateToChange = model.get(dateFieldName);
Expand Down
2 changes: 1 addition & 1 deletion app/appointments/edit/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default AbstractEditRoute.extend(PatientListRoute, {
modelName: 'appointment',
newTitle: t('appointments.newTitle'),

getNewData: function() {
getNewData() {
return Ember.RSVP.resolve({
appointmentType: 'Admission',
allDay: true,
Expand Down
6 changes: 3 additions & 3 deletions app/appointments/index/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default AbstractIndexRoute.extend({
modelName: 'appointment',
pageTitle: t('appointments.thisWeek'),

_getStartKeyFromItem: function(item) {
_getStartKeyFromItem(item) {
let endDate = item.get('endDate');
let id = this._getPouchIdFromItem(item);
let startDate = item.get('startDate');
Expand All @@ -26,7 +26,7 @@ export default AbstractIndexRoute.extend({
return [startDate, endDate, id];
},

_modelQueryParams: function() {
_modelQueryParams() {
let endOfWeek = moment().endOf('week').toDate().getTime();
let startOfWeek = moment().startOf('week').toDate().getTime();
let maxId = this._getMaxPouchId();
Expand All @@ -40,7 +40,7 @@ export default AbstractIndexRoute.extend({
},

actions: {
editAppointment: function(appointment) {
editAppointment(appointment) {
appointment.set('returnTo', this.get('editReturn'));
this.send('editItem', appointment);
}
Expand Down
2 changes: 1 addition & 1 deletion app/appointments/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default AbstractModuleRoute.extend(UserSession, {
sectionTitle: t('appointments.sectionTitle'),

actions: {
createVisit: function(appointment) {
createVisit(appointment) {
let visitProps = appointment.getProperties('startDate', 'endDate', 'location', 'patient');
visitProps.visitType = appointment.get('appointmentType');
visitProps.examiner = appointment.get('provider');
Expand Down
Loading

0 comments on commit d0dfb25

Please sign in to comment.