From b2f849ec71587c540bc582b8eb48a5f3b801da1b Mon Sep 17 00:00:00 2001 From: syam Date: Fri, 19 Jun 2020 11:48:46 +0530 Subject: [PATCH 01/25] minor change as per suggestion. to have a fixed legend --- src/Components/Patient/SampleTest.tsx | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/Components/Patient/SampleTest.tsx b/src/Components/Patient/SampleTest.tsx index fae914e34a7..637533aee0d 100644 --- a/src/Components/Patient/SampleTest.tsx +++ b/src/Components/Patient/SampleTest.tsx @@ -10,12 +10,8 @@ import { CheckboxField, MultilineInputField, SelectField, TextInputField } from import { Loading } from "../Common/Loading"; import PageTitle from "../Common/PageTitle"; import { SampleTestModel } from "./models"; - -import ExpansionPanel from '@material-ui/core/ExpansionPanel'; -import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary'; -import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails'; import Typography from '@material-ui/core/Typography'; -import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; +import Container from "@material-ui/core/Container"; import color = Mocha.reporters.Base.color; const sampleTestTypes = [...SAMPLE_TYPE_CHOICES]; @@ -223,16 +219,9 @@ export const SampleTest = (props: any) => { />
+ + Reference below to know more about ICMR Categories - - } - aria-controls="panel1a-content" - id="panel1a-header" - > - ICMR Categories - -
  • Cat 0 - Repeat Sample of Positive Case / Follow Up case @@ -253,11 +242,10 @@ export const SampleTest = (props: any) => { Cat 5a - Asymptomatic Direct and High Risk contact of confirmed case - family Member
  • - Cat 5b - Asymptomatic Healthcare worker in contact with confimred case without adequete protection + Cat 5b - Asymptomatic Healthcare worker in contact with confirmed case without adequate protection
  • -
    -
    +
    Date: Fri, 19 Jun 2020 13:04:20 +0530 Subject: [PATCH 02/25] Code Cleanup --- src/Components/Auth/ForgetPassword.tsx | 12 +- src/Components/Auth/Login.tsx | 28 +- src/Components/Common/AppMessage.tsx | 64 ----- src/Components/Common/DashboardStatsCard.tsx | 40 --- src/Components/Common/Header.tsx | 251 ------------------ src/Components/Common/HospitalView.tsx | 60 ----- src/Components/Common/Loader.tsx | 38 --- src/Components/Common/Modal.tsx | 39 --- src/Components/Common/StatsCard.tsx | 22 -- src/Components/Common/Stepper.tsx | 126 --------- src/Components/Common/TitleHeader.tsx | 38 --- src/Components/Common/VirtualizedTable.tsx | 23 +- src/Components/Dashboard/PrivateDashboard.tsx | 12 - src/Components/Patient/ManagePatients.tsx | 2 +- src/Components/Patient/PatientFilter.tsx | 17 -- src/Components/Patient/SampleDetails.tsx | 2 +- src/Components/Patient/SamplePreview.tsx | 2 +- src/Components/Patient/SampleTestCard.tsx | 2 +- src/Components/Patient/SampleViewAdmin.tsx | 2 +- src/Components/Users/ManageUsers.tsx | 2 +- src/Router/AppRouter.tsx | 6 +- 21 files changed, 15 insertions(+), 773 deletions(-) delete mode 100644 src/Components/Common/AppMessage.tsx delete mode 100644 src/Components/Common/DashboardStatsCard.tsx delete mode 100644 src/Components/Common/Header.tsx delete mode 100644 src/Components/Common/HospitalView.tsx delete mode 100644 src/Components/Common/Loader.tsx delete mode 100644 src/Components/Common/Modal.tsx delete mode 100644 src/Components/Common/StatsCard.tsx delete mode 100644 src/Components/Common/Stepper.tsx delete mode 100644 src/Components/Common/TitleHeader.tsx delete mode 100644 src/Components/Dashboard/PrivateDashboard.tsx diff --git a/src/Components/Auth/ForgetPassword.tsx b/src/Components/Auth/ForgetPassword.tsx index b8937113b41..1702e9182ba 100644 --- a/src/Components/Auth/ForgetPassword.tsx +++ b/src/Components/Auth/ForgetPassword.tsx @@ -1,21 +1,13 @@ -import { Button, Card, CardActions, CardContent, CardHeader, Grid } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; +import { Button, CardActions, CardContent } from '@material-ui/core'; import { A } from 'hookrouter'; -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { useDispatch } from 'react-redux'; import { postForgotPassword } from '../../Redux/actions'; import { TextInputField } from '../Common/HelperInputFields'; import * as Notification from "../../Utils/Notifications.js"; import { Loading } from "../Common/Loading"; -const useStyles = makeStyles(theme => ({ - formTop: { - marginTop: '100px', - }, -})); - export const ForgotPassword = () => { - const classes = useStyles(); const dispatch: any = useDispatch(); const initForm: any = { username: '', diff --git a/src/Components/Auth/Login.tsx b/src/Components/Auth/Login.tsx index e1b17f4e9ad..12b1239ed97 100644 --- a/src/Components/Auth/Login.tsx +++ b/src/Components/Auth/Login.tsx @@ -1,41 +1,19 @@ import React, { useState } from "react"; import { useDispatch } from "react-redux"; import { postLogin } from "../../Redux/actions"; -import { A, navigate } from "hookrouter"; -import { makeStyles } from "@material-ui/styles"; +import { navigate } from "hookrouter"; import { - Box, - Button, - Card, CardActions, CardContent, - CardHeader, - Grid, TextField + Grid } from "@material-ui/core"; import { TextInputField } from "../Common/HelperInputFields"; import { get } from "lodash"; import { PublicDashboard } from "../Dashboard/PublicDashboard"; import ReCaptcha from "react-google-recaptcha"; -const useStyles = makeStyles(theme => ({ - formTop: { - marginTop: "100px" - }, - pdLogo: { - height: "345px", - border: "solid 3px white" - }, - logoImg: { - objectFit: "contain", - height: "8rem" - }, - imgSection: { - paddingBottom: "45px" - } -})); - export const Login = () => { - const classes = useStyles(); + const dispatch: any = useDispatch(); const initForm: any = { username: "", diff --git a/src/Components/Common/AppMessage.tsx b/src/Components/Common/AppMessage.tsx deleted file mode 100644 index 81832fb8bbd..00000000000 --- a/src/Components/Common/AppMessage.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import React from 'react'; -import { Snackbar, IconButton } from '@material-ui/core'; -import CloseIcon from '@material-ui/icons/Close'; -import { makeStyles, Theme } from '@material-ui/core/styles'; - -const useStyles = makeStyles((theme: Theme) => ({ - root: { - 'width': '100%', - 'z-index': '1203', - '& > * + *': { - marginTop: theme.spacing(2), - backgroundColor: 'ghostwhite' - } - } - } -)); - -interface AppMessageProps { - open: boolean; - type: string; - message: string; - handleClose: () => void; - handleDialogClose: () => void; -} - -const AppMessage = (props: AppMessageProps) => { - const { open, type, message, handleClose, handleDialogClose } = props; - const classes = useStyles(); - - if(type === 'success'){ - return ( -
    - -
    - ) - } else{ - return ( -
    - - - - - - } - /> -
    - ) - } -}; - -export default AppMessage; \ No newline at end of file diff --git a/src/Components/Common/DashboardStatsCard.tsx b/src/Components/Common/DashboardStatsCard.tsx deleted file mode 100644 index a7ee9b6229f..00000000000 --- a/src/Components/Common/DashboardStatsCard.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import React from 'react'; -import { makeStyles } from '@material-ui/core/styles'; -import Card from '@material-ui/core/Card'; -import Typography from '@material-ui/core/Typography'; -import { blue } from '@material-ui/core/colors'; -import CardContent from '@material-ui/core/CardContent'; - -const useStyles = makeStyles(theme => ({ - card: { - height: 90, - width: 300, - }, - valueField:{ - color: blue['500'], - fontWeight:'bold' - } -})); -interface DashboardStatsCardProps { - title: string; - value: number; -} -export const DashboardStatsCard = (props: DashboardStatsCardProps) => { - const { title , value } = props; - const classes = useStyles(); - return ( - - - - {title} - - - {' '} - - - {value} - - - - ); -}; diff --git a/src/Components/Common/Header.tsx b/src/Components/Common/Header.tsx deleted file mode 100644 index be93067f5f0..00000000000 --- a/src/Components/Common/Header.tsx +++ /dev/null @@ -1,251 +0,0 @@ -import { - AppBar, - Button, - Drawer, - Grid, - Hidden, - IconButton, - List, - ListItem, - ListItemText, - Menu, - MenuItem, - Toolbar, - Typography -} from "@material-ui/core"; -import MenuIcon from "@material-ui/icons/Menu"; -import { makeStyles } from "@material-ui/styles"; -import { navigate, usePath, A } from "hookrouter"; -import React, { useEffect, useState } from "react"; -import { useDispatch, useSelector } from "react-redux"; -import DonutLargeIcon from "@material-ui/icons/DonutLarge"; -import DashboardIcon from "@material-ui/icons/Dashboard"; -import { get } from "lodash"; -import PersonIcon from "@material-ui/icons/Person"; -import InboxIcon from "@material-ui/icons/Inbox"; -import ListAltIcon from "@material-ui/icons/ListAlt"; -import SettingsIcon from "@material-ui/icons/Settings"; -import WorkIcon from "@material-ui/icons/Work"; -import TimeToLeaveIcon from "@material-ui/icons/TimeToLeave"; -import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown"; -import LocalHospitalIcon from "@material-ui/icons/LocalHospital"; -import CancelIcon from "@material-ui/icons/Cancel"; -const img = - "https://cdn.coronasafe.network/black-logo.svg"; -const drawerWidth = 240; -const useStyles = makeStyles({ - flexGrow: { - flexGrow: 1 - }, - rightAlign: { - float: "right" - }, - drawer: { - width: drawerWidth, - flexShrink: 0 - }, - drawerPaper: { - width: drawerWidth - }, - noDecoration: { - textDecoration: "none" - } -}); -const Header = () => { - const classes = useStyles(); - const dispatch: any = useDispatch(); - const state: any = useSelector(state => state); - const { currentUser } = state; - const [drawer, setDrawer] = useState(false); - const path = usePath(); - const url = path.split("/"); - const toggleDrawer = () => { - setDrawer(!drawer); - }; - - let menus = [ - { - title: "Facilities", - link: "/facility", - icon: - }, - { - title: 'Patients / Suspects', - link: '/patients', - icon: - }, - { - title: "Ambulances", - link: "/ambulance", - icon: - }, - // { - // title: "Sample Test", - // link: "/sample", - // icon: - // }, - { - title: "Users", - link: "/users", - icon: - } - ]; - const loginUser = `${get(currentUser, "data.first_name", "")} ${get( - currentUser, - "data.last_name", - "" - )}`; - const sideBar = ( -
    -
    - - care logo - -
    -
    - {menus.map(item => { - const parts = item.link.split("/"); - const selectedClasses = url.includes(parts && parts[1]) - ? "border-b bg-gray-200 border-grey-500 inline-flex items-center justify-start whitespace-no-wrap font-semibold cursor-pointer hover:bg-gray-300 w-full px-4 py-4 " - : "border-b border-grey-300 inline-flex items-center justify-start whitespace-no-wrap font-semibold cursor-pointer hover:bg-gray-300 w-full px-4 py-4 "; - return ( - - ); - })} -
    -
    - - {loginUser} -
    -
    { - localStorage.removeItem("care_access_token"); - localStorage.removeItem("care_refresh_token"); - navigate("/login"); - window.location.reload(); - }} - > - - Logout -
    -
    -
    -
    - ); - const [anchorEl, setAnchorEl] = React.useState(null); - - const handleClick = (event: any) => { - setAnchorEl(event.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; - - const headerSection = () => { - return ( -
    -
    - - - - - - care logo - - -
    - - - { - localStorage.removeItem("care_access_token"); - localStorage.removeItem("care_refresh_token"); - navigate("/login"); - window.location.reload(); - }} - > - Logout - - -
    -
    -
    - ); - }; - - return ( -
    - {headerSection()} - - - {sideBar} - - -
    -
    {sideBar}
    -
    -
    - ); -}; - -export default Header; diff --git a/src/Components/Common/HospitalView.tsx b/src/Components/Common/HospitalView.tsx deleted file mode 100644 index 85c3bae056d..00000000000 --- a/src/Components/Common/HospitalView.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import React from 'react' -import { makeStyles } from '@material-ui/core/styles'; -import Card from '@material-ui/core/Card'; -import CardActions from '@material-ui/core/CardActions'; -import CardContent from '@material-ui/core/CardContent'; -import Button from '@material-ui/core/Button'; -import Typography from '@material-ui/core/Typography'; -import PhoneIcon from '@material-ui/icons/Phone'; -import LocationCityIcon from '@material-ui/icons/LocationCity'; -import LocationOnIcon from '@material-ui/icons/LocationOn'; -import LocalHospitalIcon from '@material-ui/icons/LocalHospital'; -const useStyles = makeStyles({ - root: { - minWidth: 200, - width: 350, - background: "#54f9ff", - margin: "auto", - border: "5px", - transition: "0.3s", - boxShadow: "0 8px 40px -12px rgba(0,0,0,0.3)", - "&:hover": { - boxShadow: "0 16px 70px -12.125px rgba(0,0,0,0.3)", - }, - }, - title: { - fontSize: 14, - }, - pos: { - marginBottom: 12, - }, - }); -interface HospitalViewProps { - name: string; - addr: string; - phone: string; - district: string; -} -export const HospitalView = (props: HospitalViewProps) => { - const classes = useStyles(); - return ( - - - - {props.name} - -
    - - Address: {props.addr} -
    - Phone: {props.phone} -
    - District: {props.district} -
    -
    - - - -
    - ) -} diff --git a/src/Components/Common/Loader.tsx b/src/Components/Common/Loader.tsx deleted file mode 100644 index 1162246e9be..00000000000 --- a/src/Components/Common/Loader.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import React from 'react'; -import { Modal, CircularProgress } from "@material-ui/core"; -import { makeStyles } from '@material-ui/styles'; - -const useStyles = makeStyles({ - modal:{ - outline:0 - }, - modalContent: { - position: 'absolute', - backgroundColor: 'white', - top: '50%', - left: '50%', - transform: 'translate(-50%, -50%)', - width: 'auto', - padding: '15px', - borderRadius: '5px', - outline:0 - } -}); - -const Loader = (props: { open: boolean; }) => { - const { open } = props; - const classes = useStyles(); - return ( - -
    - -
    -
    - ); -}; - -export default Loader; diff --git a/src/Components/Common/Modal.tsx b/src/Components/Common/Modal.tsx deleted file mode 100644 index e4382777f2b..00000000000 --- a/src/Components/Common/Modal.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import React from 'react'; -import { Modal } from "@material-ui/core"; -import { makeStyles } from '@material-ui/styles'; - -const useStyles = makeStyles({ - modalContent: { - position: 'absolute', - maxWidth: '80%', - // minWidth: '600px', - backgroundColor: 'white', - top: '50%', - left: '50%', - transform: 'translate(-50%, -50%)', - marginBottom: '50px' - } -}); -interface ModalProps { - children: JSX.Element[] | JSX.Element; - open: boolean; - handleClose: () => void; - style: Object; -}; -const ModalComponent = (props: ModalProps) => { - const { children, open, handleClose, style } = props; - const classes = useStyles(); - return ( - -
    - {children} -
    -
    - ); -}; - -export default ModalComponent; diff --git a/src/Components/Common/StatsCard.tsx b/src/Components/Common/StatsCard.tsx deleted file mode 100644 index 282e6db2cc9..00000000000 --- a/src/Components/Common/StatsCard.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; -import { Grid } from '@material-ui/core'; - -interface StatsCardProps { - title: string; - children: JSX.Element[] | JSX.Element -} -const StatsCard = (props: StatsCardProps) => { - const { title } = props; - return ( - -
    -
    -
    {title}
    -
    - {props.children} -
    -
    - ) -}; - -export default StatsCard; \ No newline at end of file diff --git a/src/Components/Common/Stepper.tsx b/src/Components/Common/Stepper.tsx deleted file mode 100644 index 5a4d53f6c17..00000000000 --- a/src/Components/Common/Stepper.tsx +++ /dev/null @@ -1,126 +0,0 @@ -import React from 'react'; -import { navigate } from 'hookrouter'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; -import { - Grid, - List, - ListItem, - ListItemIcon, - Typography -} from '@material-ui/core'; -import '../../App.css'; -import Brightness1Icon from '@material-ui/icons/Brightness1'; - -const useStyles = makeStyles(theme => ({ - root: { - display: 'flex', - }, - listItemContainer: { - width: 100 - }, - activeBorder: { - borderBottomColor: '#FFFFFF', - borderBottomWidth: 4, - borderBottomStyle: 'solid' - }, - inActiveBorder: { - borderBottomColor: '#005D79', - borderBottomWidth: 4, - borderBottomStyle: 'solid', - }, - itemContainer: { - padding: 0 - }, - listItemText: { - color: '#FFFFFF', - fontWeight: 600, - fontSize: 12, - lineHeight: 2, - letterSpacing: 0.4 - }, - activeItemIcon: { - height: 15, - width: 15, - color: '#FFFFFF', - cursor:'pointer' - }, - inActiveItemIcon: { - height: 15, - width: 15, - color: '#005D79' - }, - listIconContainer: { - top: -5, - right: 5, - bottom: 25, - position: 'absolute', - justifyContent: 'flexEnd', - width: 100, - orderTopStyle: 'solid', - borderTopWidth: 1, - }, - lastListIconContainer: { - top: -7, - right: 7, - bottom: 25, - position: 'absolute', - justifyContent: 'flexEnd', - width: 100, - orderTopStyle: 'solid', - borderTopWidth: 1, - }, - listItemTextContainer: { - display: 'flex', - justifyContent: 'center', - position: 'absolute', - width: 100, - right: 45, - paddingTop: 10 - }, - listGridContent: { - flex: 1, - position: 'relative' - } -})); -// Type definitions -type Label = {link: string; name: string;} -interface StepperProps { - labels: Array
    ) -} \ No newline at end of file +} diff --git a/src/Redux/actions.tsx b/src/Redux/actions.tsx index 9a87e818a67..350989eaba4 100644 --- a/src/Redux/actions.tsx +++ b/src/Redux/actions.tsx @@ -22,14 +22,6 @@ export const postForgotPassword = (form: object) => { return fireRequest('forgotPassword', [], form); }; -// Ambulance -export const postAmbulance = (params: object) => { - return fireRequest('createAmbulance', [], params); -}; -export const getAmbulanceList = (params: object) => { - return fireRequest('listAmbulance', [], params); -}; - // Facility export const createFacility = (params: object) => { return fireRequest("createFacility", [], params); diff --git a/src/Redux/api.tsx b/src/Redux/api.tsx index 3ae8714b2b5..220f19d59a2 100644 --- a/src/Redux/api.tsx +++ b/src/Redux/api.tsx @@ -133,15 +133,6 @@ export default { }, // Ambulance - createAmbulance: { - path: '/api/v1/ambulance/create/', - method: 'POST', - noAuth: true, - }, - listAmbulance: { - path: '/api/v1/ambulance', - }, - // Hospital Beds createCapacity: { path: "/api/v1/facility/{facilityId}/capacity/", diff --git a/src/Router/AppRouter.tsx b/src/Router/AppRouter.tsx index 4a0a6f97dca..eedeaa626d4 100644 --- a/src/Router/AppRouter.tsx +++ b/src/Router/AppRouter.tsx @@ -3,7 +3,6 @@ import React, { useState } from "react"; import { navigate, usePath } from "hookrouter"; import { get } from "lodash"; import { useSelector } from "react-redux"; -import AmbulanceList from "../Components/Ambulance/AmbulanceList"; import { BedCapacityForm } from "../Components/Facility/BedCapacityForm"; import { ConsultationDetails } from "../Components/Facility/ConsultationDetails"; import { ConsultationForm } from "../Components/Facility/ConsultationForm"; @@ -26,7 +25,6 @@ import { TeleConsultation } from "../Components/Patient/TeleConsultation"; import { TreatmentForm } from "../Components/Patient/TreatmentForm"; import ManageUsers from "../Components/Users/ManageUsers"; import { UserAdd } from "../Components/Users/UserAdd"; -import AmbulanceOnboarding from "../Components/Ambulance/AmbulanceOnboarding"; import InventoryList from "../Components/Facility/InventoryList"; import InventoryLog from "../Components/Facility/InventoryLog"; import { AddInventoryForm } from "../Components/Facility/AddInventoryForm"; @@ -43,8 +41,6 @@ const routes = { "/": () => , "/users": () => , "/user/add": () => , - "/ambulance": () => , - "/ambulance/add": () => , "/patients": () => , "/patient/:id": ({ id }: any) => , "/patient/tele-consult": () => , From 7ee015595453213ae0a1ee456df84f76e0821ce6 Mon Sep 17 00:00:00 2001 From: syam Date: Fri, 19 Jun 2020 20:34:54 +0530 Subject: [PATCH 06/25] removed material icons --- src/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.html b/src/index.html index c072423b6ba..b34b4ad7e52 100644 --- a/src/index.html +++ b/src/index.html @@ -27,7 +27,6 @@ - From 578d4a2d9320283d818a7f3a49ae545e8191efba Mon Sep 17 00:00:00 2001 From: syam Date: Fri, 19 Jun 2020 21:03:52 +0530 Subject: [PATCH 07/25] minor fixes and Gzip Compression --- package-lock.json | 220 +++++++++++++++++++++++++++++++++++++++ package.json | 17 +-- src/Router/AppRouter.tsx | 3 +- webpack.config.js | 2 + 4 files changed, 232 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc91410639d..538caa22686 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4521,6 +4521,226 @@ } } }, + "compression-webpack-plugin": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/compression-webpack-plugin/-/compression-webpack-plugin-4.0.0.tgz", + "integrity": "sha512-DRoFQNTkQ8gadlk117Y2wxANU+MDY56b1FIZj/yJXucBOTViTHXjthM7G9ocnitksk4kLzt1N2RLF0gDjxI+hg==", + "dev": true, + "requires": { + "cacache": "^15.0.3", + "find-cache-dir": "^3.3.1", + "schema-utils": "^2.6.6", + "serialize-javascript": "^3.0.0", + "webpack-sources": "^1.4.3" + }, + "dependencies": { + "cacache": { + "version": "15.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.0.4.tgz", + "integrity": "sha512-YlnKQqTbD/6iyoJvEY3KJftjrdBYroCbxxYXzhOzsFLWlp6KX4BOlEf4mTx0cMUfVaTS3ENL2QtDWeRYoGLkkw==", + "dev": true, + "requires": { + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^5.1.1", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.0", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + } + }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true + }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "schema-utils": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", + "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.4", + "ajv": "^6.12.2", + "ajv-keywords": "^3.4.1" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "serialize-javascript": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz", + "integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "ssri": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.0.tgz", + "integrity": "sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==", + "dev": true, + "requires": { + "minipass": "^3.1.1" + } + }, + "tar": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.0.2.tgz", + "integrity": "sha512-Glo3jkRtPcvpDlAs/0+hozav78yoXKFr+c4wgw62NNMO3oo4AaJdCo21Uu7lcwr55h39W2XD1LMERc64wtbItg==", + "dev": true, + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.0", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "dependencies": { + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", diff --git a/package.json b/package.json index b0071849131..0e4ebd1235a 100644 --- a/package.json +++ b/package.json @@ -90,16 +90,20 @@ }, "devDependencies": { "@fullhuman/postcss-purgecss": "^2.1.2", + "@testing-library/jest-dom": "^4.2.4", + "@testing-library/react": "^9.4.0", + "@testing-library/user-event": "^7.2.1", + "@types/draft-js": "^0.10.37", + "@types/draftjs-to-html": "^0.8.0", + "@types/html-to-draftjs": "^1.4.0", + "@types/jest": "^24.9.1", "@types/mocha": "^5.2.7", "autoprefixer": "^9.7.6", + "compression-webpack-plugin": "^4.0.0", "concurrently": "^5.1.0", "copy-webpack-plugin": "^6.0.2", "css-loader": "^2.1.1", "cssnano": "^4.1.10", - "@types/draft-js": "^0.10.37", - "@types/draftjs-to-html": "^0.8.0", - "@types/html-to-draftjs": "^1.4.0", - "@types/jest": "^24.9.1", "eslint": "^6.4.0", "eslint-config-airbnb": "^18.0.1", "eslint-config-react-app": "^5.0.2", @@ -110,14 +114,11 @@ "eslint-plugin-react": "7.14.3", "eslint-plugin-react-hooks": "^1.6.1", "http-server": "^0.12.3", - "postcss-cli": "^7.1.0", "jest": "24.9.0", "jest-environment-jsdom-fourteen": "0.1.0", "jest-resolve": "24.9.0", "jest-watch-typeahead": "0.4.0", - "@testing-library/jest-dom": "^4.2.4", - "@testing-library/react": "^9.4.0", - "@testing-library/user-event": "^7.2.1", + "postcss-cli": "^7.1.0", "redux-devtools-extension": "^2.13.8", "source-map-loader": "^0.2.4", "ts-loader": "^6.2.0", diff --git a/src/Router/AppRouter.tsx b/src/Router/AppRouter.tsx index eedeaa626d4..6922737bba1 100644 --- a/src/Router/AppRouter.tsx +++ b/src/Router/AppRouter.tsx @@ -1,6 +1,5 @@ -import { useRedirect, useRoutes } from "hookrouter"; +import { useRedirect, useRoutes, navigate, usePath } from "hookrouter"; import React, { useState } from "react"; -import { navigate, usePath } from "hookrouter"; import { get } from "lodash"; import { useSelector } from "react-redux"; import { BedCapacityForm } from "../Components/Facility/BedCapacityForm"; diff --git a/webpack.config.js b/webpack.config.js index 8c215c12c68..5a8223491be 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,6 +6,7 @@ const { CleanWebpackPlugin } = require("clean-webpack-plugin"); let googleKey = "6LdvxuQUAAAAADDWVflgBqyHGfq-xmvNJaToM0pN"; const CopyPlugin = require("copy-webpack-plugin"); const WorkboxPlugin = require("workbox-webpack-plugin"); +const CompressionPlugin = require('compression-webpack-plugin'); module.exports = (env, argv) => { const mode = argv.mode || "development"; @@ -104,6 +105,7 @@ module.exports = (env, argv) => { }, ], }), + new CompressionPlugin(), new CleanWebpackPlugin(), new HtmlWebpackPlugin({ template: path.resolve(__dirname, "src", "index.html"), From 352996592cff5527ddeb934e6a9dbd0290942339 Mon Sep 17 00:00:00 2001 From: syam Date: Fri, 19 Jun 2020 21:18:44 +0530 Subject: [PATCH 08/25] Terser Webpack --- package-lock.json | 337 ++++++++++++++++++++++++++++++++++++++++------ package.json | 1 + webpack.config.js | 3 + 3 files changed, 299 insertions(+), 42 deletions(-) diff --git a/package-lock.json b/package-lock.json index 538caa22686..58238f6b401 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3995,50 +3995,96 @@ "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" }, "cacache": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz", - "integrity": "sha512-5ZvAxd05HDDU+y9BVvcqYu2LLXmPnQ0hW62h32g4xBTgL/MppR4/04NHfj/ycM2y6lmTnbw6HVi+1eN0Psba6w==", + "version": "15.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.0.4.tgz", + "integrity": "sha512-YlnKQqTbD/6iyoJvEY3KJftjrdBYroCbxxYXzhOzsFLWlp6KX4BOlEf4mTx0cMUfVaTS3ENL2QtDWeRYoGLkkw==", + "dev": true, "requires": { - "chownr": "^1.1.2", - "figgy-pudding": "^3.5.1", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "glob": "^7.1.4", - "graceful-fs": "^4.2.2", "infer-owner": "^1.0.4", "lru-cache": "^5.1.1", - "minipass": "^3.0.0", + "minipass": "^3.1.1", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.2", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "p-map": "^3.0.0", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", "promise-inflight": "^1.0.1", - "rimraf": "^2.7.1", - "ssri": "^7.0.0", + "rimraf": "^3.0.2", + "ssri": "^8.0.0", + "tar": "^6.0.2", "unique-filename": "^1.1.1" }, "dependencies": { + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true + }, "lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, "requires": { "yallist": "^3.0.2" } }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, "p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, "requires": { "aggregate-error": "^3.0.0" } }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "tar": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.0.2.tgz", + "integrity": "sha512-Glo3jkRtPcvpDlAs/0+hozav78yoXKFr+c4wgw62NNMO3oo4AaJdCo21Uu7lcwr55h39W2XD1LMERc64wtbItg==", + "dev": true, + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.0", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "dependencies": { + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true } } }, @@ -13475,6 +13521,31 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" }, + "cacache": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz", + "integrity": "sha512-5ZvAxd05HDDU+y9BVvcqYu2LLXmPnQ0hW62h32g4xBTgL/MppR4/04NHfj/ycM2y6lmTnbw6HVi+1eN0Psba6w==", + "requires": { + "chownr": "^1.1.2", + "figgy-pudding": "^3.5.1", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.2", + "infer-owner": "^1.0.4", + "lru-cache": "^5.1.1", + "minipass": "^3.0.0", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "p-map": "^3.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^2.7.1", + "ssri": "^7.0.0", + "unique-filename": "^1.1.1" + } + }, "clone-deep": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", @@ -13597,6 +13668,21 @@ "schema-utils": "^2.5.0" } }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, "html-webpack-plugin": { "version": "4.0.0-beta.11", "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.11.tgz", @@ -13637,6 +13723,15 @@ "strip-ansi": "^5.0.0" } }, + "jest-worker": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-25.5.0.tgz", + "integrity": "sha512-/dsSmUkIy5EBGfv/IjjqmFxrNAUpBERfGs1oHROyD7yxjG/w+t0GOJDX8O1k32ySmd7+a5IhnJU2qQFcJ4n1vw==", + "requires": { + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + } + }, "jsdom": { "version": "14.1.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-14.1.0.tgz", @@ -13686,6 +13781,30 @@ "strip-bom": "^3.0.0" } }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "requires": { + "semver": "^6.0.0" + } + }, "mini-css-extract-plugin": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz", @@ -13714,6 +13833,35 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -13727,6 +13875,11 @@ "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz", "integrity": "sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ==" }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, "path-type": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", @@ -13740,6 +13893,25 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "requires": { + "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + } + } + }, "postcss-modules-local-by-default": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.2.tgz", @@ -13832,6 +14004,15 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" }, + "ssri": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-7.1.0.tgz", + "integrity": "sha512-77/WrDZUWocK0mvA5NTRQyveUf+wsrIc6vyrxpS8tVvYBcX215QbafrJR3KtkpskIzoFLqqNuuYQvxaMjXJ/0g==", + "requires": { + "figgy-pudding": "^3.5.1", + "minipass": "^3.1.1" + } + }, "string-length": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-length/-/string-length-3.1.0.tgz", @@ -13854,6 +14035,37 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "terser-webpack-plugin": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.4.tgz", + "integrity": "sha512-Nv96Nws2R2nrFOpbzF6IxRDpIkkIfmhvOws+IqMvYdFLO7o6wAILWFKONFgaYy8+T4LVz77DQW0f7wOeDEAjrg==", + "requires": { + "cacache": "^13.0.1", + "find-cache-dir": "^3.2.0", + "jest-worker": "^25.1.0", + "p-limit": "^2.2.2", + "schema-utils": "^2.6.4", + "serialize-javascript": "^2.1.2", + "source-map": "^0.6.1", + "terser": "^4.4.3", + "webpack-sources": "^1.4.3" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, "util.promisify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", @@ -13913,6 +14125,11 @@ "requires": { "async-limiter": "~1.0.0" } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" } } }, @@ -15316,11 +15533,11 @@ } }, "ssri": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-7.1.0.tgz", - "integrity": "sha512-77/WrDZUWocK0mvA5NTRQyveUf+wsrIc6vyrxpS8tVvYBcX215QbafrJR3KtkpskIzoFLqqNuuYQvxaMjXJ/0g==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.0.tgz", + "integrity": "sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==", + "dev": true, "requires": { - "figgy-pudding": "^3.5.1", "minipass": "^3.1.1" } }, @@ -15889,18 +16106,19 @@ } }, "terser-webpack-plugin": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.4.tgz", - "integrity": "sha512-Nv96Nws2R2nrFOpbzF6IxRDpIkkIfmhvOws+IqMvYdFLO7o6wAILWFKONFgaYy8+T4LVz77DQW0f7wOeDEAjrg==", - "requires": { - "cacache": "^13.0.1", - "find-cache-dir": "^3.2.0", - "jest-worker": "^25.1.0", - "p-limit": "^2.2.2", - "schema-utils": "^2.6.4", - "serialize-javascript": "^2.1.2", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-3.0.6.tgz", + "integrity": "sha512-z3HLOOPUHkCNGkeEHqqiMAIy1pjpHwS1o+i6Zn0Ws3EAvHJj46737efNNEvJ0Vx9BdDQM83d56qySDJOSORA0A==", + "dev": true, + "requires": { + "cacache": "^15.0.4", + "find-cache-dir": "^3.3.1", + "jest-worker": "^26.0.0", + "p-limit": "^3.0.1", + "schema-utils": "^2.6.6", + "serialize-javascript": "^4.0.0", "source-map": "^0.6.1", - "terser": "^4.4.3", + "terser": "^4.8.0", "webpack-sources": "^1.4.3" }, "dependencies": { @@ -15908,6 +16126,7 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dev": true, "requires": { "commondir": "^1.0.1", "make-dir": "^3.0.2", @@ -15918,6 +16137,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, "requires": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -15926,12 +16146,14 @@ "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true }, "jest-worker": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-25.5.0.tgz", - "integrity": "sha512-/dsSmUkIy5EBGfv/IjjqmFxrNAUpBERfGs1oHROyD7yxjG/w+t0GOJDX8O1k32ySmd7+a5IhnJU2qQFcJ4n1vw==", + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.0.0.tgz", + "integrity": "sha512-pPaYa2+JnwmiZjK9x7p9BoZht+47ecFCDFA/CJxspHzeDvQcfVBLWzCiWyo+EGrSiQMWZtCFo9iSvMZnAAo8vw==", + "dev": true, "requires": { "merge-stream": "^2.0.0", "supports-color": "^7.0.0" @@ -15941,6 +16163,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, "requires": { "p-locate": "^4.1.0" } @@ -15949,14 +16172,16 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, "requires": { "semver": "^6.0.0" } }, "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.1.tgz", + "integrity": "sha512-mw/p92EyOzl2MhauKodw54Rx5ZK4624rNfgNaBguFZkHzyUG9WsDzFF5/yQVEJinbJDdP4jEfMN+uBquiGnaLg==", + "dev": true, "requires": { "p-try": "^2.0.0" } @@ -15965,24 +16190,39 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, "requires": { "p-limit": "^2.2.0" + }, + "dependencies": { + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + } } }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true }, "pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, "requires": { "find-up": "^4.0.0" } @@ -15991,6 +16231,7 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", + "dev": true, "requires": { "@types/json-schema": "^7.0.4", "ajv": "^6.12.2", @@ -16000,17 +16241,29 @@ "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true }, "supports-color": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, "requires": { "has-flag": "^4.0.0" } diff --git a/package.json b/package.json index 0e4ebd1235a..30659bdbdd1 100644 --- a/package.json +++ b/package.json @@ -121,6 +121,7 @@ "postcss-cli": "^7.1.0", "redux-devtools-extension": "^2.13.8", "source-map-loader": "^0.2.4", + "terser-webpack-plugin": "^3.0.6", "ts-loader": "^6.2.0", "webpack": "^4.41.1", "webpack-cli": "^3.3.9", diff --git a/webpack.config.js b/webpack.config.js index 5a8223491be..db38ebb42ec 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,6 +7,7 @@ let googleKey = "6LdvxuQUAAAAADDWVflgBqyHGfq-xmvNJaToM0pN"; const CopyPlugin = require("copy-webpack-plugin"); const WorkboxPlugin = require("workbox-webpack-plugin"); const CompressionPlugin = require('compression-webpack-plugin'); +const TerserPlugin = require('terser-webpack-plugin'); module.exports = (env, argv) => { const mode = argv.mode || "development"; @@ -29,6 +30,8 @@ module.exports = (env, argv) => { }, optimization: { moduleIds: "hashed", + minimize: true, + minimizer: [new TerserPlugin()], runtimeChunk: "single", splitChunks: { cacheGroups: { From 927524cc102f1d77232b992c4f7749014c34a564 Mon Sep 17 00:00:00 2001 From: syam Date: Fri, 19 Jun 2020 22:49:11 +0530 Subject: [PATCH 09/25] changes based on ICMR changes --- src/Components/Patient/SamplePreview.tsx | 8 ++++++-- src/Components/Patient/SampleTest.tsx | 12 ++++++------ src/Components/Patient/models.tsx | 5 +++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/Components/Patient/SamplePreview.tsx b/src/Components/Patient/SamplePreview.tsx index 50afd4343cc..828999f838f 100644 --- a/src/Components/Patient/SamplePreview.tsx +++ b/src/Components/Patient/SamplePreview.tsx @@ -6,6 +6,7 @@ import {Loading} from "../Common/Loading"; import { sampleReport} from "../../Redux/actions"; import {statusType, useAbortableEffect} from "../../Common/utils"; import { SampleReportModel } from "./models"; +import moment from "moment"; const useStyles = makeStyles({ root: { @@ -298,7 +299,10 @@ export default function SampleReport(props: samplePreviewProps) { - {sampleData && sampleData.specimen_details && sampleData.specimen_details.collection_date} + { + sampleData && + sampleData.specimen_details + && moment(sampleData.specimen_details.created_date).format("lll") } @@ -310,7 +314,7 @@ export default function SampleReport(props: samplePreviewProps) { - {sampleData && sampleData.specimen_details && sampleData.specimen_details.label} + {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_label} diff --git a/src/Components/Patient/SampleTest.tsx b/src/Components/Patient/SampleTest.tsx index 637533aee0d..b8b1746a463 100644 --- a/src/Components/Patient/SampleTest.tsx +++ b/src/Components/Patient/SampleTest.tsx @@ -20,7 +20,7 @@ const icmrCategories = [...ICMR_CATEGORY]; const initForm: SampleTestModel = { isFastTrack: false, fast_track: "", - notes: "", + icmr_label: "", atypical_presentation: "", diagnosis: "", diff_diagnosis: "", @@ -87,7 +87,7 @@ export const SampleTest = (props: any) => { invalidForm = true; } break; - case "notes": + case "icmr_label": if ( !state.form[field]) { errors[field] = "Please specify the label"; invalidForm = true; @@ -124,7 +124,7 @@ export const SampleTest = (props: any) => { setIsLoading(true); const data: SampleTestModel = { fast_track: state.form.isFastTrack ? state.form.fast_track : undefined, - notes: state.form.notes ? state.form.notes : undefined, + icmr_label: state.form.icmr_label ? state.form.icmr_label : undefined, facility: facilityId, patient: patientId, has_ari: state.form.has_ari, @@ -210,12 +210,12 @@ export const SampleTest = (props: any) => {
    Label*
    diff --git a/src/Components/Patient/models.tsx b/src/Components/Patient/models.tsx index 9d3d0a3ccc0..0613750c0d9 100644 --- a/src/Components/Patient/models.tsx +++ b/src/Components/Patient/models.tsx @@ -64,7 +64,7 @@ export interface SampleTestModel { status?: string; result?: string; icmr_category?: string; - notes?: string; + icmr_label?: string; date_of_sample?: string; date_of_result?: string; consultation?: number; @@ -100,11 +100,12 @@ export interface SampleReportModel { state_name?: string; } specimen_details?: { + created_date?: string; sample_type?: string; collection_type?: string; collection_date?: string; icmr_category?: string; - label?: string; + icmr_label?: string; is_repeated_sample?: boolean; lab_name?: string; lab_pincode?: string; From e8c81c683d388b4c7ab166deb3a818eefc5e5d32 Mon Sep 17 00:00:00 2001 From: syam Date: Sat, 20 Jun 2020 00:19:20 +0530 Subject: [PATCH 10/25] fix for patient search --- package-lock.json | 488 --------------------- package.json | 2 - src/Components/Common/SearchPhone.tsx | 47 -- src/Components/Patient/ManagePatients.tsx | 15 +- src/Components/Patient/SampleViewAdmin.tsx | 41 +- src/Components/Users/ManageUsers.tsx | 5 +- src/Redux/actions.tsx | 3 + src/Redux/api.tsx | 3 + webpack.config.js | 5 - 9 files changed, 33 insertions(+), 576 deletions(-) delete mode 100644 src/Components/Common/SearchPhone.tsx diff --git a/package-lock.json b/package-lock.json index 58238f6b401..d66e7f041f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3994,100 +3994,6 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" }, - "cacache": { - "version": "15.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.0.4.tgz", - "integrity": "sha512-YlnKQqTbD/6iyoJvEY3KJftjrdBYroCbxxYXzhOzsFLWlp6KX4BOlEf4mTx0cMUfVaTS3ENL2QtDWeRYoGLkkw==", - "dev": true, - "requires": { - "@npmcli/move-file": "^1.0.1", - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", - "infer-owner": "^1.0.4", - "lru-cache": "^5.1.1", - "minipass": "^3.1.1", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^8.0.0", - "tar": "^6.0.2", - "unique-filename": "^1.1.1" - }, - "dependencies": { - "chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "dev": true - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true - }, - "p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "tar": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.0.2.tgz", - "integrity": "sha512-Glo3jkRtPcvpDlAs/0+hozav78yoXKFr+c4wgw62NNMO3oo4AaJdCo21Uu7lcwr55h39W2XD1LMERc64wtbItg==", - "dev": true, - "requires": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.0", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "dependencies": { - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - } - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - } - } - }, "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -4567,226 +4473,6 @@ } } }, - "compression-webpack-plugin": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/compression-webpack-plugin/-/compression-webpack-plugin-4.0.0.tgz", - "integrity": "sha512-DRoFQNTkQ8gadlk117Y2wxANU+MDY56b1FIZj/yJXucBOTViTHXjthM7G9ocnitksk4kLzt1N2RLF0gDjxI+hg==", - "dev": true, - "requires": { - "cacache": "^15.0.3", - "find-cache-dir": "^3.3.1", - "schema-utils": "^2.6.6", - "serialize-javascript": "^3.0.0", - "webpack-sources": "^1.4.3" - }, - "dependencies": { - "cacache": { - "version": "15.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.0.4.tgz", - "integrity": "sha512-YlnKQqTbD/6iyoJvEY3KJftjrdBYroCbxxYXzhOzsFLWlp6KX4BOlEf4mTx0cMUfVaTS3ENL2QtDWeRYoGLkkw==", - "dev": true, - "requires": { - "@npmcli/move-file": "^1.0.1", - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", - "infer-owner": "^1.0.4", - "lru-cache": "^5.1.1", - "minipass": "^3.1.1", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^8.0.0", - "tar": "^6.0.2", - "unique-filename": "^1.1.1" - } - }, - "chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "dev": true - }, - "find-cache-dir": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", - "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "schema-utils": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", - "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.4", - "ajv": "^6.12.2", - "ajv-keywords": "^3.4.1" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "serialize-javascript": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz", - "integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "ssri": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.0.tgz", - "integrity": "sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==", - "dev": true, - "requires": { - "minipass": "^3.1.1" - } - }, - "tar": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.0.2.tgz", - "integrity": "sha512-Glo3jkRtPcvpDlAs/0+hozav78yoXKFr+c4wgw62NNMO3oo4AaJdCo21Uu7lcwr55h39W2XD1LMERc64wtbItg==", - "dev": true, - "requires": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.0", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "dependencies": { - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - } - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - } - } - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -15532,15 +15218,6 @@ "tweetnacl": "~0.14.0" } }, - "ssri": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.0.tgz", - "integrity": "sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==", - "dev": true, - "requires": { - "minipass": "^3.1.1" - } - }, "stable": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", @@ -16105,171 +15782,6 @@ } } }, - "terser-webpack-plugin": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-3.0.6.tgz", - "integrity": "sha512-z3HLOOPUHkCNGkeEHqqiMAIy1pjpHwS1o+i6Zn0Ws3EAvHJj46737efNNEvJ0Vx9BdDQM83d56qySDJOSORA0A==", - "dev": true, - "requires": { - "cacache": "^15.0.4", - "find-cache-dir": "^3.3.1", - "jest-worker": "^26.0.0", - "p-limit": "^3.0.1", - "schema-utils": "^2.6.6", - "serialize-javascript": "^4.0.0", - "source-map": "^0.6.1", - "terser": "^4.8.0", - "webpack-sources": "^1.4.3" - }, - "dependencies": { - "find-cache-dir": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", - "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "jest-worker": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.0.0.tgz", - "integrity": "sha512-pPaYa2+JnwmiZjK9x7p9BoZht+47ecFCDFA/CJxspHzeDvQcfVBLWzCiWyo+EGrSiQMWZtCFo9iSvMZnAAo8vw==", - "dev": true, - "requires": { - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "p-limit": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.1.tgz", - "integrity": "sha512-mw/p92EyOzl2MhauKodw54Rx5ZK4624rNfgNaBguFZkHzyUG9WsDzFF5/yQVEJinbJDdP4jEfMN+uBquiGnaLg==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - }, - "dependencies": { - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - } - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - }, - "schema-utils": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", - "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.4", - "ajv": "^6.12.2", - "ajv-keywords": "^3.4.1" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "test-exclude": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", diff --git a/package.json b/package.json index 30659bdbdd1..f5d38225eba 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,6 @@ "@types/jest": "^24.9.1", "@types/mocha": "^5.2.7", "autoprefixer": "^9.7.6", - "compression-webpack-plugin": "^4.0.0", "concurrently": "^5.1.0", "copy-webpack-plugin": "^6.0.2", "css-loader": "^2.1.1", @@ -121,7 +120,6 @@ "postcss-cli": "^7.1.0", "redux-devtools-extension": "^2.13.8", "source-map-loader": "^0.2.4", - "terser-webpack-plugin": "^3.0.6", "ts-loader": "^6.2.0", "webpack": "^4.41.1", "webpack-cli": "^3.3.9", diff --git a/src/Components/Common/SearchPhone.tsx b/src/Components/Common/SearchPhone.tsx deleted file mode 100644 index bbfa4e2f3ac..00000000000 --- a/src/Components/Common/SearchPhone.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { TextFieldProps } from '@material-ui/core'; -import { debounce } from "lodash"; -import React, { useCallback, useState } from 'react'; - - - -type TextFieldPropsExtended = TextFieldProps & { errors: string, search: (value: string) => void } - -export const SearchPhone = (props: TextFieldPropsExtended) => { - const [state, setState] = useState("") - const { search, placeholder } = props; - - const handler = useCallback(debounce(search, 500), []); - - const handleKeyDown = (event: any) => { - const value = event.target.value; - setState(value); - if (value.length === 0 || value.length > 10) { - handler(value); - } - }; - - const clearSearch = () => { - handler(""); - setState(""); - }; - - return ( -
    -
    - {state ? -
    - - - -
    : -
    - - - -
    - } - -
    -
    - ) -} diff --git a/src/Components/Patient/ManagePatients.tsx b/src/Components/Patient/ManagePatients.tsx index 3fa55ca32a0..a575fd83e78 100644 --- a/src/Components/Patient/ManagePatients.tsx +++ b/src/Components/Patient/ManagePatients.tsx @@ -6,13 +6,13 @@ import { navigate } from "hookrouter"; import React, { useCallback, useState } from "react"; import { useDispatch } from "react-redux"; import { statusType, useAbortableEffect } from "../../Common/utils"; -import { getAllPatient, searchPatient } from "../../Redux/actions"; +import {getAllPatient, searchPatientFilter} from "../../Redux/actions"; import { Loading } from "../Common/Loading"; import PageTitle from "../Common/PageTitle"; import Pagination from "../Common/Pagination"; import { PatientFilter } from "./PatientFilter"; import { InputSearchBox } from "../Common/SearchBox"; -import { SearchPhone } from "../Common/SearchPhone"; + const useStyles = makeStyles((theme) => ({ paginateTopPadding: { @@ -69,7 +69,7 @@ export const PatientManager = (props: any) => { const searchByName = async (searchValue: string) => { setIsLoading(true); - const res = await dispatch(searchPatient({ limit, offset, name: searchValue })); + const res = await dispatch(searchPatientFilter({ limit, offset, name: searchValue })); if (res && res.data) { setData(res.data.results); setTotalCount(res.data.count); @@ -79,7 +79,7 @@ export const PatientManager = (props: any) => { const searchByPhone = async (searchValue: string) => { setIsLoading(true); - const res = await dispatch(searchPatient({ limit, offset, phone_number: encodeURI(searchValue) })); + const res = await dispatch(searchPatientFilter({ limit, offset, phone_number: encodeURI(searchValue) })); if (res && res.data) { setData(res.data.results); setTotalCount(res.data.count); @@ -120,11 +120,6 @@ export const PatientManager = (props: any) => { Medical Worker )} - {!patient.is_active && ( - - Inactive - - )}
    @@ -224,7 +219,7 @@ export const PatientManager = (props: any) => {
    Search by number
    - ({ paginateTopPadding: { @@ -287,26 +286,26 @@ export default function SampleViewAdmin(props: any) { errors='' />
    -
    -
    - Search by Name -
    - -
    -
    -
    - Search by number -
    - -
    + {/*
    */} + {/*
    */} + {/* Search by Name*/} + {/*
    */} + {/* */} + {/*
    */} + {/*
    */} + {/*
    */} + {/* Search by number*/} + {/*
    */} + {/* */} + {/*
    */}
    {manageSamples}
    diff --git a/src/Components/Users/ManageUsers.tsx b/src/Components/Users/ManageUsers.tsx index 31594aeb4ff..9ff98182dd8 100644 --- a/src/Components/Users/ManageUsers.tsx +++ b/src/Components/Users/ManageUsers.tsx @@ -1,4 +1,3 @@ - import React, { useCallback, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; import { statusType, useAbortableEffect } from "../../Common/utils"; @@ -9,7 +8,7 @@ import Pagination from "../Common/Pagination"; import { navigate } from "hookrouter"; import { USER_TYPES } from "../../Common/constants"; import {InputSearchBox} from "../Common/SearchBox"; -import {SearchPhone} from "../Common/SearchPhone"; + export default function ManageUsers(props: any) { @@ -179,7 +178,7 @@ export default function ManageUsers(props: any) {
    Search by number
    - { export const searchPatient = (params: object) => { return fireRequest('searchPatient', [], params); }; +export const searchPatientFilter = (params: object) => { + return fireRequest('searchPatientFilter', [], params); +}; export const searchUser = (params: object) => { return fireRequest('searchUser', [], params); } diff --git a/src/Redux/api.tsx b/src/Redux/api.tsx index 220f19d59a2..38d17ce7cc2 100644 --- a/src/Redux/api.tsx +++ b/src/Redux/api.tsx @@ -182,6 +182,9 @@ export default { searchPatient: { path: "/api/v1/patient/search", }, + searchPatientFilter: { + path: "/api/v1/patient_search" + }, patientList: { path: "/api/v1/patient", }, diff --git a/webpack.config.js b/webpack.config.js index db38ebb42ec..8c215c12c68 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,8 +6,6 @@ const { CleanWebpackPlugin } = require("clean-webpack-plugin"); let googleKey = "6LdvxuQUAAAAADDWVflgBqyHGfq-xmvNJaToM0pN"; const CopyPlugin = require("copy-webpack-plugin"); const WorkboxPlugin = require("workbox-webpack-plugin"); -const CompressionPlugin = require('compression-webpack-plugin'); -const TerserPlugin = require('terser-webpack-plugin'); module.exports = (env, argv) => { const mode = argv.mode || "development"; @@ -30,8 +28,6 @@ module.exports = (env, argv) => { }, optimization: { moduleIds: "hashed", - minimize: true, - minimizer: [new TerserPlugin()], runtimeChunk: "single", splitChunks: { cacheGroups: { @@ -108,7 +104,6 @@ module.exports = (env, argv) => { }, ], }), - new CompressionPlugin(), new CleanWebpackPlugin(), new HtmlWebpackPlugin({ template: path.resolve(__dirname, "src", "index.html"), From 5ce42ec6ad2678aa145d83ba464225f244c9f164 Mon Sep 17 00:00:00 2001 From: syam Date: Sat, 20 Jun 2020 01:30:17 +0530 Subject: [PATCH 11/25] fix for staging phone number issue --- src/Components/Common/SearchPhone.tsx | 47 ---------------------- src/Components/Patient/ManagePatients.tsx | 10 ++--- src/Components/Patient/SamplePreview.tsx | 5 ++- src/Components/Patient/SampleTest.tsx | 34 +++++----------- src/Components/Patient/SampleViewAdmin.tsx | 41 +++++++++---------- src/Components/Patient/models.tsx | 6 +-- src/Components/Users/ManageUsers.tsx | 5 +-- src/Redux/actions.tsx | 7 +++- src/Redux/api.tsx | 3 ++ src/index.html | 2 +- 10 files changed, 54 insertions(+), 106 deletions(-) delete mode 100644 src/Components/Common/SearchPhone.tsx diff --git a/src/Components/Common/SearchPhone.tsx b/src/Components/Common/SearchPhone.tsx deleted file mode 100644 index bbfa4e2f3ac..00000000000 --- a/src/Components/Common/SearchPhone.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { TextFieldProps } from '@material-ui/core'; -import { debounce } from "lodash"; -import React, { useCallback, useState } from 'react'; - - - -type TextFieldPropsExtended = TextFieldProps & { errors: string, search: (value: string) => void } - -export const SearchPhone = (props: TextFieldPropsExtended) => { - const [state, setState] = useState("") - const { search, placeholder } = props; - - const handler = useCallback(debounce(search, 500), []); - - const handleKeyDown = (event: any) => { - const value = event.target.value; - setState(value); - if (value.length === 0 || value.length > 10) { - handler(value); - } - }; - - const clearSearch = () => { - handler(""); - setState(""); - }; - - return ( -
    -
    - {state ? -
    - - - -
    : -
    - - - -
    - } - -
    -
    - ) -} diff --git a/src/Components/Patient/ManagePatients.tsx b/src/Components/Patient/ManagePatients.tsx index 14ef237ea03..de78a3cd4ea 100644 --- a/src/Components/Patient/ManagePatients.tsx +++ b/src/Components/Patient/ManagePatients.tsx @@ -6,13 +6,13 @@ import { navigate } from "hookrouter"; import React, { useCallback, useState } from "react"; import { useDispatch } from "react-redux"; import { statusType, useAbortableEffect } from "../../Common/utils"; -import { getAllPatient, getFacilities, searchPatient } from "../../Redux/actions"; +import { getAllPatient, searchPatientFilter } from "../../Redux/actions"; import { Loading } from "../Common/Loading"; import PageTitle from "../Common/PageTitle"; import Pagination from "../Common/Pagination"; import { PatientFilter } from "./PatientFilter"; import { InputSearchBox } from "../Common/SearchBox"; -import { SearchPhone } from "../Common/SearchPhone"; + const useStyles = makeStyles((theme) => ({ paginateTopPadding: { @@ -69,7 +69,7 @@ export const PatientManager = (props: any) => { const searchByName = async (searchValue: string) => { setIsLoading(true); - const res = await dispatch(searchPatient({ limit, offset, name: searchValue })); + const res = await dispatch(searchPatientFilter({ limit, offset, name: searchValue })); if (res && res.data) { setData(res.data.results); setTotalCount(res.data.count); @@ -79,7 +79,7 @@ export const PatientManager = (props: any) => { const searchByPhone = async (searchValue: string) => { setIsLoading(true); - const res = await dispatch(searchPatient({ limit, offset, phone_number: encodeURI(searchValue) })); + const res = await dispatch(searchPatientFilter({ limit, offset, phone_number: encodeURI(searchValue) })); if (res && res.data) { setData(res.data.results); setTotalCount(res.data.count); @@ -224,7 +224,7 @@ export const PatientManager = (props: any) => {
    Search by number
    - - {sampleData && sampleData.specimen_details && sampleData.specimen_details.collection_date} + {sampleData && sampleData.specimen_details && moment(sampleData.specimen_details.created_date).format("lll")} @@ -310,7 +311,7 @@ export default function SampleReport(props: samplePreviewProps) { - {sampleData && sampleData.specimen_details && sampleData.specimen_details.label} + {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_label} diff --git a/src/Components/Patient/SampleTest.tsx b/src/Components/Patient/SampleTest.tsx index fae914e34a7..79e672bd421 100644 --- a/src/Components/Patient/SampleTest.tsx +++ b/src/Components/Patient/SampleTest.tsx @@ -10,12 +10,8 @@ import { CheckboxField, MultilineInputField, SelectField, TextInputField } from import { Loading } from "../Common/Loading"; import PageTitle from "../Common/PageTitle"; import { SampleTestModel } from "./models"; - -import ExpansionPanel from '@material-ui/core/ExpansionPanel'; -import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary'; -import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails'; import Typography from '@material-ui/core/Typography'; -import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; +import Container from "@material-ui/core/Container"; import color = Mocha.reporters.Base.color; const sampleTestTypes = [...SAMPLE_TYPE_CHOICES]; @@ -24,7 +20,7 @@ const icmrCategories = [...ICMR_CATEGORY]; const initForm: SampleTestModel = { isFastTrack: false, fast_track: "", - notes: "", + icmr_label: "", atypical_presentation: "", diagnosis: "", diff_diagnosis: "", @@ -91,7 +87,7 @@ export const SampleTest = (props: any) => { invalidForm = true; } break; - case "notes": + case "icmr_label": if ( !state.form[field]) { errors[field] = "Please specify the label"; invalidForm = true; @@ -128,7 +124,7 @@ export const SampleTest = (props: any) => { setIsLoading(true); const data: SampleTestModel = { fast_track: state.form.isFastTrack ? state.form.fast_track : undefined, - notes: state.form.notes ? state.form.notes : undefined, + icmr_label: state.form.icmr_label ? state.form.icmr_label : undefined, facility: facilityId, patient: patientId, has_ari: state.form.has_ari, @@ -214,25 +210,18 @@ export const SampleTest = (props: any) => {
    Label*
    + Reference below to know more about ICMR Categories - - } - aria-controls="panel1a-content" - id="panel1a-header" - > - ICMR Categories - - +
  • Cat 0 - Repeat Sample of Positive Case / Follow Up case @@ -253,11 +242,10 @@ export const SampleTest = (props: any) => { Cat 5a - Asymptomatic Direct and High Risk contact of confirmed case - family Member
  • - Cat 5b - Asymptomatic Healthcare worker in contact with confimred case without adequete protection + Cat 5b - Asymptomatic Healthcare worker in contact with confirmed case without adequate protection
  • -
    -
    +
    ({ paginateTopPadding: { @@ -287,26 +286,26 @@ export default function SampleViewAdmin(props: any) { errors='' />
    -
    -
    - Search by Name -
    - -
    -
    -
    - Search by number -
    - -
    + {/*
    */} + {/*
    */} + {/* Search by Name*/} + {/*
    */} + {/* */} + {/*
    */} + {/*
    */} + {/*
    */} + {/* Search by number*/} + {/*
    */} + {/* */} + {/*
    */}
    {manageSamples}
    diff --git a/src/Components/Patient/models.tsx b/src/Components/Patient/models.tsx index 9d3d0a3ccc0..3e4bac50160 100644 --- a/src/Components/Patient/models.tsx +++ b/src/Components/Patient/models.tsx @@ -64,7 +64,7 @@ export interface SampleTestModel { status?: string; result?: string; icmr_category?: string; - notes?: string; + icmr_label?: string; date_of_sample?: string; date_of_result?: string; consultation?: number; @@ -102,9 +102,9 @@ export interface SampleReportModel { specimen_details?: { sample_type?: string; collection_type?: string; - collection_date?: string; + created_date?: string; icmr_category?: string; - label?: string; + icmr_label?: string; is_repeated_sample?: boolean; lab_name?: string; lab_pincode?: string; diff --git a/src/Components/Users/ManageUsers.tsx b/src/Components/Users/ManageUsers.tsx index cd3c7b16c99..4de8ce3c995 100644 --- a/src/Components/Users/ManageUsers.tsx +++ b/src/Components/Users/ManageUsers.tsx @@ -2,14 +2,13 @@ import React, { useCallback, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; import { statusType, useAbortableEffect } from "../../Common/utils"; -import {getUserList, searchPatient, searchUser} from "../../Redux/actions"; +import {getUserList, searchUser} from "../../Redux/actions"; import { Loading } from "../Common/Loading"; import PageTitle from "../Common/PageTitle"; import Pagination from "../Common/Pagination"; import { navigate } from "hookrouter"; import { USER_TYPES } from "../../Common/constants"; import {InputSearchBox} from "../Common/SearchBox"; -import {SearchPhone} from "../Common/SearchPhone"; export default function ManageUsers(props: any) { @@ -179,7 +178,7 @@ export default function ManageUsers(props: any) {
    Search by number
    - { }; export const searchUser = (params: object) => { return fireRequest('searchUser', [], params); -} +}; + +export const searchPatientFilter = (params: object) => { + return fireRequest('searchPatientFilter', [], params); +}; + export const getAllPatient = (params: object) => { return fireRequest('patientList', [], params); }; diff --git a/src/Redux/api.tsx b/src/Redux/api.tsx index 3ae8714b2b5..dfafec4a8f2 100644 --- a/src/Redux/api.tsx +++ b/src/Redux/api.tsx @@ -191,6 +191,9 @@ export default { searchPatient: { path: "/api/v1/patient/search", }, + searchPatientFilter: { + path: "/api/v1/patient_search" + }, patientList: { path: "/api/v1/patient", }, diff --git a/src/index.html b/src/index.html index 2e3b286533d..d3e694825e0 100644 --- a/src/index.html +++ b/src/index.html @@ -27,7 +27,7 @@ - + From 2c766b11198a8d7d17d2ee15a1a34ad54f767307 Mon Sep 17 00:00:00 2001 From: syam Date: Sat, 20 Jun 2020 02:04:52 +0530 Subject: [PATCH 12/25] hidden search boxes for api's --- src/Components/Users/ManageUsers.tsx | 44 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/Components/Users/ManageUsers.tsx b/src/Components/Users/ManageUsers.tsx index 4de8ce3c995..50df6d1a72f 100644 --- a/src/Components/Users/ManageUsers.tsx +++ b/src/Components/Users/ManageUsers.tsx @@ -163,28 +163,28 @@ export default function ManageUsers(props: any) { return (
    -
    -
    -
    - Search by Name -
    - -
    -
    -
    - Search by number -
    - -
    -
    + {/*
    */} + {/*
    */} + {/*
    */} + {/* Search by Name*/} + {/*
    */} + {/* */} + {/*
    */} + {/*
    */} + {/*
    */} + {/* Search by number*/} + {/*
    */} + {/* */} + {/*
    */} + {/*
    */}
    {manageUsers} From 81d4d8cccd16bf2b89f1a0c8f32f5381dd2a8310 Mon Sep 17 00:00:00 2001 From: syam Date: Sat, 20 Jun 2020 02:13:54 +0530 Subject: [PATCH 13/25] removed Ambulance Module and removed Deprecated Components --- src/Common/constants.tsx | 10 - src/Components/Ambulance/AmbulanceList.tsx | 214 ---------- .../Ambulance/AmbulanceOnboarding.tsx | 136 ------- .../Ambulance/DriverDetailsForm.tsx | 299 -------------- .../Ambulance/VehicleDetailsForm.tsx | 370 ------------------ src/Components/Common/Header.tsx | 5 - src/Components/Common/Loader.tsx | 38 -- src/Components/Common/Stepper.tsx | 126 ------ src/Redux/actions.tsx | 8 - src/Redux/api.tsx | 9 - src/Router/AppRouter.tsx | 7 +- 11 files changed, 1 insertion(+), 1221 deletions(-) delete mode 100644 src/Components/Ambulance/AmbulanceList.tsx delete mode 100644 src/Components/Ambulance/AmbulanceOnboarding.tsx delete mode 100644 src/Components/Ambulance/DriverDetailsForm.tsx delete mode 100644 src/Components/Ambulance/VehicleDetailsForm.tsx delete mode 100644 src/Components/Common/Loader.tsx delete mode 100644 src/Components/Common/Stepper.tsx diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx index a442101cd4d..df0e43c2029 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -108,16 +108,6 @@ export const GENDER_TYPES: Array = [ { id: 3, text: "Other" } ]; -export const AGREE_CONSENT = - "I / We confirm and agree that the Ambulances enrolled in the Private Voluntary Online Ambulance Network by filling this online form will work under instruction and direction of the State Mission Director, National Health Mission, Kerala or officers / teams duly authorised by the State Mission Director, National Health Mission, Kerala."; - -export const AMBULANCE_FREE_SERVICE_CONSENT = - "I / we will provide services free of any charge."; - -export const AMBULANCE_SERVICE_FEE_TEXT = - "I / we will require fees for providing service"; - - export const SAMPLE_TEST_RESULT = [ { id: 1, text: "POSITIVE" }, { id: 2, text: "NEGATIVE" }, diff --git a/src/Components/Ambulance/AmbulanceList.tsx b/src/Components/Ambulance/AmbulanceList.tsx deleted file mode 100644 index 1588a36460e..00000000000 --- a/src/Components/Ambulance/AmbulanceList.tsx +++ /dev/null @@ -1,214 +0,0 @@ -import { CardContent, CardHeader, Grid, Tooltip, Typography } from "@material-ui/core"; -import { makeStyles } from "@material-ui/core/styles"; -import React, { useCallback, useState } from "react"; -import { useDispatch } from "react-redux"; -import { statusType, useAbortableEffect } from "../../Common/utils"; -import { getAmbulanceList } from "../../Redux/actions"; -import { Loading } from "../Common/Loading"; -import PageTitle from "../Common/PageTitle"; -import Pagination from "../Common/Pagination"; -import { navigate } from "hookrouter"; - -const useStyles = makeStyles(theme => ({ - root: { - flexGrow: 1, - padding: "8px" - }, - card: { - height: 160, - width: "100%", - backgroundColor: "#FFFFFF" - }, - title: { - whiteSpace: "nowrap", - overflow: "hidden", - textOverflow: "ellipsis", - fontWeight: 400, - //padding: '10px', - //fontSize: '14px', - display: "inline-block", - [theme.breakpoints.up("md")]: { - width: "12vw" - }, - [theme.breakpoints.down("sm")]: { - width: "40vw" - }, - [theme.breakpoints.down("xs")]: { - width: "65vw" - } - }, - content: { - padding: "5px 10px" - }, - cardHeader: { - padding: "10px" - }, - contentText: { - whiteSpace: "nowrap", - overflow: "hidden", - textOverflow: "ellipsis", - display: "inline-block", - [theme.breakpoints.up("md")]: { - width: "10vw" - }, - [theme.breakpoints.down("sm")]: { - width: "40vw" - }, - [theme.breakpoints.down("xs")]: { - width: "40vw" - } - }, - spacing: { - marginLeft: theme.spacing(1) - }, - margin: { - margin: theme.spacing(1) - }, - addUserCard: { - marginTop: "50px" - }, - paginateTopPadding: { - paddingTop: "50px" - }, - userCardSideTitle: { - fontSize: "13px" - }, - toolTip: { - fontSize: "13px" - } -})); - -export default function AmbulanceList(props: any) { - const classes = useStyles(); - const dispatch: any = useDispatch(); - const initialData: any[] = []; - let manageAmbulances: any = null; - const [ambulances, setAmbulances] = useState(initialData); - const [isLoading, setIsLoading] = useState(false); - const [totalCount, setTotalCount] = useState(0); - const [currentPage, setCurrentPage] = useState(1); - const [offset, setOffset] = useState(0); - - const limit = 14; - - const fetchData = useCallback( - async (status: statusType) => { - setIsLoading(true); - const res = await dispatch(getAmbulanceList({ limit, offset })); - if (!status.aborted) { - if (res && res.data) { - setAmbulances(res.data.results); - setTotalCount(res.data.count); - } - setIsLoading(false); - } - }, - [dispatch, offset] - ); - - useAbortableEffect( - (status: statusType) => { - fetchData(status); - }, - [fetchData] - ); - - const handlePagination = (page: number, limit: number) => { - const offset = (page - 1) * limit; - setCurrentPage(page); - setOffset(offset); - }; - - const addAmbulance = (
    -
    navigate("/ambulance/add")} - > - Onboard New Ambulance -
    -
    ); - - - let ambulanceList: any[] = []; - if (ambulances && ambulances.length) { - ambulanceList = ambulances.map((ambulance: any, idx: number) => { - return ( -
    -
    - - - {ambulance.vehicle_number} - - } - interactive={true} - > - {ambulance.vehicle_number} - - - } - /> - - - - Owner Name{" "} - - {ambulance.owner_name} - - - - - - Owner Number{" "} - - {ambulance.owner_phone_number} - - -
    -
    - ); - }); - } - - if (isLoading || !ambulances) { - manageAmbulances = ; - } else if (ambulances && ambulances.length) { - manageAmbulances = ( - <> - {addAmbulance} - {ambulanceList} - {totalCount > limit && ( -
    - -
    - )} - - ); - } else if (ambulances && ambulances.length === 0) { - manageAmbulances = ( - -
    - {" "} - You are not Authorised to access this Page -
    -
    - ); - } - - return ( -
    - - -
    {manageAmbulances}
    -
    - ); -} diff --git a/src/Components/Ambulance/AmbulanceOnboarding.tsx b/src/Components/Ambulance/AmbulanceOnboarding.tsx deleted file mode 100644 index f9b4f29c62d..00000000000 --- a/src/Components/Ambulance/AmbulanceOnboarding.tsx +++ /dev/null @@ -1,136 +0,0 @@ -import AppBar from "@material-ui/core/AppBar"; -import Box from "@material-ui/core/Box"; -import { makeStyles, Theme } from "@material-ui/core/styles"; -import Tab from "@material-ui/core/Tab"; -import Tabs from "@material-ui/core/Tabs"; -import Typography from "@material-ui/core/Typography"; -import React from "react"; -import PageTitle from "../Common/PageTitle"; -import { DriverDetailsForm, driverForm, initDriverData } from "./DriverDetailsForm"; -import { initVehicleData, VehicleDetailsForm, vehicleForm } from "./VehicleDetailsForm"; - -interface TabPanelProps { - children?: React.ReactNode; - index: any; - value: any; -} - -const TabPanel = (props: TabPanelProps) => { - const { children, value, index, ...other } = props; - - return ( - - ); -} - -const a11yProps = (index: any) => { - return { - id: `simple-tab-${index}`, - "aria-controls": `simple-tabpanel-${index}` - }; -} - -const useStyles = makeStyles((theme: Theme) => ({ - root: { - flexGrow: 1, - backgroundColor: theme.palette.background.paper - }, - marginBottom10: { - marginBottom: "10px" - }, - formBottomPadding: { - paddingBottom: "10px" - }, - tabSection: { - color: "black", - background: "white" - }, - cardContent: { - marginTop: "-20px" - }, - checkBoxLabel: { - marginLeft: "8px" - }, - dateField: { - marginTop: "8px" - }, - selectField: { - marginBottom: "10px" - }, - selectLabel: { - color: "black", - padding: "10px 0px" - } -})); - -export default function AmbulanceOnboarding() { - const classes = useStyles(); - const [value, setValue] = React.useState(0); - const [vehicleObj, setVehicleObj] = React.useState( - initVehicleData - ); - const [driverObj, setDriverObj] = React.useState(initDriverData); - - const handleChange = (event: React.ChangeEvent<{}>, newValue: number) => { - // prevent navigating to driver details without entering vehicle details - if (newValue === 1 && !vehicleObj.isValid) { - return; - } - setValue(newValue); - }; - - const updateVehicleObj = (form: vehicleForm) => { - setVehicleObj(form); - if (form.isValid) { - setValue(1); - } - }; - - const updateDriverObj = (form: driverForm) => { - setDriverObj(form); - }; - - return ( -
    - - - - - - - - - - - - - - -
    - ); -} diff --git a/src/Components/Ambulance/DriverDetailsForm.tsx b/src/Components/Ambulance/DriverDetailsForm.tsx deleted file mode 100644 index 0383e9419dc..00000000000 --- a/src/Components/Ambulance/DriverDetailsForm.tsx +++ /dev/null @@ -1,299 +0,0 @@ -import { Box, Button, Card, CardActions, CardContent, CardHeader, Checkbox, Grid, Switch, Typography } from "@material-ui/core"; -import CheckCircleOutlineIcon from '@material-ui/icons/CheckCircleOutline'; -import { navigate } from "hookrouter"; -import { isEmpty } from "lodash"; -import React, { useState } from "react"; -import { useDispatch } from "react-redux"; -import { AGREE_CONSENT, AMBULANCE_FREE_SERVICE_CONSENT, AMBULANCE_SERVICE_FEE_TEXT } from "../../Common/constants"; -import { postAmbulance } from "../../Redux/actions"; -import * as Notification from '../../Utils/Notifications.js'; -import { CheckboxField, TextInputField, PhoneNumberField } from "../Common/HelperInputFields"; -import { vehicleForm } from "./VehicleDetailsForm"; -import { parsePhoneNumberFromString } from 'libphonenumber-js'; - -interface DriverDetailsProps { - classes: any; - vehicleInfo: vehicleForm; - driverInfo: driverForm; - setDriverObj: (form: driverForm) => void; -} - -export interface driverForm { - driverName1: string; - cellNumber1: string; - isSmartPhone1: boolean; - driverName2: string; - cellNumber2: string; - isSmartPhone2: boolean; - hasFreeService: boolean; - pricePerKm: string; - agreeConsent: boolean; -} - -export const initDriverData: driverForm = { - driverName1: "", - cellNumber1: "", - isSmartPhone1: false, - driverName2: "", - cellNumber2: "", - isSmartPhone2: false, - hasFreeService: true, - pricePerKm: "", - agreeConsent: false -}; - -export const DriverDetailsForm = (props: DriverDetailsProps) => { - const { vehicleInfo, classes, driverInfo, setDriverObj } = props; - const dispatch: any = useDispatch(); - const initForm: driverForm = { ...driverInfo }; - const initErr: any = {}; - const [form, setForm] = useState(initForm); - const [errors, setErrors] = useState(initErr); - const [isLoading, setIsLoading] = useState(false); - - const handleChange = (e: any) => { - const { value, name } = e.target; - const formData = { ...form }; - const errorField = { ...errors }; - - if (errorField[name]) { - errorField[name] = null; - setErrors(errorField); - } - formData[name] = value; - setForm(formData); - setDriverObj(formData); - }; - - const validateData = () => { - const err: any = {}; - Object.keys(form).forEach(key => { - const value = form[key]; - switch (key) { - case "driverName1": - if (!value) { - err[key] = "This field is required"; - } - break; - case "cellNumber1": - const phoneNumber = parsePhoneNumberFromString(value); - if (!value || !phoneNumber?.isPossible()) { - err[key] = "Please enter valid phone number"; - } - break; - case "cellNumber2": - if (form.driverName2 && !value) { - err[key] = "This field is required"; - } else if (form.driverName2 && value) { - const phoneNumber2 = parsePhoneNumberFromString(value); - if (!value || !phoneNumber2?.isPossible()) { - err[key] = "Please enter valid phone number"; - } - } - break; - default: - break; - } - }); - if (!isEmpty(err)) { - setErrors(err); - return false; - } - return form; - }; - - const handleCheckboxFieldChange = (e: any) => { - const { checked, name } = e.target; - const formData = { ...form, [name]: checked }; - setForm(formData); - setDriverObj(formData); - }; - - const handleValueChange = (value: any, name: string) => { - const formOld = { ...form }; - formOld[name] = value; - setForm(formOld); - }; - - const handleSubmit = async (e: any) => { - e.preventDefault(); - const valid = validateData(); - if (valid && vehicleInfo) { - const ambulanceData = { - drivers: [ - { - name: form.driverName1, - phone_number: parsePhoneNumberFromString(form.cellNumber1)?.format('E.164'), - is_smart_phone: form.isSmartPhone1 - } - ], - vehicle_number: vehicleInfo.registrationNumber - ? String(vehicleInfo.registrationNumber).toUpperCase() - : "", - vehicle_type: vehicleInfo.vehicleType - ? vehicleInfo.vehicleType - : undefined, - owner_name: vehicleInfo.nameOfOwner, - owner_phone_number: parsePhoneNumberFromString(vehicleInfo.ownerPhoneNumber)?.format('E.164'), - owner_is_smart_phone: vehicleInfo.isSmartPhone, - primary_district: vehicleInfo.primaryDistrict - ? Number(vehicleInfo.primaryDistrict) - : undefined, - secondary_district: vehicleInfo.secondaryDistrict - ? Number(vehicleInfo.secondaryDistrict) - : undefined, - third_district: vehicleInfo.thirdDistrict - ? Number(vehicleInfo.thirdDistrict) - : undefined, - has_oxygen: vehicleInfo.hasOxygenSupply, - has_ventilator: vehicleInfo.hasVentilator, - has_suction_machine: vehicleInfo.hasSuctionMachine, - has_defibrillator: vehicleInfo.hasDefibrillator, - insurance_valid_till_year: vehicleInfo.insuranceValidTill - ? Number(vehicleInfo.insuranceValidTill) - : undefined, - has_free_service: Boolean(form.hasFreeService), - price_per_km: !form.hasFreeService ? 20 : undefined - }; - - if (!!form.driverName2) { - ambulanceData.drivers.push({ - name: form.driverName2, - phone_number: parsePhoneNumberFromString(form.cellNumber2)?.format('E.164'), - is_smart_phone: form.isSmartPhone2 - }); - } - setIsLoading(true); - const res = await dispatch(postAmbulance(ambulanceData)); - setIsLoading(false); - if (res && res.data) { - Notification.Success({ - msg: "Ambulance added successfully" - }); - navigate("/"); - } - } - }; - - const handleClear = (e: any) => { - e.preventDefault(); - setErrors(initErr); - setForm(initDriverData); - setDriverObj(initDriverData); - }; - - return ( -
    - - - - -
    handleSubmit(e)}> - -

    Driver 1

    - - handleValueChange(value, 'cellNumber1')} - errors={errors.cellNumber1} - /> - -

    Driver 2

    - - handleValueChange(value, 'cellNumber2')} - errors={errors.cellNumber2} - /> - - - - - - - {form.hasFreeService - ? AMBULANCE_FREE_SERVICE_CONSENT - : AMBULANCE_SERVICE_FEE_TEXT} - - -

    Declaration

    - - - {" "} - - - {AGREE_CONSENT} - - -
    - - - - - -
    -
    -
    -
    -
    - ); -}; diff --git a/src/Components/Ambulance/VehicleDetailsForm.tsx b/src/Components/Ambulance/VehicleDetailsForm.tsx deleted file mode 100644 index 52b2d4a0b96..00000000000 --- a/src/Components/Ambulance/VehicleDetailsForm.tsx +++ /dev/null @@ -1,370 +0,0 @@ -import { Box, Button, Card, CardActions, CardContent, CardHeader, Grid, Typography } from "@material-ui/core"; -import NavigateNextIcon from '@material-ui/icons/NavigateNext'; -import { parsePhoneNumberFromString } from 'libphonenumber-js'; -import { isEmpty } from "lodash"; -import React, { useState } from "react"; -import { DISTRICT_CHOICES, VEHICLE_TYPES } from "../../Common/constants"; -import { CheckboxField, ErrorHelperText, NativeSelectField, PhoneNumberField, TextInputField } from "../Common/HelperInputFields"; - -export interface vehicleForm { - registrationNumber: string; - vehicleType: string; - insuranceValidTill: number; - nameOfOwner: string; - ownerPhoneNumber: string; - isSmartPhone: boolean; - primaryDistrict: number; - secondaryDistrict: number; - thirdDistrict: number; - hasOxygenSupply: boolean; - hasVentilator: boolean; - hasSuctionMachine: boolean; - hasDefibrillator: boolean; - isValid: boolean; -} - -export const initVehicleData: vehicleForm = { - registrationNumber: '', - vehicleType: '', - insuranceValidTill: 0, - nameOfOwner: '', - ownerPhoneNumber: '', - isSmartPhone: false, - primaryDistrict: 0, - secondaryDistrict: 0, - thirdDistrict: 0, - hasOxygenSupply: false, - hasVentilator: false, - hasSuctionMachine: false, - hasDefibrillator: false, - isValid: false, -}; - -//add empty option to districts -const allDistrictOptions: Array<{ id: number; text: string }> = [ - { - id: 0, - text: 'District Choice Priority', - }, - ...DISTRICT_CHOICES]; - -export const VehicleDetailsForm = (props: any) => { - const { classes, setVehicleObj, vehicleDetails } = props; - const initForm: vehicleForm = { ...initVehicleData }; - const initErr: any = {}; - const [form, setForm] = useState(Object.assign(initForm, vehicleDetails)); - const [errors, setErrors] = useState(initErr); - const validTill = [{ - id: 0, - text: 'Select', - }]; - for (let i = 0; i <= 2; i++) { - let text = `202${i}` - validTill.push({ id: parseInt(text), text }) - } - - const vehicleTypes = [{ - id: 0, - text: 'Select', - }, ...VEHICLE_TYPES] - - const [districtOptions, setDistrictOptions] = useState({ - primaryDistrict: [...allDistrictOptions], - secondaryDistrict: [...allDistrictOptions], - thirdDistrict: [...allDistrictOptions], - }); - - const handleChange = (e: any) => { - const { value, name } = e.target; - const fieldValue = Object.assign({}, form); - const errorField = Object.assign({}, errors); - if (errorField[name]) { - errorField[name] = null; - setErrors(errorField); - } - let fValue = value; - if (name === 'primaryDistrict' || name === 'secondaryDistrict' || name === 'thirdDistrict' || name === 'insuranceValidTill') { - fValue = parseInt(fValue) - } - fieldValue[name] = fValue; - setForm(fieldValue); - // remove selected districts from the other district options - if (name === 'primaryDistrict' || name === 'secondaryDistrict' || name === 'thirdDistrict') { - setDistrictOptions({ - primaryDistrict: allDistrictOptions.filter(i => !i.id || !(i.id === fieldValue.secondaryDistrict || i.id === fieldValue.thirdDistrict)), - secondaryDistrict: allDistrictOptions.filter(i => !i.id || !(i.id === fieldValue.primaryDistrict || i.id === fieldValue.thirdDistrict)), - thirdDistrict: allDistrictOptions.filter(i => !i.id || !(i.id === fieldValue.primaryDistrict || i.id === fieldValue.secondaryDistrict)), - }); - } - }; - - const handleCheckboxFieldChange = (e: any) => { - const { checked, name } = e.target; - const fieldValue = Object.assign({}, form); - fieldValue[name] = checked; - setForm(fieldValue); - }; - - const handleValueChange = (value: any, name: string) => { - const formOld = { ...form }; - formOld[name] = value; - setForm(formOld); - }; - - const validateData = () => { - const err: any = {}; - Object.keys(form).forEach(key => { - const value = form[key]; - switch (key) { - case "registrationNumber": - if (!value) { - err[key] = "This field is required"; - } else if (value && !(/^[a-zA-Z]{2}[0-9]{0,2}[a-zA-Z]{0,2}[0-9]{1,4}$/.test(value))) { - err[key] = "Please Enter the vehicle number without spaces, eg: KL13AB1234"; - } - break; - case "ownerPhoneNumber": - const phoneNumber = parsePhoneNumberFromString(value); - if (!value || !phoneNumber?.isPossible()) { - err[key] = "Please enter valid phone number"; - } - break; - case "insuranceValidTill": - case "vehicleType": - case "nameOfOwner": - case "primaryDistrict": - case "secondaryDistrict": - case "thirdDistrict": - !value && (err[key] = "This field is required"); - break; - case 'pricePerKm': - if (!form['hasFreeService']) { - if (!value) { - err[key] = 'This field is required'; - } else if (value && !/^[+]?\d+(\.\d+)?$/.test(value)) { - err[key] = 'Invalid price'; - } - } - break; - default: - break; - } - }); - if (!isEmpty(err)) { - setErrors(err); - setVehicleObj({ - ...initForm, - isValid: false, - }); - return; - } - setVehicleObj({ - ...form, - isValid: true, - }); - }; - - const handleSubmit = (e: any) => { - e.preventDefault(); - validateData(); - }; - - const handleClear = (e: any) => { - e.preventDefault(); - setDistrictOptions({ - primaryDistrict: [...allDistrictOptions], - secondaryDistrict: [...allDistrictOptions], - thirdDistrict: [...allDistrictOptions], - }); - setErrors(initErr); - setForm(initVehicleData); - setVehicleObj(initVehicleData); - } - - return ( -
    - - - - -
    { - handleSubmit(e) - }} className={`${classes.formBottomPadding}`}> - - - -
    - - -
    - -
    - - -
    - - handleValueChange(value, 'ownerPhoneNumber')} - errors={errors.ownerPhoneNumber} - /> - - - - - - Select Serviceable Districts - - -
    - - -
    -
    - - -
    -
    - - -
    - - - Select Your Ambulance Features - - - - - - - - - - - - - - -
    -
    - - - - -
    -
    -
    -
    -
    - ); -}; diff --git a/src/Components/Common/Header.tsx b/src/Components/Common/Header.tsx index be93067f5f0..b8ee98a925a 100644 --- a/src/Components/Common/Header.tsx +++ b/src/Components/Common/Header.tsx @@ -74,11 +74,6 @@ const Header = () => { link: '/patients', icon: }, - { - title: "Ambulances", - link: "/ambulance", - icon: - }, // { // title: "Sample Test", // link: "/sample", diff --git a/src/Components/Common/Loader.tsx b/src/Components/Common/Loader.tsx deleted file mode 100644 index 1162246e9be..00000000000 --- a/src/Components/Common/Loader.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import React from 'react'; -import { Modal, CircularProgress } from "@material-ui/core"; -import { makeStyles } from '@material-ui/styles'; - -const useStyles = makeStyles({ - modal:{ - outline:0 - }, - modalContent: { - position: 'absolute', - backgroundColor: 'white', - top: '50%', - left: '50%', - transform: 'translate(-50%, -50%)', - width: 'auto', - padding: '15px', - borderRadius: '5px', - outline:0 - } -}); - -const Loader = (props: { open: boolean; }) => { - const { open } = props; - const classes = useStyles(); - return ( - -
    - -
    -
    - ); -}; - -export default Loader; diff --git a/src/Components/Common/Stepper.tsx b/src/Components/Common/Stepper.tsx deleted file mode 100644 index 5a4d53f6c17..00000000000 --- a/src/Components/Common/Stepper.tsx +++ /dev/null @@ -1,126 +0,0 @@ -import React from 'react'; -import { navigate } from 'hookrouter'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; -import { - Grid, - List, - ListItem, - ListItemIcon, - Typography -} from '@material-ui/core'; -import '../../App.css'; -import Brightness1Icon from '@material-ui/icons/Brightness1'; - -const useStyles = makeStyles(theme => ({ - root: { - display: 'flex', - }, - listItemContainer: { - width: 100 - }, - activeBorder: { - borderBottomColor: '#FFFFFF', - borderBottomWidth: 4, - borderBottomStyle: 'solid' - }, - inActiveBorder: { - borderBottomColor: '#005D79', - borderBottomWidth: 4, - borderBottomStyle: 'solid', - }, - itemContainer: { - padding: 0 - }, - listItemText: { - color: '#FFFFFF', - fontWeight: 600, - fontSize: 12, - lineHeight: 2, - letterSpacing: 0.4 - }, - activeItemIcon: { - height: 15, - width: 15, - color: '#FFFFFF', - cursor:'pointer' - }, - inActiveItemIcon: { - height: 15, - width: 15, - color: '#005D79' - }, - listIconContainer: { - top: -5, - right: 5, - bottom: 25, - position: 'absolute', - justifyContent: 'flexEnd', - width: 100, - orderTopStyle: 'solid', - borderTopWidth: 1, - }, - lastListIconContainer: { - top: -7, - right: 7, - bottom: 25, - position: 'absolute', - justifyContent: 'flexEnd', - width: 100, - orderTopStyle: 'solid', - borderTopWidth: 1, - }, - listItemTextContainer: { - display: 'flex', - justifyContent: 'center', - position: 'absolute', - width: 100, - right: 45, - paddingTop: 10 - }, - listGridContent: { - flex: 1, - position: 'relative' - } -})); -// Type definitions -type Label = {link: string; name: string;} -interface StepperProps { - labels: Array
    -} \ No newline at end of file +} diff --git a/src/Components/Patient/PatientRegister.tsx b/src/Components/Patient/PatientRegister.tsx index e8b220cd8f5..80e5ad1fdad 100644 --- a/src/Components/Patient/PatientRegister.tsx +++ b/src/Components/Patient/PatientRegister.tsx @@ -2,7 +2,6 @@ import { Box, Button, Card, CardContent, CircularProgress, FormControlLabel, Inp import CheckCircleOutlineIcon from '@material-ui/icons/CheckCircleOutline'; import { navigate } from "hookrouter"; import { parsePhoneNumberFromString } from 'libphonenumber-js'; -import { debounce } from "lodash"; import moment from "moment"; import React, { useCallback, useReducer, useState } from "react"; import { useDispatch } from "react-redux"; @@ -20,6 +19,7 @@ import DuplicatePatientDialog from "../Facility/DuplicatePatientDialog"; import { DupPatientModel } from "../Facility/models"; import { PatientModel } from "./models"; import TransferPatientDialog from "../Facility/TransferPatientDialog"; +const debounce = require('lodash.debounce'); const placesList = countryList.concat(statesList.filter((i: string) => i !== 'Kerala')); diff --git a/src/Components/Patient/TeleConsultation.tsx b/src/Components/Patient/TeleConsultation.tsx index 081d92bd72e..f328b8dbfd0 100644 --- a/src/Components/Patient/TeleConsultation.tsx +++ b/src/Components/Patient/TeleConsultation.tsx @@ -1,10 +1,9 @@ import { Box, Button, Card, CardActions, CardContent, CardHeader, Checkbox, Grid, Typography } from "@material-ui/core"; import { makeStyles, Theme } from '@material-ui/core/styles'; -import { isEmpty } from "lodash"; import React, { useState } from "react"; import { useDispatch } from "react-redux"; import { TextInputField } from "../Common/HelperInputFields"; - +const isEmpty = require('lodash.isempty'); const useStyles = makeStyles((theme: Theme) => ({ formTop: { diff --git a/src/Components/Patient/TreatmentForm.tsx b/src/Components/Patient/TreatmentForm.tsx index 4762ad5ada6..36e8dd7ecc7 100644 --- a/src/Components/Patient/TreatmentForm.tsx +++ b/src/Components/Patient/TreatmentForm.tsx @@ -4,7 +4,7 @@ import { useDispatch } from "react-redux"; import { Box, Grid, Checkbox, Card, CardHeader, CardContent, CardActions, Button, FormControl, InputLabel, Select, MenuItem, Typography, FormLabel, RadioGroup, Radio, FormControlLabel } from "@material-ui/core"; import { TextInputField, TimeInputField } from "../Common/HelperInputFields"; // import { } from "../../Redux/actions"; -import { isEmpty } from "lodash"; +const isEmpty = require('lodash.isempty'); const useStyles = makeStyles((theme: Theme) => ({ @@ -249,4 +249,4 @@ export const TreatmentForm = (props: any) => {
    -} \ No newline at end of file +} diff --git a/src/Router/AppRouter.tsx b/src/Router/AppRouter.tsx index 090ffdc75cc..bc1d9b2ce98 100644 --- a/src/Router/AppRouter.tsx +++ b/src/Router/AppRouter.tsx @@ -1,6 +1,5 @@ import { useRedirect, useRoutes , navigate, usePath } from "hookrouter"; import React, { useEffect, useState } from "react"; -import { get } from "lodash"; import { useDispatch, useSelector } from "react-redux"; import { BedCapacityForm } from "../Components/Facility/BedCapacityForm"; import { ConsultationDetails } from "../Components/Facility/ConsultationDetails"; @@ -30,6 +29,7 @@ import { AddInventoryForm } from "../Components/Facility/AddInventoryForm"; import { SetInventoryForm } from "../Components/Facility/SetInventoryForm"; import MinQuantityList from "../Components/Facility/MinQuantityList"; import { UpdateMinQuantity } from "../Components/Facility/UpdateMinQuantity"; +const get = require('lodash.get'); const img = "https://cdn.coronasafe.network/light-logo.svg"; From a6fb38c010fc5440a693b6d6adb09352632b0f6b Mon Sep 17 00:00:00 2001 From: Sandeep Thomas Date: Sat, 20 Jun 2020 08:48:01 +0530 Subject: [PATCH 17/25] fix: phone number validation --- package.json | 2 +- src/Components/Common/HelperInputFields.tsx | 10 +++++++--- src/react-phone-input-2.d.ts | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f5d38225eba..6d9035c0c43 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "react-dom": "^16.12.0", "react-google-recaptcha": "^2.0.1", "react-leaflet-location-picker": "^1.4.2", - "react-phone-input-2": "^2.12.1", + "react-phone-input-2": "^2.13.5", "react-redux": "^7.1.1", "react-scripts": "3.3.1", "react-virtualized": "^9.21.2", diff --git a/src/Components/Common/HelperInputFields.tsx b/src/Components/Common/HelperInputFields.tsx index deba1c81068..22198a44b7c 100644 --- a/src/Components/Common/HelperInputFields.tsx +++ b/src/Components/Common/HelperInputFields.tsx @@ -7,8 +7,8 @@ import { SelectProps } from '@material-ui/core/Select'; import Autocomplete from '@material-ui/lab/Autocomplete'; import { DatePickerProps, KeyboardDatePicker, KeyboardDateTimePicker, KeyboardTimePicker, MuiPickersUtilsProvider } from '@material-ui/pickers'; import { MaterialUiPickersDate } from '@material-ui/pickers/typings/date'; -import React from 'react'; -import PhoneInput from 'react-phone-input-2'; +import React, { ChangeEvent } from 'react'; +import PhoneInput, { ICountryData } from 'react-phone-input-2'; import 'react-phone-input-2/lib/high-res.css'; export interface DefaultSelectInputProps extends Omit { @@ -405,12 +405,16 @@ export const AutoCompleteAsyncField = (props: any) => { export const PhoneNumberField = (props: any) => { const { label, placeholder, errors, onChange, onlyIndia, value } = props; const countryRestriction = !!onlyIndia ? { onlyCountries: ['in'] } : {}; + const handleChange = (value: string, data: ICountryData | {}, event: ChangeEvent, formattedValue: string) => { + onChange(formattedValue); + } return (<> {label && {label}} diff --git a/src/react-phone-input-2.d.ts b/src/react-phone-input-2.d.ts index f3b9fdad3bd..1f29ce97050 100644 --- a/src/react-phone-input-2.d.ts +++ b/src/react-phone-input-2.d.ts @@ -1,7 +1,7 @@ declare module "react-phone-input-2" { import React from "react"; - interface ICountryData { + export interface ICountryData { name: string; dialCode: string; countryCode: string; @@ -23,7 +23,7 @@ declare module "react-phone-input-2" { } interface IPhoneInputEventsProps { - onChange?(value: string, data: ICountryData | {}): void; + onChange?(value: string, data: ICountryData | {}, event: ChangeEvent, formattedValue: string): void; onFocus?( event: React.FocusEvent, data: ICountryData | {} From 05ff913ac975c695e0eb465156f8dcfbd665b1f1 Mon Sep 17 00:00:00 2001 From: syamkumar Date: Sat, 20 Jun 2020 13:53:27 +0530 Subject: [PATCH 18/25] Update src/Components/Auth/ForgetPassword.tsx Co-authored-by: Rigin Oommen --- src/Components/Auth/ForgetPassword.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Components/Auth/ForgetPassword.tsx b/src/Components/Auth/ForgetPassword.tsx index 4b2d3fe75b6..8ad823b9a32 100644 --- a/src/Components/Auth/ForgetPassword.tsx +++ b/src/Components/Auth/ForgetPassword.tsx @@ -1,4 +1,3 @@ - import { Button, CardActions, CardContent } from '@material-ui/core'; import { A } from 'hookrouter'; import React, { useState } from 'react'; From e36982f0a36863b77051ca922828f0186cfeadaa Mon Sep 17 00:00:00 2001 From: syamkumar Date: Sat, 20 Jun 2020 13:53:41 +0530 Subject: [PATCH 19/25] Update src/Components/Common/LocationSearchAndPick.tsx Co-authored-by: Rigin Oommen --- src/Components/Common/LocationSearchAndPick.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Common/LocationSearchAndPick.tsx b/src/Components/Common/LocationSearchAndPick.tsx index 5910a7fd2a6..04ca7ee26fb 100644 --- a/src/Components/Common/LocationSearchAndPick.tsx +++ b/src/Components/Common/LocationSearchAndPick.tsx @@ -70,7 +70,7 @@ export const LocationSearchAndPick = (props: LocationSearchAndPickProps) => { const renderLocationResults = () => { const locResultListOpen = Boolean(searchResultAnchorEl); - const searchResultPopoverId = 'search-result-popover'; + const searchResultPopoverId = 'search-result-popover'; return ( Date: Sat, 20 Jun 2020 13:53:54 +0530 Subject: [PATCH 20/25] Update src/Components/Patient/SamplePreview.tsx Co-authored-by: Rigin Oommen --- src/Components/Patient/SamplePreview.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Components/Patient/SamplePreview.tsx b/src/Components/Patient/SamplePreview.tsx index 2442027f1ac..16e645d302a 100644 --- a/src/Components/Patient/SamplePreview.tsx +++ b/src/Components/Patient/SamplePreview.tsx @@ -299,7 +299,6 @@ export default function SampleReport(props: samplePreviewProps) { - {sampleData && sampleData.specimen_details && moment(sampleData.specimen_details.created_date).format("lll")} From e2ec8952a34df1f1b8d82ca0a7ceddfc43ead81b Mon Sep 17 00:00:00 2001 From: syam Date: Sat, 20 Jun 2020 14:04:55 +0530 Subject: [PATCH 21/25] fix merge conflicts --- src/Components/Patient/models.tsx | 1 - src/Redux/actions.tsx | 5 ----- 2 files changed, 6 deletions(-) diff --git a/src/Components/Patient/models.tsx b/src/Components/Patient/models.tsx index 32577fa5a04..b157a67f724 100644 --- a/src/Components/Patient/models.tsx +++ b/src/Components/Patient/models.tsx @@ -103,7 +103,6 @@ export interface SampleReportModel { created_date?: string; sample_type?: string; collection_type?: string; - created_date?: string; icmr_category?: string; icmr_label?: string; is_repeated_sample?: boolean; diff --git a/src/Redux/actions.tsx b/src/Redux/actions.tsx index a41889ac903..1eb26afb3d9 100644 --- a/src/Redux/actions.tsx +++ b/src/Redux/actions.tsx @@ -82,11 +82,6 @@ export const searchPatientFilter = (params: object) => { export const searchUser = (params: object) => { return fireRequest('searchUser', [], params); }; - -export const searchPatientFilter = (params: object) => { - return fireRequest('searchPatientFilter', [], params); -}; - export const getAllPatient = (params: object) => { return fireRequest('patientList', [], params); }; From ba4c6c2fb674b3f0a54efcbd20493383f80cd324 Mon Sep 17 00:00:00 2001 From: Bodhish Thomas Date: Sat, 20 Jun 2020 21:52:35 +0530 Subject: [PATCH 22/25] Fix styling issue in ICMR form --- src/Components/Patient/SamplePreview.tsx | 1224 +++++++++++----------- 1 file changed, 612 insertions(+), 612 deletions(-) diff --git a/src/Components/Patient/SamplePreview.tsx b/src/Components/Patient/SamplePreview.tsx index 16e645d302a..5f9119fe0b8 100644 --- a/src/Components/Patient/SamplePreview.tsx +++ b/src/Components/Patient/SamplePreview.tsx @@ -1,10 +1,10 @@ -import React, {useCallback, useState} from 'react'; -import {Box, Button, Paper, Typography} from '@material-ui/core'; -import {makeStyles} from '@material-ui/core/styles'; -import {useDispatch} from "react-redux"; -import {Loading} from "../Common/Loading"; -import { sampleReport} from "../../Redux/actions"; -import {statusType, useAbortableEffect} from "../../Common/utils"; +import React, { useCallback, useState } from 'react'; +import { Box, Button, Paper, Typography } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core/styles'; +import { useDispatch } from "react-redux"; +import { Loading } from "../Common/Loading"; +import { sampleReport } from "../../Redux/actions"; +import { statusType, useAbortableEffect } from "../../Common/utils"; import { SampleReportModel } from "./models"; import moment from "moment"; @@ -76,7 +76,7 @@ const useStyles = makeStyles({ }); const coronasafeLogo = 'https://cdn.coronasafe.network/coronaSafeLogo.webp'; -interface samplePreviewProps { +interface samplePreviewProps { id: number; } export default function SampleReport(props: samplePreviewProps) { @@ -84,14 +84,14 @@ export default function SampleReport(props: samplePreviewProps) { const dispatch: any = useDispatch(); const { id } = props; const [isLoading, setIsLoading] = useState(false); - const [ sampleData, setSampleData] = useState({}); + const [sampleData, setSampleData] = useState({}); let report: any = null; let reportData: any = null; const fetchData = useCallback( async (status: statusType) => { setIsLoading(true); - const res: any = await dispatch(sampleReport({id})); + const res: any = await dispatch(sampleReport({ id })); if (!status.aborted) { if (res && res.data) { @@ -136,7 +136,7 @@ export default function SampleReport(props: samplePreviewProps) { - + ICMR Specimen Referral Data for COVID-19 (SARS-CoV2) @@ -148,806 +148,806 @@ export default function SampleReport(props: samplePreviewProps) { FOR INTERNAL USE ONLY - + + + + Sample Id : {id} + + + +
    + className={`${classes.subHeader} ${classes.borderRight} ${classes.borderLeft} ${classes.borderBottom} ${classes.cellTBPadding}`}> - Sample Id : {id} - - - -
    - - - SECTION A - MANDATORY FIELDS + SECTION A - MANDATORY FIELDS - - - - A.1 PERSON DETAILS + + + + A.1 PERSON DETAILS - - - - - - Patient Name - - - - - {sampleData && sampleData.personal_details && sampleData.personal_details.name} + + + + + + Patient Name - - - - - Age + + + {sampleData && sampleData.personal_details && sampleData.personal_details.name} + + + + + + + Age - - - - {sampleData && sampleData.personal_details && sampleData.personal_details.age_years } years{''} {sampleData && sampleData.personal_details && sampleData.personal_details.age_months } Months + + + + {sampleData && sampleData.personal_details && sampleData.personal_details.age_years} years{''} {sampleData && sampleData.personal_details && sampleData.personal_details.age_months} Months - + - - - - - Present Patient Village or Town - - - - - {sampleData && sampleData.personal_details && sampleData.personal_details.local_body_name} + + + + + Present Patient Village or Town - - - - - Gender - - - - - {sampleData && sampleData.personal_details && sampleData.personal_details.gender} + + + {sampleData && sampleData.personal_details && sampleData.personal_details.local_body_name} + + + + + + + Gender - + + + + {sampleData && sampleData.personal_details && sampleData.personal_details.gender} + + - - - - - Mobile Number (Self) + + + + + Mobile Number (Self) - - - - {sampleData && sampleData.personal_details && sampleData.personal_details.phone_number} - - - - - - District of Present Residence - - - - - {sampleData && sampleData.personal_details && sampleData.personal_details.district_name} + + + {sampleData && sampleData.personal_details && sampleData.personal_details.phone_number} + + + + + + + District of Present Residence - + + + + {sampleData && sampleData.personal_details && sampleData.personal_details.district_name} + + - - - - - Nationality - - - - - Indian + + + + + Nationality - - - - - State Of Present Residence + + + Indian - - - - {sampleData && sampleData.personal_details && sampleData.personal_details.state_name} + + + + + + State Of Present Residence - + + + + {sampleData && sampleData.personal_details && sampleData.personal_details.state_name} + + - - - A.2 SPECIMEN INFORMATION FROM REFERRING AGENCY + + A.2 SPECIMEN INFORMATION FROM REFERRING AGENCY - + - - - - - Collection Date - - - - - {sampleData && sampleData.specimen_details && moment(sampleData.specimen_details.created_date).format("lll")} + + + + + Collection Date - - - - - Label - - - - - {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_label} + + + {sampleData && sampleData.specimen_details && moment(sampleData.specimen_details.created_date).format("lll")} + + + + + + + Label - + + + + {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_label} + + - - - - - Sample Repeated + + + + + Sample Repeated - - - - {sampleData && sampleData.specimen_details && sampleData.specimen_details.is_repeated_sample !== null ? sampleData.specimen_details.is_repeated_sample ? 'Yes' : 'No' : ''} - - - - - - Sample Collection Facility Name - - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.hospital_name} + + + {sampleData && sampleData.specimen_details && sampleData.specimen_details.is_repeated_sample !== null ? sampleData.specimen_details.is_repeated_sample ? 'Yes' : 'No' : ''} + + + + + + + Sample Collection Facility Name - + + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.hospital_name} + + - - - - - Collection Facility Pin code - - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.hospital_pincode} + + + + + Collection Facility Pin code - + + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.hospital_pincode} + + - - - A.3 Patient Category + + A.3 Patient Category - + - - - {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 0' && + + + {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 0' && Cat 0 - Repeat Sample of Positive Case / Follow Up case - } - {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 1' && + } + {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 1' && Cat 1 - Symptomatic International Traveller in last 14 days - } - {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 2' && + } + {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 2' && Cat 2 - Symptomatic contact of lab confirmed Case - } - {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 3' && + } + {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 3' && Cat 3 - Symptomatic Healthcare Worker - } - {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 4' && + } + {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 4' && Cat 4 - Hospitalized SARI (Severe Acute Respiratory illness Patient) - } - {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 5a' && + } + {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 5a' && Cat 5a - Asymptomatic Direct and High Risk contact of confirmed case - family Member - } - {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 5b' && + } + {sampleData && sampleData.specimen_details && sampleData.specimen_details.icmr_category === 'Cat 5b' && Cat 5b - Asymptomatic Healthcare worker in contact with confimred case without adequete protection - } - + } + - - - SECTION B - OTHER FIELDS TO BE UPDATED + + + SECTION B - OTHER FIELDS TO BE UPDATED - - - - B.1 PERSON DETAILS + + + + B.1 PERSON DETAILS - + - - - - - Present Patient Address + + + + + Present Patient Address - - - - {sampleData && sampleData.personal_details && sampleData.personal_details.address} - - - - - - Pin code - - - - - {sampleData && sampleData.personal_details && sampleData.personal_details.pincode} + + + {sampleData && sampleData.personal_details && sampleData.personal_details.address} + + + + + + + Pin code - + + + + {sampleData && sampleData.personal_details && sampleData.personal_details.pincode} + + - - - - - Email Id - - - - - {sampleData && sampleData.personal_details && sampleData.personal_details.email} + + + + + Email Id - - - - - Date Of Birth - - - - - {sampleData && sampleData.personal_details && sampleData.personal_details.date_of_birth} + + + {sampleData && sampleData.personal_details && sampleData.personal_details.email} + + + + + + + Date Of Birth - + + + + {sampleData && sampleData.personal_details && sampleData.personal_details.date_of_birth} + + - - - - - Patient Aadhar Number + + + + + Patient Aadhar Number - - - - .................... - - - - - - Patient Passport Number + + + .................... - - - - {sampleData && sampleData.personal_details && sampleData.personal_details.passport_no} + + + + + + Patient Passport Number - + + + + {sampleData && sampleData.personal_details && sampleData.personal_details.passport_no} + + - - - B.2 EXPOSURE HISTORY ( 2 WEEKS BEFORE THE ONSET OF SYMPTOMS ) + + + B.2 EXPOSURE HISTORY ( 2 WEEKS BEFORE THE ONSET OF SYMPTOMS ) - + - - - - - Travel to foreign country in last 14 days + + + + + Travel to foreign country in last 14 days - - - - {sampleData && sampleData.exposure_history && sampleData.exposure_history.has_travel_to_foreign_last_14_days !== null ? sampleData.exposure_history.has_travel_to_foreign_last_14_days ? 'Yes' : 'No' : ''} - - - {/* Places of travel only if above is true*/} - - - - Places of travel - - - - - {sampleData && sampleData.exposure_history && sampleData.exposure_history.places_of_travel} + + + {sampleData && sampleData.exposure_history && sampleData.exposure_history.has_travel_to_foreign_last_14_days !== null ? sampleData.exposure_history.has_travel_to_foreign_last_14_days ? 'Yes' : 'No' : ''} + + + + {/* Places of travel only if above is true*/} + + + + Places of travel - + + + + {sampleData && sampleData.exposure_history && sampleData.exposure_history.places_of_travel} + + - - - - - Travel Start Date - - - - - {sampleData && sampleData.exposure_history && sampleData.exposure_history.travel_start_date} + + + + + Travel Start Date - - - - - Travel End Date - - - - - {sampleData && sampleData.exposure_history && sampleData.exposure_history.travel_end_date} + + + {sampleData && sampleData.exposure_history && sampleData.exposure_history.travel_start_date} + + + + + + + Travel End Date - + + + + {sampleData && sampleData.exposure_history && sampleData.exposure_history.travel_end_date} + + - - - - - In Contact with lab confimed Covid 19 Patient + + + + + In Contact with lab confimed Covid 19 Patient - - - - {sampleData && sampleData.exposure_history && sampleData.exposure_history.contact_with_confirmed_case !== null ? sampleData.exposure_history.contact_with_confirmed_case ? 'Yes' : 'No' : ''} - - - - - - Name of Confirmed Contacted Covid Patient - - - - - {sampleData && sampleData.exposure_history && sampleData.exposure_history.contact_case_name} + + + {sampleData && sampleData.exposure_history && sampleData.exposure_history.contact_with_confirmed_case !== null ? sampleData.exposure_history.contact_with_confirmed_case ? 'Yes' : 'No' : ''} + + + + + + + Name of Confirmed Contacted Covid Patient - + + + + {sampleData && sampleData.exposure_history && sampleData.exposure_history.contact_case_name} + + - - - - - Quarantine Status + + + + + Quarantine Status - - - - {sampleData && sampleData.exposure_history && sampleData.exposure_history.was_quarantined !== null ? sampleData.exposure_history.was_quarantined ? 'Yes' : 'No' : ''} - - - - - - Quarantine Location - - - - - {sampleData && sampleData.exposure_history && sampleData.exposure_history.quarantined_type} + + + {sampleData && sampleData.exposure_history && sampleData.exposure_history.was_quarantined !== null ? sampleData.exposure_history.was_quarantined ? 'Yes' : 'No' : ''} + + + + + + + Quarantine Location - + + + + {sampleData && sampleData.exposure_history && sampleData.exposure_history.quarantined_type} + + - - - - - Health care worker working in a hospital involved in managing patients + + + + + Health care worker working in a hospital involved in managing patients - - - - {sampleData && sampleData.exposure_history && sampleData.exposure_history.healthcare_worker !== null ? sampleData.exposure_history.healthcare_worker ? 'Yes' : 'No' : ''} - - + + + + {sampleData && sampleData.exposure_history && sampleData.exposure_history.healthcare_worker !== null ? sampleData.exposure_history.healthcare_worker ? 'Yes' : 'No' : ''} + + - - - B.3 CLINICAL SYMPTOMS AND SIGNS + + + B.3 CLINICAL SYMPTOMS AND SIGNS - + - - - - - Date of Onset of Symptoms + + + + + Date of Onset of Symptoms - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.date_of_onset_of_symptoms} - - - - - - Symptoms - - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.symptoms && !!sampleData.medical_conditions.symptoms.length && sampleData.medical_conditions.symptoms.join(', ')} + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.date_of_onset_of_symptoms} + + + + + + + Symptoms - + + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.symptoms && !!sampleData.medical_conditions.symptoms.length && sampleData.medical_conditions.symptoms.join(', ')} + + - - - - - First Symptom - - - - - - + + + + + First Symptom - - - - - Person has Severe Acute Respiratory illness + + + - - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.has_sari !== null ? sampleData.medical_conditions.has_sari ? 'Yes' : 'No' : ''} + + + + + + Person has Severe Acute Respiratory illness - + + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.has_sari !== null ? sampleData.medical_conditions.has_sari ? 'Yes' : 'No' : ''} + + - - - - - Person Has Acute Respiratory Illness + + + + + Person Has Acute Respiratory Illness - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.has_ari !== null ? sampleData.medical_conditions.has_ari ? 'Yes' : 'No' : ''} - - + + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.has_ari !== null ? sampleData.medical_conditions.has_ari ? 'Yes' : 'No' : ''} + + - - - B.4 UNDERLYING MEDICAL CONDITIONS + + + B.4 UNDERLYING MEDICAL CONDITIONS - + - - {/* + {/* */} - - - Medical Conditions + + + Medical Conditions - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.medical_conditions && !!sampleData.medical_conditions.medical_conditions.length && sampleData.medical_conditions.medical_conditions.join(', ')} - - - {/* */} - {/**/} - {/* */} - {/* */} - {/* Immuno Compromised Conditions*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/* {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.has_sari}*/} - {/* */} - {/* */} - {/**/} - - - - - - B.5 HOSPITALIZATION , TREATMENT AND INVESTIGATION + + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.medical_conditions && !!sampleData.medical_conditions.medical_conditions.length && sampleData.medical_conditions.medical_conditions.join(', ')} + {/* */} + {/**/} + {/* */} + {/* */} + {/* Immuno Compromised Conditions*/} + {/* */} + {/* */} + {/* */} + {/* */} + {/* {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.has_sari}*/} + {/* */} + {/* */} + {/**/} + - - - - - Hospitalization Date - - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.hospitalization_date} + + + + B.5 HOSPITALIZATION , TREATMENT AND INVESTIGATION + + + + + + + + Hospitalization Date - - - - - Diagnosis - - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.diagnosis} + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.hospitalization_date} + + + + + + + Diagnosis - + + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.diagnosis} + + - - - - - Differential diagnosis + + + + + Differential diagnosis - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.diff_diagnosis} - - - - - - Etiology Identified - - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.etiology_identified} + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.diff_diagnosis} + + + + + + + Etiology Identified - + + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.etiology_identified} + + - - - - - Asypical Presentation - - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.is_atypical_presentation !== null ? sampleData.medical_conditions.is_atypical_presentation ? 'Yes' : 'No' : ''} + + + + + Asypical Presentation - - - - - Unusual or Unexpected Course - - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.is_unusual_course !== null ? sampleData.medical_conditions.is_unusual_course ? 'Yes' : 'No' : ''} + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.is_atypical_presentation !== null ? sampleData.medical_conditions.is_atypical_presentation ? 'Yes' : 'No' : ''} + + + + + + + Unusual or Unexpected Course - + + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.is_unusual_course !== null ? sampleData.medical_conditions.is_unusual_course ? 'Yes' : 'No' : ''} + + - - {/* + {/* */} - - - Outcome - - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.diagnosis} - - - {/* */} - {/**/} - {/* */} - {/* */} - {/* Outcome Date*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/* 20-01-2020*/} - {/* */} - {/* */} - {/**/} - - - - - - - Hospital Name / Address + + + Outcome - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.hospital_name} + + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.diagnosis} + + + {/* */} + {/**/} + {/* */} + {/* */} + {/* Outcome Date*/} + {/* */} + {/* */} + {/* */} + {/* */} + {/* 20-01-2020*/} + {/* */} + {/* */} + {/**/} + + + + + + + Hospital Name / Address - - - - - Hospital Phone Number - - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.hospital_phone_number} + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.hospital_name} + + + + + + + Hospital Phone Number - + + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.hospital_phone_number} + + - - - - - Name of Doctor + + + + + Name of Doctor - - - - {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.doctor_name} - - - - - - Signature & Date + + + {sampleData && sampleData.medical_conditions && sampleData.medical_conditions.doctor_name} + + + + + + + Signature & Date - -
    - + +
    +
    ) From 26929452d20c2ed5ef81f3357eb3a61dc6cdd5c2 Mon Sep 17 00:00:00 2001 From: Bodhish Thomas Date: Sun, 21 Jun 2020 01:59:10 +0530 Subject: [PATCH 23/25] Clean up w3 styles --- src/Components/Facility/FacilityHome.tsx | 24 +- src/Components/Patient/PatientHome.tsx | 2 +- src/Components/Patient/TeleConsultation.tsx | 298 -------------------- src/Components/Patient/TreatmentForm.tsx | 252 ----------------- src/Router/AppRouter.tsx | 9 +- src/index.html | 2 - 6 files changed, 14 insertions(+), 573 deletions(-) delete mode 100644 src/Components/Patient/TeleConsultation.tsx delete mode 100644 src/Components/Patient/TreatmentForm.tsx diff --git a/src/Components/Facility/FacilityHome.tsx b/src/Components/Facility/FacilityHome.tsx index feb718015c5..13fdf1b91aa 100644 --- a/src/Components/Facility/FacilityHome.tsx +++ b/src/Components/Facility/FacilityHome.tsx @@ -116,11 +116,11 @@ export const FacilityHome = (props: any) => { {data.num_patient_referred || "-"} ); @@ -155,7 +155,7 @@ export const FacilityHome = (props: any) => { - + - + - + - + - + - +
    ) : ( - +
    No Medical History so far
    )} diff --git a/src/Components/Patient/TeleConsultation.tsx b/src/Components/Patient/TeleConsultation.tsx deleted file mode 100644 index f328b8dbfd0..00000000000 --- a/src/Components/Patient/TeleConsultation.tsx +++ /dev/null @@ -1,298 +0,0 @@ -import { Box, Button, Card, CardActions, CardContent, CardHeader, Checkbox, Grid, Typography } from "@material-ui/core"; -import { makeStyles, Theme } from '@material-ui/core/styles'; -import React, { useState } from "react"; -import { useDispatch } from "react-redux"; -import { TextInputField } from "../Common/HelperInputFields"; -const isEmpty = require('lodash.isempty'); - -const useStyles = makeStyles((theme: Theme) => ({ - formTop: { - marginTop: '80px', - marginBottom: "70px" - }, - formControl: { - margin: theme.spacing(1) - }, - selectLabel: { - background: 'white', - padding: '2px 10px' - }, - checkBoxLabel: { - marginLeft: '8px' - }, -})); - - -export const TeleConsultation = () => { - const classes = useStyles(); - const dispatch: any = useDispatch(); - const inputLabel = React.useRef(null); - - const initForm: any = { - fever: false, - feverDuration:"", - soreThroat:false, - soreThroatDuration:"", - cough: false, - coughDuration:"", - breathlessness: false, - breathlessnessDuration: "", - otherSymptoms: false, - otherSymptomsDetails: "", - reasonForCall:"" - - }; - const initErr: any = {}; - const [form, setForm] = useState(initForm); - const [errors, setErrors] = useState(initErr); - - const validateForm = () => { - const err: any = {}; - Object.keys(form).forEach(key => { - const value = form[key]; - switch (key) { - case "feverDuration": - if (form.fever && !value) { - err[key] = "please fill the duration"; - } - break; - case "soreThroatDuration": - if (form.soreThroat && !value) { - err[key] = "please fill the duration"; - } - break; - case "coughDuration": - if (form.cough && !value) { - err[key] = "please fill the duration"; - } - break; - case "breathlessnessDuration": - if (form.breathlessness && !value) { - err[key] = "please fill the duration"; - } - break; - case "otherSymptomsDetails": - if (form.otherSymptoms && !value) { - err[key] = "please fill the details"; - } - break; - default: - break; - } - }); - if (!isEmpty(err)) { - setErrors(err); - return false; - } - setErrors({}); - return true; - }; - - const handleSubmit = (e: any) => { - e.preventDefault() - const validForm = validateForm(); - if (validForm) { - console.log('form', form); - } - } - - const handleChange = (e: any) => { - const { name, value } = e.target; - const formValues = { ...form }; - const errorField = Object.assign({}, errors); - if (errorField[name]) { - errorField[name] = null; - setErrors(errorField); - } - formValues[name] = value; - setForm(formValues) - } - const handleCheckboxFieldChange = (e: any) => { - const { checked, name } = e.target; - const fieldValue = Object.assign({}, form); - fieldValue[name] = checked; - setForm(fieldValue); - }; - - return
    - - - - - - - -
    handleSubmit(e)}> - - - - Symptoms (Yes / No) and Duration (in days) - - - - - Fever - - - - {form.fever && } - - - - Sore Throat - - - - {form.soreThroat && } - - - - - Cough - - - - {form.cough && } - - - - - Breathlessness - - - - {form.breathlessness && } - - Any other symptoms? - - - - - Other symptoms - - - - {form.otherSymptoms && } - - - Reason for calling - - - - - - - - - - -
    -
    - -
    -
    -
    -} diff --git a/src/Components/Patient/TreatmentForm.tsx b/src/Components/Patient/TreatmentForm.tsx deleted file mode 100644 index 36e8dd7ecc7..00000000000 --- a/src/Components/Patient/TreatmentForm.tsx +++ /dev/null @@ -1,252 +0,0 @@ -import React, { useState } from "react" -import { makeStyles, Theme } from '@material-ui/core/styles'; -import { useDispatch } from "react-redux"; -import { Box, Grid, Checkbox, Card, CardHeader, CardContent, CardActions, Button, FormControl, InputLabel, Select, MenuItem, Typography, FormLabel, RadioGroup, Radio, FormControlLabel } from "@material-ui/core"; -import { TextInputField, TimeInputField } from "../Common/HelperInputFields"; -// import { } from "../../Redux/actions"; -const isEmpty = require('lodash.isempty'); - - -const useStyles = makeStyles((theme: Theme) => ({ - formTop: { - marginTop: '80px', - marginBottom: "70px" - }, - formControl: { - margin: theme.spacing(1) - }, - selectLabel: { - background: 'white', - padding: '2px 10px' - }, - checkBoxLabel: { - marginLeft: '8px' - }, -})); - - -export const TreatmentForm = (props: any) => { - const classes = useStyles(); - const dispatch: any = useDispatch(); - const inputLabel = React.useRef(null); - const [selectedDate, setSelectedDate] = useState(new Date()); - - const initForm: any = { - patientExamDetails: "", - physicalExamSigns: "", - medicationAlready: "", - medProvidedAtCenter: "", - otherDetails: "", - temperature: "", - time: selectedDate - }; - const initErr: any = {}; - const [form, setForm] = useState(initForm); - const [errors, setErrors] = useState(initErr); - - const validateForm = () => { - const err: any = {}; - Object.keys(form).forEach(key => { - const value = form[key]; - switch (key) { - case "patientExamDetails": - if (!value) { - err[key] = "please fill the details"; - } - break; - case "physicalExamSigns": - if (!value) { - err[key] = "please fill the details"; - } - break; - case "medicationAlready": - if (!value) { - err[key] = "please fill the details"; - } - break; - case "medProvidedAtCenter": - if (!value) { - err[key] = "please fill the details"; - } - break; - case "temperature": - if (!value) { - err[key] = "please fill the temperature"; - } - break; - default: - break; - } - }); - if (!isEmpty(err)) { - setErrors(err); - return false; - } - setErrors({}); - return true; - }; - - const handleSubmit = (e: any) => { - e.preventDefault() - const validForm = validateForm(); - if (validForm) { - console.log('form', form); - } - } - - const handleChange = (e: any) => { - const { name, value } = e.target; - const formValues = { ...form }; - const errorField = Object.assign({}, errors); - if (errorField[name]) { - errorField[name] = null; - setErrors(errorField); - } - formValues[name] = value; - setForm(formValues) - } - - const handleTimeFieldChange = (date: any) => { - const formValues = { ...form }; - formValues['time'] = date; - setSelectedDate(date); - setForm(formValues); - }; - - return
    - - - - - - - -
    handleSubmit(e)}> - - - - - - Patient Daily Progress - - - - - - - - - - - - - - - - - - - Patient Medication - - - - - - - - - - - -
    -
    -
    -
    -
    -} diff --git a/src/Router/AppRouter.tsx b/src/Router/AppRouter.tsx index bc1d9b2ce98..5c781b33658 100644 --- a/src/Router/AppRouter.tsx +++ b/src/Router/AppRouter.tsx @@ -1,4 +1,4 @@ -import { useRedirect, useRoutes , navigate, usePath } from "hookrouter"; +import { useRedirect, useRoutes, navigate, usePath } from "hookrouter"; import React, { useEffect, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; import { BedCapacityForm } from "../Components/Facility/BedCapacityForm"; @@ -19,8 +19,6 @@ import { SampleDetails } from "../Components/Patient/SampleDetails"; import SampleReport from "../Components/Patient/SamplePreview"; import { SampleTest } from "../Components/Patient/SampleTest"; import SampleViewAdmin from "../Components/Patient/SampleViewAdmin"; -import { TeleConsultation } from "../Components/Patient/TeleConsultation"; -import { TreatmentForm } from "../Components/Patient/TreatmentForm"; import ManageUsers from "../Components/Users/ManageUsers"; import { UserAdd } from "../Components/Users/UserAdd"; import InventoryList from "../Components/Facility/InventoryList"; @@ -42,9 +40,7 @@ const routes = { "/user/add": () => , "/patients": () => , "/patient/:id": ({ id }: any) => , - "/patient/tele-consult": () => , "/patient/discharge": () => , - "/patient/treatment": () => , "/sample": () => , "/sample/:id": ({ id }: any) => , '/sample/report/:patientId': ({ patientId }: any) => , @@ -83,9 +79,6 @@ const routes = { "/facility/:facilityId/patient/:patientId/sample/:id": ({ id }: any) => ( ), - "/facility/:facilityId/patient/:id/treatment": ({ facilityId, id }: any) => ( - - ), "/facility/:facilityId/triage/:id": ({ facilityId, id }: any) => ( ), diff --git a/src/index.html b/src/index.html index b34b4ad7e52..215608dc42e 100644 --- a/src/index.html +++ b/src/index.html @@ -30,8 +30,6 @@ - - From 57280af2d9895a90c9a17458e6461193907eebe0 Mon Sep 17 00:00:00 2001 From: syam Date: Sun, 21 Jun 2020 13:25:56 +0530 Subject: [PATCH 24/25] removed treatment form and tele consultation form --- src/Components/Patient/TeleConsultation.tsx | 298 -------------------- src/Components/Patient/TreatmentForm.tsx | 252 ----------------- 2 files changed, 550 deletions(-) delete mode 100644 src/Components/Patient/TeleConsultation.tsx delete mode 100644 src/Components/Patient/TreatmentForm.tsx diff --git a/src/Components/Patient/TeleConsultation.tsx b/src/Components/Patient/TeleConsultation.tsx deleted file mode 100644 index f328b8dbfd0..00000000000 --- a/src/Components/Patient/TeleConsultation.tsx +++ /dev/null @@ -1,298 +0,0 @@ -import { Box, Button, Card, CardActions, CardContent, CardHeader, Checkbox, Grid, Typography } from "@material-ui/core"; -import { makeStyles, Theme } from '@material-ui/core/styles'; -import React, { useState } from "react"; -import { useDispatch } from "react-redux"; -import { TextInputField } from "../Common/HelperInputFields"; -const isEmpty = require('lodash.isempty'); - -const useStyles = makeStyles((theme: Theme) => ({ - formTop: { - marginTop: '80px', - marginBottom: "70px" - }, - formControl: { - margin: theme.spacing(1) - }, - selectLabel: { - background: 'white', - padding: '2px 10px' - }, - checkBoxLabel: { - marginLeft: '8px' - }, -})); - - -export const TeleConsultation = () => { - const classes = useStyles(); - const dispatch: any = useDispatch(); - const inputLabel = React.useRef(null); - - const initForm: any = { - fever: false, - feverDuration:"", - soreThroat:false, - soreThroatDuration:"", - cough: false, - coughDuration:"", - breathlessness: false, - breathlessnessDuration: "", - otherSymptoms: false, - otherSymptomsDetails: "", - reasonForCall:"" - - }; - const initErr: any = {}; - const [form, setForm] = useState(initForm); - const [errors, setErrors] = useState(initErr); - - const validateForm = () => { - const err: any = {}; - Object.keys(form).forEach(key => { - const value = form[key]; - switch (key) { - case "feverDuration": - if (form.fever && !value) { - err[key] = "please fill the duration"; - } - break; - case "soreThroatDuration": - if (form.soreThroat && !value) { - err[key] = "please fill the duration"; - } - break; - case "coughDuration": - if (form.cough && !value) { - err[key] = "please fill the duration"; - } - break; - case "breathlessnessDuration": - if (form.breathlessness && !value) { - err[key] = "please fill the duration"; - } - break; - case "otherSymptomsDetails": - if (form.otherSymptoms && !value) { - err[key] = "please fill the details"; - } - break; - default: - break; - } - }); - if (!isEmpty(err)) { - setErrors(err); - return false; - } - setErrors({}); - return true; - }; - - const handleSubmit = (e: any) => { - e.preventDefault() - const validForm = validateForm(); - if (validForm) { - console.log('form', form); - } - } - - const handleChange = (e: any) => { - const { name, value } = e.target; - const formValues = { ...form }; - const errorField = Object.assign({}, errors); - if (errorField[name]) { - errorField[name] = null; - setErrors(errorField); - } - formValues[name] = value; - setForm(formValues) - } - const handleCheckboxFieldChange = (e: any) => { - const { checked, name } = e.target; - const fieldValue = Object.assign({}, form); - fieldValue[name] = checked; - setForm(fieldValue); - }; - - return
    - - - - - - - -
    handleSubmit(e)}> - - - - Symptoms (Yes / No) and Duration (in days) - - - - - Fever - - - - {form.fever && } - - - - Sore Throat - - - - {form.soreThroat && } - - - - - Cough - - - - {form.cough && } - - - - - Breathlessness - - - - {form.breathlessness && } - - Any other symptoms? - - - - - Other symptoms - - - - {form.otherSymptoms && } - - - Reason for calling - - - - - - - - - - -
    -
    - -
    -
    -
    -} diff --git a/src/Components/Patient/TreatmentForm.tsx b/src/Components/Patient/TreatmentForm.tsx deleted file mode 100644 index 36e8dd7ecc7..00000000000 --- a/src/Components/Patient/TreatmentForm.tsx +++ /dev/null @@ -1,252 +0,0 @@ -import React, { useState } from "react" -import { makeStyles, Theme } from '@material-ui/core/styles'; -import { useDispatch } from "react-redux"; -import { Box, Grid, Checkbox, Card, CardHeader, CardContent, CardActions, Button, FormControl, InputLabel, Select, MenuItem, Typography, FormLabel, RadioGroup, Radio, FormControlLabel } from "@material-ui/core"; -import { TextInputField, TimeInputField } from "../Common/HelperInputFields"; -// import { } from "../../Redux/actions"; -const isEmpty = require('lodash.isempty'); - - -const useStyles = makeStyles((theme: Theme) => ({ - formTop: { - marginTop: '80px', - marginBottom: "70px" - }, - formControl: { - margin: theme.spacing(1) - }, - selectLabel: { - background: 'white', - padding: '2px 10px' - }, - checkBoxLabel: { - marginLeft: '8px' - }, -})); - - -export const TreatmentForm = (props: any) => { - const classes = useStyles(); - const dispatch: any = useDispatch(); - const inputLabel = React.useRef(null); - const [selectedDate, setSelectedDate] = useState(new Date()); - - const initForm: any = { - patientExamDetails: "", - physicalExamSigns: "", - medicationAlready: "", - medProvidedAtCenter: "", - otherDetails: "", - temperature: "", - time: selectedDate - }; - const initErr: any = {}; - const [form, setForm] = useState(initForm); - const [errors, setErrors] = useState(initErr); - - const validateForm = () => { - const err: any = {}; - Object.keys(form).forEach(key => { - const value = form[key]; - switch (key) { - case "patientExamDetails": - if (!value) { - err[key] = "please fill the details"; - } - break; - case "physicalExamSigns": - if (!value) { - err[key] = "please fill the details"; - } - break; - case "medicationAlready": - if (!value) { - err[key] = "please fill the details"; - } - break; - case "medProvidedAtCenter": - if (!value) { - err[key] = "please fill the details"; - } - break; - case "temperature": - if (!value) { - err[key] = "please fill the temperature"; - } - break; - default: - break; - } - }); - if (!isEmpty(err)) { - setErrors(err); - return false; - } - setErrors({}); - return true; - }; - - const handleSubmit = (e: any) => { - e.preventDefault() - const validForm = validateForm(); - if (validForm) { - console.log('form', form); - } - } - - const handleChange = (e: any) => { - const { name, value } = e.target; - const formValues = { ...form }; - const errorField = Object.assign({}, errors); - if (errorField[name]) { - errorField[name] = null; - setErrors(errorField); - } - formValues[name] = value; - setForm(formValues) - } - - const handleTimeFieldChange = (date: any) => { - const formValues = { ...form }; - formValues['time'] = date; - setSelectedDate(date); - setForm(formValues); - }; - - return
    - - - - - - - -
    handleSubmit(e)}> - - - - - - Patient Daily Progress - - - - - - - - - - - - - - - - - - - Patient Medication - - - - - - - - - - - -
    -
    -
    -
    -
    -} From 62629cf916e27e1abb1c09f5968c4d1535808d4a Mon Sep 17 00:00:00 2001 From: syamkumar Date: Sun, 21 Jun 2020 13:51:31 +0530 Subject: [PATCH 25/25] Apply suggestions from code review Co-authored-by: Rigin Oommen --- src/Components/Facility/FacilityHome.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Components/Facility/FacilityHome.tsx b/src/Components/Facility/FacilityHome.tsx index 13fdf1b91aa..febfaa193a7 100644 --- a/src/Components/Facility/FacilityHome.tsx +++ b/src/Components/Facility/FacilityHome.tsx @@ -155,7 +155,7 @@ export const FacilityHome = (props: any) => { - + - + - + - + - + - +