Skip to content

Commit 4a8b3d9

Browse files
committed
Merge branch 'develop' into care-connect
2 parents d9a4a4f + 5836840 commit 4a8b3d9

File tree

83 files changed

+2946
-1040
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2946
-1040
lines changed

.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ REACT_APP_COVER_IMAGE=https://cdn.coronasafe.network/care_logo.svg
66
REACT_APP_COVER_IMAGE_ALT=https://cdn.coronasafe.network/care_logo.svg
77

88
# Dev envs
9-
ESLINT_NO_DEV_ERRORS=true
9+
ESLINT_NO_DEV_ERRORS=true

.github/workflows/codeql-analysis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
CodeQL-Build:
1111
runs-on: ubuntu-latest
12+
if: github.repository == 'coronasafe/care_fe'
1213
permissions:
1314
security-events: write
1415
actions: read

.github/workflows/comment-p1-issues.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
add-comment:
10-
if: github.event.label.name == 'P1'
10+
if: github.event.label.name == 'P1' && github.repository == 'coronasafe/care_fe'
1111
runs-on: ubuntu-latest
1212
permissions:
1313
issues: write

.github/workflows/cypress.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111

1212
jobs:
1313
cypress-run:
14+
if: github.repository == 'coronasafe/care_fe'
1415
runs-on: ubuntu-latest
1516
steps:
1617
- name: Checkout 📥

.github/workflows/deploy.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ env:
2121

2222
jobs:
2323
test:
24+
if: github.repository == 'coronasafe/care_fe'
2425
runs-on: ubuntu-latest
2526
name: Test
2627
steps:

.github/workflows/issue-automation.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
issue_opened_and_reopened:
1111
name: issue_opened_and_reopened
1212
runs-on: ubuntu-latest
13-
if: github.event_name == 'issues' && github.event.action == 'opened' || github.event.action == 'reopened'
13+
if: github.repository == 'coronasafe/care_fe' && github.event_name == 'issues' && github.event.action == 'opened' || github.event.action == 'reopened'
1414
steps:
1515
- name: 'Move issue to "Triage"'
1616
uses: leonsteinhaeuser/[email protected]
@@ -23,7 +23,7 @@ jobs:
2323
issue_closed:
2424
name: issue_closed
2525
runs-on: ubuntu-latest
26-
if: github.event_name == 'issues' && github.event.action == 'closed'
26+
if: github.repository == 'coronasafe/care_fe' && github.event_name == 'issues' && github.event.action == 'closed'
2727
steps:
2828
- name: 'Moved issue to "Done"'
2929
uses: leonsteinhaeuser/[email protected]
@@ -36,7 +36,7 @@ jobs:
3636
issue_assigned:
3737
name: issue_assigned
3838
runs-on: ubuntu-latest
39-
if: github.event_name == 'issues' && github.event.action == 'assigned'
39+
if: github.repository == 'coronasafe/care_fe' && github.event_name == 'issues' && github.event.action == 'assigned'
4040
steps:
4141
- name: 'Move issue to "In Progress"'
4242
uses: leonsteinhaeuser/[email protected]

.github/workflows/label-deploy-failed.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
auto-label-deploy-failed:
1414
runs-on: ubuntu-latest
1515
if: |
16-
github.event.issue.pull_request &&
16+
github.repository == 'coronasafe/care_fe' && github.event.issue.pull_request &&
1717
contains(github.event.comment.body, 'Deploy Preview')
1818
steps:
1919
- name: Add 'Deploy-Failed'

.github/workflows/label-merge-conflict.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212

1313
jobs:
1414
auto-label:
15+
if: github.repository == 'coronasafe/care_fe'
1516
runs-on: ubuntu-latest
1617
steps:
1718
- uses: prince-chrismc/label-merge-conflicts-action@v2

.github/workflows/label-wip.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
jobs:
1111
check-linked-issues:
12+
if: github.repository == 'coronasafe/care_fe'
1213
name: Check linked issues
1314
runs-on: ubuntu-latest
1415
outputs:
@@ -28,7 +29,7 @@ jobs:
2829
runs-on: ubuntu-latest
2930
needs: check-linked-issues
3031
permissions: write-all
31-
if: join(needs.check-linked-issues.outputs.linked_issues) != ''
32+
if: github.repository == 'coronasafe/care_fe' && 'join(needs.check-linked-issues.outputs.linked_issues) != ''
3233
steps:
3334
- name: Label
3435
uses: actions/github-script@v6

.github/workflows/ossar-analysis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
jobs:
1111
OSSAR-Scan:
12+
if: github.repository == 'coronasafe/care_fe'
1213
# OSSAR runs on windows-latest.
1314
# ubuntu-latest and macos-latest support coming soon
1415
runs-on: windows-latest

.github/workflows/stale.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
jobs:
77
stale:
88
runs-on: ubuntu-latest
9+
if: github.repository == 'coronasafe/care_fe'
910
steps:
1011
- uses: actions/stale@v6
1112
with:

package-lock.json

