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

Commit

Permalink
Merge remote-tracking branch 'upstream/master' from 'hospitalrun/hosp…
Browse files Browse the repository at this point in the history
…italrun-frontend'
  • Loading branch information
aboma committed May 11, 2016
2 parents df46d82 + e36dc73 commit a9b5c6c
Show file tree
Hide file tree
Showing 25 changed files with 183 additions and 80 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
/.idea

# compiled output
/dist
Expand Down Expand Up @@ -29,3 +30,5 @@ server/config.js
newrelic_agent.log

newrelic.js

/async-disk-cache
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
# Change Log

## [0.9.7](https://github.com/HospitalRun/hospitalrun-frontend/tree/0.9.7) (2016-04-26)
## [0.9.8](https://github.com/HospitalRun/hospitalrun-frontend/tree/0.9.9) (2016-05-03)
[Full Changelog](https://github.com/HospitalRun/hospitalrun-frontend/compare/0.9.8...0.9.9)
Forgot to run build... so here it is!

## [0.9.8](https://github.com/HospitalRun/hospitalrun-frontend/tree/0.9.8) (2016-05-03)
[Full Changelog](https://github.com/HospitalRun/hospitalrun-frontend/compare/0.9.7...0.9.8)

**Fixed bugs:**

- Offline with service worker not working on new window/tab [\#391](https://github.com/HospitalRun/hospitalrun-frontend/issues/391)
- 'No patients found' helper link not presented after removing all patients [\#357](https://github.com/HospitalRun/hospitalrun-frontend/issues/357)

**Merged pull requests:**

- Update hospitalrun-server-routes to version 0.9.6 🚀 [\#442](https://github.com/HospitalRun/hospitalrun-frontend/pull/442) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- Fixes \#391 offline with service worker not working on new window/tab [\#441](https://github.com/HospitalRun/hospitalrun-frontend/pull/441) ([Epsilonnnn](https://github.com/Epsilonnnn))
- Update ember-i18n to version 4.2.1 🚀 [\#439](https://github.com/HospitalRun/hospitalrun-frontend/pull/439) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- Update ember-ajax to version 2.3.1 🚀 [\#436](https://github.com/HospitalRun/hospitalrun-frontend/pull/436) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))

## [0.9.7](https://github.com/HospitalRun/hospitalrun-frontend/tree/0.9.7) (2016-04-26)
[Full Changelog](https://github.com/HospitalRun/hospitalrun-frontend/compare/0.9.6...0.9.7)

**Implemented enhancements:**
Expand Down Expand Up @@ -34,7 +52,6 @@

## [0.9.6](https://github.com/HospitalRun/hospitalrun-frontend/tree/0.9.6) (2016-04-21)
[Full Changelog](https://github.com/HospitalRun/hospitalrun-frontend/compare/0.9.5...0.9.6)
Forgot to run build for 0.9.5, so here it is.

## [0.9.5](https://github.com/HospitalRun/hospitalrun-frontend/tree/0.9.5) (2016-04-21)
[Full Changelog](https://github.com/HospitalRun/hospitalrun-frontend/compare/0.9.4...0.9.5)
Expand Down
2 changes: 1 addition & 1 deletion app/appointments/item/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<td>{{appointment.appointmentType}}</td>
<td>{{appointment.location}}</td>
<td>{{appointment.provider}}</td>
<td>{{appointment.displayStatus}}</td>
<td class="appointment-status">{{appointment.displayStatus}}</td>
<td>
{{#if canAddVisit}}
<button class="btn btn-default" {{action 'createVisit' appointment bubbles=false }}>{{t 'buttons.add_visit'}}</button>
Expand Down
4 changes: 4 additions & 0 deletions app/appointments/missed/controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import AppointmentIndexController from 'hospitalrun/appointments/index/controller';
export default AppointmentIndexController.extend({
startKey: []
});
17 changes: 17 additions & 0 deletions app/appointments/missed/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import AppointmentIndexRoute from 'hospitalrun/appointments/index/route';
import { translationMacro as t } from 'ember-i18n';

export default AppointmentIndexRoute.extend({
editReturn: 'appointments.missed',
modelName: 'appointment',
pageTitle: t('appointments.missed'),

_modelQueryParams() {
let queryParams = this._super(...arguments);
queryParams.filterBy = [{
name: 'status',
value: 'Missed'
}];
return queryParams;
}
});
1 change: 1 addition & 0 deletions app/appointments/missed/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{partial 'appointments/index'}}
6 changes: 3 additions & 3 deletions app/labs/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}}
</div>
{{checkbox-or-typeahead property="labTypeName"
label="Lab Type" list=objectTypeList
label=(t 'labs.labels.lab_type') list=objectTypeList
selection=selectedLabType
optionLabelPath='name'
typeAheadType='pricing'
Expand All @@ -36,8 +36,8 @@
</div>
{{/if}}
{{#if canComplete}}
{{em-input property="result" label="Result" class="test-result-input"}}
{{em-input property="result" label=(t 'labels.result') class="test-result-input"}}
{{/if}}
{{em-text property="notes" label="Notes" rows=3 }}
{{em-text property="notes" label=(t 'labels.notes') rows=3 }}
{{/em-form}}
{{/edit-panel}}
1 change: 1 addition & 0 deletions app/locales/en/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ export default {
new_title: 'New Appointment',
section_title: 'Appointments',
this_week: 'Appointments This Week',
missed: 'Missed Appointments',
search_title: 'Search Appointments',
today_title: 'Today\'s Appointments',
messages: {
Expand Down
3 changes: 2 additions & 1 deletion app/mixins/appointment-statuses.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import SelectValues from 'hospitalrun/utils/select-values';
export default Ember.Mixin.create({
appointmentStatusList: [
'Scheduled',
'Canceled'
'Canceled',
'Missed'
],
appointmentStatuses: Ember.computed.map('appointmentStatusList', SelectValues.selectValuesMap),

Expand Down
2 changes: 1 addition & 1 deletion app/mixins/hospitalrun-version.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Ember from 'ember';
export default Ember.Mixin.create({
version: '0.9.6'
version: '0.9.9'
});
6 changes: 6 additions & 0 deletions app/mixins/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ export default Ember.Mixin.create({
route: 'appointments.today',
capability: 'appointments'
},
{
title: 'Missed',
iconClass: 'octicon-chevron-right',
route: 'appointments.missed',
capability: 'appointments'
},
{
title: 'Search',
iconClass: 'octicon-search',
Expand Down
1 change: 1 addition & 0 deletions app/models/appointment.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default AbstractModel.extend({
patient: DS.belongsTo('patient', {
async: false
}),
visits: DS.hasMany('visit'),
provider: DS.attr('string'),
location: DS.attr('string'),
appointmentType: DS.attr('string'),
Expand Down
1 change: 1 addition & 0 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Router.map(function() {
this.route('edit', { path: '/edit/:appointment_id' });
this.route('search');
this.route('today');
this.route('missed');
});

this.route('finishgauth', { path: '/finishgauth/:s1/:s2/:k/:t/:i/:p' });
Expand Down
14 changes: 10 additions & 4 deletions app/services/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ export default Ember.Service.extend({
this.set('configDB', db);
this.setCurrentUser();
return db;
}).then(replicateConfigDB).then(loadConfig);
})
.then(replicateConfigDB)
.catch((err) => {
console.log('replicate db error', err);
})
.finally(loadConfig)
.catch((err)=>console.log(err));
},

createDB() {
Expand Down Expand Up @@ -51,13 +57,13 @@ export default Ember.Service.extend({
console.log('Could not get configDB configs:', err);
reject(err);
}
const config = {};
const configObj = {};
for (var i = 0; i < response.rows.length; i++) {
if (!response.rows[i].error && response.rows[i].doc) {
config[response.rows[i].id] = response.rows[i].doc.value;
configObj[response.rows[i].id] = response.rows[i].doc.value;
}
}
resolve(config);
resolve(configObj);
});
}, 'getting configuration from the database');
},
Expand Down
49 changes: 39 additions & 10 deletions app/services/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default Ember.Service.extend(PouchAdapterUtils, {
createDB(configs) {
return new Ember.RSVP.Promise((resolve, reject) => {
let pouchOptions = {};
if (configs.config_use_google_auth) {
if (configs && configs.config_use_google_auth) {
pouchOptions.ajax = {
timeout: 30000
};
Expand All @@ -43,15 +43,13 @@ export default Ember.Service.extend(PouchAdapterUtils, {
}
}
const url = `${document.location.protocol}//${document.location.host}/db/main`;
new PouchDB(url, pouchOptions, (err, db) => {
if (err) {
reject(err);
return;
}
createPouchViews(db);
resolve(db);
});
});

this._createRemoteDB(url, pouchOptions)
.catch(() => this._createLocalDB('localMainDB', pouchOptions))
.then((db) => resolve(db))
.catch((err) => reject(err));

}, 'initialize application db');
},

queryMainDB(queryParams, mapReduce) {
Expand Down Expand Up @@ -154,5 +152,36 @@ export default Ember.Service.extend(PouchAdapterUtils, {
});
}
return mappedRows;
},

_createRemoteDB(remoteUrl, pouchOptions) {
return new Ember.RSVP.Promise(function(resolve, reject) {
new PouchDB(remoteUrl, pouchOptions, (errRemote, remoteDB) => {
if (errRemote) {
reject(errRemote);
return;
}

// remote db lazy created, check if db created correctly
remoteDB.info().then(() => {
createPouchViews(remoteDB);
resolve(remoteDB);
}).catch((err) => reject(err));
});
});
},

_createLocalDB(localDBName, pouchOptions) {
return new Ember.RSVP.Promise(function(resolve, reject) {
new PouchDB(localDBName, pouchOptions, (errLocal, localDB) => {
if (errLocal) {
reject(errLocal);
return;
}

createPouchViews(localDB);
resolve(localDB);
});
});
}
});
2 changes: 1 addition & 1 deletion app/services/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export default Ember.Service.extend({
},

/**
* Property to to determine if file system API is available.
* Property to determine if file system API is available.
*/
isFileSystemEnabled: function() {
var filer = this.get('filer');
Expand Down
4 changes: 2 additions & 2 deletions config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = function(environment) {
modulePrefix: 'hospitalrun',
environment: environment,
baseURL: '/',
locationType: 'history',
locationType: 'hash', // Using hash location type because it is more friendly for offline.
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
Expand Down Expand Up @@ -62,7 +62,7 @@ module.exports = function(environment) {
if (environment === 'production') {
ENV.serviceWorker.debug = false;
}

return ENV;
};

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hospitalrun",
"version": "0.9.7",
"version": "0.9.9",
"description": "Ember front end for HospitalRun",
"homepage": "http://hospitalrun.io",
"directories": {
Expand Down Expand Up @@ -33,7 +33,7 @@
"broccoli-manifest": "0.0.7",
"broccoli-merge-trees": "^1.0.0",
"broccoli-serviceworker": "0.1.0",
"ember-ajax": "2.1.0",
"ember-ajax": "2.3.2",
"ember-cli": "^2.4.1",
"ember-cli-active-link-wrapper": "0.2.0",
"ember-cli-app-version": "^1.0.0",
Expand All @@ -45,7 +45,7 @@
"ember-cli-htmlbars": "^1.0.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-qunit": "^1.2.4",
"ember-cli-qunit": "^2.0.0",
"ember-cli-release": "1.0.0-beta.1",
"ember-cli-sass": "^5.2.1",
"ember-cli-scss-lint": "1.0.0",
Expand All @@ -54,7 +54,7 @@
"ember-data": "^2.4.0",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"ember-i18n": "4.2.0",
"ember-i18n": "4.2.1",
"ember-load-initializers": "^0.5.0",
"ember-pouch": "^3.1.0",
"ember-rapid-forms": "1.0.0-beta4",
Expand All @@ -67,7 +67,7 @@
"express": "^4.8.5",
"glob": "^7.0.0",
"hospitalrun-dblisteners": "0.9.2",
"hospitalrun-server-routes": "0.9.5",
"hospitalrun-server-routes": "0.9.6",
"loader.js": "^4.0.2",
"nano": "6.2.0",
"request": "2.72.0"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions prod/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />

<base href="/" />
<meta name="hospitalrun/config/environment" content="%7B%22modulePrefix%22%3A%22hospitalrun%22%2C%22environment%22%3A%22production%22%2C%22baseURL%22%3A%22/%22%2C%22locationType%22%3A%22history%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22APP%22%3A%7B%22name%22%3A%22hospitalrun%22%2C%22version%22%3A%220.9.6+6f3a0730%22%7D%2C%22contentSecurityPolicy%22%3A%7B%22connect-src%22%3A%22%27self%27%22%2C%22default-src%22%3A%22%27self%27%22%2C%22frame-src%22%3A%22%27self%27%22%2C%22img-src%22%3A%22%27self%27%20filesystem%3A%20data%3A%22%2C%22script-src%22%3A%22%27self%27%20%27unsafe-inline%27%20%27unsafe-eval%27%22%2C%22style-src%22%3A%22%27self%27%20%27unsafe-inline%27%22%2C%22font-src%22%3A%5B%22%27self%27%22%5D%2C%22media-src%22%3A%5B%22%27self%27%22%5D%7D%2C%22i18n%22%3A%7B%22defaultLocale%22%3A%22en%22%7D%2C%22manifest%22%3A%7B%22enabled%22%3Atrue%2C%22appcacheFile%22%3A%22/manifest.appcache%22%2C%22excludePaths%22%3A%5B%22index.html%22%2C%22tests/index.html%22%2C%22robots.txt%22%2C%22crossdomain.xml%22%2C%22testem.js%22%5D%2C%22showCreateDate%22%3Atrue%2C%22includePaths%22%3A%5B%5D%2C%22network%22%3A%5B%22*%22%5D%7D%2C%22serviceWorker%22%3A%7B%22enabled%22%3Atrue%2C%22debug%22%3Afalse%2C%22excludePaths%22%3A%5B%22manifest.appcache%22%5D%2C%22swIncludeFiles%22%3A%5B%22bower_components/pouchdb/dist/pouchdb.js%22%5D%7D%2C%22contentSecurityPolicyHeader%22%3A%22Content-Security-Policy-Report-Only%22%2C%22exportApplicationGlobal%22%3Afalse%7D" />

<meta name="hospitalrun/config/environment" content="%7B%22modulePrefix%22%3A%22hospitalrun%22%2C%22environment%22%3A%22production%22%2C%22baseURL%22%3A%22/%22%2C%22locationType%22%3A%22hash%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22APP%22%3A%7B%22name%22%3A%22hospitalrun%22%2C%22version%22%3A%220.9.9+56e22fbf%22%7D%2C%22contentSecurityPolicy%22%3A%7B%22connect-src%22%3A%22%27self%27%22%2C%22default-src%22%3A%22%27self%27%22%2C%22frame-src%22%3A%22%27self%27%22%2C%22img-src%22%3A%22%27self%27%20filesystem%3A%20data%3A%22%2C%22script-src%22%3A%22%27self%27%20%27unsafe-inline%27%20%27unsafe-eval%27%22%2C%22style-src%22%3A%22%27self%27%20%27unsafe-inline%27%22%2C%22font-src%22%3A%5B%22%27self%27%22%5D%2C%22media-src%22%3A%5B%22%27self%27%22%5D%7D%2C%22i18n%22%3A%7B%22defaultLocale%22%3A%22en%22%7D%2C%22manifest%22%3A%7B%22enabled%22%3Atrue%2C%22appcacheFile%22%3A%22/manifest.appcache%22%2C%22excludePaths%22%3A%5B%22index.html%22%2C%22tests/index.html%22%2C%22robots.txt%22%2C%22crossdomain.xml%22%2C%22testem.js%22%5D%2C%22showCreateDate%22%3Atrue%2C%22includePaths%22%3A%5B%5D%2C%22network%22%3A%5B%22*%22%5D%7D%2C%22serviceWorker%22%3A%7B%22enabled%22%3Atrue%2C%22debug%22%3Afalse%2C%22excludePaths%22%3A%5B%22manifest.appcache%22%5D%2C%22swIncludeFiles%22%3A%5B%22bower_components/pouchdb/dist/pouchdb.js%22%5D%7D%2C%22contentSecurityPolicyHeader%22%3A%22Content-Security-Policy-Report-Only%22%2C%22exportApplicationGlobal%22%3Afalse%7D" />

<link rel="stylesheet" href="assets/vendor-ed8acd5f4063b4b83b5df16f6da9e8b0.css" integrity="sha256-8SEzsmD/Yu0KXXOOfKz1o2a7UPfUg0z/idfuC6vxZWY= sha512-rBdZdkJyfXTenDbP1KZYS3FLalUji+IE+vxyRjp0xrjs0jI7NO4zKk6EkPAC3XGwtiVf3Fy/PnJpQM3VOZd7Pg==" >
<link rel="stylesheet" href="assets/hospitalrun-5597b10d9b3989644768cdf048da1cad.css" integrity="sha256-8bxyBbzhF9E1E5vqUPqyCznLC52U89cip7JnMId0ObM= sha512-IEwfCIpGVnLqVQoTrMIuOCcxBl/19OeJa8vhaQOzaJ3z0fxU4gGWCktA5VqwZUQc7qtLVV7/XsqFYXK1vPTFGw==" >
Expand Down Expand Up @@ -44,8 +44,8 @@
</script>


<script src="assets/vendor-785885e5429dcaa0e2d5c60c80aeae45.js" integrity="sha256-/Xcm9SKbUakR2SZmOKS1re6I66hJ5yv5c2dIHloh0/Y= sha512-tGNb3d5TFJDucy5lC8SJmm+W0utYmPUivdCKxNaMYfYPotcnYGUWuGCBru1/6ZRcc/R+HSEJQ3sc5Jykrf93YA==" ></script>
<script src="assets/hospitalrun-9de08bdc299938d9a83d5f8656cbfdfb.js" integrity="sha256-kfRiGPy8v1oLqriAvTCvPyHxYdV58Zrxi3IjMMc+R50= sha512-uY5DFMYHvkJHkmUIN2n9/GEfIc7jiyhCkd3dpun93Rxf0ZUsZt8mGsSUddG6HpBwHOn70N206TPk040KgxJTRw==" ></script>
<script src="assets/vendor-d4e773a0bf7d0d6e5ad0321158e989ee.js" integrity="sha256-7nNqxiscS5Pc8MjAsoXAJpYz44WGHPVoenDTJRUShOw= sha512-310EBHySPZpYoojZLR+helIX8I5/Ztx08uoLlutT5NCh4MYiEfazWjSghvHzD79AMVJnkyGaMVpfG62nomKclw==" ></script>
<script src="assets/hospitalrun-3f13246ab46f208fcacfac451c08b1a3.js" integrity="sha256-PDkHM7p7CD3zI5UjB+WfDARtpXcQngEe8sGe/i0enKU= sha512-w4DPl0cUeeF2xUqw6/bdeaMYJlyA2CZfPXFd9bF0NeLAPahhvxLx7uDEcpH+JudKddzWaB5hEh1Xi3iwUGs9hg==" ></script>

<script>if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./service-worker.js', {scope: './'})
Expand Down
6 changes: 3 additions & 3 deletions prod/manifest.appcache
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
CACHE MANIFEST
# created 2016-04-26T15:01:53.401Z
# created 2016-05-03T21:02:04.827Z

CACHE:
assets/hospitalrun-3f13246ab46f208fcacfac451c08b1a3.js
assets/hospitalrun-5597b10d9b3989644768cdf048da1cad.css
assets/hospitalrun-9de08bdc299938d9a83d5f8656cbfdfb.js
assets/vendor-785885e5429dcaa0e2d5c60c80aeae45.js
assets/vendor-d4e773a0bf7d0d6e5ad0321158e989ee.js
assets/vendor-ed8acd5f4063b4b83b5df16f6da9e8b0.css
dymo/BarcodeAsImage.label
favicon-7440091f4e8bd83e23e4d5824c2c3da4.png
Expand Down
6 changes: 3 additions & 3 deletions prod/service-worker.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
importScripts('sw-toolbox.js');
var CACHE_PREFIX = 'brocsw-v';
var CACHE_VERSION = CACHE_PREFIX+'1461682913461';
var CACHE_VERSION = CACHE_PREFIX+'1462309324872';
toolbox.options.cache.name = CACHE_VERSION;
var urlsToPrefetch = [
'/',
"assets/hospitalrun-3f13246ab46f208fcacfac451c08b1a3.js",
"assets/hospitalrun-5597b10d9b3989644768cdf048da1cad.css",
"assets/hospitalrun-9de08bdc299938d9a83d5f8656cbfdfb.js",
"assets/vendor-785885e5429dcaa0e2d5c60c80aeae45.js",
"assets/vendor-d4e773a0bf7d0d6e5ad0321158e989ee.js",
"assets/vendor-ed8acd5f4063b4b83b5df16f6da9e8b0.css",
"crossdomain.xml",
"dymo/BarcodeAsImage.label",
Expand Down
Loading

0 comments on commit a9b5c6c

Please sign in to comment.