diff --git a/app/adapters/user.js b/app/adapters/user.js index 20532236d7..a5c024812d 100644 --- a/app/adapters/user.js +++ b/app/adapters/user.js @@ -152,7 +152,7 @@ export default DS.RESTAdapter.extend(UserSession, { startkey: '"org.couchdb.user"' } }; - let allURL = this.endpoint + '_all_docs'; + let allURL = `${this.endpoint}_all_docs`; return this.ajax(allURL, 'GET', ajaxData); }, diff --git a/app/admin/roles/controller.js b/app/admin/roles/controller.js index f01b1e90e9..3491e18c3e 100644 --- a/app/admin/roles/controller.js +++ b/app/admin/roles/controller.js @@ -108,11 +108,11 @@ export default AbstractEditController.extend(UserRoles, UserSession, { section.capabilities.forEach((key) => { mappedCapabilities.push({ key: key, - name: this.get('i18n').t('admin.roles.capability.' + key) + name: this.get('i18n').t(`admin.roles.capability.${key}`) }); }); return { - name: this.get('i18n').t('admin.roles.capability.' + section.name), + name: this.get('i18n').t(`admin.roles.capability.${section.name}`), capabilities: mappedCapabilities }; }), diff --git a/app/appointments/edit/controller.js b/app/appointments/edit/controller.js index 109fecb66e..c187815d02 100644 --- a/app/appointments/edit/controller.js +++ b/app/appointments/edit/controller.js @@ -46,7 +46,7 @@ export default AbstractEditController.extend(AppointmentStatuses, PatientSubmodu let minute; let minuteList = []; for (minute = 0; minute < 60; minute++) { - minuteList.push(String('00' + minute).slice(-2)); + minuteList.push(String(`00${minute}`).slice(-2)); } return minuteList; }.property(), diff --git a/app/appointments/search/route.js b/app/appointments/search/route.js index 9071e70a3a..0b84eb3d8c 100644 --- a/app/appointments/search/route.js +++ b/app/appointments/search/route.js @@ -28,7 +28,7 @@ export default AppointmentIndexRoute.extend(DateFormat, { let startOfDay = startDate.startOf('day').toDate().getTime(); let searchOptions = { startkey: [startOfDay, null, 'appointment_'], - endkey: [maxValue, maxValue, 'appointment_' + maxValue] + endkey: [maxValue, maxValue, `appointment_${maxValue}`] }; return { options: searchOptions, diff --git a/app/appointments/today/route.js b/app/appointments/today/route.js index 39ece348c2..c96050acad 100644 --- a/app/appointments/today/route.js +++ b/app/appointments/today/route.js @@ -12,7 +12,7 @@ export default AppointmentIndexRoute.extend({ return { options: { startkey: [startOfDay, null, 'appointment_'], - endkey: [endOfDay, endOfDay, 'appointment_' + maxValue] + endkey: [endOfDay, endOfDay, `appointment_${maxValue}`] }, mapReduce: 'appointments_by_date' }; diff --git a/app/components/charge-quantity.js b/app/components/charge-quantity.js index 6d04259603..c11eb0eb62 100644 --- a/app/components/charge-quantity.js +++ b/app/components/charge-quantity.js @@ -8,7 +8,7 @@ export default Ember.Component.extend({ didReceiveAttrs(/* attrs */) { this._super(...arguments); - this.quantitySelected = Ember.computed.alias('model.' + this.get('pricingItem.id')); + this.quantitySelected = Ember.computed.alias(`model.${this.get('pricingItem.id')}`); }, hasError: function() { diff --git a/app/components/charges-by-type-tab.js b/app/components/charges-by-type-tab.js index e716410850..0570d05b43 100644 --- a/app/components/charges-by-type-tab.js +++ b/app/components/charges-by-type-tab.js @@ -18,6 +18,6 @@ export default Ember.Component.extend({ tabHref: function() { let tabId = this.get('tabId'); - return '#' + tabId; + return `#${tabId}`; }.property('tabId') }); diff --git a/app/components/checkbox-or-typeahead.js b/app/components/checkbox-or-typeahead.js index 4b38b5f372..67ededdb38 100644 --- a/app/components/checkbox-or-typeahead.js +++ b/app/components/checkbox-or-typeahead.js @@ -23,9 +23,9 @@ export default SelectOrTypeahead.extend({ _setup: function() { let property = this.get('property'); - Ember.defineProperty(this, 'errors', Ember.computed('model.errors.' + property, function() { + Ember.defineProperty(this, 'errors', Ember.computed(`model.errors.${property}`, function() { let property = this.get('property'); - let errors = this.get('model.errors.' + property); + let errors = this.get(`model.errors.${property}`); if (!Ember.isEmpty(errors)) { return errors[0]; } @@ -47,7 +47,7 @@ export default SelectOrTypeahead.extend({ actions: { checkboxChanged: function(value, checked) { let property = this.get('property'); - let propertyName = 'model.' + property; + let propertyName = `model.${property}`; let selectedValues = this.get(propertyName); if (!Ember.isArray(selectedValues)) { selectedValues = []; diff --git a/app/components/custom-form.js b/app/components/custom-form.js index f521adb78a..dd47cdab89 100644 --- a/app/components/custom-form.js +++ b/app/components/custom-form.js @@ -22,7 +22,7 @@ export default Ember.Component.extend(SelectValues, { currentRow = []; colCount = 0; } - field.classNames += ' col-sm-' + (colWidth * colSpan); + field.classNames += ` col-sm-${colWidth * colSpan}`; if (field.type === 'select') { field.mappedValues = field.values.map(this.selectValuesMap); } diff --git a/app/components/date-input.js b/app/components/date-input.js index 931e5b68b9..b51b6432c4 100644 --- a/app/components/date-input.js +++ b/app/components/date-input.js @@ -73,16 +73,16 @@ export default HtmlInput.extend({ didReceiveAttrs(/* attrs */) { this._super(...arguments); let dateProperty = this.get('mainComponent.property'); - let displayPropertyName = 'display_' + dateProperty; + let displayPropertyName = `display_${dateProperty}`; this.set('mainComponent.property', displayPropertyName); - this.currentDate = Ember.computed.alias('mainComponent.model.' + dateProperty); - this.selectedValue = Ember.computed.alias('mainComponent.model.' + displayPropertyName); + this.currentDate = Ember.computed.alias(`mainComponent.model.${dateProperty}`); + this.selectedValue = Ember.computed.alias(`mainComponent.model.${displayPropertyName}`); this.minDate = Ember.computed.alias('mainComponent.minDate'); this.maxDate = Ember.computed.alias('mainComponent.maxDate'); this.showTime = Ember.computed.alias('mainComponent.showTime'); this.yearRange = Ember.computed.alias('mainComponent.yearRange'); - this.addObserver('mainComponent.model.' + dateProperty, this, this.currentDateChangedValue); - Ember.Binding.from('mainComponent.model.errors.' + dateProperty).to('mainComponent.model.errors.' + displayPropertyName).connect(this); + this.addObserver(`mainComponent.model.${dateProperty}`, this, this.currentDateChangedValue); + Ember.Binding.from(`mainComponent.model.errors.${dateProperty}`).to(`mainComponent.model.errors.${displayPropertyName}`).connect(this); }, willDestroyElement: function() { diff --git a/app/components/icd10-typeahead.js b/app/components/icd10-typeahead.js index b0f1bd2262..6af2f51d4a 100644 --- a/app/components/icd10-typeahead.js +++ b/app/components/icd10-typeahead.js @@ -14,7 +14,7 @@ export default TypeAhead.extend({ cb(suggestions); // Set the headers content. let $header = this.$('.query-results'); - $header.html('' + query + ' returned ' + suggestions.length + ' results'); + $header.html(`${query} returned ${suggestions.length} results`); }.bind(this)); }, diff --git a/app/components/take-photo.js b/app/components/take-photo.js index 13b4ead706..43af524ea3 100644 --- a/app/components/take-photo.js +++ b/app/components/take-photo.js @@ -57,9 +57,9 @@ export default Ember.Component.extend({ for (let i = 0; i !== sourceInfos.length; ++i) { let sourceInfo = sourceInfos[i]; if (sourceInfo.kind === 'video') { - cameraLabel = 'Camera ' + (++cameraCount); + cameraLabel = `Camera '${++cameraCount}`; if (sourceInfo.label) { - cameraLabel += ' (' + sourceInfo.label + ')'; + cameraLabel += ` (${sourceInfo.label})`; } videoSources.addObject({ id: sourceInfo.id, diff --git a/app/controllers/abstract-edit-controller.js b/app/controllers/abstract-edit-controller.js index e2d5c79f2a..c7e618d120 100644 --- a/app/controllers/abstract-edit-controller.js +++ b/app/controllers/abstract-edit-controller.js @@ -113,11 +113,11 @@ export default Ember.Controller.extend(EditPanelProps, IsUpdateDisabled, ModalHe this.saveModel(skipAfterUpdate); }).catch((err) => { if (!err.ignore) { - this.displayAlert('Error!!!!', 'An error occurred while attempting to save: ' + JSON.stringify(err)); + this.displayAlert('Error!!!!', `An error occurred while attempting to save: ${JSON.stringify(err)}`); } }); } catch (ex) { - this.displayAlert('Error!!!!', 'An error occurred while attempting to save: ' + ex); + this.displayAlert('Error!!!!', `An error occurred while attempting to save: ${ex}`); } } }, diff --git a/app/controllers/abstract-report-controller.js b/app/controllers/abstract-report-controller.js index 374efacb4f..cbb74cfd6d 100644 --- a/app/controllers/abstract-report-controller.js +++ b/app/controllers/abstract-report-controller.js @@ -104,10 +104,10 @@ export default Ember.Controller.extend(DateFormat, ModalHelper, NumberFormat, Pa } }); - csvRows.push('"' + rowToAdd.join('","') + '"'); + csvRows.push(`"${rowToAdd.join('","')}"`); }); let csvString = csvRows.join('\r\n'); - let uriContent = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csvString); + let uriContent = `data:application/csv;charset=utf-8,${encodeURIComponent(csvString)}`; this.set('csvExport', uriContent); }, diff --git a/app/controllers/index.js b/app/controllers/index.js index 59682ace7e..f44505e1d1 100644 --- a/app/controllers/index.js +++ b/app/controllers/index.js @@ -15,7 +15,7 @@ export default Ember.Controller.extend(UserSession, { let permissions = this.get('defaultCapabilities'); for (let capability in permissions) { if (this.currentUserCan(capability)) { - this.set('userCan_' + capability, true); + this.set(`userCan_${capability}`, true); } } }.on('init'), diff --git a/app/controllers/navigation.js b/app/controllers/navigation.js index e08c64de3d..b98cfcea19 100644 --- a/app/controllers/navigation.js +++ b/app/controllers/navigation.js @@ -43,9 +43,9 @@ export default Ember.Controller.extend(HospitalRunVersion, ModalHelper, Progress let textToFind = this.get('searchText'); if (currentSearchText !== textToFind || currentRouteName.indexOf('.search') === -1) { this.set('searchText', ''); - this.set('progressMessage', 'Searching for ' + textToFind + '. Please wait...'); + this.set('progressMessage', `Searching for ${textToFind}. Please wait...`); this.showProgressModal(); - this.transitionToRoute(this.searchRoute + '/' + textToFind); + this.transitionToRoute(`${this.searchRoute}/${textToFind}`); } } }, diff --git a/app/inventory/edit/controller.js b/app/inventory/edit/controller.js index e4fecc1577..7c88fed9ac 100644 --- a/app/inventory/edit/controller.js +++ b/app/inventory/edit/controller.js @@ -202,7 +202,7 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi sequence.incrementProperty('value', 1); sequenceValue = sequence.get('value'); if (sequenceValue < 100000) { - friendlyId += String('00000' + sequenceValue).slice(-5); + friendlyId += String(`00000${sequenceValue}`).slice(-5); } else { friendlyId += sequenceValue; } @@ -222,7 +222,7 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi sequenceFinder.then(function(prefixChars) { let store = this.get('store'); let newSequence = store.push(store.normalize('sequence', { - id: 'inventory_' + inventoryType, + id: `inventory_${inventoryType}`, prefix: inventoryType.toLowerCase().substr(0, prefixChars), value: 0 })); @@ -287,7 +287,7 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi model.validate().then(function() { if (model.get('isValid')) { this.set('savingNewItem', true); - this.store.find('sequence', 'inventory_' + inventoryType).then(function(sequence) { + this.store.find('sequence', `inventory_${inventoryType}`).then(function(sequence) { this._completeBeforeUpdate(sequence, resolve, reject); }.bind(this), function() { this._findSequence(inventoryType, resolve, reject); diff --git a/app/inventory/reports/controller.js b/app/inventory/reports/controller.js index fc5e0d00c6..263a4d70ff 100644 --- a/app/inventory/reports/controller.js +++ b/app/inventory/reports/controller.js @@ -612,7 +612,7 @@ export default AbstractReportController.extend(LocationName, ModalHelper, Number let i = this._numberFormat(beginningBalance + inventoryAdjustment); let i18n = this.get('i18n'); if ((beginningBalance + inventoryAdjustment) < 0) { - this.get('reportRows').addObject([i18n.t('inventory.reports.rows.balanceEnd'), '', '(' + i + ')']); + this.get('reportRows').addObject([i18n.t('inventory.reports.rows.balanceEnd'), '', `(${i})`]); } else { this.get('reportRows').addObject([i18n.t('inventory.reports.rows.balanceEnd'), '', i]); } @@ -695,10 +695,10 @@ export default AbstractReportController.extend(LocationName, ModalHelper, Number Object.keys(consumed).forEach(function(key) { let i = this._getValidNumber(consumed[key]); consumedTotal += i; - this.get('reportRows').addObject(['', key, '(' + this._numberFormat(i) + ')']); + this.get('reportRows').addObject(['', key, `(${this._numberFormat(i)})`]); }.bind(this)); overallValue += consumedTotal; - this.get('reportRows').addObject([i18n.t('inventory.reports.rows.consumedPurchasesTotal'), '', '(' + this._numberFormat(consumedTotal) + ')']); + this.get('reportRows').addObject([i18n.t('inventory.reports.rows.consumedPurchasesTotal'), '', `(${this._numberFormat(consumedTotal)})`]); } if (Object.keys(gikConsumed).length > 0) { this.get('reportRows').addObject([i18n.t('inventory.reports.rows.consumedGik'), '', '']); @@ -706,12 +706,12 @@ export default AbstractReportController.extend(LocationName, ModalHelper, Number Object.keys(gikConsumed).forEach(function(key) { let i = this._getValidNumber(gikConsumed[key]); gikTotal += i; - this.get('reportRows').addObject(['', key, '(' + this._numberFormat(i) + ')']); + this.get('reportRows').addObject(['', key, `(${this._numberFormat(i)})`]); }.bind(this)); overallValue += gikTotal; - this.get('reportRows').addObject([i18n.t('inventory.reports.rows.consumedGikTotal'), '', '(' + this._numberFormat(gikTotal) + ')']); + this.get('reportRows').addObject([i18n.t('inventory.reports.rows.consumedGikTotal'), '', `(${this._numberFormat(gikTotal)})`]); } - this.get('reportRows').addObject([i18n.t('inventory.reports.rows.consumedTotal'), '', '(' + this._numberFormat(overallValue) + ')']); + this.get('reportRows').addObject([i18n.t('inventory.reports.rows.consumedTotal'), '', `(${this._numberFormat(overallValue)})`]); adjustedValue -= overallValue; } // write the adjustment rows @@ -727,13 +727,13 @@ export default AbstractReportController.extend(LocationName, ModalHelper, Number this.get('reportRows').addObject(['', key, this._numberFormat(i)]); } else { adjustmentTotal -= i; - this.get('reportRows').addObject(['', key, '(' + this._numberFormat(i) + ')']); + this.get('reportRows').addObject(['', key, `(${this._numberFormat(i)})`]); } }.bind(this)); } }.bind(this)); if (adjustmentTotal < 0) { - this.get('reportRows').addObject([i18n.t('inventory.reports.rows.adjustmentsTotal'), '', '(' + this._numberFormat(adjustmentTotal) + ')']); + this.get('reportRows').addObject([i18n.t('inventory.reports.rows.adjustmentsTotal'), '', `(${this._numberFormat(adjustmentTotal)})`]); } else { this.get('reportRows').addObject([i18n.t('inventory.reports.rows.adjustmentsTotal'), '', this._numberFormat(adjustmentTotal)]); } @@ -803,7 +803,7 @@ export default AbstractReportController.extend(LocationName, ModalHelper, Number } }.bind(this)); if (beginningBalance < 0) { - this.get('reportRows').addObject([i18n.t('inventory.reports.rows.balanceBegin'), '', '(' + this._numberFormat(beginningBalance) + ')']); + this.get('reportRows').addObject([i18n.t('inventory.reports.rows.balanceBegin'), '', `(${this._numberFormat(beginningBalance)})`]); } else { this.get('reportRows').addObject([i18n.t('inventory.reports.rows.balanceBegin'), '', this._numberFormat(beginningBalance)]); } @@ -944,7 +944,7 @@ export default AbstractReportController.extend(LocationName, ModalHelper, Number if (consumedQuantity === 0) { row.consumedPerDay = '0'; } else { - row.consumedPerDay = '?' + consumedQuantity; + row.consumedPerDay = `?${consumedQuantity}`; } row.daysLeft = '?'; } diff --git a/app/invoices/edit/controller.js b/app/invoices/edit/controller.js index 619ed522b8..1b605d86f2 100644 --- a/app/invoices/edit/controller.js +++ b/app/invoices/edit/controller.js @@ -292,7 +292,7 @@ export default AbstractEditController.extend(NumberFormat, PatientSubmodule, Pub sequence.incrementProperty('value', 1); sequenceValue = sequence.get('value'); if (sequenceValue < 100000) { - invoiceId += String('00000' + sequenceValue).slice(-5); + invoiceId += String(`00000${sequenceValue}`).slice(-5); } else { invoiceId += sequenceValue; } diff --git a/app/mixins/charge-actions.js b/app/mixins/charge-actions.js index f1557ee45d..64dfd19415 100644 --- a/app/mixins/charge-actions.js +++ b/app/mixins/charge-actions.js @@ -18,7 +18,7 @@ export default Ember.Mixin.create({ resolve(); }.bind(this), reject); }.bind(this), reject); - }.bind(this), '_createNewChargeRecord with pricingId:' + pricingId); + }.bind(this), `_createNewChargeRecord with pricingId:${pricingId}`); }, actions: { @@ -207,7 +207,7 @@ export default Ember.Mixin.create({ this.set(priceObjectToSet, newPricing); resolve(); }.bind(this), reject); - }.bind(this), 'saveNewPricing for: ' + pricingName); + }.bind(this), `saveNewPricing for: ${pricingName}`); }, getSelectedPricing: function(selectedField) { @@ -293,7 +293,7 @@ export default Ember.Mixin.create({ } } }.bind(this)); - Ember.RSVP.all(chargePromises, 'Charges updated for current record:' + this.get('model.id')).then(resolve, reject); - }.bind(this), 'updateCharges for current record:' + this.get('model.id')); + Ember.RSVP.all(chargePromises, `Charges updated for current record: ${this.get('model.id')}`).then(resolve, reject); + }.bind(this), `updateCharges for current record: ${this.get('model.id')}`); } }); diff --git a/app/mixins/fulfill-request.js b/app/mixins/fulfill-request.js index f2ee39ea98..c3f1ec1638 100644 --- a/app/mixins/fulfill-request.js +++ b/app/mixins/fulfill-request.js @@ -96,7 +96,7 @@ export default Ember.Mixin.create({ } }); if (!foundQuantity) { - return 'Could not find any purchases that had the required quantity:' + quantityRequested; + return `Could not find any purchases that had the required quantity: ${quantityRequested}`; } } request.set('costPerUnit', (totalCost / quantityRequested).toFixed(2)); diff --git a/app/mixins/inventory-id.js b/app/mixins/inventory-id.js index 112f7da16a..5b4adbd4ef 100644 --- a/app/mixins/inventory-id.js +++ b/app/mixins/inventory-id.js @@ -9,6 +9,6 @@ export default Ember.Mixin.create({ let max = 999; let part1 = new Date().getTime(); let part2 = Math.floor(Math.random() * (max - min + 1)) + min; - return Ember.RSVP.resolve(part1.toString(36) + '_' + part2.toString(36)); + return Ember.RSVP.resolve(`${part1.toString(36)}_${part2.toString(36)}`); } }); diff --git a/app/mixins/navigation.js b/app/mixins/navigation.js index 9c30ce1512..3718f00116 100644 --- a/app/mixins/navigation.js +++ b/app/mixins/navigation.js @@ -307,7 +307,7 @@ export default Ember.Mixin.create({ nav.localizedTitle = translationOrOriginal(navTranslated, nav.title); // Map all of the sub navs, too nav.subnav = nav.subnav.map((sub) => { - let subItemKey = localizationPrefix + 'subnav.' + camelize(sub.title); + let subItemKey = `${localizationPrefix}subnav.${camelize(sub.title)}`; let subTranslated = this.get('i18n').t(subItemKey); sub.localizedTitle = translationOrOriginal(subTranslated, sub.title); diff --git a/app/mixins/patient-submodule.js b/app/mixins/patient-submodule.js index 238b57dc37..6f81f3437f 100644 --- a/app/mixins/patient-submodule.js +++ b/app/mixins/patient-submodule.js @@ -166,7 +166,7 @@ export default Ember.Mixin.create(PatientVisits, { let childPromises = []; let visit = this.get('model.visit'); childPromises.addObjects(this.resolveVisitChildren()); - Ember.RSVP.all(childPromises, 'Resolved visit children before removing ' + childName).then(function() { + Ember.RSVP.all(childPromises, `Resolved visit children before removing ${childName}`).then(function() { visit.get(childName).then(function(visitChildren) { visitChildren.removeObject(objectToRemove); visit.save().then(resolve, reject); diff --git a/app/mixins/pouch-adapter-utils.js b/app/mixins/pouch-adapter-utils.js index e231c72843..6e58a42d25 100644 --- a/app/mixins/pouch-adapter-utils.js +++ b/app/mixins/pouch-adapter-utils.js @@ -11,7 +11,7 @@ export default Ember.Mixin.create({ } } let errmsg = [err.status, - (err.name || err.error) + ':', + `${(err.name || err.error)}:`, (err.message || err.reason) ].join(' '); Ember.run(null, reject, errmsg); diff --git a/app/mixins/progress-dialog.js b/app/mixins/progress-dialog.js index 5be287c1b2..07ecf01a0e 100644 --- a/app/mixins/progress-dialog.js +++ b/app/mixins/progress-dialog.js @@ -28,7 +28,7 @@ export default Ember.Mixin.create({ progressBarValue = 0; } progressDialog.set('progressBarValue', progressBarValue); - let progressBarStyle = Ember.String.htmlSafe('width: ' + progressBarValue + '%'); + let progressBarStyle = Ember.String.htmlSafe(`width: ${progressBarValue}%`); progressDialog.set('progressBarStyle', progressBarStyle); }, diff --git a/app/models/patient-note.js b/app/models/patient-note.js index 9d2c36c4c9..e90330a386 100644 --- a/app/models/patient-note.js +++ b/app/models/patient-note.js @@ -5,7 +5,7 @@ export default AbstractModel.extend({ authoredBy: function() { if (!Ember.isEmpty(this.get('attribution'))) { let i18n = this.get('i18n'); - return this.get('createdBy') + ' ' + i18n.t('patients.notes.onBehalfOfCopy') + ' ' + this.get('attribution'); + return `${this.get('createdBy')} ${i18n.t('patients.notes.onBehalfOfCopy')} ${this.get('attribution')}`; } else { return this.get('createdBy'); } diff --git a/app/models/visit.js b/app/models/visit.js index 7c48611831..a76182383f 100644 --- a/app/models/visit.js +++ b/app/models/visit.js @@ -80,7 +80,7 @@ export default AbstractModel.extend({ let startDate = moment(this.get('startDate')); let visitDate = startDate.format('l'); if (!Ember.isEmpty(endDate) && !startDate.isSame(endDate, 'day')) { - visitDate += ' - ' + moment(endDate).format('l'); + visitDate += ` - ${moment(endDate).format('l')}`; } return visitDate; }.property('startDate', 'endDate'), diff --git a/app/patients/edit/controller.js b/app/patients/edit/controller.js index bef068224b..eee09df143 100644 --- a/app/patients/edit/controller.js +++ b/app/patients/edit/controller.js @@ -183,7 +183,7 @@ export default AbstractEditController.extend(BloodTypes, ReturnTo, UserSession, * @param {boolean} coverImage flag indicating if image should be marked as the cover image (currently unused). */ addPhoto: function(photoFile, caption, coverImage) { - let dirToSaveTo = this.get('model.id') + '/photos/'; + let dirToSaveTo = `${this.get('model.id')}/photos/`; let fileSystem = this.get('filesystem'); let photos = this.get('model.photos'); let newPatientPhoto = this.get('store').createRecord('photo', { @@ -492,7 +492,7 @@ export default AbstractEditController.extend(BloodTypes, ReturnTo, UserSession, } }); } - this.send('openModal', 'patients.socialwork.' + route, model); + this.send('openModal', `patients.socialwork.${route}`, model); }, _getVisitCollection: function(name) { @@ -512,7 +512,7 @@ export default AbstractEditController.extend(BloodTypes, ReturnTo, UserSession, }, _updateSocialRecord: function(recordToUpdate, name) { - let socialRecords = this.getWithDefault('model.' + name, []); + let socialRecords = this.getWithDefault(`model.${name}`, []); let isNew = recordToUpdate.get('isNew'); let patient = this.get('model'); let objectToUpdate = recordToUpdate.serialize(); diff --git a/app/patients/notes/controller.js b/app/patients/notes/controller.js index 397b5806c3..f806cc7f5c 100644 --- a/app/patients/notes/controller.js +++ b/app/patients/notes/controller.js @@ -18,7 +18,7 @@ export default AbstractEditController.extend(IsUpdateDisabled, UserSession, Pati if (this.get('model.isNew')) { return `${this.get('i18n').t('patients.notes.newNote')} ${this.get('model.patient.displayName')}`; } else { - return `${this.get('i18n').t('patients.notes.newNote')} ${(moment(this.get('model.date')).format('MM/DD/YYYY')) + ' for ' + this.get('model.patient.displayName')}`; + return `${this.get('i18n').t('patients.notes.newNote')} ${moment(this.get('model.date')).format('MM/DD/YYYY')} for ${this.get('model.patient.displayName')}`; } }.property('model.patient.displayName'), updateCapability: 'add_note', diff --git a/app/patients/reports/controller.js b/app/patients/reports/controller.js index 4611b223c2..8d336d99d9 100644 --- a/app/patients/reports/controller.js +++ b/app/patients/reports/controller.js @@ -517,7 +517,7 @@ export default AbstractReportController.extend(PatientDiagnosis, PatientVisits, visitTypes.forEach(function(visitType) { if (visitType.type === 'total') { this._addReportRow({ - visitDate: 'Total visits: ' + visitType.total + visitDate: `Total visits: ${visitType.total}` }); } else { visitType.records.forEach(function(visit) { @@ -591,13 +591,13 @@ export default AbstractReportController.extend(PatientDiagnosis, PatientVisits, for (let sex in patientBySex) { if (detailedReport) { patientBySex[sex].rows.forEach(addPatientBySexRows); - this._addReportRow({ patientId: sex + ' Total: ' + patientBySex[sex].count }, true, reportColumns); + this._addReportRow({ patientId: `${sex} Total: ${patientBySex[sex].count}` }, true, reportColumns); } else { this._addReportRow({ sex: sex, total: patientBySex[sex].count }, true, reportColumns); } sexTotal += patientBySex[sex].count; } - this._addReportRow({ patientId: 'Grand Total: ' + (sexTotal) }, true, reportColumns); + this._addReportRow({ patientId: `Grand Total: ${sexTotal}` }, true, reportColumns); this._finishReport(reportColumns); }, @@ -608,7 +608,7 @@ export default AbstractReportController.extend(PatientDiagnosis, PatientVisits, this._addRowsByType(diagnostics.labs, 'labType.name', 'Total for labs: ', reportColumns); this._finishReport(reportColumns); }.bind(this), function(err) { - this._notifyReportError('Error in _generateDiagnosticReport:' + err); + this._notifyReportError(`Error in _generateDiagnosticReport: ${err}`); }.bind(this)); }, @@ -665,7 +665,7 @@ export default AbstractReportController.extend(PatientDiagnosis, PatientVisits, return previousValue += daysDiff; }.bind(this), 0); if (detailed) { - this._addReportRow({ patientDays: 'Total: ' + this._numberFormat(patientDays) }, true, reportColumns); + this._addReportRow({ patientDays: `Total: ${this._numberFormat(patientDays)}` }, true, reportColumns); } else { this._addReportRow({ total: patientDays }, false, reportColumns); @@ -698,7 +698,7 @@ export default AbstractReportController.extend(PatientDiagnosis, PatientVisits, this._finishReport(reportColumns); } }.bind(this), function(err) { - this._notifyReportError('Error in _generateProcedureReport:' + err); + this._notifyReportError(`Error in _generateProcedureReport: ${err}`); }.bind(this)); }, @@ -712,10 +712,10 @@ export default AbstractReportController.extend(PatientDiagnosis, PatientVisits, }.bind(this)); this._finishReport(reportColumns); }.bind(this)).catch(function(err) { - this._notifyReportError('Error in _generateStatusReport:' + err); + this._notifyReportError(`Error in _generateStatusReport: ${err}`); }.bind(this)); }.bind(this)).catch(function(err) { - this._notifyReportError('Error in _generateStatusReport:' + err); + this._notifyReportError(`Error in _generateStatusReport: ${err}`); }.bind(this)); }, @@ -779,7 +779,7 @@ export default AbstractReportController.extend(PatientDiagnosis, PatientVisits, let itemList = []; if (!Ember.isEmpty(items)) { itemList = items.map(function(item) { - return Ember.get(item, descField) + '(' + this._dateFormat(Ember.get(item, dateField)) + ')'; + return `${Ember.get(item, descField)} ( ${this._dateFormat(Ember.get(item, dateField))})`; }.bind(this)); } return itemList.join(',\n'); @@ -891,7 +891,7 @@ export default AbstractReportController.extend(PatientDiagnosis, PatientVisits, } } }.bind(this), function(err) { - this._notifyReportError('Error in _findVisitsByDate:' + err); + this._notifyReportError(`Error in _findVisitsByDate: ${err}`); }.bind(this)); break; } diff --git a/app/pricing/edit/controller.js b/app/pricing/edit/controller.js index ae6f2ea02a..984b851323 100644 --- a/app/pricing/edit/controller.js +++ b/app/pricing/edit/controller.js @@ -59,9 +59,9 @@ export default AbstractEditController.extend(LabPricingTypes, ImagingPricingType id: 'expense_account_list' }]; listsToUpdate.push({ - name: category + 'PricingTypes', + name: `${category}PricingTypes`, property: 'model.pricingType', - id: category + '_pricing_types' + id: `${category}_pricing_types` }); return listsToUpdate; }.property('model.category'), @@ -69,7 +69,7 @@ export default AbstractEditController.extend(LabPricingTypes, ImagingPricingType pricingTypes: function() { let category = this.get('model.category'); if (!Ember.isEmpty(category)) { - let typesList = this.get(category.toLowerCase() + 'PricingTypes'); + let typesList = this.get(`${category.toLowerCase()}PricingTypes`); if (Ember.isEmpty(typesList) || Ember.isEmpty(typesList.get('value'))) { if (category === 'Lab') { return Ember.Object.create({ value: this.defaultLabPricingTypes }); diff --git a/app/routes/abstract-edit-route.js b/app/routes/abstract-edit-route.js index 8b502b0718..f842f44449 100644 --- a/app/routes/abstract-edit-route.js +++ b/app/routes/abstract-edit-route.js @@ -26,7 +26,7 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, { idParam: function() { let modelName = this.get('modelName'); - return modelName + '_id'; + return `${modelName}_id`; }.property('modelName'), /** diff --git a/app/routes/abstract-module-route.js b/app/routes/abstract-module-route.js index c7c225bc97..56fee45213 100644 --- a/app/routes/abstract-module-route.js +++ b/app/routes/abstract-module-route.js @@ -16,12 +16,12 @@ export default Ember.Route.extend(UserSession, AuthenticatedRouteMixin, { editPath: function() { let module = this.get('moduleName'); - return module + '.edit'; + return `${module}.edit`; }.property('moduleName'), deletePath: function() { let module = this.get('moduleName'); - return module + '.delete'; + return `${module}.delete`; }.property('moduleName'), newButtonAction: function() { @@ -34,12 +34,12 @@ export default Ember.Route.extend(UserSession, AuthenticatedRouteMixin, { searchRoute: function() { let module = this.get('moduleName'); - return '/' + module + '/search'; + return `/${module}/search`; }.property('moduleName'), actions: { allItems: function() { - this.transitionTo(this.get('moduleName') + '.index'); + this.transitionTo(`${this.get('moduleName')}.index`); }, deleteItem: function(item) { let deletePath = this.get('deletePath'); @@ -101,7 +101,7 @@ export default Ember.Route.extend(UserSession, AuthenticatedRouteMixin, { return this.store.find.apply(this.store, modelMap.findArgs); } }.bind(this)); - Ember.RSVP.allSettled(promises, 'All additional Models for ' + this.get('moduleName')).then(function(array) { + Ember.RSVP.allSettled(promises, `All additional Models for ${this.get('moduleName')}`).then(function(array) { array.forEach(function(item, index) { if (item.state === 'fulfilled') { this.set(this.additionalModels[index].name, item.value); @@ -109,7 +109,7 @@ export default Ember.Route.extend(UserSession, AuthenticatedRouteMixin, { }.bind(this)); resolve(); }.bind(this), reject); - }.bind(this), 'Additional Models for' + this.get('moduleName')); + }.bind(this), `Additional Models for ${this.get('moduleName')}`); } else { return Ember.RSVP.resolve(); } diff --git a/app/routes/abstract-search-route.js b/app/routes/abstract-search-route.js index 3260cf7713..cdd5c6a3c7 100644 --- a/app/routes/abstract-search-route.js +++ b/app/routes/abstract-search-route.js @@ -41,7 +41,7 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, { controller.set('searchText', this.get('searchText')); this.controllerFor('navigation').closeProgressModal(); let parentController = this.controllerFor(this.get('moduleName')); - let searchTitle = 'Search Results for ' + Ember.Handlebars.Utils.escapeExpression(this.get('searchText')) + ''; + let searchTitle = `Search Results for ${Ember.Handlebars.Utils.escapeExpression(this.get('searchText'))}`; parentController.set('currentScreenTitle', searchTitle.htmlSafe()); } diff --git a/app/services/config.js b/app/services/config.js index 4933509696..4c1858b0ab 100644 --- a/app/services/config.js +++ b/app/services/config.js @@ -120,7 +120,7 @@ export default Ember.Service.extend({ getConfigValue(id, defaultValue) { let configDB = this.get('configDB'); return new Ember.RSVP.Promise(function(resolve) { - configDB.get('config_' + id).then(function(doc) { + configDB.get(`config_${id}`).then(function(doc) { run(null, resolve, doc.value); }) .catch(function() { diff --git a/app/services/filesystem.js b/app/services/filesystem.js index aacf757f8c..75d54da28f 100644 --- a/app/services/filesystem.js +++ b/app/services/filesystem.js @@ -6,7 +6,7 @@ export default Ember.Service.extend({ fileSystemSize: (1024 * 1024 * 1024 * 8), // 8GB max size for local filesystem;chrome only, _onError: function(e) { - console.log('Filer filesystem error: ' + e); + console.log(`Filer filesystem error: ${e}`); }, _downloadFiles: function() { @@ -77,7 +77,7 @@ export default Ember.Service.extend({ if (newFileName.indexOf('.') === -1) { if (file.type) { let typeParts = file.type.split('/'); - newFileName += '.' + typeParts.pop(); + newFileName += `.${typeParts.pop()}`; } else { // Default to png extension newFileName += '.png'; @@ -95,7 +95,7 @@ export default Ember.Service.extend({ if (Ember.isEmpty(fileName) && !Ember.isEmpty(file.type)) { let typeParts = file.type.split('/'); if (typeParts.length > 1) { - newFileName += '.' + typeParts[1]; + newFileName += `.${typeParts[1]}`; } } filer.mkdir(path, false, function() { diff --git a/app/serviceworkers/pouchdb-sync.js b/app/serviceworkers/pouchdb-sync.js index 42ee7618d6..48ef28df25 100644 --- a/app/serviceworkers/pouchdb-sync.js +++ b/app/serviceworkers/pouchdb-sync.js @@ -23,7 +23,7 @@ toolbox.router.get('/db/main/_design/:design_doc/_view/:view', function(request, logDebug('request for view:', request.url); return couchDBResponse(request, values, options, function(request) { let options = getDBOptions(request.url); - let mapReduce = values.design_doc + '/' + values.view; + let mapReduce = `${values.design_doc}/${values.view}`; logDebug('queryPouchDB:', mapReduce, options); return localMainDB.query(mapReduce, options); }); @@ -58,7 +58,7 @@ function setupRemoteSync() { pouchOptions.ajax.headers['x-oauth-token-secret'] = configs.config_token_secret; pouchOptions.ajax.headers['x-oauth-token'] = configs.config_oauth_token; } - let remoteURL = self.location.protocol + '//' + self.location.host + '/db/main'; + let remoteURL = `${self.location.protocol}//${self.location.host}/db/main`; let remoteDB = new PouchDB(remoteURL, pouchOptions); syncingRemote = localMainDB.sync(remoteDB, { live: true, @@ -147,7 +147,7 @@ function getDBOptions(url) { function logPerformance(elapsedTime, requestUrl) { if (configs.config_log_metrics && configs.current_user) { let now = Date.now(); - let timingId = 'timing_' + configs.current_user.toLowerCase() + '_' + now; + let timingId = `timing_${configs.current_user.toLowerCase()}_${now}`; localMainDB.put({ _id: timingId, elapsed: elapsedTime, diff --git a/app/users/edit/controller.js b/app/users/edit/controller.js index 01231d4313..e4a2ccab92 100644 --- a/app/users/edit/controller.js +++ b/app/users/edit/controller.js @@ -16,7 +16,7 @@ export default AbstractEditController.extend(UserRoles, { if (updateModel.get('isNew')) { let newData = updateModel.getProperties('password', 'email', 'roles', 'displayName'); newData.name = newData.email; - newData.id = 'org.couchdb.user:' + newData.email; + newData.id = `org.couchdb.user:${newData.email}`; if (Ember.isEmpty(newData.password)) { newData.password = uuid.v4() + uuid.v4(); } diff --git a/app/utils/pouch-views.js b/app/utils/pouch-views.js index 7756360c79..da10efe6e5 100644 --- a/app/utils/pouch-views.js +++ b/app/utils/pouch-views.js @@ -7,13 +7,13 @@ function buildIndex(indexName, db) { return db.query(indexName, { limit: 0 }).catch(function(err) { - console.log('index error:' + JSON.stringify(err, null, 2)); + console.log(`index error: ${JSON.stringify(err, null, 2)}`); }); } function createDesignDoc(item, rev) { let ddoc = { - _id: '_design/' + item.name, + _id: `_design/${item.name}`, version: item.version, views: { } @@ -31,7 +31,7 @@ function createDesignDoc(item, rev) { } function checkForUpdate(view, db, runningTest, testDumpFile) { - return db.get('_design/' + view.name).then(function(doc) { + return db.get(`_design/${view.name}`).then(function(doc) { if (doc.version !== view.version) { return updateDesignDoc(view, db, doc._rev, runningTest, testDumpFile); } else { @@ -87,9 +87,9 @@ function generateSortFunction(sortFunction, includeCompareDate, filterFunction) 'rows.push(row);' + '}'; if (filterFunction) { - generatedFunction += 'rows = rows.filter(' + filterFunction + ');'; + generatedFunction += `rows = rows.filter(${filterFunction});`; } - generatedFunction += 'rows.sort(' + sortFunction + ');' + + generatedFunction += `rows.sort(${sortFunction});` + 'if (req.query.sortDesc) {' + 'rows = rows.reverse();' + '}' + @@ -113,22 +113,21 @@ function generateSortFunction(sortFunction, includeCompareDate, filterFunction) } function generateView(viewDocType, viewBody) { - return 'function(doc) {' + - 'var doctype,' + - 'uidx;' + - 'if (doc._id && (uidx = doc._id.indexOf("_")) > 0 && !doc.data.archived) {' + - 'doctype = doc._id.substring(0, uidx);' + - 'if(doctype === "' + viewDocType + '") {' + - viewBody + - '}' + - '}' + - '}'; + return `function(doc) { + var doctype, uidx; + if (doc._id && (uidx = doc._id.indexOf('_')) > 0 && !doc.data.archived) { + doctype = doc._id.substring(0, uidx); + if (doctype === '${viewDocType}') { + ${viewBody} + } + } + }`; } function updateDesignDoc(item, db, rev, runningTest, testDumpFile) { let designDoc = createDesignDoc(item, rev); if (runningTest) { - console.log(`WARNING: The view ${item.name} is out of date. Please update the pouch dump ${testDumpFile} to the latest version of ${item.name}`); + console.log(`WARNING: The view ${item.name} is out of date. Please update the pouch dump ${testDumpFile} to the latest version of ${item.name}`); } return db.put(designDoc).then(function() { // Update index @@ -140,23 +139,22 @@ function updateDesignDoc(item, db, rev, runningTest, testDumpFile) { } function generateDateForView(date1) { - return 'var ' + date1 + ' = doc.data.' + date1 + ';' + - 'if (' + date1 + ' && ' + date1 + ' !== "") {' + - date1 + ' = new Date(' + date1 + ');' + - 'if (' + date1 + '.getTime) {' + - date1 + ' = ' + date1 + '.getTime();' + - '}' + - '}'; - + return `var ${date1} = doc.data.${date1}; + if (${date1} && ${date1} !== "") { + ${date1} = new Date(${date1}); + if (${date1}.getTime) { + ${date1} = ${date1}.getTime(); + } + }`; } -let patientListingKey = 'if (doc.data.friendlyId) {' + - 'emit([doc.data.friendlyId, doc._id]);' + - '} else if (doc.data.externalPatientId) {' + - 'emit([doc.data.externalPatientId, doc._id]);' + - '} else {' + - 'emit([doc._id, doc._id]);' + -'}'; +let patientListingKey = `if (doc.data.friendlyId) { + emit([doc.data.friendlyId, doc._id]); + } else if (doc.data.externalPatientId) { + emit([doc.data.externalPatientId, doc._id]); + } else { + emit([doc._id, doc._id]); + }`; let patientListingSearch = generateSortFunction(function(a, b) { let sortBy = ''; @@ -182,9 +180,9 @@ let patientListingSearch = generateSortFunction(function(a, b) { let designDocs = [{ name: 'appointments_by_date', function: generateView('appointment', - generateDateForView('endDate') + - generateDateForView('startDate') + - 'emit([startDate, endDate, doc._id]);' + `${generateDateForView('endDate')} + ${generateDateForView('startDate')} + emit([startDate, endDate, doc._id]);` ), sort: generateSortFunction(function(a, b) { function defaultStatus(value) { @@ -245,17 +243,17 @@ let designDocs = [{ }, { name: 'appointments_by_patient', function: generateView('appointment', - generateDateForView('endDate') + - generateDateForView('startDate') + - 'emit([doc.data.patient, startDate, endDate,doc._id]);' + `${generateDateForView('endDate')} + ${generateDateForView('startDate')} + emit([doc.data.patient, startDate, endDate,doc._id]);` ), version: 4 }, { name: 'imaging_by_status', function: generateView('imaging', - generateDateForView('imagingDate') + - generateDateForView('requestedDate') + - 'emit([doc.data.status, requestedDate, imagingDate, doc._id]);' + `${generateDateForView('imagingDate')} + ${generateDateForView('requestedDate')} + emit([doc.data.status, requestedDate, imagingDate, doc._id]);` ), version: 4 }, { @@ -293,29 +291,29 @@ let designDocs = [{ }, { name: 'inventory_purchase_by_date_received', function: generateView('invPurchase', - generateDateForView('dateReceived') + - 'emit([dateReceived, doc._id]);' + `${generateDateForView('dateReceived')} + emit([dateReceived, doc._id]);` ), version: 5 }, { name: 'inventory_purchase_by_expiration_date', function: generateView('invPurchase', - generateDateForView('expirationDate') + - 'emit([expirationDate, doc._id]);' + `${generateDateForView('expirationDate')} + emit([expirationDate, doc._id]);` ), version: 5 }, { name: 'inventory_request_by_item', function: generateView('invRequest', - generateDateForView('dateCompleted') + - 'emit([doc.data.inventoryItem, doc.data.status, dateCompleted]);' + `${generateDateForView('dateCompleted')} + emit([doc.data.inventoryItem, doc.data.status, dateCompleted]);` ), version: 5 }, { name: 'inventory_request_by_status', function: generateView('invRequest', - generateDateForView('dateCompleted') + - 'emit([doc.data.status, dateCompleted, doc._id]);' + `${generateDateForView('dateCompleted')} + emit([doc.data.status, dateCompleted, doc._id]);` ), version: 5 }, { @@ -327,24 +325,24 @@ let designDocs = [{ }, { name: 'invoice_by_status', function: generateView('invoice', - generateDateForView('billDate') + - 'emit([doc.data.status, billDate, doc._id]);' + `${generateDateForView('billDate')} + emit([doc.data.status, billDate, doc._id]);` ), version: 4 }, { name: 'lab_by_status', function: generateView('lab', - generateDateForView('labDate') + - generateDateForView('requestedDate') + - 'emit([doc.data.status, requestedDate, labDate, doc._id]);' + `${generateDateForView('labDate')} + ${generateDateForView('requestedDate')} + emit([doc.data.status, requestedDate, labDate, doc._id]);` ), version: 4 }, { name: 'medication_by_status', function: generateView('medication', - generateDateForView('prescriptionDate') + - generateDateForView('requestedDate') + - 'emit([doc.data.status, requestedDate, prescriptionDate, doc._id]);' + `${generateDateForView('prescriptionDate')} + ${generateDateForView('requestedDate')} + emit([doc.data.status, requestedDate, prescriptionDate, doc._id]);` ), version: 4 }, { @@ -361,9 +359,9 @@ let designDocs = [{ }, { name: 'patient_by_admission', function: generateView('patient', - 'if(doc.data.admitted === true) {' + - patientListingKey + - '}' + `if (doc.data.admitted === true) { + ${patientListingKey} + }` ), sort: patientListingSearch, version: 4 @@ -376,8 +374,8 @@ let designDocs = [{ }, { name: 'procedure_by_date', function: generateView('procedure', - generateDateForView('procedureDate') + - 'emit([procedureDate, doc._id]);' + `${generateDateForView('procedureDate')} + emit([procedureDate, doc._id]);` ), version: 4 }, { @@ -395,24 +393,24 @@ let designDocs = [{ }, { name: 'visit_by_date', function: generateView('visit', - generateDateForView('endDate') + - generateDateForView('startDate') + - 'emit([startDate, endDate, doc._id]);' + `${generateDateForView('endDate')} + ${generateDateForView('startDate')} + emit([startDate, endDate, doc._id]);` ), version: 4 }, { name: 'visit_by_discharge_date', function: generateView('visit', - generateDateForView('endDate') + - 'emit([endDate, doc._id]);' + `${generateDateForView('endDate')} + emit([endDate, doc._id]);` ), version: 2 }, { name: 'visit_by_patient', function: generateView('visit', - generateDateForView('endDate') + - generateDateForView('startDate') + - 'emit([doc.data.patient, startDate, endDate, doc.data.visitType, doc._id]);' + `${generateDateForView('endDate')} + ${generateDateForView('startDate')} + emit([doc.data.patient, startDate, endDate, doc.data.visitType, doc._id]);` ), version: 4 }]; diff --git a/tests/acceptance/admin-test.js b/tests/acceptance/admin-test.js index 8a5862352c..4db81f87d3 100644 --- a/tests/acceptance/admin-test.js +++ b/tests/acceptance/admin-test.js @@ -129,7 +129,7 @@ test('Update workflow options', function(assert) { function verifyAll(checked) { Array.prototype.slice.call(document.querySelectorAll(selector)).forEach((node) => { - assert.equal(node.checked, checked, 'Checkbox is ' + (checked ? 'checked' : 'unchecked')); + assert.equal(node.checked, checked, `Checkbox is ${(checked ? 'checked' : 'unchecked')}`); }); } }); diff --git a/tests/acceptance/pricing-test.js b/tests/acceptance/pricing-test.js index 9765e5d96d..210a3f9043 100644 --- a/tests/acceptance/pricing-test.js +++ b/tests/acceptance/pricing-test.js @@ -9,10 +9,10 @@ function verifyPricingLists(path, includesPrices, excludesPrices, assert) { andThen(function() { assert.equal(currentURL(), path); includesPrices.forEach(function(priceName) { - assert.equal(find('.price-name:contains(' + priceName + ')').length, 1, priceName + ' displays'); + assert.equal(find(`.price-name:contains(${priceName})`).length, 1, `${priceName} displays`); }); excludesPrices.forEach(function(priceName) { - assert.equal(find('.price-name:contains(' + priceName + ')').length, 0, priceName + ' is not present'); + assert.equal(find(`.price-name:contains(${priceName})`).length, 0, `${priceName} is not present`); }); }); diff --git a/tests/helpers/select-date.js b/tests/helpers/select-date.js index 79716dc79d..c63c4e9f80 100644 --- a/tests/helpers/select-date.js +++ b/tests/helpers/select-date.js @@ -7,7 +7,7 @@ function triggerNativeEvent(element, eventName) { event.initEvent(eventName, true, false); element.dispatchEvent(event); } else { - element.fireEvent('on' + eventName); + element.fireEvent(`on${eventName}`); } }