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

WIP: Care Plugin Support #8660

Merged
merged 48 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
1833bf8
Plugs WIP
gigincg Sep 29, 2024
21214fc
Merge branch 'develop' into plugs
gigincg Sep 29, 2024
31035c4
Enforce Node.js version 20 and update package.json
gigincg Sep 29, 2024
b62840e
Rewrite types for all Routes
gigincg Sep 29, 2024
03da7d4
Add onSave tailwindcss ordering
gigincg Sep 30, 2024
c890524
Fix Plugin Nav; Other fixes
gigincg Sep 30, 2024
82ece77
Pre-Plug
gigincg Sep 30, 2024
a00a6ba
Fix Vite Config
gigincg Oct 1, 2024
186f736
Update package-lock
gigincg Oct 1, 2024
6cef8a4
Updates: Plugin Systems
gigincg Oct 1, 2024
d13ca5a
Merge branch 'develop' into plugs
nihal467 Oct 1, 2024
7281ff1
Merge branch 'develop' into plugs
gigincg Oct 3, 2024
646c691
Add Workspaces; Add local mode; Clear livekit dependencies
gigincg Oct 8, 2024
26b9725
Merge branch 'plugs' of github.com:coronasafe/care_fe into plugs
gigincg Oct 8, 2024
e4c2e81
Fix package-lock
gigincg Oct 8, 2024
42d9bb9
Merge branch 'develop' into plugs
gigincg Oct 8, 2024
68f40c4
Merge branch 'develop' into plugs
gigincg Oct 8, 2024
2ac8670
Add preinstall script for plugins; Reduce redundant code
gigincg Oct 9, 2024
6284724
Test: Add Duplicate npm i
gigincg Oct 9, 2024
ea82d88
Attempt to fix Plugin Builds
gigincg Oct 9, 2024
5df965d
Build Updates
gigincg Oct 9, 2024
b67c990
Move to DigitalOcean Backend
gigincg Oct 11, 2024
006b2a8
Cleanup Plugins
gigincg Oct 11, 2024
7de8701
Linting
gigincg Oct 11, 2024
dfb5b6b
Cleanup AppRouter
gigincg Oct 11, 2024
52e3f71
Switch to DO Backend; Expand cursorRules
gigincg Oct 11, 2024
4c9a2bd
Purge useConfig
gigincg Oct 12, 2024
abb7241
Clear Testing Aftermath in SidebarItem
gigincg Oct 12, 2024
d84ea85
Refactor Icons Implementation
gigincg Oct 12, 2024
cd6db91
Rename HospitalList to FacilityList
gigincg Oct 12, 2024
61314f5
Merge branch 'develop' into plugs
gigincg Oct 12, 2024
a50ea01
Add a types for LegendInput
gigincg Oct 12, 2024
957b9e4
i18n User Profile
gigincg Oct 13, 2024
1447913
Merge branch 'develop' into plugs
nihal467 Oct 14, 2024
b6f6f69
update lockfile
rithviknishad Oct 14, 2024
8c4a7be
Clear unintented config for scribe
gigincg Oct 14, 2024
b8139f5
Add care- to className for icons
gigincg Oct 14, 2024
54e9f9a
modified the map icon identifier for cypress
nihal467 Oct 14, 2024
e0e46d0
fix tailwindcss class order
rithviknishad Oct 14, 2024
24b3e8b
Trigger Build
khavinshankar Oct 15, 2024
633231d
Solved merge conflicts
shivankacker Oct 15, 2024
0f1248b
Add setup to README
gigincg Oct 15, 2024
9b185c0
update lockfile again....
rithviknishad Oct 15, 2024
82b0923
Merge branch 'develop' into plugs
rithviknishad Oct 15, 2024
de02a13
switched to using envs instead of json config. Updated package pullin…
shivankacker Oct 16, 2024
60874ae
updated vulnerable code
shivankacker Oct 16, 2024
e37f9af
update readme to include the new install command
shivankacker Oct 16, 2024
05bc74c
Merge branch 'develop' into plugs
gigincg Oct 16, 2024
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
23 changes: 23 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Care is a React Typescript Project, built with Vite and styled with TailwindCSS.

Care uses a Plugin Architecture. Apps are installed in /apps.

Care uses a custom useQuery hook to fetch data from the API. APIs are defined in the api.tsx file

Here's an example of how to use the useQuery hook to fetch data from the API:

```
useQuery from "@/Common/hooks/useQuery";
const { data, loading, error } = useQuery(routes.getFacilityUsers, {
facility_id: "1",
});

request from "@/Common/utils/request";
const { res } = await request(routes.partialUpdateAsset, {
pathParams: { external_id: assetId },
body: data,
});
```



2 changes: 2 additions & 0 deletions .env.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Care API URL without the /api prefix
REACT_CARE_API_URL=http://localhost:9000
2 changes: 2 additions & 0 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ REACT_PLAUSIBLE_SITE_DOMAIN=
# Plausible server URL (default: https://plausible.10bedicu.in)
REACT_PLAUSIBLE_SERVER_URL=

# Care Apps. repo@branch seperated by commas
REACT_ENABLED_APPS="ohcnetwork/care_livekit_fe@main,ohcnetwork/care_scribe"

