Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor code #38

Merged
merged 176 commits into from
Mar 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
98a211e
chore(package): update ember-cli-stylelint to version 0.9.0
greenkeeper[bot] Dec 11, 2016
47ca076
chore(package): update stylelint-scss to version 1.4.0
greenkeeper[bot] Dec 12, 2016
1d19890
chore(package): update ember-ajax to version 2.5.3
greenkeeper[bot] Dec 12, 2016
b61682d
chore(package): update ember-cli-fake-server to version 0.3.2
greenkeeper[bot] Dec 19, 2016
a28fb60
chore(package): update ember-cli-sass to version 6.0.0
greenkeeper[bot] Dec 23, 2016
c007863
chore(package): update ember-truth-helpers to version 1.3.0
greenkeeper[bot] Dec 30, 2016
f6325f1
chore(package): update ember-cli-eslint to version 3.0.1
greenkeeper[bot] Jan 1, 2017
fed0f88
chore(package): update stylelint-config-concentric to version 1.0.7
greenkeeper[bot] Jan 2, 2017
ce9b90d
added basic translations for report
Chima1707 Jan 26, 2017
3dd4032
feat: added report model
Chima1707 Jan 26, 2017
e883089
feat: added report tabs to visit page
Chima1707 Jan 26, 2017
0774d1c
feat: added report route to router
Chima1707 Jan 26, 2017
7d4d07a
feat: added report page
Chima1707 Jan 26, 2017
80de01f
feat: reports to visits children
Chima1707 Jan 26, 2017
1495e89
feat: added add/delete report capabilities
Chima1707 Jan 26, 2017
7c46622
fix: fixed diagnosisContainer issue on browser back history button
Chima1707 Jan 26, 2017
f24c59e
fix: display different report title based on type of visit
Chima1707 Jan 30, 2017
d16bc06
Merge remote-tracking branch 'origin/master' into feat/opd-report
Chima1707 Jan 30, 2017
733c231
chore(package): update ember-cli-content-security-policy to version 0…
greenkeeper[bot] Jan 31, 2017
8e8d196
Added theater scheduling
jkleinsc Feb 3, 2017
df679bc
Make sure admin works with user timeout
jkleinsc Feb 3, 2017
a551b14
Merge branch 'master' into greenkeeper/ember-cli-stylelint-0.9.0
jkleinsc Feb 3, 2017
a786848
Updated to ember-cli-stylelint 0.9.1
jkleinsc Feb 3, 2017
347c35d
Merge pull request #853 from HospitalRun/greenkeeper/ember-cli-stylel…
jkleinsc Feb 3, 2017
9ca6b28
Merge pull request #856 from HospitalRun/greenkeeper/stylelint-scss-1…
jkleinsc Feb 3, 2017
e33ff61
Updated to stylelint-scss 1.4.1
jkleinsc Feb 3, 2017
2f6bbf1
app/locales/ur/translations.js contains Urdu translation of en/transl…
emadehsan Feb 4, 2017
bf614b5
fix: added next appointment and operative plans to opd form
Chima1707 Feb 6, 2017
63f5571
Merge remote-tracking branch 'origin/dev' into feat/opd-report
Chima1707 Feb 6, 2017
389ba29
Merge pull request #932 from emadehsan/locale-for-urdu
jkleinsc Feb 6, 2017
226fda2
Merge branch 'master' into greenkeeper/ember-ajax-2.5.3
jkleinsc Feb 6, 2017
db002b9
Fixed error in theater scheduling test
jkleinsc Feb 6, 2017
195b838
Merge pull request #859 from HospitalRun/greenkeeper/ember-ajax-2.5.3
jkleinsc Feb 6, 2017
336d6bd
Merge branch 'master' into greenkeeper/ember-cli-fake-server-0.3.2
jkleinsc Feb 6, 2017
7c0aa01
Merge pull request #890 from HospitalRun/greenkeeper/ember-cli-fake-s…
jkleinsc Feb 6, 2017
65f8170
Merge branch 'master' into greenkeeper/ember-cli-sass-6.0.0
jkleinsc Feb 6, 2017
424b56a
Updated ember-cli-sass to 6.1.1
jkleinsc Feb 6, 2017
e425ef6
Merge pull request #902 from HospitalRun/greenkeeper/ember-cli-sass-6…
jkleinsc Feb 6, 2017
d2738a8
Merge branch 'master' into greenkeeper/ember-truth-helpers-1.3.0
jkleinsc Feb 6, 2017
d5c3ba4
Merge pull request #908 from HospitalRun/greenkeeper/ember-truth-help…
jkleinsc Feb 6, 2017
35e3ca1
Merge branch 'master' into greenkeeper/ember-cli-eslint-3.0.1
jkleinsc Feb 6, 2017
65c0695
Merge pull request #909 from HospitalRun/greenkeeper/ember-cli-eslint…
jkleinsc Feb 6, 2017
645fde0
Merge branch 'master' into greenkeeper/stylelint-config-concentric-1.0.7
jkleinsc Feb 6, 2017
50c8591
Merge pull request #910 from HospitalRun/greenkeeper/stylelint-config…
jkleinsc Feb 6, 2017
42b8134
Merge branch 'master' into greenkeeper/ember-cli-content-security-pol…
jkleinsc Feb 6, 2017
bd3b1cb
Merge pull request #927 from HospitalRun/greenkeeper/ember-cli-conten…
jkleinsc Feb 6, 2017
2a01552
Update ember-fullcalendar to the latest version 🚀 (#929)
greenkeeper[bot] Feb 6, 2017
901b216
Rename pt-BR and es-CO locales so they load correctly
jkleinsc Feb 7, 2017
d9268c2
Restore package.json to working state
adeolabadmus Feb 8, 2017
4ab6026
Implement custom forms for OPD Report
adeolabadmus Feb 8, 2017
32bf618
Add custom forms attribute to report model
adeolabadmus Feb 9, 2017
3be61a1
Merge pull request #1 from eHealthAfrica/opd-custom-form
Feb 9, 2017
a216731
Refactor patientTypes to use i18n (#936)
rodolfoghi Feb 9, 2017
f20e9f1
Adding a code of conduct to the project
tangollama Feb 11, 2017
31f3d1a
Add some missing pt-br translations (#938)
rodolfoghi Feb 13, 2017
f1831cc
Merge branch 'master' into code_of_conduct
jkleinsc Feb 13, 2017
4e94eae
fix: saved report object
Chima1707 Feb 13, 2017
6da7b88
fix: added preview report feat
Chima1707 Feb 13, 2017
225bcff
Fix for load db screen not loading.
jkleinsc Feb 15, 2017
32f96a2
fix: added report by visit view
Chima1707 Feb 15, 2017
dd25475
fix: added logic to show different report sections
Chima1707 Feb 15, 2017
07b23c9
fix: added some report translations
Chima1707 Feb 15, 2017
8ac82d8
fix: edited report model
Chima1707 Feb 15, 2017
f6f2dac
fix: implemented logic to toggle between show report and new report
Chima1707 Feb 15, 2017
9d0c479
Make sure outPatient flag gets properly set.
jkleinsc Feb 15, 2017
1a6c955
Merge outpatient fix from upstream repo
adeolabadmus Feb 16, 2017
ccb0b05
Remove preview functionality from OPD Reports
adeolabadmus Feb 16, 2017
0e49768
Implement print button
adeolabadmus Feb 16, 2017
cfbbb35
Fixed importing of lookup lists
jkleinsc Feb 16, 2017
bac66a6
Remove print section header
adeolabadmus Feb 16, 2017
5b2efbb
Write styles and markup for print page
adeolabadmus Feb 16, 2017
6d6e851
Refactor report header into partial
adeolabadmus Feb 16, 2017
1f85452
Rename report types
adeolabadmus Feb 16, 2017
a9a3159
fix style lint errors
adeolabadmus Feb 17, 2017
c4f497c
Merge pull request #2 from eHealthAfrica/print
Feb 17, 2017
64583f2
fix: completed internationalization and lint fix
Chima1707 Feb 17, 2017
a7ad7f4
0.9.18
mofesola Feb 17, 2017
177f5b4
Incremented version number, added scope
mofesola Feb 17, 2017
b6b70f1
fix: remove patientId field, fixed next appointment bug, removed unus…
Chima1707 Feb 17, 2017
2d8c5c9
fix: change date fields to simple text
Chima1707 Feb 21, 2017
f2be926
Merge remote-tracking branch 'origin/dev' into feat/opd-report
Chima1707 Feb 21, 2017
a8341e4
Merge remote-tracking branch 'hospital-run/master' into feat/opd-report
Chima1707 Feb 21, 2017
f8859de
Merge pull request #5 from eHealthAfrica/feat/opd-report
adeolabadmus Feb 21, 2017
bf79a5c
fix: fixed bug that has to do with page header title
Chima1707 Feb 21, 2017
9334afb
Added .travis.yml file for building and deploying to npm
mofesola Feb 21, 2017
41f9ef6
Merge pull request #14 from eHealthAfrica/conf/deploy
mofesola Feb 21, 2017
da5668f
Removed ember test. Pretty much does the same as npm test
mofesola Feb 21, 2017
7106cfa
Merge pull request #15 from eHealthAfrica/conf/deploy
mofesola Feb 21, 2017
fdfa21e
Allowing all branches to be tested and built
mofesola Feb 21, 2017
be9b666
Merge pull request #16 from eHealthAfrica/conf/deploy
mofesola Feb 21, 2017
e023b78
refactor patients model translation (#951)
billybonks Feb 21, 2017
0b0b761
fix: added translations for discharge report
Chima1707 Feb 22, 2017
6a2e480
fix: modified report model to accommodate discharge report
Chima1707 Feb 22, 2017
3c6cb9e
fix: added discharge report
Chima1707 Feb 22, 2017
a0c3ddf
fix: added next appointment date to discharge report on save
Chima1707 Feb 22, 2017
bd2b0d4
fix: implemented next appointment as a mixin
Chima1707 Feb 22, 2017
1cf8534
fix: added translations for followup appointment message
Chima1707 Feb 22, 2017
d0140b3
fix: made sure a followup appointment exists before you generate disc…
Chima1707 Feb 22, 2017
169b268
Merge remote-tracking branch 'origin/dev' into feat/discharge-report
Chima1707 Feb 22, 2017
0990ad1
Change how "new" routes work
jkleinsc Feb 22, 2017
917cfdf
Move back to official release of ember-rapid-forms.
jkleinsc Feb 22, 2017
29795ac
Add Hospital Info report header as option config
adeolabadmus Feb 22, 2017
16ba110
Merge pull request #17 from eHealthAfrica/hospital-config
adeolabadmus Feb 23, 2017
2077532
Add report model to patient-diagnosis and visit unit tests
adeolabadmus Feb 23, 2017
238d590
Merge pull request #18 from eHealthAfrica/fix-test
adeolabadmus Feb 23, 2017
0c2d368
Merge branch 'master' into code_of_conduct
Feb 23, 2017
07652db
Merge pull request #939 from HospitalRun/code_of_conduct
Feb 23, 2017
1a0fcf1
Merge remote-tracking branch 'origin/dev' into feat/discharge-report
Chima1707 Feb 23, 2017
d35a8a9
fix: fixed report header conflict
Chima1707 Feb 23, 2017
edb0ef3
Refactor report template
adeolabadmus Feb 23, 2017
2db7c32
Add custom forms to discharge report
adeolabadmus Feb 23, 2017
f1cd0e4
Merge pull request #13 from eHealthAfrica/feat/discharge-report
Feb 23, 2017
4662424
fix: added hospital info doc to environment
Chima1707 Feb 23, 2017
d98df0d
fix: create sample docs on couchdb
Chima1707 Feb 23, 2017
32d0deb
Merge remote-tracking branch 'origin/dev' into feat/discharge-report
Chima1707 Feb 23, 2017
ed34c53
Change how "new" routes work
jkleinsc Feb 22, 2017
4a20709
fix: made sure sample docs are created when deleted
Chima1707 Feb 23, 2017
59b3b30
Add query parameters to improve app navigation experience
adeolabadmus Feb 24, 2017
dd9ce6b
set patient on visit models
adeolabadmus Feb 24, 2017
7d439f0
Redirect reports/new to patients when no visit model
adeolabadmus Feb 24, 2017
dd89556
Clean up visit controller
adeolabadmus Feb 24, 2017
012f7d5
Set visit on models
adeolabadmus Feb 24, 2017
4834a44
Update visit acceptance tests
adeolabadmus Feb 24, 2017
67670f6
Fix appointments new surgery test error
adeolabadmus Feb 24, 2017
55daf75
Fix typo on README.md ## Running with Docker section (#963)
biasao Feb 26, 2017
8c0387a
Remove double reference to visits controller
adeolabadmus Feb 26, 2017
a38f060
Display visit diagnosis appropriately
adeolabadmus Feb 26, 2017
62c4dce
Fix Operative Plans display
adeolabadmus Feb 26, 2017
a015ed2
Merge pull request #22 from eHealthAfrica/fix-report-diagnosis
Feb 27, 2017
74f1819
Merge pull request #23 from eHealthAfrica/fix-operative-plan
Feb 27, 2017
4de70c2
Merge pull request #20 from eHealthAfrica/fix-new-route
Feb 27, 2017
3314ee2
Merge pull request #19 from eHealthAfrica/feat/discharge-report
adeolabadmus Feb 27, 2017
df81a13
fix: fixed translation lables for next appointments
Chima1707 Mar 2, 2017
de35e44
fix: modified get futureAppointment to work for list of appointments
Chima1707 Mar 2, 2017
bbdbd65
fix: implemented next appointments on both template and controller
Chima1707 Mar 2, 2017
f91decc
fix: fix lint
Chima1707 Mar 2, 2017
9765327
FIx next appointments display
adeolabadmus Mar 2, 2017
6ce8d23
Merge pull request #25 from eHealthAfrica/feat/nextAppointment
adeolabadmus Mar 2, 2017
cc260dd
Added auto trigger hospitalrun-server refresh script on successful build
mofesola Mar 2, 2017
191aef1
Merge pull request #26 from eHealthAfrica/conf/deploy
mofesola Mar 2, 2017
cda4799
Fix reports controller bug
adeolabadmus Mar 2, 2017
397fb9a
Add diagnosis container
adeolabadmus Mar 2, 2017
897e380
Set patient on model if model is not new
adeolabadmus Mar 2, 2017
1d3302a
Set visit on controller and add display current operative plan
adeolabadmus Mar 2, 2017
fbfa8b7
Add `Completed By` field to report
adeolabadmus Mar 2, 2017
c276e9c
Refactor reports template
adeolabadmus Mar 2, 2017
31d8c33
Ensure reports.edit returns to visits.edit
adeolabadmus Mar 2, 2017
ac20a24
Display patient procedures on report
adeolabadmus Mar 3, 2017
22e4f62
Merge pull request #28 from eHealthAfrica/patient-procedures
Mar 3, 2017
25aed98
Testing improvements.
jkleinsc Mar 6, 2017
6af3e2c
Fixed build error
jkleinsc Mar 6, 2017
d4bbd83
Remove discharge report compulsory next appointment modal
adeolabadmus Mar 7, 2017
f0ee0b3
Fix `completed by` on report page
adeolabadmus Mar 7, 2017
c1f82b0
Style select element properly; Add titles to report
adeolabadmus Mar 7, 2017
ac35a25
fix: fix new user title bug after a new user has been added
Chima1707 Mar 7, 2017
2d78c4a
Merge pull request #29 from eHealthAfrica/retro-fix
adeolabadmus Mar 7, 2017
a85da20
Merge pull request #30 from eHealthAfrica/fix/user
adeolabadmus Mar 7, 2017
3241938
Added deploy branches to .travis.yml
mofesola Mar 8, 2017
7575a2b
Merge pull request #32 from eHealthAfrica/conf/deploy
mofesola Mar 8, 2017
cab65ea
Solved issue #313 - Button not visible properly (#971)
Mar 8, 2017
b7bbbc7
fix: fix test for new user title bug
Chima1707 Mar 9, 2017
b751d50
Merge pull request #36 from eHealthAfrica/fix/user-edit-title-test
adeolabadmus Mar 9, 2017
3d12782
fix: updated report template with testing attributes on fields
Chima1707 Mar 10, 2017
299aa25
fix: update visit template with testing attributes on fields
Chima1707 Mar 10, 2017
e94be73
fix: implemented acceptance tests for opd and discharge reports
Chima1707 Mar 10, 2017
2163458
Merge remote-tracking branch 'origin/dev' into fix/report-acceptance-…
Chima1707 Mar 10, 2017
0f06b3a
Updating documentation about linters. (#981)
sweeneydavidj Mar 10, 2017
1c0e2d0
Try to get tests to work better in Travis
jkleinsc Mar 11, 2017
9d5f5b5
Customizable print header (#985)
baoqchau Mar 13, 2017
d305705
Incident reporting (#987)
jkleinsc Mar 13, 2017
964018d
Fix issues with tests.
jkleinsc Mar 13, 2017
79d52a4
Implement acceptance tests for OPD Report
adeolabadmus Mar 14, 2017
e2d8131
Merge pull request #37 from eHealthAfrica/fix/report-acceptance-tests
adeolabadmus Mar 14, 2017
ad1d00e
Merge remote-tracking branch 'upstream/master' into refactor-code
adeolabadmus Mar 14, 2017
7895b24
Refactor code to conform with style guide
adeolabadmus Mar 14, 2017
6463268
Fix nextAppointment bug
adeolabadmus Mar 15, 2017
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
9 changes: 5 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to the Ember front end for HospitalRun

Contributions are welcome via pull requests and issues. This project uses the style guides from Dockyard for [Ember](https://github.com/dockyard/styleguides/blob/master/engineering/ember.md) and [JavaScript](https://github.com/dockyard/styleguides/blob/master/engineering/javascript.md). These style guides are enforced via [Ember Suave](https://github.com/dockyard/ember-suave). Before submitting a pull request, please make sure all tests pass by running ```ember test```.
Contributions are welcome via pull requests and issues. Before submitting a pull request, please make sure all tests pass by running ```ember test```. This project uses the style guides from Dockyard for [Ember](https://github.com/dockyard/styleguides/blob/master/engineering/ember.md) and [JavaScript](https://github.com/dockyard/styleguides/blob/master/engineering/javascript.md). These style guides are enforced via ESLint, which is one of the linters described in the section on [linters](#linter) below.

## Slack / Communication

Expand Down Expand Up @@ -118,14 +118,15 @@ Ember, by default uses [JSON API](http://jsonapi.org) as a JSON convention. [Cou

A linter is a small program that checks code for stylistic or programming errors. Linters are available for most syntaxes, from Python to HTML.

Programming is hard. We are bound to make mistakes. The big advantage of using linter is that your code can be linted as you type (before saving your changes) and any errors are highlighted immediately, which is considerably easier than saving the file, switching to a terminal, running a linter, reading through a list of errors, then switching back to your editor to locate the errors!
Programming is hard. We are bound to make mistakes. The big advantage of using a linter is that your code can be linted as you type (before saving your changes) and any errors are highlighted immediately, which is considerably easier than saving the file, switching to a terminal, running a linter, reading through a list of errors, then switching back to your editor to locate the errors!

In addition, linters can help to enforce coding standards, find unused variables, find formatting discrepancies etc.

**HospitalRun** uses the following linters:

1. [ESLint](http://eslint.org/) for ECMAScript/JavaScript. You can find the ESLint User guide [here](http://eslint.org/docs/user-guide/).
2. [stylelint](http://stylelint.io/) for Stylesheets. You can find stylelint User guide [here](http://stylelint.io/user-guide/).
1. [ESLint](http://eslint.org/) for ECMAScript/JavaScript. You can find the ESLint User guide [here](http://eslint.org/docs/user-guide/). ESLint is setup to use eslint-plugin-ember-suave, you can find more information about that [here](https://github.com/DockYard/eslint-plugin-ember-suave).
2. [stylelint](http://stylelint.io/) for Stylesheets. You can find the stylelint User guide [here](http://stylelint.io/user-guide/).
3. [ember-template-lint](https://github.com/rwjblue/ember-template-lint) for Ember templates.

### Using Local Cache

Expand Down
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@ branches:
sudo: false

cache:
directories
directories:
- $HOME/.npm
- $HOME/.cache # includes bowers cache

before_install:
- npm config set spin false
- npm install -g bower
- npm install -g bower phantomjs-prebuilt
- bower --version
- npm install phantomjs-prebuilt
- node_modules/phantomjs-prebuilt/bin/phantomjs --version
- phantomjs --version

install:
- npm install
- bower install

script:
- npm test
- travis_retry npm test
51 changes: 51 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Contributor Covenant Code of Conduct

## Summary

In the interest of fostering an open and welcoming environment, we as community members and moderators pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, sexual identity and orientation, or any other factor that people might use to insult or belittle another person.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Community moderators and core maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Community moderators and core maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any community member for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the community. Examples of representing a community include using an official community e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by community moderators.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the community moderators at [email protected]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The moderators are obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Community moderators and core maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ To start the frontend please do the following:
To run HospitalRun with Docker please do the following:
- Goto [https://docs.docker.com/engine/installation](https://docs.docker.com/engine/installation) to download and install Docker.
- Clone the repository with the command `git clone https://github.com/HospitalRun/hospitalrun-frontend.git`.
- Change to the hospitalrun-frontend directory `cd hosptialrun-frontend`.
- Build the HosptialRun image with `docker build -t hospitalrun-frontend .`
- Change to the hospitalrun-frontend directory `cd hospitalrun-frontend`.
- Build the HospitalRun image with `docker build -t hospitalrun-frontend .`
- Execute `docker run -it --name couchdb -d couchdb` to create the couchdb container.
- Execute `docker run -it --name hospitalrun-frontend -p 4200:4200 --link couchdb:couchdb -d hospitalrun-frontend` to create the HospitalRun container.

Expand Down Expand Up @@ -122,12 +122,6 @@ To run the test suite locally while developing, just run `ember test` from the p

Tests will also run automatically via Travis CI when you push a branch to the repository or a pull request. You can view output by going to the Travis test status from the Pull Request merge box.

### The SCSS linter

To keep our styling scalable and consistent, we are using an [scss linter](https://www.npmjs.com/package/ember-cli-scss-lint) that will throw an error in the build if you do not conform to it's syntax rules. The syntax rules are defined in the [`.scss-lint.yml`](https://github.com/HospitalRun/hospitalrun-frontend/blob/master/.scss-lint.yml) file, and documentation for each linter is [available here](https://github.com/brigade/scss-lint/blob/master/lib/scss_lint/linter/README.md).

The easiest way to work with styles in the project and abide by our linting rules is to install the [linter-scss-lint](https://atom.io/packages/linter-scss-lint) package for Atom. The package will then show you in real time where your styles are breaking the linter and how to correct them.

## Contributing

Again, contributions are welcome via pull requests and issues. Please see our [contributing guide](https://github.com/hospitalrun/hospitalrun-frontend/blob/master/.github/CONTRIBUTING.md) for more details.
Expand Down
60 changes: 32 additions & 28 deletions app/adapters/application.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import Ember from 'ember';
import { Adapter } from 'ember-pouch';
import UnauthorizedError from 'hospitalrun/utils/unauthorized-error';
import PouchAdapterUtils from 'hospitalrun/mixins/pouch-adapter-utils';
import uuid from 'npm:uuid';

const {
get,
run: {
bind
}
} = Ember;

export default Adapter.extend(PouchAdapterUtils, {
export default Adapter.extend({
database: Ember.inject.service(),
db: Ember.computed.reads('database.mainDB'),

Expand Down Expand Up @@ -193,6 +192,7 @@ export default Adapter.extend(PouchAdapterUtils, {
} else if (query.containsValue) {
return this._executeContainsSearch(store, type, query);
}
let database = get(this, 'database');
return new Ember.RSVP.Promise((resolve, reject) => {
let db = this.get('db');
try {
Expand All @@ -204,7 +204,7 @@ export default Adapter.extend(PouchAdapterUtils, {
};
db.list(`${mapReduce}/sort/${mapReduce}`, listParams, (err, response) => {
if (err) {
reject(this._handleErrorResponse(err));
reject(database.handleErrorResponse(err));
} else {
let responseJSON = JSON.parse(response.body);
this._handleQueryResponse(responseJSON, store, type).then(resolve, reject);
Expand All @@ -213,7 +213,7 @@ export default Adapter.extend(PouchAdapterUtils, {
} else {
db.query(mapReduce, queryParams, (err, response) => {
if (err) {
reject(this._handleErrorResponse(err));
reject(database.handleErrorResponse(err));
} else {
this._handleQueryResponse(response, store, type).then(resolve, reject);
}
Expand All @@ -222,50 +222,54 @@ export default Adapter.extend(PouchAdapterUtils, {
} else {
db.allDocs(queryParams, (err, response) => {
if (err) {
reject(this._handleErrorResponse(err));
reject(database.handleErrorResponse(err));
} else {
this._handleQueryResponse(response, store, type).then(resolve, reject);
}
});
}
} catch(err) {
reject(this._handleErrorResponse(err));
reject(database.handleErrorResponse(err));
}
}, 'findQuery in application-pouchdb-adapter');
}
},

createRecord(store, type, record) {
return new Ember.RSVP.Promise((resolve, reject) => {
this._super(store, type, record).then(resolve, (err) => {
reject(this._handleErrorResponse(err));
});
});
return this._checkForErrors(this._super(store, type, record));
},

findAll(store, type) {
return this._checkForErrors(this._super(store, type));
},

findMany(store, type, ids) {
return this._checkForErrors(this._super(store, type, ids));
},

findHasMany(store, record, link, rel) {
return this._checkForErrors(this._super(store, record, link, rel));
},

findRecord(store, type, id) {
return this._checkForErrors(this._super(store, type, id));
},

updateRecord(store, type, record) {
return new Ember.RSVP.Promise((resolve, reject) => {
this._super(store, type, record).then(resolve, (err) => {
reject(this._handleErrorResponse(err));
});
});
return this._checkForErrors(this._super(store, type, record));
},

deleteRecord(store, type, record) {
return this._checkForErrors(this._super(store, type, record));
},

_checkForErrors(callPromise) {
return new Ember.RSVP.Promise((resolve, reject) => {
this._super(store, type, record).then(resolve, (err) => {
reject(this._handleErrorResponse(err));
callPromise.then(resolve, (err) => {
let database = get(this, 'database');
reject(database.handleErrorResponse(err));
});
});
},

_handleErrorResponse(err) {
if (err.status) {
let detailedMessage = JSON.stringify(err, null, 2);
return new UnauthorizedError(err, detailedMessage);
} else {
return err;
}
}

});
26 changes: 22 additions & 4 deletions app/adapters/user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Ember from 'ember';
import DS from 'ember-data';
import UserSession from 'hospitalrun/mixins/user-session';

const { get } = Ember;

export default DS.RESTAdapter.extend(UserSession, {
database: Ember.inject.service(),
session: Ember.inject.service(),
Expand Down Expand Up @@ -82,7 +85,12 @@ export default DS.RESTAdapter.extend(UserSession, {
*/
find(store, type, id) {
let findUrl = this.endpoint + id;
return this.ajax(findUrl, 'GET');
return new Ember.RSVP.Promise((resolve, reject) => {
this.ajax(findUrl, 'GET').then(resolve, (error) => {
let database = get(this, 'database');
reject(database.handleErrorResponse(error));
});
});
},

headers: function() {
Expand Down Expand Up @@ -126,8 +134,13 @@ export default DS.RESTAdapter.extend(UserSession, {
}
data = this._cleanPasswordAttrs(data);
let putURL = `${this.endpoint}${Ember.get(record, 'id')}`;
return this.ajax(putURL, 'PUT', {
data
return new Ember.RSVP.Promise((resolve, reject) => {
this.ajax(putURL, 'PUT', {
data
}).then(resolve, (error) => {
let database = get(this, 'database');
reject(database.handleErrorResponse(error));
});
});
},

Expand All @@ -153,7 +166,12 @@ export default DS.RESTAdapter.extend(UserSession, {
}
};
let allURL = `${this.endpoint}_all_docs`;
return this.ajax(allURL, 'GET', ajaxData);
return new Ember.RSVP.Promise((resolve, reject) => {
this.ajax(allURL, 'GET', ajaxData).then(resolve, (error) => {
let database = get(this, 'database');
reject(database.handleErrorResponse(error));
});
});
},

/**
Expand Down
34 changes: 20 additions & 14 deletions app/admin/address/route.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
import AbstractEditRoute from 'hospitalrun/routes/abstract-edit-route';
import Ember from 'ember';
import { translationMacro as t } from 'ember-i18n';
import UnauthorizedError from 'hospitalrun/utils/unauthorized-error';

export default AbstractEditRoute.extend({
hideNewButton: true,
newTitle: t('admin.address.newTitle'),
editTitle: t('admin.address.editTitle'),
model() {
return new Ember.RSVP.Promise(function(resolve) {
this.get('store').find('option', 'address_options').then(function(addressOptions) {
return new Ember.RSVP.Promise((resolve, reject) => {
this.get('store').find('option', 'address_options').then((addressOptions) => {
resolve(addressOptions);
}, function() {
let store = this.get('store');
let newConfig = store.push(store.normalize('option', {
id: 'address_options',
value: {
address1Label: this.get('i18n').t('admin.address.addressLabel'),
address1Include: true
}
}));
resolve(newConfig);
}.bind(this));
}.bind(this));
}, (err) => {
if (err instanceof UnauthorizedError) {
reject(err);
} else {
let store = this.get('store');
let newConfig = store.push(store.normalize('option', {
id: 'address_options',
value: {
address1Label: this.get('i18n').t('admin.address.addressLabel'),
address1Include: true
}
}));
resolve(newConfig);
}
});
});
}
});
5 changes: 4 additions & 1 deletion app/admin/custom-forms/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ export default AbstractEditController.extend({
}),

formTypeValues: [
'incident',
'operativePlan',
'patient',
'socialwork',
'visit'
'visit',
'opdReport',
'dischargeReport'
],

formTypes: computed(function() {
Expand Down
10 changes: 8 additions & 2 deletions app/admin/loaddb/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ import AbstractEditRoute from 'hospitalrun/routes/abstract-edit-route';
import Ember from 'ember';
import { translationMacro as t } from 'ember-i18n';
import UserSession from 'hospitalrun/mixins/user-session';

const { get, inject } = Ember;

export default AbstractEditRoute.extend(UserSession, {
hideNewButton: true,
editTitle: t('admin.loaddb.editTitle'),

database: inject.service(),

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

// No model needed for import.
// Make sure database is available for import
model() {
return Ember.RSVP.resolve(Ember.Object.create({}));
let database = get(this, 'database');
return database.getDBInfo().catch((err) => this.send('error', database.handleErrorResponse(err)));
}
});
Loading