-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"@livekit/react-components": "^1.1.0",
4040
"@loadable/component": "^5.15.0",
4141
"@material-ui/core": "^4.11.4",
42-
"@material-ui/icons": "^4.11.2",
4342
"@material-ui/lab": "^4.0.0-alpha.58",
4443
"@material-ui/pickers": "^3.3.10",
4544
"@material-ui/styles": "^4.11.4",

src/CAREUI/display/Count.tsx

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import CareIcon from "../icons/CareIcon";
2+
3+
export default function CountBlock(props: {
4+
count: number;
5+
text: string;
6+
loading: boolean;
7+
icon: string;
8+
color?: string;
9+
containerClass?: string;
10+
}) {
11+
const {
12+
count,
13+
text,
14+
loading,
15+
icon,
16+
color = "primary",
17+
containerClass,
18+
} = props;
19+
20+
return (
21+
<div className={"rounded-lg p-4 shadow flex-1 bg-white " + containerClass}>
22+
<dl className="">
23+
<div
24+
className={`flex items-center justify-center rounded-lg text-xl w-10 h-10 bg-${color}-100`}
25+
>
26+
<CareIcon className={`care-l-${icon} text-${color}-600`} />
27+
</div>
28+
<div>
29+
<dt className="text-sm font-semibold text-gray-700 truncate my-2">
30+
{text}
31+
</dt>
32+
{loading ? (
33+
<dd className="rounded-lg w-full max-w-[100px] h-10 bg-gray-300 animate-pulse" />
34+
) : (
35+
<dd className="text-5xl leading-9 font-black">{count}</dd>
36+
)}
37+
</div>
38+
</dl>
39+
</div>
40+
);
41+
}

src/Common/constants.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,20 @@ export const PATIENT_FILTER_ORDER: (OptionsType & { order: string })[] = [
171171
{ id: 4, text: "-modified_date", desc: "Modified Date", order: "Descending" },
172172
{ id: 5, text: "review_time", desc: "Review Time", order: "Ascending" },
173173
{ id: 6, text: "-review_time", desc: "Review Time", order: "Descending" },
174+
{ id: 7, text: "name", desc: "Patient Name", order: "Ascending" },
175+
{ id: 8, text: "-name", desc: "Patient Name", order: "Descending" },
176+
{
177+
id: 7,
178+
text: "facility__name,last_consultation__current_bed__bed__name",
179+
desc: "Bed Number",
180+
order: "Ascending",
181+
},
182+
{
183+
id: 8,
184+
text: "facility__name,-last_consultation__current_bed__bed__name",
185+
desc: "Bed Number",
186+
order: "Descending",
187+
},
174188
];
175189

176190
export const getBedTypes = ({

src/Common/hooks/useAsyncOptions.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ export function useAsyncOptions<T extends Record<string, unknown>>(
5050
if (!selected?.length) return queryOptions;
5151

5252
return [
53-
...queryOptions,
54-
...selected.filter(
55-
(obj) => !queryOptions.some((s) => s[uniqueKey] === obj[uniqueKey])
53+
...selected,
54+
...queryOptions.filter(
55+
(option) => !selected.find((s) => s[uniqueKey] === option[uniqueKey])
5656
),
5757
];
5858
};

src/Common/hooks/useConfig.ts

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ export interface IConfig {
4949
* URL of the sample format for external result import.
5050
*/
5151
sample_format_external_result_import: string;
52+
/**
53+
* Env to enable HCX features
54+
*/
55+
enable_hcx: boolean;
5256
}
5357

5458
const useConfig = () => {
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { useEffect } from "react";
2+
3+
type onMessage = (data: any) => void;
4+
5+
export const useMessageListener = (onMessage: onMessage) => {
6+
useEffect(() => {
7+
const handleMessage = (e: MessageEvent) => {
8+
onMessage(e.data);
9+
};
10+
navigator.serviceWorker.addEventListener("message", handleMessage);
11+
12+
return () => {
13+
navigator.serviceWorker.removeEventListener("message", handleMessage);
14+
};
15+
});
16+
};

src/Components/Assets/AssetFilter.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ function AssetFilter(props: any) {
113113
const handleFacilitySelect = (selected: FacilityModel) => {
114114
setFacility(selected ? selected : { name: "" });
115115
};
116-
const handleLocationSelect = (selected: AssetLocationObject) => {
117-
setLocation(selected ? selected : initialLocation);
116+
const handleLocationSelect = (selectedId: string) => {
117+
setLocationId(selectedId);
118118
};
119119

120120
return (
@@ -149,10 +149,10 @@ function AssetFilter(props: any) {
149149
<FieldLabel className="text-sm">Location</FieldLabel>
150150
<LocationSelect
151151
name="Facilities"
152-
setSelected={(selected) =>
153-
handleLocationSelect(selected as AssetLocationObject)
152+
setSelected={(selectedId) =>
153+
handleLocationSelect((selectedId as string) || "")
154154
}
155-
selected={location}
155+
selected={location.id}
156156
errors=""
157157
showAll={false}
158158
multiple={false}

0 commit comments

Comments
 (0)