Skip to content

Commit

Permalink
Merge pull request #51 from mcode/descending-order-forms
Browse files Browse the repository at this point in the history
Descending order forms
  • Loading branch information
plarocque4 authored Oct 26, 2023
2 parents 713e796 + d86308d commit 6684395
Show file tree
Hide file tree
Showing 27 changed files with 291 additions and 274 deletions.
4 changes: 3 additions & 1 deletion backend/.prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dist
dist
node_modules
package-lock.json
10 changes: 9 additions & 1 deletion backend/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@
"endOfLine": "auto",
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true
"singleQuote": true,
"overrides": [
{
"files": "*.json",
"options": {
"singleQuote": false
}
}
]
}
8 changes: 4 additions & 4 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}\""
}
}
4 changes: 3 additions & 1 deletion frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
dist
build
build
node_modules
package-lock.json
12 changes: 10 additions & 2 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@
"endOfLine": "auto",
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true
}
"singleQuote": true,
"overrides": [
{
"files": "*.json",
"options": {
"singleQuote": false
}
}
]
}
10 changes: 4 additions & 6 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -82,7 +82,5 @@
"last 1 safari version"
]
},

"proxy": "http://localhost:5051"

}
44 changes: 25 additions & 19 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Box >
<Router >
<div className='App'>
<Container className='NavContainer' maxWidth='xl'>
<div className='containerg'>
<div className='logo'>
<LocalPharmacyIcon sx={{ color: 'white', fontSize: 40, paddingTop: 2.5, paddingRight: 2.5 }} />
<Box>
<Router>
<div className="App">
<Container className="NavContainer" maxWidth="xl">
<div className="containerg">
<div className="logo">
<LocalPharmacyIcon
sx={{ color: 'white', fontSize: 40, paddingTop: 2.5, paddingRight: 2.5 }}
/>
<h1>Pharmacy</h1>
</div>
<div className='links'>
<Link className='NavButtons' to='/DoctorOrders'><Button variant='contained'>Doctor Orders</Button></Link>
<Link className='NavButtons' to='/Login'><Button variant='contained'>Login</Button></Link>
<div className="links">
<Link className="NavButtons" to="/DoctorOrders">
<Button variant="contained">Doctor Orders</Button>
</Link>
<Link className="NavButtons" to="/Login">
<Button variant="contained">Login</Button>
</Link>
</div>
</div>
</Container>
</div>
<Routes>
{/* Initial load to login page, will need to change to check for user authentication to load to correct page */}
<Route path='/' element={<Login />} />
<Route path='/Login' element={< Login />}></Route>
<Route path='/DoctorOrders' element={< DoctorOrders />}></Route>
<Route path="/" element={<Login />} />
<Route path="/Login" element={<Login />}></Route>
<Route path="/DoctorOrders" element={<DoctorOrders />}></Route>
</Routes>
</Router>
</Box >
</Box>
);
}

Expand Down
10 changes: 5 additions & 5 deletions frontend/src/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"realm": "ClientFhirServer",
"client": "pims-login",
"auth": "http://localhost:8180/auth",
"scopeId": "pims"
}
"realm": "ClientFhirServer",
"client": "pims-login",
"auth": "http://localhost:8180/auth",
"scopeId": "pims"
}
4 changes: 1 addition & 3 deletions frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<React.StrictMode>
<App />
Expand Down
62 changes: 31 additions & 31 deletions frontend/src/styles/theme.tsx
Original file line number Diff line number Diff line change
@@ -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;
33 changes: 17 additions & 16 deletions frontend/src/views/DoctorOrders/DoctorOrders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
};
}

Expand All @@ -21,21 +21,22 @@ export default function DoctorOrders() {
};

return (
<Container maxWidth='xl'>
<Box sx={{
width: '100%',
border: 1,
borderRadius: '5px',
borderWidth: 4,
borderColor: '#F1F3F4',
backgroundColor: '#E7EBEF',

}}>
<Container maxWidth="xl">
<Box
sx={{
width: '100%',
border: 1,
borderRadius: '5px',
borderWidth: 4,
borderColor: '#F1F3F4',
backgroundColor: '#E7EBEF'
}}
>
<Box sx={{ backgroundColor: '#F1F3F4', borderBottom: 1, borderColor: 'divider' }}>
<Tabs value={tabIndex} onChange={handleChange} aria-label='basic tabs example' centered>
<Tab label='New Orders' {...a11yProps(0)} />
<Tab label='Verified Orders' {...a11yProps(1)} />
<Tab label='Picked Up Orders' {...a11yProps(2)} />
<Tabs value={tabIndex} onChange={handleChange} aria-label="basic tabs example" centered>
<Tab label="New Orders" {...a11yProps(0)} />
<Tab label="Verified Orders" {...a11yProps(1)} />
<Tab label="Picked Up Orders" {...a11yProps(2)} />
</Tabs>
</Box>

Expand All @@ -61,4 +62,4 @@ export default function DoctorOrders() {
</Box>
</Container>
);
}
}
3 changes: 1 addition & 2 deletions frontend/src/views/DoctorOrders/NewOrders/NewOrders.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import axios from 'axios';

jest.mock('axios');
describe('<NewOrders />', () => {

it('renders the order card with no doctor orders', async () => {
axios.get = jest.fn().mockImplementationOnce(() => Promise.resolve({ data: [] }));
render(<NewOrders />);
Expand All @@ -15,4 +14,4 @@ describe('<NewOrders />', () => {
expect(linkElement).toBeInTheDocument();
});
});
});
});
6 changes: 3 additions & 3 deletions frontend/src/views/DoctorOrders/NewOrders/NewOrders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import './NewOrders.css';

const NewOrders = () => {
return (
<div className='NewOrders'>
<div className="NewOrders">
<h1>NewOrders</h1>
<OrderCard tabStatus = {'Pending'}/>
<OrderCard tabStatus={'Pending'} />
</div>
);
};

export default NewOrders;
export default NewOrders;
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import EtasuPopUp from './EtasuPopUp';

test.skip('renders Status', () => {
render(<EtasuPopUp />);
const linkElement = screen.getByText("Total");
const linkElement = screen.getByText('Total');
expect(linkElement).toBeInTheDocument();
});
});
Loading

0 comments on commit 6684395

Please sign in to comment.