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

EmberCLI 2.8 & Ember 2.8 upgrade #669

Merged
merged 12 commits into from
Sep 30, 2016
4 changes: 2 additions & 2 deletions app/helpers/html-line-break.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Ember from 'ember';
export default Ember.Helper.helper(function([text]) {
if (text !== null && typeof text !== 'undefined') {
return new Ember.Handlebars.SafeString(text.replace(/\n/g, '<br>'));
return Ember.String.htmlSafe(text.replace(/\n/g, '<br>'));
} else {
return null;
}
});
});
38 changes: 20 additions & 18 deletions app/mixins/patient-submodule.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import DS from 'ember-data';
import Ember from 'ember';
import PatientVisits from 'hospitalrun/mixins/patient-visits';
import SelectValues from 'hospitalrun/utils/select-values';
Expand All @@ -6,6 +7,7 @@ export default Ember.Mixin.create(PatientVisits, {
needToUpdateVisit: false,
patientList: null,
selectedPatient: null,
newVisitAdded: null,

actions: {
showPatient: function(patient) {
Expand Down Expand Up @@ -83,11 +85,9 @@ export default Ember.Mixin.create(PatientVisits, {
model.set('visit', visit);
visit.save().then(function() {
visit.reload().then(function(updatedVisit) {
this.getPatientVisits(patient).then(function(visits) {
this.set('patientVisits', visits);
model.set('visit', updatedVisit);
resolve(updatedVisit);
}.bind(this), reject);
this.set('newVisitAdded', updatedVisit);
model.set('visit', updatedVisit);
resolve(updatedVisit);
}.bind(this), reject);
}.bind(this), reject).catch(function(err) {
console.log('Error creating new visit');
Expand All @@ -109,20 +109,19 @@ export default Ember.Mixin.create(PatientVisits, {

patientId: Ember.computed.alias('model.patient.id'),

patientChanged: function() {
var patient = this.get('model.patient');
patientVisits: function() {
let patient = this.get('model.patient');
let visitPromise;

if (!Ember.isEmpty(patient) && this.get('findPatientVisits')) {
this.getPatientVisits(patient).then(function(visits) {
if (Ember.isEmpty(this.get('model.patient'))) {
this.set('patientVisits', []);
} else {
this.set('patientVisits', visits);
}
}.bind(this));
visitPromise = this.getPatientVisits(patient);
} else if (Ember.isEmpty(patient) && this.get('findPatientVisits')) {
this.set('patientVisits', []);
visitPromise = Ember.RSVP.resolve([]);
}
}.observes('model.patient'),
return DS.PromiseArray.create({
promise: visitPromise
});
}.property('model.patient.id', 'newVisitAdded'),

selectedPatientChanged: function() {
var selectedPatient = this.get('selectedPatient');
Expand All @@ -145,11 +144,14 @@ export default Ember.Mixin.create(PatientVisits, {
}
}.observes('patientId').on('init'),

patientVisits: [],
returnPatientId: null,
returnVisitId: null,
patientVisitsForSelect: function() {
return this.get('patientVisits').map(SelectValues.selectObjectMap);
return DS.PromiseArray.create({
promise: this.get('patientVisits').then(function(patientVisits) {
return patientVisits.map(SelectValues.selectObjectMap);
})
});
}.property('patientVisits.[]'),

/**
Expand Down
4 changes: 2 additions & 2 deletions app/mixins/progress-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default Ember.Mixin.create({
progressBarValue = 0;
}
progressDialog.set('progressBarValue', progressBarValue);
var progressBarStyle = new Ember.Handlebars.SafeString('width: ' + progressBarValue + '%');
var progressBarStyle = Ember.String.htmlSafe('width: ' + progressBarValue + '%');
progressDialog.set('progressBarStyle', progressBarStyle);
},

Expand All @@ -39,7 +39,7 @@ export default Ember.Mixin.create({

showProgressModal: function() {
var progressDialog = Ember.Object.create(this.get('progressDialogDefaults'));
progressDialog.progressBarStyle = new Ember.Handlebars.SafeString(progressDialog.progressBarStyle);
progressDialog.progressBarStyle = new Ember.String.htmlSafe(progressDialog.progressBarStyle);
progressDialog.set('title', this.get('progressTitle'));
progressDialog.set('message', this.get('progressMessage'));
this.set('progressDialog', progressDialog);
Expand Down
13 changes: 3 additions & 10 deletions app/serviceworkers/pouchdb-sync.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
var configDB;

var configs = false;
var localMainDB;
var syncingRemote = false;

new PouchDB('config', function(err, db) {
configDB = db;
});

new PouchDB('localMainDB', function(err, db) {
localMainDB = db;
});
var configDB = new PouchDB('config');
var localMainDB = new PouchDB('localMainDB');

toolbox.router.get('/db/main/_all_docs', function(request, values, options) {
logDebug('request for all docs:', request.url);
Expand Down
5 changes: 2 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
"dependencies": {
"JsBarcode": "https://github.com/HospitalRun/JsBarcode.git",
"bootstrap": "~3.3.5",
"ember": "~2.7.0",
"ember": "~2.8.0",
"ember-cli-shims": "0.1.1",
"ember-qunit-notifications": "0.1.0",
"filer.js": "https://github.com/ebidel/filer.js.git#~0.4.3",
"idb.filesystem": "https://github.com/ebidel/idb.filesystem.js.git#~0.0.6",
"moment": "~2.10.5",
Expand All @@ -15,7 +14,7 @@
"typeahead.js": "~0.11.1",
"pouchdb-load": "^1.4.0",
"pretender": "~0.10.0",
"pouchdb": "5.3.2",
"pouchdb": "^5.4.5",
"relational-pouch": "^1.4.4",
"pouchdb-find": "^0.10.2"
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"broccoli-serviceworker": "0.1.1",
"ember-ajax": "2.5.1",
"ember-browserify": "^1.1.12",
"ember-cli": "^2.7.0",
"ember-cli": "^2.8.0",
"ember-cli-active-link-wrapper": "0.3.0",
"ember-cli-app-version": "^2.0.0",
"ember-cli-babel": "^5.1.6",
Expand All @@ -61,14 +61,14 @@
"ember-cli-template-lint": "0.4.12",
"ember-cli-test-loader": "^1.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-data": "~2.6.2",
"ember-data": "^2.8.0",
"ember-export-application-global": "^1.0.5",
"ember-i18n": "4.3.2",
"ember-keyboard": "2.1.3",
"ember-load-initializers": "^0.5.1",
"ember-pouch": "4.0.1",
"ember-radio-buttons": "^4.0.1",
"ember-rapid-forms": "1.0.0-beta7",
"ember-rapid-forms": "GCorbel/ember-rapid-forms#26229804a2c430bbdf1ffb6bab8fb53af17bb3a4",
"ember-resolver": "^2.0.3",
"ember-select-list": "0.9.5",
"ember-simple-auth": "^1.1.0",
Expand Down
5 changes: 4 additions & 1 deletion tests/helpers/run-with-pouch-dump.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ function runWithPouchDumpAsyncHelper(app, dumpName, functionToRun) {
return Ember.RSVP.resolve(configDB);
},
replicateConfigDB() {

return configDB.put({
_id: 'config_disable_offline_sync',
value: true
});
}
});

Expand Down