diff --git a/backend/.prettierignore b/backend/.prettierignore index 53c37a1..91a3983 100644 --- a/backend/.prettierignore +++ b/backend/.prettierignore @@ -1 +1,3 @@ -dist \ No newline at end of file +dist +node_modules +package-lock.json diff --git a/backend/.prettierrc b/backend/.prettierrc index 0243ce1..0be80af 100644 --- a/backend/.prettierrc +++ b/backend/.prettierrc @@ -4,5 +4,13 @@ "endOfLine": "auto", "printWidth": 100, "tabWidth": 2, - "singleQuote": true + "singleQuote": true, + "overrides": [ + { + "files": "*.json", + "options": { + "singleQuote": false + } + } + ] } diff --git a/backend/package.json b/backend/package.json index fe8e3ab..dd2976c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -51,9 +51,9 @@ "start": "ts-node-dev src/server.ts", "test": "mocha", "build": "tsc", - "lint": "tsc && eslint \"**/*.{js,ts}\"", - "lint:fix": "tsc --noEmit && eslint \"**/*.{js,ts}\" --quiet --fix", - "prettier": "prettier --check \"**/*.{js,ts}\"", - "prettier:fix": "prettier --write \"**/*.{js,ts}\"" + "lint": "tsc && eslint \"**/*.{js,ts,jsx,tsx}\"", + "lint:fix": "tsc --noEmit && eslint \"**/*.{js,ts,jsx,tsx}\" --quiet --fix", + "prettier": "prettier --check \"**/*.{js,ts,jsx,tsx,json}\"", + "prettier:fix": "prettier --write \"**/*.{js,ts,jsx,tsx,json}\"" } } diff --git a/frontend/.prettierignore b/frontend/.prettierignore index 2cf1da4..9763c73 100644 --- a/frontend/.prettierignore +++ b/frontend/.prettierignore @@ -1,2 +1,4 @@ dist -build \ No newline at end of file +build +node_modules +package-lock.json diff --git a/frontend/.prettierrc b/frontend/.prettierrc index 912f7bb..0be80af 100644 --- a/frontend/.prettierrc +++ b/frontend/.prettierrc @@ -4,5 +4,13 @@ "endOfLine": "auto", "printWidth": 100, "tabWidth": 2, - "singleQuote": true -} \ No newline at end of file + "singleQuote": true, + "overrides": [ + { + "files": "*.json", + "options": { + "singleQuote": false + } + } + ] +} diff --git a/frontend/package.json b/frontend/package.json index d31801e..fdc2a52 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -54,10 +54,10 @@ "test": "react-scripts test --watchAll=false", "build": "react-scripts build", "eject": "react-scripts eject", - "lint": "tsc && eslint \"**/*.{js,ts}\"", - "lint:fix": "eslint \"**/*.{js,ts}\" --quiet --fix", - "prettier": "prettier --check \"**/*.{js,ts}\"", - "prettier:fix": "prettier --write \"**/*.{js,ts}\"" + "lint": "tsc && eslint \"**/*.{js,ts,jsx,tsx}\"", + "lint:fix": "tsc --noEmit && eslint \"**/*.{js,ts,jsx,tsx}\" --quiet --fix", + "prettier": "prettier --check \"**/*.{js,ts,jsx,tsx,json}\"", + "prettier:fix": "prettier --write \"**/*.{js,ts,jsx,tsx,json}\"" }, "eslintConfig": { "extends": [ @@ -82,7 +82,5 @@ "last 1 safari version" ] }, - "proxy": "http://localhost:5051" - } diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index b9d282a..7b9f888 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -2,43 +2,49 @@ import LocalPharmacyIcon from '@mui/icons-material/LocalPharmacy'; import { Button } from '@mui/material'; import Box from '@mui/material/Box'; import { Container } from '@mui/system'; -import { - BrowserRouter as Router, Link, Route, Routes -} from 'react-router-dom'; +import { BrowserRouter as Router, Link, Route, Routes } from 'react-router-dom'; import './App.css'; import DoctorOrders from './views/DoctorOrders/DoctorOrders'; import Login from './views/Login/Login'; import axios from 'axios'; -axios.defaults.baseURL = process.env.REACT_APP_PIMS_BACKEND_URL ? process.env.REACT_APP_PIMS_BACKEND_URL : - 'http://localhost:' + (process.env.REACT_APP_PIMS_BACKEND_PORT ? process.env.REACT_APP_PIMS_BACKEND_PORT : '5051') ; +axios.defaults.baseURL = process.env.REACT_APP_PIMS_BACKEND_URL + ? process.env.REACT_APP_PIMS_BACKEND_URL + : 'http://localhost:' + + (process.env.REACT_APP_PIMS_BACKEND_PORT ? process.env.REACT_APP_PIMS_BACKEND_PORT : '5051'); function App() { return ( - - -
- -
-
- + + +
+ +
+
+

Pharmacy

-
- - +
+ + + + + +
{/* Initial load to login page, will need to change to check for user authentication to load to correct page */} - } /> - }> - }> + } /> + }> + }> - + ); } diff --git a/frontend/src/config.json b/frontend/src/config.json index fd923bb..6ce29d5 100644 --- a/frontend/src/config.json +++ b/frontend/src/config.json @@ -1,6 +1,6 @@ { - "realm": "ClientFhirServer", - "client": "pims-login", - "auth": "http://localhost:8180/auth", - "scopeId": "pims" - } \ No newline at end of file + "realm": "ClientFhirServer", + "client": "pims-login", + "auth": "http://localhost:8180/auth", + "scopeId": "pims" +} diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index 032464f..db4d643 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -4,9 +4,7 @@ import './index.css'; import App from './App'; import reportWebVitals from './reportWebVitals'; -const root = ReactDOM.createRoot( - document.getElementById('root') as HTMLElement -); +const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement); root.render( diff --git a/frontend/src/styles/theme.tsx b/frontend/src/styles/theme.tsx index 81e1262..b50826b 100644 --- a/frontend/src/styles/theme.tsx +++ b/frontend/src/styles/theme.tsx @@ -1,42 +1,42 @@ import { createTheme } from '@mui/material/styles'; const colors = { - white: '#fff', - black: '#222', - red: '#d95d77', - redLight: '#f50057', - blue: '#5d89a1', - green: '#28a745', - gray: '#4a4a4a', - grayLight: '#4e5258', - grayLighter: '#b5b6ba', - grayLightest: '#f2f3f9', + white: '#fff', + black: '#222', + red: '#d95d77', + redLight: '#f50057', + blue: '#5d89a1', + green: '#28a745', + gray: '#4a4a4a', + grayLight: '#4e5258', + grayLighter: '#b5b6ba', + grayLightest: '#f2f3f9' }; const paletteBase = { - primary: { - main: colors.blue - }, - secondary: { - main: colors.redLight, - success: colors.green - }, - error: { - main: colors.red - }, - common: colors, - background: { - default: colors.grayLightest, - primary: colors.grayLight - }, - text: { - primary: colors.black, - secondary: colors.black, - gray: colors.grayLighter - }, + primary: { + main: colors.blue + }, + secondary: { + main: colors.redLight, + success: colors.green + }, + error: { + main: colors.red + }, + common: colors, + background: { + default: colors.grayLightest, + primary: colors.grayLight + }, + text: { + primary: colors.black, + secondary: colors.black, + gray: colors.grayLighter + } }; const theme = createTheme({ - palette: { ...paletteBase }, + palette: { ...paletteBase } }); export default theme; diff --git a/frontend/src/views/DoctorOrders/DoctorOrders.tsx b/frontend/src/views/DoctorOrders/DoctorOrders.tsx index 4f9ac01..4237ed3 100644 --- a/frontend/src/views/DoctorOrders/DoctorOrders.tsx +++ b/frontend/src/views/DoctorOrders/DoctorOrders.tsx @@ -9,7 +9,7 @@ import VerifiedOrders from './VerifiedOrders/VerifiedOrders'; function a11yProps(index: number) { return { id: `simple-tab-${index}`, - 'aria-controls': `simple-tabpanel-${index}`, + 'aria-controls': `simple-tabpanel-${index}` }; } @@ -21,21 +21,22 @@ export default function DoctorOrders() { }; return ( - - + + - - - - + + + + @@ -61,4 +62,4 @@ export default function DoctorOrders() { ); -} \ No newline at end of file +} diff --git a/frontend/src/views/DoctorOrders/NewOrders/NewOrders.test.tsx b/frontend/src/views/DoctorOrders/NewOrders/NewOrders.test.tsx index 51dd590..d66b265 100644 --- a/frontend/src/views/DoctorOrders/NewOrders/NewOrders.test.tsx +++ b/frontend/src/views/DoctorOrders/NewOrders/NewOrders.test.tsx @@ -5,7 +5,6 @@ import axios from 'axios'; jest.mock('axios'); describe('', () => { - it('renders the order card with no doctor orders', async () => { axios.get = jest.fn().mockImplementationOnce(() => Promise.resolve({ data: [] })); render(); @@ -15,4 +14,4 @@ describe('', () => { expect(linkElement).toBeInTheDocument(); }); }); -}); \ No newline at end of file +}); diff --git a/frontend/src/views/DoctorOrders/NewOrders/NewOrders.tsx b/frontend/src/views/DoctorOrders/NewOrders/NewOrders.tsx index 2297c50..62a4485 100644 --- a/frontend/src/views/DoctorOrders/NewOrders/NewOrders.tsx +++ b/frontend/src/views/DoctorOrders/NewOrders/NewOrders.tsx @@ -3,11 +3,11 @@ import './NewOrders.css'; const NewOrders = () => { return ( -
+

NewOrders

- +
); }; -export default NewOrders; \ No newline at end of file +export default NewOrders; diff --git a/frontend/src/views/DoctorOrders/OrderCard/EtasuPopUp/EtasuPopUp.test.tsx b/frontend/src/views/DoctorOrders/OrderCard/EtasuPopUp/EtasuPopUp.test.tsx index 36e9c22..31654b4 100644 --- a/frontend/src/views/DoctorOrders/OrderCard/EtasuPopUp/EtasuPopUp.test.tsx +++ b/frontend/src/views/DoctorOrders/OrderCard/EtasuPopUp/EtasuPopUp.test.tsx @@ -4,6 +4,6 @@ import EtasuPopUp from './EtasuPopUp'; test.skip('renders Status', () => { render(); - const linkElement = screen.getByText("Total"); + const linkElement = screen.getByText('Total'); expect(linkElement).toBeInTheDocument(); -}); \ No newline at end of file +}); diff --git a/frontend/src/views/DoctorOrders/OrderCard/EtasuPopUp/EtasuPopUp.tsx b/frontend/src/views/DoctorOrders/OrderCard/EtasuPopUp/EtasuPopUp.tsx index 6153bee..be0bc0f 100644 --- a/frontend/src/views/DoctorOrders/OrderCard/EtasuPopUp/EtasuPopUp.tsx +++ b/frontend/src/views/DoctorOrders/OrderCard/EtasuPopUp/EtasuPopUp.tsx @@ -11,6 +11,14 @@ import axios from 'axios'; import * as React from 'react'; import { useState } from 'react'; +type MetRequirements = { + stakeholderId: string; + completed: boolean; + metRequirementId: string; + requirementName: string; + requirementDescription: string; + _id: string; +}; interface DoctorOrder { caseNumber?: string; @@ -26,42 +34,35 @@ interface DoctorOrder { total?: number; pickupDate?: string; dispenseStatus?: string; - metRequirements: { - stakeholderId: string, - completed: boolean, - metRequirementId: string, - requirementName: string, - requirementDescription: string, - _id: string - }[] + metRequirements: MetRequirements[]; } const Transition = React.forwardRef(function Transition( props: TransitionProps & { children: React.ReactElement; }, - ref: React.Ref, + ref: React.Ref ) { - return ; + return ; }); const EtasuPopUp = (props: any) => { const [open, setOpen] = React.useState(false); - const [doctorOrder, getDoctorOrders] = useState(); const handleClickOpen = () => { setOpen(true); - // call api endpoint to update - const url = '/doctorOrders/api/updateRx/' + props.data._id + '?dontUpdateStatus=true'; - axios.patch(url) - .then(function (response) { - const DoctorOrders = response.data; - //Adding data to state - getDoctorOrders(DoctorOrders); - }) - .catch(error => console.error('Error: $(error')); + // call api endpoint to update + const url = '/doctorOrders/api/updateRx/' + props.data._id + '?dontUpdateStatus=true'; + axios + .patch(url) + .then(function (response) { + const DoctorOrders = response.data; + //Adding data to state + getDoctorOrders(DoctorOrders); + }) + .catch(error => console.error('Error: $(error')); }; const handleClose = () => { @@ -70,7 +71,7 @@ const EtasuPopUp = (props: any) => { return ( - { TransitionComponent={Transition} keepMounted onClose={handleClose} - aria-describedby='alert-dialog-slide-description' + aria-describedby="alert-dialog-slide-description" > {'Elements to Assure Safe Use (ETASU)'} - + - {doctorOrder?.metRequirements.map((etasuElement) => - - {etasuElement.requirementName} - {etasuElement.completed ? '✅' : '❌'} - - )} + {doctorOrder?.metRequirements + .sort((first: MetRequirements, second: MetRequirements) => { + // Keep the other forms unsorted. + if (second.requirementName.includes('Patient Status Update')) { + // Sort the Patient Status Update forms in descending order of timestamp. + return second.requirementName.localeCompare(first.requirementName); + } + return 0; + }) + .map(etasuElement => ( + + {etasuElement.requirementName} + {etasuElement.completed ? '✅' : '❌'} + + ))} @@ -101,4 +111,4 @@ const EtasuPopUp = (props: any) => { ); }; -export default EtasuPopUp; \ No newline at end of file +export default EtasuPopUp; diff --git a/frontend/src/views/DoctorOrders/OrderCard/OrderCard.test.tsx b/frontend/src/views/DoctorOrders/OrderCard/OrderCard.test.tsx index f7a1888..a82d8a6 100644 --- a/frontend/src/views/DoctorOrders/OrderCard/OrderCard.test.tsx +++ b/frontend/src/views/DoctorOrders/OrderCard/OrderCard.test.tsx @@ -3,36 +3,40 @@ import { render, screen, waitFor } from '@testing-library/react'; import OrderCard from './OrderCard'; import axios from 'axios'; -const doctorOrders = [{caseNumber: '1694010494795', - dispenseStatus: 'Pending', - doctorContact: '716-873-1557', - doctorEmail: 'jane.betty@myhospital.com', - doctorID: '1122334455', - doctorName: 'Dr. Jane Doe', - drugNames:'Turalio 200 MG Oral Capsule', - drugNdcCode: '65597-402-20', - drugPrice: 200, - metRequirements: [], - patientCity: 'Winterfell', - patientCountry: 'US', - patientDOB: '1996-06-01', - patientFirstName: 'Jon', - patientLastName: 'Snow', - patientName: 'Jon Snow', - patientPostalCode: '00008', - patientStateProvince: 'Westeros', - pickupDate: 'Tue Dec 13 2022', - quanitities: '90', - rxDate: '2020-07-11', - simpleDrugName: 'Turalio', - total: 1800}]; +const doctorOrders = [ + { + caseNumber: '1694010494795', + dispenseStatus: 'Pending', + doctorContact: '716-873-1557', + doctorEmail: 'jane.betty@myhospital.com', + doctorID: '1122334455', + doctorName: 'Dr. Jane Doe', + drugNames: 'Turalio 200 MG Oral Capsule', + drugNdcCode: '65597-402-20', + drugPrice: 200, + metRequirements: [], + patientCity: 'Winterfell', + patientCountry: 'US', + patientDOB: '1996-06-01', + patientFirstName: 'Jon', + patientLastName: 'Snow', + patientName: 'Jon Snow', + patientPostalCode: '00008', + patientStateProvince: 'Westeros', + pickupDate: 'Tue Dec 13 2022', + quanitities: '90', + rxDate: '2020-07-11', + simpleDrugName: 'Turalio', + total: 1800 + } +]; jest.mock('axios'); describe('', () => { it('renders the order card with no doctor orders', async () => { axios.get = jest.fn().mockImplementationOnce(() => Promise.resolve({ data: [] })); - render(); + render(); await waitFor(() => { expect(screen.getByRole('heading', { name: /no orders yet\./i })).toBeInTheDocument(); @@ -41,7 +45,7 @@ describe('', () => { it('renders the order card and any doctor orders', async () => { axios.get = jest.fn().mockImplementationOnce(() => Promise.resolve({ data: doctorOrders })); - render(); + render(); await waitFor(() => { expect(screen.getByText(/Jon Snow/i)).toBeInTheDocument(); @@ -59,4 +63,4 @@ describe('', () => { expect(screen.getByRole('button', { name: /remove all/i })).toBeInTheDocument(); }); }); -}); \ No newline at end of file +}); diff --git a/frontend/src/views/DoctorOrders/OrderCard/OrderCard.tsx b/frontend/src/views/DoctorOrders/OrderCard/OrderCard.tsx index 25d1b7d..0893f1a 100644 --- a/frontend/src/views/DoctorOrders/OrderCard/OrderCard.tsx +++ b/frontend/src/views/DoctorOrders/OrderCard/OrderCard.tsx @@ -61,7 +61,7 @@ const OrderCard = (props: any) => { }, []); const getAllDoctorOrders = async () => { - await axios + await axios .get(url) .then(function (response) { const allDoctorOrders = response.data; @@ -76,7 +76,7 @@ const OrderCard = (props: any) => { if (doctorOrder.length < 1 && !isLoading) { return ( - +

No orders yet.

); diff --git a/frontend/src/views/DoctorOrders/OrderCard/PickedUpButton.tsx b/frontend/src/views/DoctorOrders/OrderCard/PickedUpButton.tsx index 6b0203f..5a39f37 100644 --- a/frontend/src/views/DoctorOrders/OrderCard/PickedUpButton.tsx +++ b/frontend/src/views/DoctorOrders/OrderCard/PickedUpButton.tsx @@ -1,8 +1,6 @@ import Button from '@mui/material/Button'; import axios from 'axios'; - - // interface DoctorOrder { // caseNumber?: string; // patientName?: string; @@ -28,22 +26,23 @@ import axios from 'axios'; // } const PickedUpButton = (props: any) => { - - - //verify the order - const verifyOrder = () => { - const url = '/doctorOrders/api/updateRx/' + props.data.row._id + '/pickedUp'; - axios.patch(url) - .then(function (response) { - props.data.getAllDoctorOrders(); - console.log(response.data); - }) - .catch(error => console.error('Error: $(error')); - }; + //verify the order + const verifyOrder = () => { + const url = '/doctorOrders/api/updateRx/' + props.data.row._id + '/pickedUp'; + axios + .patch(url) + .then(function (response) { + props.data.getAllDoctorOrders(); + console.log(response.data); + }) + .catch(error => console.error('Error: $(error')); + }; - return ( - - ); + return ( + + ); }; -export default PickedUpButton; \ No newline at end of file +export default PickedUpButton; diff --git a/frontend/src/views/DoctorOrders/OrderCard/VerifyButton.tsx b/frontend/src/views/DoctorOrders/OrderCard/VerifyButton.tsx index c2edac6..db7ec61 100644 --- a/frontend/src/views/DoctorOrders/OrderCard/VerifyButton.tsx +++ b/frontend/src/views/DoctorOrders/OrderCard/VerifyButton.tsx @@ -1,7 +1,6 @@ import Button from '@mui/material/Button'; import axios from 'axios'; - // interface DoctorOrder { // caseNumber?: string; // patientName?: string; @@ -27,22 +26,23 @@ import axios from 'axios'; // } const VerifyButton = (props: any) => { - - - //verify the order - const verifyOrder = () => { - const url = '/doctorOrders/api/updateRx/' + props.data.row._id; - axios.patch(url) - .then(function (response) { - props.data.getAllDoctorOrders(); - console.log(response.data); - }) - .catch(error => console.error('Error: $(error')); - }; + //verify the order + const verifyOrder = () => { + const url = '/doctorOrders/api/updateRx/' + props.data.row._id; + axios + .patch(url) + .then(function (response) { + props.data.getAllDoctorOrders(); + console.log(response.data); + }) + .catch(error => console.error('Error: $(error')); + }; - return ( - - ); + return ( + + ); }; -export default VerifyButton; \ No newline at end of file +export default VerifyButton; diff --git a/frontend/src/views/DoctorOrders/PickedUpOrders/PickedUpOrders.test.tsx b/frontend/src/views/DoctorOrders/PickedUpOrders/PickedUpOrders.test.tsx index 4b44995..9df9b04 100644 --- a/frontend/src/views/DoctorOrders/PickedUpOrders/PickedUpOrders.test.tsx +++ b/frontend/src/views/DoctorOrders/PickedUpOrders/PickedUpOrders.test.tsx @@ -5,7 +5,6 @@ import axios from 'axios'; jest.mock('axios'); describe('', () => { - it('renders the order card with no doctor orders', async () => { axios.get = jest.fn().mockImplementationOnce(() => Promise.resolve({ data: [] })); render(); @@ -15,4 +14,4 @@ describe('', () => { expect(linkElement).toBeInTheDocument(); }); }); -}); \ No newline at end of file +}); diff --git a/frontend/src/views/DoctorOrders/PickedUpOrders/PickedUpOrders.tsx b/frontend/src/views/DoctorOrders/PickedUpOrders/PickedUpOrders.tsx index adfa078..7780eb6 100644 --- a/frontend/src/views/DoctorOrders/PickedUpOrders/PickedUpOrders.tsx +++ b/frontend/src/views/DoctorOrders/PickedUpOrders/PickedUpOrders.tsx @@ -3,11 +3,11 @@ import './PickedUpOrders.css'; const PickedUpOrders = () => { return ( -
+

PickedUpOrders

- +
); }; -export default PickedUpOrders; \ No newline at end of file +export default PickedUpOrders; diff --git a/frontend/src/views/DoctorOrders/VerifiedOrders/VerifiedOrders.test.tsx b/frontend/src/views/DoctorOrders/VerifiedOrders/VerifiedOrders.test.tsx index 2a4b8ae..97d90dd 100644 --- a/frontend/src/views/DoctorOrders/VerifiedOrders/VerifiedOrders.test.tsx +++ b/frontend/src/views/DoctorOrders/VerifiedOrders/VerifiedOrders.test.tsx @@ -3,10 +3,8 @@ import { render, screen, waitFor } from '@testing-library/react'; import VerifiedOrders from './VerifiedOrders'; import axios from 'axios'; - jest.mock('axios'); describe('', () => { - it('renders the order card with no doctor orders', async () => { axios.get = jest.fn().mockImplementationOnce(() => Promise.resolve({ data: [] })); render(); diff --git a/frontend/src/views/DoctorOrders/VerifiedOrders/VerifiedOrders.tsx b/frontend/src/views/DoctorOrders/VerifiedOrders/VerifiedOrders.tsx index a4a21cc..2ef04ad 100644 --- a/frontend/src/views/DoctorOrders/VerifiedOrders/VerifiedOrders.tsx +++ b/frontend/src/views/DoctorOrders/VerifiedOrders/VerifiedOrders.tsx @@ -3,11 +3,11 @@ import './VerifiedOrders.css'; const VerifiedOrders = () => { return ( -
-

VerifiedOrders

- +
+

VerifiedOrders

+
); }; -export default VerifiedOrders; \ No newline at end of file +export default VerifiedOrders; diff --git a/frontend/src/views/DoctorOrders/data.json b/frontend/src/views/DoctorOrders/data.json index a5412ad..9ab5e81 100644 --- a/frontend/src/views/DoctorOrders/data.json +++ b/frontend/src/views/DoctorOrders/data.json @@ -1,32 +1,32 @@ [ - { - "caseNumber": "43f575fe0ae14558976e4a71b7483242", - "patientName": "John Snow", - "patientDOB": "10/22/1980", - "doctorName": "Dr. Jane Betty Doe", - "doctorContact": "716-873-1557", - "doctorID": 1122334455, - "doctorEmail": "jane.betty@myhospital.com", - "drugNames": "Isotretinoin 50 MG Oral Capsule", - "drugPrice": 200, - "quanitities": 90, - "total": 18000, - "pickupDate": "Tue Dec 13 2022", - "dispenseStatus": "Pending" - }, - { - "caseNumber": "53f575fe0ae14558976e4a71b7483242", - "patientName": "Lisa Doe", - "patientDOB": "9/5/1991", - "doctorName": "Dr. Mike Doe", - "doctorContact": "716-873-1557", - "doctorID": 1122334455, - "doctorEmail": "jane.betty@myhospital.com", - "drugNames": "Turalio 200 MG Oral Capsule", - "drugPrice": 200, - "quanitities": 5, - "total": 1000, - "pickupDate": "Tue Dec 13 2022", - "dispenseStatus": "Pending" - } -] \ No newline at end of file + { + "caseNumber": "43f575fe0ae14558976e4a71b7483242", + "patientName": "John Snow", + "patientDOB": "10/22/1980", + "doctorName": "Dr. Jane Betty Doe", + "doctorContact": "716-873-1557", + "doctorID": 1122334455, + "doctorEmail": "jane.betty@myhospital.com", + "drugNames": "Isotretinoin 50 MG Oral Capsule", + "drugPrice": 200, + "quanitities": 90, + "total": 18000, + "pickupDate": "Tue Dec 13 2022", + "dispenseStatus": "Pending" + }, + { + "caseNumber": "53f575fe0ae14558976e4a71b7483242", + "patientName": "Lisa Doe", + "patientDOB": "9/5/1991", + "doctorName": "Dr. Mike Doe", + "doctorContact": "716-873-1557", + "doctorID": 1122334455, + "doctorEmail": "jane.betty@myhospital.com", + "drugNames": "Turalio 200 MG Oral Capsule", + "drugPrice": 200, + "quanitities": 5, + "total": 1000, + "pickupDate": "Tue Dec 13 2022", + "dispenseStatus": "Pending" + } +] diff --git a/frontend/src/views/Login/Login.test.tsx b/frontend/src/views/Login/Login.test.tsx index 9a49111..2b305bd 100644 --- a/frontend/src/views/Login/Login.test.tsx +++ b/frontend/src/views/Login/Login.test.tsx @@ -6,4 +6,4 @@ test.skip('renders Sign in', () => { render(); const linkElement = screen.getByText(/Sign/i); expect(linkElement).toBeInTheDocument(); -}); \ No newline at end of file +}); diff --git a/frontend/src/views/Login/Login.tsx b/frontend/src/views/Login/Login.tsx index 1c08bd1..e2335b3 100644 --- a/frontend/src/views/Login/Login.tsx +++ b/frontend/src/views/Login/Login.tsx @@ -19,12 +19,10 @@ export default function Login() { params.append('grant_type', 'password'); params.append('client_id', config.client); axios - .post( - `${config.auth}/realms/${config.realm}/protocol/openid-connect/token`, - params, - { withCredentials: true } - ) - .then((result) => { + .post(`${config.auth}/realms/${config.realm}/protocol/openid-connect/token`, params, { + withCredentials: true + }) + .then(result => { // do something with the token const scope = result.data.scope.split(' ').includes(config.scopeId); if (scope) { @@ -44,57 +42,52 @@ export default function Login() { }; return ( - + - {token ? + {token ? ( - : + ) : ( - } - + )} + Sign in - + - ); -} \ No newline at end of file +} diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 2c2bc1e..e548762 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -1,11 +1,7 @@ { "compilerOptions": { "target": "es6", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, @@ -20,12 +16,8 @@ "outDir": "dist", "jsx": "react-jsx", "paths": { - "*": [ - "./src/typings/*" - ] + "*": ["./src/typings/*"] } }, - "include": [ - "src" - ] + "include": ["src"] }