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

Commit

Permalink
Merge pull request #1 from HospitalRun/master
Browse files Browse the repository at this point in the history
Latest changes
  • Loading branch information
oizuldan committed Mar 3, 2020
2 parents f5f3b29 + 2a99b58 commit 366a43a
Show file tree
Hide file tree
Showing 65 changed files with 2,657 additions and 533 deletions.
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
name: 🐛 Bug report
name: "\U0001F41B Bug report"
about: Create a report to help us improve
title: ''
labels: ''
labels: bug
assignees: ''

---

Before you submit an issue we recommend you drop into our [Spectrum channel](https://spectrum.chat/hospitalrun) and ask any questions you have or mention any problems you've had getting started with HospitalRun.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/regression.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: 💥 Regression Report
name: "\U0001F4A5 Regression Report"
about: Report unexpected behavior that worked in previous versions
title: ''
labels: ''
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/security.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: 👮 Security Issue
name: "\U0001F46E Security Issue"
about: Responsible Disclosure
title: ''
labels: ''
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
# - os: windows-latest
# node-version: 13.x
steps:
- uses: actions/checkout@v1
- run: git config --global core.autocrlf false # this is needed to prevent git changing EOL after cloning on Windows OS
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
Expand Down Expand Up @@ -46,7 +47,8 @@ jobs:
# - os: windows-latest
# node-version: 13.x
steps:
- uses: actions/checkout@v1
- run: git config --global core.autocrlf false # this is needed to prevent git changing EOL after cloning on Windows OS
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
Expand All @@ -63,9 +65,6 @@ jobs:
- name: Build
run: |
yarn build
- name: Storybook build
run: |
yarn build-storybook
- name: Run tests
run: |
yarn test:ci
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/compressed-size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Compressed Size

on: [pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2-beta
with:
fetch-depth: 1
- uses: preactjs/compressed-size-action@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ React frontend for [HospitalRun](http://hospitalrun.io/): free software for deve
- To contribute, follow the guidelines in the readme or alternatively ask for details on Slack channel [#contributors](https://hospitalrun-slack.herokuapp.com).
- To use version 1.0.0-beta (not production ready) in a hospital facility, ask for support on Slack channel [#troubleshooting](https://hospitalrun-slack.herokuapp.com) or Spectrum channel [#support](https://spectrum.chat/hospitalrun).

<div align="center">

[![Slack](https://img.shields.io/badge/Slack-Join%20our%20devs%20group-blueviolet?style=for-the-badge&logo=slack)](https://hospitalrun-slack.herokuapp.com)

</div>

# Contributing

Contributions are always welcome. Before contributing please read our [contributor guide](https://github.com/HospitalRun/hospitalrun-frontend/blob/master/.github/CONTRIBUTING.md).
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@
"private": false,
"license": "MIT",
"dependencies": {
"@hospitalrun/components": "^0.33.1",
"@hospitalrun/components": "^0.34.0",
"@reduxjs/toolkit": "~1.2.1",
"@types/pouchdb-find": "~6.3.4",
"bootstrap": "~4.4.1",
"date-fns": "~2.9.0",
"i18next": "~19.1.0",
"date-fns": "~2.10.0",
"i18next": "~19.3.1",
"i18next-browser-languagedetector": "~4.0.1",
"i18next-xhr-backend": "~3.2.2",
"node-sass": "~4.13.0",
"pouchdb": "~7.1.1",
"pouchdb-adapter-memory": "~7.1.1",
"pouchdb-find": "~7.1.1",
"pouchdb": "~7.2.1",
"pouchdb-adapter-memory": "~7.2.1",
"pouchdb-find": "~7.2.1",
"pouchdb-quick-search": "~1.3.0",
"react": "~16.12.0",
"react": "~16.13.0",
"react-bootstrap": "~1.0.0-beta.16",
"react-bootstrap-typeahead": "~3.4.7",
"react-dom": "~16.12.0",
"react-dom": "~16.13.0",
"react-i18next": "~11.3.0",
"react-redux": "~7.1.3",
"react-redux": "~7.2.0",
"react-router": "~5.1.2",
"react-router-dom": "~5.1.2",
"react-scripts": "~3.3.0",
"redux": "~4.0.5",
"redux-thunk": "~2.3.0",
"typescript": "~3.7.4"
"typescript": "~3.8.2"
},
"repository": {
"type": "git",
Expand All @@ -56,8 +56,8 @@
"@types/react-router": "~5.1.2",
"@types/react-router-dom": "~5.1.0",
"@types/redux-mock-store": "~1.0.1",
"@typescript-eslint/eslint-plugin": "~2.19.0",
"@typescript-eslint/parser": "~2.19.0",
"@typescript-eslint/eslint-plugin": "~2.22.0",
"@typescript-eslint/parser": "~2.22.0",
"commitizen": "~4.0.3",
"commitlint-config-cz": "~0.13.0",
"coveralls": "~3.0.9",
Expand All @@ -70,11 +70,11 @@
"eslint-config-airbnb": "~18.0.1",
"eslint-config-prettier": "~6.10.0",
"eslint-plugin-import": "~2.20.0",
"eslint-plugin-jest": "~23.7.0",
"eslint-plugin-jest": "~23.8.0",
"eslint-plugin-jsx-a11y": "~6.2.3",
"eslint-plugin-prettier": "~3.1.1",
"eslint-plugin-react": "~7.18.0",
"eslint-plugin-react-hooks": "~2.3.0",
"eslint-plugin-react-hooks": "~2.5.0",
"history": "~4.10.1",
"husky": "~4.2.1",
"jest": "~24.9.0",
Expand Down
132 changes: 75 additions & 57 deletions src/HospitalRun.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { useSelector } from 'react-redux'
import { Toaster } from '@hospitalrun/components'
import Appointments from 'scheduling/appointments/Appointments'
import NewAppointment from 'scheduling/appointments/new/NewAppointment'
import EditAppointment from 'scheduling/appointments/edit/EditAppointment'
import ViewAppointment from 'scheduling/appointments/view/ViewAppointment'
import Breadcrumbs from 'breadcrumbs/Breadcrumbs'
import { ButtonBarProvider } from 'page-header/ButtonBarProvider'
import ButtonToolBar from 'page-header/ButtonToolBar'
import Sidebar from './components/Sidebar'
import Permissions from './model/Permissions'
import Dashboard from './dashboard/Dashboard'
Expand All @@ -19,68 +23,82 @@ import PrivateRoute from './components/PrivateRoute'
const HospitalRun = () => {
const { title } = useSelector((state: RootState) => state.title)
const { permissions } = useSelector((state: RootState) => state.user)

return (
<div>
<Navbar />
<div className="container-fluid">
<Sidebar />
<div className="row">
<main role="main" className="col-md-9 ml-sm-auto col-lg-10 px-4">
<div className="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 className="h2">{title}</h1>
</div>
<div>
<Switch>
<Route exact path="/" component={Dashboard} />
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.ReadPatients)}
exact
path="/patients"
component={Patients}
/>
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.WritePatients)}
exact
path="/patients/new"
component={NewPatient}
/>
<PrivateRoute
isAuthenticated={
permissions.includes(Permissions.WritePatients) &&
permissions.includes(Permissions.ReadPatients)
}
exact
path="/patients/edit/:id"
component={EditPatient}
/>
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.ReadPatients)}
path="/patients/:id"
component={ViewPatient}
/>
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.ReadAppointments)}
exact
path="/appointments"
component={Appointments}
/>
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.WriteAppointments)}
exact
path="/appointments/new"
component={NewAppointment}
/>
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.ReadAppointments)}
exact
path="/appointments/:id"
component={ViewAppointment}
/>
</Switch>
</div>
<Toaster autoClose={5000} hideProgressBar draggable />
</main>
</div>
<ButtonBarProvider>
<div className="row">
<main role="main" className="col-md-9 ml-sm-auto col-lg-10 px-4">
<div className="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 className="h2">{title}</h1>
<ButtonToolBar />
</div>
<Breadcrumbs />
<div>
<Switch>
<Route exact path="/" component={Dashboard} />
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.ReadPatients)}
exact
path="/patients"
component={Patients}
/>
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.WritePatients)}
exact
path="/patients/new"
component={NewPatient}
/>
<PrivateRoute
isAuthenticated={
permissions.includes(Permissions.WritePatients) &&
permissions.includes(Permissions.ReadPatients)
}
exact
path="/patients/edit/:id"
component={EditPatient}
/>
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.ReadPatients)}
path="/patients/:id"
component={ViewPatient}
/>
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.ReadAppointments)}
exact
path="/appointments"
component={Appointments}
/>
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.WriteAppointments)}
exact
path="/appointments/new"
component={NewAppointment}
/>
<PrivateRoute
isAuthenticated={
permissions.includes(Permissions.WriteAppointments) &&
permissions.includes(Permissions.ReadAppointments)
}
exact
path="/appointments/edit/:id"
component={EditAppointment}
/>
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.ReadAppointments)}
exact
path="/appointments/:id"
component={ViewAppointment}
/>
</Switch>
</div>
<Toaster autoClose={5000} hideProgressBar draggable />
</main>
</div>
</ButtonBarProvider>
</div>
</div>
)
Expand Down
Loading

0 comments on commit 366a43a

Please sign in to comment.