# Main logo (JSON string with light and dark properties)
REACT_HEADER_LOGO=
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ bun.lockb
# Cypress
cypress/downloads
cypress/fixtures/token.json

# Care Apps
/apps/*
src/pluginMap.ts
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
gigincg marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 3 additions & 4 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"semi": true,
"jsxSingleQuote": false,
"arrowParens": "always",
"tailwindFunctions": [
"classNames"
]
}
"tailwindFunctions": ["classNames"],
gigincg marked this conversation as resolved.
Show resolved Hide resolved
"plugins": ["prettier-plugin-tailwindcss"]
}
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@
</a>
<p align="center"><b>Our goal is to continuously improve the quality and accessibility of public healthcare services using digital tools.</b></p>
<h2></h2>
<h3 align="center"><a href="https://care.ohc.network" target="_blank">🚀 Staging Deploy</a></h3>
<p align="center"><img src="https://api.netlify.com/api/v1/badges/fd123f42-ef65-448c-9b03-39959d60e60b/deploy-status"></p>
<h3 align="center"><a href="https://care.ohc.network" target="_blank">🚀 Staging Deployment</a></h3>
<center>

[![Netlify Status](https://api.netlify.com/api/v1/badges/de76351f-b1f0-4bf8-8445-d9faf6391b13/deploy-status)](https://app.netlify.com/sites/care-ohc/deploys)

</center>
<p align="center">Auto deployed to <a href="https://care.ohc.network/">care.ohc.network</a> for <code>develop</code> branch. All pull requests have preview builds powered by <a href="https://netlify.com">Netlify</a>.</p>

[![](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/images/0)](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/links/0)[![](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/images/1)](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/links/1)[![](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/images/2)](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/links/2)[![](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/images/3)](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/links/3)[![](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/images/4)](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/links/4)[![](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/images/5)](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/links/5)[![](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/images/6)](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/links/6)[![](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/images/7)](https://sourcerer.io/fame/tomahawk-pilot/ohcnetwork/care_fe/links/7)

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=coronasafe_care_fe&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=coronasafe_care_fe)
![Code scanning - action](https://github.com/ohcnetwork/care_fe/workflows/Code%20scanning%20-%20action/badge.svg)
![OSSAR](https://github.com/ohcnetwork/care_fe/workflows/OSSAR/badge.svg)
[![Cypress Tests](https://img.shields.io/endpoint?url=https://cloud.cypress.io/badge/simple/wf7d2m/develop&style=flat&logo=cypress)](https://cloud.cypress.io/projects/wf7d2m/runs)
![Staging Release](https://github.com/ohcnetwork/care_fe/workflows/CARE%20Develop%20Registry/badge.svg)
![Production Release](https://github.com/ohcnetwork/care_fe/workflows/Production%20Release/badge.svg)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/200482ab117e4b5397ff3f5ae5719aa2)](https://www.codacy.com/gh/ohcnetwork/care_fe?utm_source=github.com&utm_medium=referral&utm_content=ohcnetwork/care_fe&utm_campaign=Badge_Grade)
[![CircleCI](https://circleci.com/gh/ohcnetwork/care_fe.svg?style=svg)](https://circleci.com/gh/ohcnetwork/care_fe)
[![Maintainability](https://api.codeclimate.com/v1/badges/f1438f693aa459805301/maintainability)](https://codeclimate.com/github/ohcnetwork/care_fe/maintainability)

## Getting started
Expand All @@ -33,7 +35,14 @@
#### Install the required dependencies

```sh
npm install
npm run install-all
```
#### First-time setup

For first-time setup, run the following command to generate the pluginMap and install plugin configurations:

```sh
npm run setup
```

#### 🏃 Run the app in development mode
Expand Down
7 changes: 7 additions & 0 deletions care.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ const careConfig = {
abdm: {
enabled: (env.REACT_ENABLE_ABDM ?? "true") === "true",
},

careApps: env.REACT_ENABLED_APPS
? env.REACT_ENABLED_APPS.split(",").map((app) => ({
branch: app.split("@")[1],
package: app.split("@")[0],
}))
: [],
} as const;

export default careConfig;
2 changes: 1 addition & 1 deletion cypress/e2e/users_spec/UsersHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("User Homepage", () => {
const altPhoneNumber = "8878825662";
const homeFacility = "Dummy Facility 40";
const nurseUserName = "dummynurse1";
const doctorUserName = "devdoctor";
const doctorUserName = "devdoctor1";

before(() => {
loginPage.loginAsDisctrictAdmin();
Expand Down
2 changes: 1 addition & 1 deletion cypress/pageobject/Facility/FacilityCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class FacilityPage {

selectLocation(location: string) {
cy.intercept("https://maps.googleapis.com/**").as("mapApi");
cy.get("span > svg.care-svg-icon__baseline.care-l-map-marker").click();
cy.get("#facility-location-button").click();
cy.wait("@mapApi").its("response.statusCode").should("eq", 200);
cy.get("input#pac-input").type(location).type("{enter}");
cy.wait(2000);
Expand Down
Loading
Loading