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

Merge Develop To Staging v24.50.0 #9299

Merged
merged 26 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6bea49a
updated crowdin.yml file (#9211)
Tanuj1718 Nov 28, 2024
fa5fa25
Fix: Breadcrumbs redirection to patient edit consultation form (#8985)
shauryag2002 Nov 28, 2024
fc2ac3b
Fixes PR thank you msg. from potentially tagging the PR author twice …
JavidSumra Nov 28, 2024
c407120
Implemented Next and Previous button for files preview (#9196)
sarvesh-official Nov 29, 2024
7c9751d
Fix: Date of Birth to Year of Birth on Patient Details Page when DOB …
AdityaJ2305 Nov 29, 2024
2a89332
Update cursorrules
bodhish Nov 29, 2024
c58de17
fixing back button for camera asset (#9246)
SwanandBhuskute Nov 29, 2024
59cc025
Rewriting UsersCreation.cy.ts according to POM approach (#8930)
AnveshNalimela Nov 30, 2024
7d56fdc
Fixed Breadcrumb to Display Detailed Name Instead of ID (#9200)
rayyjeb Nov 30, 2024
f2a9698
Fix : Advanced Filters Autofilling on Revisit to Patient Tab (#9251)
Mahendar0701 Nov 30, 2024
66326dd
Add edit button to immunisation section; replaced buttons with shadcn…
DonXavierdev Nov 30, 2024
8118ccf
phone size responsive issue shifting details page (#9256)
ayushpatil2122 Nov 30, 2024
f76c625
Fix: Reflect Updated Service Notes Immediately in Asset Details witho…
Rishith25 Dec 1, 2024
2d9669e
Camera Preset Not Resetting on Re-selection Bug (#9186)
Jacobjeevan Dec 2, 2024
1868edd
Update Sample File Upload and upgrade buttons to Shadcn button (#9157)
nithish1018 Dec 3, 2024
59a584d
Referral letter preview desktop (#8954)
modamaan Dec 3, 2024
724813b
Tooltip added for treating docter skills in Patient details page (#9254)
Mahendar0701 Dec 3, 2024
4442eb0
Bump @radix-ui/react-icons from 1.3.1 to 1.3.2 (#9127)
dependabot[bot] Dec 3, 2024
931b42a
Bump @radix-ui/react-tooltip from 1.1.3 to 1.1.4 (#9098)
dependabot[bot] Dec 3, 2024
663b400
Bump @sentry/browser from 8.37.1 to 8.42.0 (#9280)
dependabot[bot] Dec 3, 2024
076ecd4
Updated Non-Core Question Workflow (#9220)
tellmeY18 Dec 4, 2024
8b16710
Enable ABDM plug in cypress env (#9288)
nihal467 Dec 4, 2024
9561e0d
Refactored User Login Workflow in cypress (#9285)
nihal467 Dec 4, 2024
577f7ec
Partially revert lockfile changes from #9285 (#9295)
rithviknishad Dec 4, 2024
7c37aab
Bump tailwind-merge from 2.5.4 to 2.5.5 (#9293)
dependabot[bot] Dec 4, 2024
a57480c
Bump cypress from 13.15.2 to 13.16.0 (#9292)
dependabot[bot] Dec 4, 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
42 changes: 27 additions & 15 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
Care is a React Typescript Project, built with Vite and styled with TailwindCSS.
You are an expert in TypeScript, React, Shadcn UI, Tailwind.

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

Care uses a custom useQuery hook to fetch data from the API. APIs are defined in the api.tsx file
- Write concise, technical TypeScript code with accurate examples.
- Use functional and declarative programming patterns; avoid classes.
- Prefer iteration and modularization over code duplication.
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).

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

```
useQuery from "@/common/hooks/useQuery";
const { data, loading, error } = useQuery(routes.getFacilityUsers, {
facility_id: "1",
});
- Use lowercase with dashes for directories (e.g., components/auth-wizard).
- Favor named exports for components.

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

- Use TypeScript for all code; prefer interfaces over types.
- Avoid enums; use maps instead.
- Use functional components with TypeScript interfaces.

Syntax and Formatting

- Use the "function" keyword for pure functions.
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
- Use declarative JSX.

UI and Styling

- Use Shadcn UI, Radix, and Tailwind for components and styling.
- Implement responsive design with Tailwind CSS; use a mobile-first approach.

General Guidelines

- Care uses a custom useQuery hook to fetch data from the API. (Docs @ /Utils/request/useQuery)
- APIs are defined in the api.tsx file.
5 changes: 3 additions & 2 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ jobs:
containers: [1, 2, 3, 4]
env:
REACT_CARE_API_URL: http://localhost:9000
REACT_ENABLED_APPS: "ohcnetwork/care_hcx_fe@main"
REACT_ENABLED_APPS: "ohcnetwork/care_hcx_fe@main,ohcnetwork/care_abdm_fe@main"
REACT_ENABLE_HCX: true
REACT_ENABLE_ABDM: true
steps:
- name: Checkout 📥
uses: actions/checkout@v3
Expand Down Expand Up @@ -135,4 +136,4 @@ jobs:
if: ${{ failure() && steps.pr_origin.outputs.is_forked == 'true' }}
with:
name: cypress-videos
path: cypress/videos
path: cypress/videos
95 changes: 48 additions & 47 deletions .github/workflows/notify-non-core-qn.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
name: Notify Core Team on Non-Core Questions

on:
issue_comment:
types: [created]

permissions:
issues: write
pull-requests: write

jobs:
notify_core_team:
runs-on: ubuntu-latest
env:
ALLOWED_USERNAMES: ${{ vars.ALLOWED_USERNAMES }}
QUESTION_KEYWORDS: ${{ vars.QUESTION_KEYWORDS }}
QUESTION_LABELS: ${{ vars.QUESTION_LABELS }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
ALLOWED_USERNAMES: ${{ vars.ALLOWED_USERNAMES || '' }}
QUESTION_KEYWORDS: ${{ vars.QUESTION_KEYWORDS || '' }}
QUESTION_LABELS: ${{ vars.QUESTION_LABELS || '' }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK || '' }}

steps:
- name: Check and Notify
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
console.log('Script started');
const isOrgMember = (commenter, allowedUsers) => {
return allowedUsers.split(',').map(u => u.trim()).includes(commenter);
};
const containsQuestionKeywords = (text, keywords) => {
return keywords.split(',').map(k => k.trim()).some(keyword =>
const isOrgMember = (commenter, allowedUsers) =>
allowedUsers.split(',').map(u => u.trim()).includes(commenter);

const containsQuestionKeywords = (text, keywords) =>
keywords.split(',').map(k => k.trim()).some(keyword =>
text.toLowerCase().includes(keyword.toLowerCase())
);
};

const addLabelsToIssue = async (github, context, labelsString) => {
const labels = labelsString.split(',').map(label => label.trim()).filter(label => label);
const labels = labelsString.split(',').map(label => label.trim()).filter(Boolean);
if (labels.length > 0) {
console.log('Adding labels:', labels);
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -40,48 +42,47 @@ jobs:
});
}
};
const sendSlackNotification = async (webhook, payload) => {

const sendSlackNotification = async (webhook, commentUrl) => {
const payload = { commentUrl };
const response = await fetch(webhook, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
throw new Error(`Slack notification failed with status: ${response.status}`);
}
};

const isBot = async (github, commenter) => {
try {
const { data: user } = await github.rest.users.getByUsername({ username: commenter });
return user.type === 'Bot';
} catch {
return false;
}
};

const commenter = context.payload.comment.user.login;
console.log('Commenter:', commenter);
if (!isOrgMember(commenter, process.env.ALLOWED_USERNAMES)) {
const commentBody = context.payload.comment.body;
const sanitizedComment = commentBody
?.replace(/[^\w\s?]/gi, '')
.toLowerCase();
console.log('Comment body:', sanitizedComment);
if (containsQuestionKeywords(sanitizedComment, process.env.QUESTION_KEYWORDS)) {
try {
console.log('Adding labels to the issue');
await addLabelsToIssue(github, context, process.env.QUESTION_LABELS);
console.log('Labels added successfully');
const issueUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/issues/${context.payload.issue.number}`;
const issueTitle = context.payload.issue.title;
const issueNumber = context.payload.issue.number;
console.log('Issue URL:', issueUrl);
console.log('Issue Title:', issueTitle);
console.log('Issue Number:', issueNumber);
const payload = {
link: issueUrl,
Question: commentBody,
"issue-number": issueNumber,
title: issueTitle,
user: commenter
};
await sendSlackNotification(process.env.SLACK_WEBHOOK, payload);
console.log('Slack notification sent successfully');
} catch (error) {
console.error('Workflow failed:', error.message);
core.setFailed(`Workflow failed: ${error.message}`);
const allowedUsers = process.env.ALLOWED_USERNAMES;
const keywords = process.env.QUESTION_KEYWORDS;
const labels = process.env.QUESTION_LABELS;
const webhook = process.env.SLACK_WEBHOOK;

if (await isBot(github, commenter)) return;

if (allowedUsers && !isOrgMember(commenter, allowedUsers)) {
const commentBody = context.payload.comment.body.trim();
const filteredCommentBody = commentBody.split('\n').filter(line => !line.startsWith('>')).join('\n');

if (keywords && containsQuestionKeywords(filteredCommentBody, keywords)) {
if (labels) {
await addLabelsToIssue(github, context, labels);
}
if (webhook) {
const commentUrl = context.payload.comment.html_url;
await sendSlackNotification(webhook, commentUrl);
}
}
}
console.log('Script ended');
26 changes: 10 additions & 16 deletions .github/workflows/thank-you.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,20 @@ jobs:
uses: actions/[email protected]
with:
script: |
const thankyouNote = 'Your efforts have helped advance digital healthcare and TeleICU systems. :rocket: Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! :raised_hands:'
const thankyouNote = 'Your efforts have helped advance digital healthcare and TeleICU systems. :rocket: Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! :raised_hands:';
const options = {
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
}
};

const result = await github.rest.issues.get({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
})

const { assignees, user } = result.data
const { data : { assignees, user } } = await github.rest.issues.get(options);

const assignees_tagged = assignees.map((user) => '@' + user.login).join(' ')
const owner_tagged = '@' + user.login
const taggedUsers = [...new Set(
assignees.map(u => "@"+u.login).concat("@"+user.login)
)].join(" ")

if (assignees.length == 0) {
await github.rest.issues.createComment({ ...options, body: `${owner_tagged} ${thankyouNote}` })
} else {
await github.rest.issues.createComment({ ...options, body: `${assignees_tagged} ${owner_tagged} ${thankyouNote}` })
}
await github.rest.issues.createComment({
...options,
body: `${taggedUsers} ${thankyouNote}`
});
5 changes: 3 additions & 2 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
files:
- source: /src/Locale/en/*.json
translation: /src/Locale/%two_letters_code%/%original_file_name%
- source: /public/locale/{{lang}}.json
translation: /public/locale/%two_letters_code%/%original_file_name%
bundles:
- 2

Loading
Loading