Skip to content

Commit

Permalink
Merge pull request #10420 from ohcnetwork/staging
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak authored Feb 5, 2025
2 parents 84a33f5 + 525dac8 commit 8858f50
Show file tree
Hide file tree
Showing 883 changed files with 60,061 additions and 273,687 deletions.
6 changes: 6 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ General Guidelines

- Care uses TanStack Query for data fetching from the API along with query and mutate utilities for the queryFn and mutationFn. (Docs @ /Utils/request/README.md)
- APIs are defined in the api.tsx file.
- Use raviger for routing.
- Add and reuse proper translations for the components in the en.json file.

# Testing Guidelines

For Cypress testing guidelines, refer to cypress/docs/*.md
6 changes: 5 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ ESLINT_NO_DEV_ERRORS=true
CARE_CDN_URL="https://egov-s3-facility-10bedicu.s3.amazonaws.com https://egov-s3-patient-data-10bedicu.s3.amazonaws.com http://localhost:4566"
REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn"

REACT_ENABLED_APPS=""
# Remote apps
# Localhost : ohcnetwork/care_scribe_fe@localhost:4173
# Remote URL : ohcnetwork/care_scribe_fe@https://care-scribe-fe.pages.dev
# Repo/Github Pages : ohcnetwork/care_scribe_fe
REACT_ENABLED_APPS=""
94 changes: 0 additions & 94 deletions .eslintrc.json

This file was deleted.

19 changes: 7 additions & 12 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ REACT_GITHUB_URL=
# OHCN URL (default: https://ohc.network?ref=care)
REACT_OHCN_URL=

# Plausible site domain (default: care.ohc.network)
REACT_PLAUSIBLE_SITE_DOMAIN=

# Plausible server URL (default: https://plausible.ohc.network)
REACT_PLAUSIBLE_SERVER_URL=

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

Expand Down Expand Up @@ -53,11 +47,6 @@ REACT_SENTRY_DSN=
# Sentry environment (default: staging)
REACT_SENTRY_ENVIRONMENT=

# KASP settings
REACT_KASP_ENABLED=true
REACT_KASP_STRING=KASP
REACT_KASP_FULL_STRING=Karunya Arogya Suraksha Padhathi

# Sample format file paths
REACT_SAMPLE_FORMAT_ASSET_IMPORT=/asset-import-template.xlsx

Expand All @@ -78,5 +67,11 @@ REACT_JWT_TOKEN_REFRESH_INTERVAL=
# Minimum encounter date (default: 2020-01-01)
REACT_MIN_ENCOUNTER_DATE=

# Default Encounter Type (default: "hh" - Home Health)
REACT_DEFAULT_ENCOUNTER_TYPE=

# Available languages to switch between (2 Digit language code seperated by comas. See src->Locale->config.ts for available codes)
REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn"
REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn"

# ISO 3166-1 Alpha-2 code for the default country code (default: "IN")
REACT_DEFAULT_COUNTRY=
9 changes: 5 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
version: 2
updates:
- package-ecosystem: "yarn"
- package-ecosystem: npm
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 0
allow:
- dependency-name: "*"
dependency-type: "production"
assignees:
- "tomahawk_pilot"
labels:
- "yarn"
- "dependencies"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
assignees:
open-pull-requests-limit: 0
assignees:
- "tomahawk_pilot"
labels:
- "ci"
- "dependencies"
- "dependencies"
4 changes: 2 additions & 2 deletions .github/workflows/auto-testing-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ on:

jobs:
auto_label:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm

steps:
- name: Check PR Conditions and Add Label
id: check_conditions
uses: actions/github-script@v5
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: javascript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
4 changes: 2 additions & 2 deletions .github/workflows/combine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ permissions:

jobs:
combine-prs:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm

steps:
- name: Combine dependencies
id: combine-dependencies
uses: github/combine-prs@v5.0.0
uses: github/combine-prs@v5.2.0
with:
pr_title: Combined dependencies # The title of the pull request to create
select_label: dependencies # The label which marks PRs that should be combined.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/comment-p1-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
jobs:
add-comment:
if: github.event.label.name == 'P1' && github.repository == 'ohcnetwork/care_fe'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
permissions:
issues: write
steps:
- name: Add comment
uses: actions/github-script@v6.3.3
uses: actions/github-script@v7
with:
script: |
const body = ':warning: **Refrain from assigning this issue to yourself if you have another `P1` issue assigned that is not yet closed.**'
Expand Down
64 changes: 8 additions & 56 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,55 +11,17 @@ jobs:
cypress-run:
permissions: write-all
if: github.repository == 'ohcnetwork/care_fe'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4]
containers: [1]
env:
REACT_CARE_API_URL: http://localhost:9000
REACT_ENABLED_APPS: "ohcnetwork/care_hcx_fe@main,ohcnetwork/care_abdm_fe@main"
REACT_ENABLE_HCX: true
REACT_ENABLE_ABDM: true
REACT_CARE_API_URL: https://careapi.ohc.network

steps:
- name: Checkout 📥
uses: actions/checkout@v3

- name: Set backend branch
id: backend-branch
run: |
if [[ '${{ github.event.pull_request.base.ref }}' == 'staging' ]]; then
echo "branch=staging" >> $GITHUB_OUTPUT
else
echo "branch=develop" >> $GITHUB_OUTPUT
fi
- name: Checkout care 📥
uses: actions/checkout@v3
with:
repository: ohcnetwork/care
path: care
ref: ${{ steps.backend-branch.outputs.branch }}

- name: Start care docker containers 🐳
run: |
cd care
echo DISABLE_RATELIMIT=True >> docker/.prebuilt.env
echo "CORS_ALLOWED_ORIGINS=\"[\\\"http://localhost:4000\\\"]\"" >> docker/.prebuilt.env
echo JWKS_BASE64=\"$(cat ../.github/runner-files/jwks.b64.txt)\" >> docker/.prebuilt.env
make docker_config_file=docker-compose.pre-built.yaml up
make docker_config_file=docker-compose.pre-built.yaml load-dummy-data
cd ..
env:
JWKS_BASE64: ${{ secrets.JWKS_BASE64 }}

- name: Wait for care to be up ♻
uses: nick-fields/retry@v2
with:
timeout_minutes: 1
max_attempts: 5
command: curl -o /dev/null -s -w "%{http_code}\n" http://localhost:9000
on_retry_command: sleep 5
uses: actions/checkout@v4

- name: Determine PR Origin
id: pr_origin
Expand All @@ -71,17 +33,11 @@ jobs:
node-version: "22.11.0"

- name: Install dependencies 📦
run: npm run install-all
run: npm ci

- name: Build ⚙️
run: npm run build

- name: Install Specific Chrome Version
run: |
sudo apt-get install -y wget
sudo wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt-get install ./google-chrome-stable_current_amd64.deb
- name: Cypress run for Non-Forked PRs 🥬
if: steps.pr_origin.outputs.is_forked == 'false'
uses: cypress-io/github-action@v5
Expand All @@ -91,10 +47,8 @@ jobs:
start: "npx vite preview --host"
wait-on: "http://localhost:4000"
wait-on-timeout: 300
browser: chrome
record: true
parallel: true
group: "UI-Chrome"
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -111,10 +65,8 @@ jobs:
start: "npx vite preview --host"
wait-on: "http://localhost:4000"
wait-on-timeout: 300
browser: chrome
record: true
parallel: true
group: "UI-Chrome"
env:
CYPRESS_SPLIT_TESTS: "true"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -125,14 +77,14 @@ jobs:
SPLIT_INDEX: ${{ strategy.job-index }}

- name: Upload cypress screenshots on failure 📸
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots

- name: Upload cypress videos 📹
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ failure() && steps.pr_origin.outputs.is_forked == 'true' }}
with:
name: cypress-videos
Expand Down
Loading

0 comments on commit 8858f50

Please sign in to comment.