Skip to content

Commit

Permalink
Initial Appointments app (#1)
Browse files Browse the repository at this point in the history
* Initial commit

* Fix lint

* Edit ReadMe file

* Update PR description

* fix lint

* fix errors

* fix translations

* remove location dropdown on create appointment

* fix  test errors

* run prettier

* fix errors
  • Loading branch information
jabahum authored Jan 17, 2024
1 parent c6b513b commit 0d5bfaa
Show file tree
Hide file tree
Showing 181 changed files with 16,416 additions and 11,963 deletions.
36 changes: 28 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
{
"env": {
"node": true
},
"extends": ["eslint:recommended", "plugin:prettier/recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"root": true,
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"ts-react-important-stuff"
],
"plugins": ["@typescript-eslint", "react-hooks"],
"rules": {
// Disabling these rules for now just to keep the diff small. I'll enable them one by one as we go.
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/triple-slash-reference": "off",
// Use `import type` instead of `import` for type imports https://typescript-eslint.io/blog/consistent-type-imports-and-exports-why-and-how
"@typescript-eslint/consistent-type-imports": [
"error",
{
"fixStyle": "inline-type-imports"
}
],
"prefer-const": "off",
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-unsafe-optional-chaining": "off",
"no-explicit-any": "off",
"no-extra-boolean-cast": "off",
"no-prototype-builtins": "off",
"no-useless-escape": "off",
"no-restricted-imports": [
"error",
{
"paths": [
// These two rules ensure that we're importing lodash and lodash-es correctly. Not doing so can bloat our bundle size significantly.
{
"name": "lodash",
"message": "Import specific methods from `lodash`. e.g. `import map from 'lodash/map'`"
Expand All @@ -22,6 +41,7 @@
"importNames": ["default"],
"message": "Import specific methods from `lodash-es`. e.g. `import { map } from 'lodash-es'`"
},
// These two rules ensure that we're importing Carbon components and icons from the correct packages (after v10). May be removed in the future.
{
"name": "carbon-components-react",
"message": "Import from `@carbon/react` directly. e.g. `import { Toggle } from '@carbon/react'`"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
types:
- created
env:
ESM_NAME: "@ugandaemr/esm-primary-navigation-app"
JS_NAME: "esm-ugandaemr-primary-navigation-app.js"
ESM_NAME: "@ugandaemr/esm-appointments-app"
JS_NAME: "esm-ugandaemr-appointments-app.js"

jobs:
build:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Requirements

- [ ] This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a [conventional commit](https://o3-dev.docs.openmrs.org/#/getting_started/contributing?id=your-pr-title-should-indicate-the-type-of-change-it-is) label. See existing PR titles for inspiration.
- [ ] My work conforms to the [OpenMRS 3.0 Styleguide](https://om.rs/styleguide) and [design documentation](https://zeroheight.com/23a080e38/p/880723-introduction).
- [ ] My work includes tests or is validated by existing tests.

## Summary
<!-- Please describe what problems your PR addresses. -->

## Screenshots
<!-- Required if you are making UI changes. -->

## Related Issue
<!-- Paste the link to the Jira ticket here if one exists. -->
<!-- https://issues.openmrs.org/browse/O3- -->

## Other
<!-- Anything not covered above -->
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
9 changes: 6 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm test
set -e # die on error

yarn prettier && npx lint-staged
yarn turbo run extract-translations
6 changes: 6 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

set -e # die on error

yarn verify
11 changes: 1 addition & 10 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# directories
.husky/
dist/
node_modules/

# dotfiles and generated
.*
yarn.lock

# by file type
**/*.css
**/*.scss
**/*.md
**/*.json
**/*.yml
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
![Node.js CI](https://github.com/METS-Programme/esm-ugandaemr-template-app/workflows/Node.js%20CI/badge.svg)

# UgandaEMR Template app
# UgandaEMR Appointments app

![Landing page screenshot](./src/assets/images/screen.png)

A starter template ESM for UgandaEMR inspired by https://github.com/openmrs/openmrs-esm-template-app.

You can use this repo as a template to spawn new frontend modules for UgandaEMR.

The current setup works best for setting up polyrepos. To adapt the template for a monorepo setup, you'll need to make the following changes:

- Add a `packages` directory inside of `src`.

101 changes: 101 additions & 0 deletions __mocks__/active-visits.mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
export const mockServiceData = [
{
uuid: "176052c7-5fd4-4b33-89cc-7bae6848c65a",
display: "Clinical consultation",
},
{ uuid: "d80ff12a-06a7-11ed-b939-0242ac120002", display: "Triage" },
];

export const mockVisitQueueEntries = [
{
uuid: "fa1e98f1-f002-4174-9e55-34d60951e710",
visit: {
uuid: "c90386ff-ae85-45cc-8a01-25852099c5ae",
display: "Facility Visit @ Outpatient Clinic - 04/03/2022 07:22",
},
queueEntry: {
uuid: "712289ab-32c0-430f-87b6-d9c1e4e4686e",
display: "Eric Test Ric",
priorityComment: "Needs Triage",
sortWeight: 0,
startedAt: "2022-03-04T09:50:54.000+0000",
endedAt: null,
queue: {
uuid: "6a97bd65-3a9a-4fab-ae8f-be59dd4ddd87",
display: "Triage",
name: "Triage",
description: "Queue for patients waiting for triage",
service: {
display: "Triage",
},
},
status: {
uuid: "aaec62b1-4b03-4166-ada7-230cb4b4aaaa",
display: "Waiting",
links: [
{
rel: "self",
uri: "http://openmrs:8080/openmrs/ws/rest/v1/concept/aaec62b1-4b03-4166-ada7-230cb4b4aaaa",
},
],
},
patient: {
uuid: "cc75ad73-c24b-499c-8db9-a7ef4fc0b36d",
display: "10000F1 - Eric Test Ric",
person: {
age: "32",
gender: "F",
},
},
priority: {
uuid: "f9684018-a4d3-4d6f-9dd5-b4b1e89af3e7",
display: "Not Urgent",
},
locationWaitingFor: null,
providerWaitingFor: null,
},
},
{
uuid: "2f85d611-5bb9-4bca-b6f8-661517df86c9",
visit: {
uuid: "6b3e233d-2b44-40ca-b0c8-c5a57a8c51b6",
display: "Home Visit @ Outpatient Clinic - 09/03/2022 21:08",
},
queueEntry: {
uuid: "5f017eb0-b035-4acd-b284-da45f5067502",
display: "John Smith",
priorityComment: "Needs immediate assistance",
sortWeight: 0,
startedAt: "2022-03-09T13:50:54.000+0000",
endedAt: null,
queue: {
uuid: "c187d78b-5c54-49bf-a0f8-b7fb6034d36d",
display: "Clinical Consultation",
name: "Clinical Consultation",
description:
"A queue for patients for a clincal consultation i.e. Doctor, Clinician",
service: {
display: "Clinical Consultation",
},
},
status: {
uuid: "aaec62b1-4b03-4166-ada7-230cb4b4aaaa",
display: "Waiting",
},
patient: {
uuid: "53568469-f652-470d-95e8-13131914286b",
display: "10000JT - John Smith",
person: {
age: "27",
gender: "M",
},
},
priority: {
uuid: "b6a84ad0-c5e6-4a37-896e-5b7a0bccfd6c",
display: "Emergency",
},
locationWaitingFor: null,
providerWaitingFor: null,
},
},
];
8 changes: 8 additions & 0 deletions __mocks__/address.mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const mockAddress = {
postalCode: "12345",
address1: "123 Main St",
cityVillage: "City",
stateProvince: "State",
country: "Country",
preferred: true,
};
Loading

0 comments on commit 0d5bfaa

Please sign in to comment.