Skip to content

Commit

Permalink
[chores]: clean up & re-arrange dirs structure
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliouzbett committed May 31, 2023
1 parent 8f3afbf commit a1d8c7b
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 46 deletions.
28 changes: 7 additions & 21 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';

// import Layout from './components/layout/Layout';
import Home from './app/main/Home';
// import PatientSearch from './components/patientSearch/Patient';
// import PatientInformation from './app/patient-dashboard/patient-info/PatientInformation';
// import Orders from './components/Orders/Orders.component';
// import Observation from './components/observations/Observation';
import Login from './app/authentication/Login';
import PatientInfo from './app/patient-dashboard/info/PatientInfo';
import PatientSearch from './app/patient-search/Patient';
Expand All @@ -14,6 +9,9 @@ import { AppContextProvider } from './app/AppContextProvider';
import Observation from './app/patient-dashboard/observations/Observation';
import { useEffect } from 'react';
import { getSession } from './app/Session';
import CsvUpload from './app/csv-uploads/CsvUpload';
import Moh731SyncQueueComponent from './app/rde-sync/Moh731Sync.component';
import AddPatientIdentifier from './app/rde-sync/AddPatients.component';

const App = () => {
useEffect(() => {
Expand All @@ -33,24 +31,12 @@ const App = () => {
<Route path="/patient-dashboard/:uuid" element={<PatientInfo />} />
<Route path="/patient-dashboard/:uuid/orders" element={<PatientOrders />} />
<Route path="/patient-dashboard/:uuid/observations" element={<Observation />} />
</Routes>

{/* <Routes>
<Route path="/login" element={<Login />} />
<Route element={<ProtectedRoutes />}>
<Route path="/" element={<Home />} />
<Route path="/patient-search" element={<PatientSearch />} />
<Route path="/patientInfo/:id" element={<PatientInformation />} />
<Route path="/patient/:id/orders" element={<Orders />} />
<Route path="/lab-results-sync" element={<CsvUpload />} />
<Route path="/moh-731-sync" element={<Moh731SyncQueueComponent />} />
<Route path="/moh-731-sync/add-patients" element={<SearchPatientIdentifier />} />
<Route path="/observations/:id" element={<Observation />} />
</Route>
</Routes> */}
<Route path="/lab-results-sync" element={<CsvUpload />} />
<Route path="/moh-731-sync" element={<Moh731SyncQueueComponent />} />
<Route path="/moh-731-sync/add-patients" element={<AddPatientIdentifier />} />
</Routes>
</Router>
{/* div below is for testing purposes */}
{/* <div data-testId="app-context-value">{JSON.stringify(contextValue)}</div> */}
</AppContextProvider>
);
};
Expand Down
2 changes: 0 additions & 2 deletions src/app/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export const getSession = async (): Promise<boolean> => {
});

const userInfo = await response.json();
console.log('userInfo', userInfo);
const { authenticated } = userInfo;
return authenticated;
};
Expand All @@ -17,7 +16,6 @@ export const clearSession = async () => {
Authorization: 'Basic ' + localStorage.getItem('auth-token'),
},
}).then((data) => {
console.log('data', data);
if (data?.status === 204 && data?.ok === true) {
localStorage.removeItem('userInformation');
localStorage.removeItem('authenticated');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { useEffect, useState } from 'react';
import { CsvUploadData, uploadCsvFile } from './csv.resource';
import { toast, ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import storage from '../../app/localStorage';
import storage from '../localStorage';
import DisplayCSV from './DisplayCSV';
import Header from '../layout/headers/HeaderWithLogo';
import Footer from '../layout/Footer';
import Header from '../../components/layout/headers/HeaderWithLogo';
import Footer from '../../components/layout/Footer';

const CsvUpload = () => {
const [csvFile, setCsvFile] = useState(new File([], ''));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import Modal from 'react-modal';
import { getCsvFiles, deleteCsvFile, syncCsvFile, getErrorLogs } from './csv.resource';
import { ToastContainer, toast } from 'react-toastify';
import swal from 'sweetalert';
import storage from '../../app/localStorage';
import Pagination from '../pagination/Pagination';
import storage from '../localStorage';
import Pagination from '../../components/pagination/Pagination';

const customStyles = {
content: {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useState } from 'react';
import { AiOutlineDelete } from 'react-icons/ai';
import storage from '../../app/localStorage';
import storage from '../localStorage';
import { FaPlus } from 'react-icons/fa';
import Header from '../layout/headers/HeaderWithLogo';
import Footer from '../layout/Footer';
import Header from '../../components/layout/headers/HeaderWithLogo';
import Footer from '../../components/layout/Footer';
import { useNavigate } from 'react-router-dom';
import { queuePatients, setReportingMonth } from './AddPatients.resource';
import ErrorToast from '../toasts/ErrorToast';
import SuccessToast from '../toasts/SuccessToast';
import ErrorToast from '../../components/toasts/ErrorToast';
import SuccessToast from '../../components/toasts/SuccessToast';

const AddPatientIdentifier = () => {
const [patientIdentifier, setPatientIdentifier] = useState({
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { Patient } from '../../types/Patient';
import { formatDate } from '../../utils/DateUtil';
import Footer from '../layout/Footer';
import Header from '../layout/headers/HeaderWithLogo';
import Footer from '../../components/layout/Footer';
import Header from '../../components/layout/headers/HeaderWithLogo';
import { fetchMoh731SyncQueue, freezeProcessedPatients, processQueuedPatients } from './Moh731Sync.resource';
import storage from '../../app/localStorage';
import storage from '../localStorage';

interface searchProps {
handleSearch: React.ChangeEventHandler<HTMLInputElement>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import storage from '../../app/localStorage';
import storage from '../localStorage';
import { Patient } from '../../types/Patient';
import { ProcessQueuePayload } from '../../types/Payloads';

Expand Down
9 changes: 0 additions & 9 deletions src/context/AppContext.ts

This file was deleted.

0 comments on commit a1d8c7b

Please sign in to comment.