Skip to content

Commit

Permalink
Merge branch 'coronasafe:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
siddnikh authored May 22, 2022
2 parents d452a48 + 8e781b0 commit 1195279
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/Components/Common/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export const SideBar: React.FC<SideBarProps> = ({ isOpen, setIsOpen }) => {
<Link
key={item.title}
href={item.link}
onClick={() => isMobile && setIsOpen(false)}
className={clsx(
"flex justify-items-start items-center overflow-hidden w-10 py-1 my-1 hover:bg-primary-700 hover:text-white rounded transition-all duration-300",
active === item.link.replaceAll("/", "")
Expand Down Expand Up @@ -204,6 +205,7 @@ export const SideBar: React.FC<SideBarProps> = ({ isOpen, setIsOpen }) => {
href={process.env.REACT_APP_DASHBOARD_URL}
target="_blank"
rel="noreferrer"
onClick={() => isMobile && setIsOpen(false)}
className={clsx(
"flex justify-items-start items-center overflow-hidden w-10 py-1 my-1 hover:bg-primary-700 hover:text-white rounded transition-all duration-300 text-primary-300",
expanded && "w-60"
Expand Down
20 changes: 19 additions & 1 deletion src/Components/Facility/Investigations/Reports/ReportTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import {
Typography,
Box,
Button,
Grid,
} from "@material-ui/core";
import { createStyles, makeStyles, withStyles } from "@material-ui/styles";
import React from "react";
import { getColorIndex, rowColor, transformData } from "./utils";
import { InvestigationResponse } from "./types";
import moment from "moment";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const useStyle = makeStyles((theme: Theme) => ({
tableCell: {
fontSize: "1.1rem",
Expand Down Expand Up @@ -45,6 +47,7 @@ const useStyle = makeStyles((theme: Theme) => ({
},
}));

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const StyledTableRow = withStyles((theme: Theme) =>
createStyles({
root: {
Expand Down Expand Up @@ -74,6 +77,7 @@ const ReportRow = ({ data, name, min, max }: any) => {
});
return (
<TableCell
key={d?.value}
className={className.tableCell}
align="center"
style={{
Expand Down Expand Up @@ -105,12 +109,18 @@ const ReportRow = ({ data, name, min, max }: any) => {

interface ReportTableProps {
title: string;
patientDetails: {
name: string;
age: number;
hospitalName: string;
};
investigationData: InvestigationResponse;
}

const ReportTable: React.FC<ReportTableProps> = ({
title,
investigationData,
patientDetails,
}) => {
const className = useStyle();
const { data, sessions } = transformData(investigationData);
Expand Down Expand Up @@ -142,6 +152,15 @@ const ReportTable: React.FC<ReportTableProps> = ({
</Typography>
)}
<br />
<Grid container spacing={2}>
<Grid item xs={12} sm={6}>
<p>Name: {patientDetails.name}</p>

<p>Age: {patientDetails.age}</p>
<p>Hospital: {patientDetails.hospitalName}</p>
</Grid>
</Grid>
<br />
<div className="my-4">
<span className="inline-block bg-yellow-200 py-1 m-1 px-6 rounded-full text-yellow-900 font-medium">
Below Ideal
Expand Down Expand Up @@ -204,7 +223,6 @@ const ReportTable: React.FC<ReportTableProps> = ({
min={t.investigation_object.min_value}
max={t.investigation_object.max_value}
name={t.investigation_object.name}
onChange={(e: { target: { value: any } }) => {}}
/>
);
})
Expand Down
21 changes: 17 additions & 4 deletions src/Components/Facility/Investigations/Reports/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ const InvestigationReports = ({ id }: any) => {
const [sessionPage, setSessionPage] = useState(1);
const [isNextSessionDisabled, setIsNextSessionDisabled] = useState(false);
const [isLoadMoreDisabled, setIsLoadMoreDisabled] = useState(false);
const [patientName, setPatientName] = useState("");
const [patientDetails, setPatientDetails] = useState<{
name: string;
age: number;
hospitalName: string;
}>({ name: "", age: -1, hospitalName: "" });
const [state, dispatch] = useReducer(
investigationReportsReducer,
initialState
Expand Down Expand Up @@ -219,10 +223,18 @@ const InvestigationReports = ({ id }: any) => {
if (id) {
const res = await dispatchAction(getPatient({ id: id }));
if (res.data) {
setPatientName(res.data.name);
setPatientDetails({
name: res.data.name,
age: res.data.age,
hospitalName: res.data.facility_object.name,
});
}
} else {
setPatientName("");
setPatientDetails({
name: "",
age: -1,
hospitalName: "",
});
}
}
fetchPatientName();
Expand Down Expand Up @@ -324,7 +336,7 @@ const InvestigationReports = ({ id }: any) => {
title={"Investigation Reports"}
crumbsReplacements={{
patient: { style: "pointer-events-none" },
[id]: { name: patientName },
[id]: { name: patientDetails.name },
}}
/>
{!isLoading.investigationGroupLoading ? (
Expand Down Expand Up @@ -442,6 +454,7 @@ const InvestigationReports = ({ id }: any) => {
<ReportTable
investigationData={investigationTableData}
title="Report"
patientDetails={patientDetails}
/>

{!!isLoading.tableData && (
Expand Down
1 change: 1 addition & 0 deletions src/Locale/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export const LANGUAGE_NAMES: { [key: string]: any } = {
ta: "தமிழ்",
ml: "മലയാളം",
mr: "मराठी",
kn: "ಕನ್ನಡ",
};
5 changes: 4 additions & 1 deletion src/Locale/en/Common.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"District": "District",
"Local Body": "Local Body",
"Location": "Location",
"Ward": "Ward"
"Ward": "Ward",
"Notice Board": "Notice Board",
"Assets": "Assets",
"Notifications": "Notifications"
}
33 changes: 33 additions & 0 deletions src/Locale/kn/Auth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"username": "ಬಳಕೆದಾರ ಹೆಸರು",
"password": "ಪಾಸ್ವರ್ಡ್",
"new_password": "ಹೊಸ ಪಾಸ್ವರ್ಡ್",
"confirm_password": "ಪಾಸ್ವರ್ಡ್ ದೃಢೀಕರಿಸಿ",
"first_name": "ಮೊದಲ ಹೆಸರು",
"last_name": "ಕೊನೆಯ ಹೆಸರು",
"email": "ಇಮೇಲ್ ವಿಳಾಸ",
"phone_number": "ದೂರವಾಣಿ ಸಂಖ್ಯೆ",
"district": "ಜಿಲ್ಲೆ",
"gender": "ಲಿಂಗ",
"age": "ವಯಸ್ಸು",
"login": "ಲಾಗಿನ್",
"field_required": "ಈ ಜಾಗ ಬೇಕಾಗಿದೆ",
"password_mismatch": "ಪಾಸ್ವರ್ಡ್ ಮತ್ತು ದೃಢೀಕರಣ ಪಾಸ್ವರ್ಡ್ ಒಂದೇ ಆಗಿರಬೇಕು.",
"enter_valid_age": "ದಯವಿಟ್ಟು ಮಾನ್ಯವಾದ ವಯಸ್ಸನ್ನು ನಮೂದಿಸಿ",
"invalid_username": "ಅಗತ್ಯವಿದೆ. 150 ಅಕ್ಷರಗಳು ಅಥವಾ ಕಡಿಮೆ. ಅಕ್ಷರಗಳು, ಅಂಕೆಗಳು ಮತ್ತು @/./+/-/_ ಮಾತ್ರ.",
"invalid_password": "ಪಾಸ್ವರ್ಡ್ ಅವಶ್ಯಕತೆಗಳನ್ನು ಪೂರೈಸುವುದಿಲ್ಲ",
"invalid_email": "ದಯವಿಟ್ಟು ಸರಿಯಾದ ಇಮೇಲ್ ವಿಳಾಸವನ್ನು ನಮೂದಿಸಿ",
"invalid_phone": "ದಯವಿಟ್ಟು ಮಾನ್ಯವಾದ ಫೋನ್ ಸಂಖ್ಯೆಯನ್ನು ನಮೂದಿಸಿ",
"register_hospital": "ಆಸ್ಪತ್ರೆಯನ್ನು ನೋಂದಾಯಿಸಿ",
"register_page_title": "ಆಸ್ಪತ್ರೆ ನಿರ್ವಾಹಕರಾಗಿ ನೋಂದಾಯಿಸಿ",
"auth_login_title": "ಅಧಿಕೃತ ಲಾಗಿನ್",
"forget_password": "ಪಾಸ್ವರ್ಡ್ ಮರೆತಿರಾ?",
"forget_password_instruction": "ನಿಮ್ಮ ಬಳಕೆದಾರ ಹೆಸರನ್ನು ನಮೂದಿಸಿ ಮತ್ತು ನಿಮ್ಮ ಪಾಸ್‌ವರ್ಡ್ ಅನ್ನು ಮರುಹೊಂದಿಸಲು ನಾವು ನಿಮಗೆ ಲಿಂಕ್ ಅನ್ನು ಕಳುಹಿಸುತ್ತೇವೆ.",
"send_reset_link": "ಮರುಹೊಂದಿಸುವ ಲಿಂಕ್ ಕಳುಹಿಸಿ",
"already_a_member": "ಈಗಾಗಲೇ ಸದಸ್ಯರೇ?",
"password_sent": "ಪಾಸ್ವರ್ಡ್ ಮರುಹೊಂದಿಸುವ ಇಮೇಲ್ ಕಳುಹಿಸಲಾಗಿದೆ",
"password_reset_success": "ಪಾಸ್ವರ್ಡ್ ಅನ್ನು ಯಶಸ್ವಿಯಾಗಿ ಮರುಹೊಂದಿಸಲಾಗಿದೆ",
"password_reset_failure": "ಪಾಸ್ವರ್ಡ್ ಮರುಹೊಂದಿಸಲು ವಿಫಲವಾಗಿದೆ",
"reset_password": "ಪಾಸ್ವರ್ಡ್ ಮರುಹೊಂದಿಸಿ",
"sign_out": "ಸೈನ್ ಔಟ್ ಮಾಡಿ"
}
18 changes: 18 additions & 0 deletions src/Locale/kn/Common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"coronasafe_network": "ಕೊರೊನಾಸೇಫ್ ನೆಟ್‌ವರ್ಕ್",
"goal": "ಸಾಮರ್ಥ್ಯ ಮೀರಿದ ಓವರ್‌ಲೋಡ್‌ನಿಂದ ಆರೋಗ್ಯ ವ್ಯವಸ್ಥೆಯನ್ನು ರಕ್ಷಿಸುವುದು ನಮ್ಮ ಗುರಿಯಾಗಿದೆ.",
"something_wrong": "ಏನೋ ತಪ್ಪಾಗಿದೆ! ನಂತರ ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ!",
"contribute_github": "GitHub ನಲ್ಲಿ ಕೊಡುಗೆ ನೀಡಿ",
"footer_body": "ಕೊರೊನಾಸೇಫ್ ನೆಟ್‌ವರ್ಕ್ ಎಂಬುದು ತೆರೆದ ಮೂಲ ಸಾರ್ವಜನಿಕ ಉಪಯುಕ್ತತೆಯಾಗಿದ್ದು, ನಾವೀನ್ಯಕಾರರು ಮತ್ತು ಸ್ವಯಂಸೇವಕರ ಬಹು-ಶಿಸ್ತಿನ ತಂಡದಿಂದ ವಿನ್ಯಾಸಗೊಳಿಸಲಾಗಿದೆ. ಕರೋನಾ ಸೇಫ್ ಕೇರ್ ವಿಶ್ವಸಂಸ್ಥೆಯಿಂದ ಗುರುತಿಸಲ್ಪಟ್ಟ ಡಿಜಿಟಲ್ ಸಾರ್ವಜನಿಕ ಸೇವೆಯಾಗಿದೆ.",
"reset": "ಮರುಹೊಂದಿಸಿ",
"downloads": "ಡೌನ್‌ಲೋಡ್‌ಗಳು",
"download_type": "ಡೌನ್‌ಲೋಡ್ ಪ್ರಕಾರ",
"State": "ರಾಜ್ಯ",
"District": "ಜಿಲ್ಲೆ",
"Local Body": "ಸ್ಥಳೀಯ ಸಂಸ್ಥೆ",
"Location": "ಸ್ಥಳ",
"Ward": "ವಾರ್ಡ್",
"Notice Board": "ಸೂಚನಾ ಫಲಕ",
"Assets": "ಸ್ವತ್ತುಗಳು",
"Notifications": "ಅಧಿಸೂಚನೆಗಳು"
}
11 changes: 11 additions & 0 deletions src/Locale/kn/Entities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"Facilities": "ಸೌಲಭ್ಯಗಳು",
"Patients": "ರೋಗಿಗಳು",
"Sample Test": "ಮಾದರಿ ಪರೀಕ್ಷೆ",
"Shifting": "ಸ್ಥಳಾಂತರ",
"Resource": "ಸಂಪನ್ಮೂಲ",
"External Results": "ಬಾಹ್ಯ ಫಲಿತಾಂಶಗಳು",
"Users": "ಬಳಕೆದಾರರು",
"Profile": "ಪ್ರೊಫೈಲ್",
"Dashboard": "ಡ್ಯಾಶ್‌ಬೋರ್ಡ್"
}
10 changes: 10 additions & 0 deletions src/Locale/kn/Facility.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"facility_search_placeholder": "ಸೌಲಭ್ಯ / ಜಿಲ್ಲೆಯ ಹೆಸರಿನ ಮೂಲಕ ಹುಡುಕಿ",
"advanced_filters": "ಸುಧಾರಿತ ಫಿಲ್ಟರ್‌ಗಳು",
"Facility Type": "ಸೌಲಭ್ಯದ ಪ್ರಕಾರ",
"KASP Empanelled": "ಕೆಎಎಸ್ಪಿ ಎಂಪನೇಲ್ಡ್",
"View Facility": "ವೀಕ್ಷಣೆ ಸೌಲಭ್ಯ",
"no_duplicate_facility": "ನೀವು ನಕಲಿ ಸೌಲಭ್ಯಗಳನ್ನು ರಚಿಸಬಾರದು",
"no_facilities": "ಯಾವುದೇ ಸೌಲಭ್ಯಗಳು ಕಂಡುಬಂದಿಲ್ಲ",
"create_facility": "ಹೊಸ ಸೌಲಭ್ಯವನ್ನು ರಚಿಸಿ"
}
11 changes: 11 additions & 0 deletions src/Locale/kn/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Auth from "./Auth.json";
import Common from "./Common.json";
import Entities from "./Entities.json";
import Facility from "./Facility.json";

export default {
...Auth,
...Common,
...Entities,
...Facility,
};
5 changes: 4 additions & 1 deletion src/Locale/ml/Common.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"District": "ജില്ല",
"Local Body": "തദ്ദേശസ്ഥാപനം",
"Location": "സ്ഥാനം",
"Ward": "വാര്‍ഡ്‌"
"Ward": "വാര്‍ഡ്‌",
"Notice Board": "നോട്ടീസ് ബോർഡ്",
"Assets": "ആസ്തികൾ",
"Notifications": "അറിയിപ്പുകൾ"
}
5 changes: 4 additions & 1 deletion src/Locale/mr/Common.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"District": "जिल्हा",
"Local Body": "स्थानिक संस्था",
"Location": "स्थान",
"Ward": "वॉर्ड"
"Ward": "वॉर्ड",
"Notice Board": "सूचना फलक",
"Assets": "मालमत्ता",
"Notifications": "अधिसूचना"
}
5 changes: 4 additions & 1 deletion src/Locale/ta/Common.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"District": "மாவட்டம்",
"Local Body": "உள்ளாட்சி மன்றம்",
"Location": "இடம்",
"Ward": "தொகுதி"
"Ward": "தொகுதி",
"Notice Board": "அறிவிப்பு பலகை",
"Assets": "சொத்துக்கள்",
"Notifications": "அறிவிப்புகள்"
}
1 change: 1 addition & 0 deletions src/Router/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ const menus = [
const AppRouter = () => {
useRedirect("/", "/facility");
useRedirect("/teleicu", "/teleicu/facility");
useRedirect("/user", "/users");
const pages = useRoutes(routes);
const path = usePath();
const [isSidebarOpen, setIsSidebarOpen] = useState(false);
Expand Down
2 changes: 2 additions & 0 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import en from "./Locale/en";
import ta from "./Locale/ta";
import ml from "./Locale/ml";
import mr from "./Locale/mr";
import kn from "./Locale/kn";

const resources = {
en: { translation: en },
ta: { translation: ta },
ml: { translation: ml },
mr: { translation: mr },
kn: { translation: kn },
};

i18n
Expand Down

0 comments on commit 1195279

Please sign in to comment.