-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add tailwind config and dependencies to project * add tailwind eslint dependencies and config * rename routes directory to features directory again I think this keeps things clearer until we actually\/if adopt remix * use react router dom lazy loading functionality (instead of React.lazy) to decouple, bundle and break apart features * fix expected type for new manifest * remove example accordian section from dashbaord
- Loading branch information
1 parent
c89338c
commit 85ec774
Showing
48 changed files
with
720 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
export { Root as Component } from './Root'; | ||
import { Root } from './Root'; | ||
|
||
export { Root as Component }; | ||
export default Root; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { ErrorPage as Component } from '~/features/ErrorPage/ErrorPage'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { ManifestDetails } from './ManifestDetails'; | ||
|
||
export { ManifestDetails as Component }; | ||
export default ManifestDetails; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { ManifestList } from './ManifestList'; | ||
|
||
export { ManifestList as Component }; | ||
export default ManifestList; |
8 changes: 4 additions & 4 deletions
8
...p/routes/NewManifest/NewManifest.spec.tsx → ...features/NewManifest/NewManifest.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { NewManifest } from './NewManifest'; | ||
|
||
export { NewManifest as Component }; | ||
export default NewManifest; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
client/app/routes/SiteDetails/index.ts → client/app/features/SiteDetails/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { SiteDetails } from '~/routes/SiteDetails/SiteDetails'; | ||
import { SiteDetails } from '~/features/SiteDetails/SiteDetails'; | ||
|
||
export { SiteDetails as Component }; | ||
export default SiteDetails; |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
client/app/routes/SiteList/index.ts → client/app/features/SiteList/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { SiteList } from '~/routes/SiteList/SiteList'; | ||
import { SiteList } from '~/features/SiteList/SiteList'; | ||
|
||
export { SiteList as Component }; | ||
export default SiteList; |
2 changes: 1 addition & 1 deletion
2
client/app/routes/about/About.tsx → client/app/features/about/About.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { HtCard } from '~/components/UI'; | ||
import React, { ReactElement } from 'react'; | ||
import { Col, Container, Row } from 'react-bootstrap'; | ||
import { | ||
GeneratorStatusAreaChart, | ||
ManifestCountBarChart, | ||
ManifestStatusPieChart, | ||
} from '~/components/Charts'; | ||
import { useTitle } from '~/hooks'; | ||
|
||
/** Dashboard page for logged-in user*/ | ||
export function Dashboard(): ReactElement { | ||
useTitle(`Haztrak`, false, true); | ||
|
||
return ( | ||
<Container className="py-2 pt-3"> | ||
<Row xs={1} lg={2}> | ||
<Col className="my-3"> | ||
<HtCard title="Calculated Status" className="p-2"> | ||
<GeneratorStatusAreaChart /> | ||
</HtCard> | ||
</Col> | ||
<Col className="my-3"> | ||
<HtCard title="Manifest by Status" className="p-2"> | ||
<ManifestStatusPieChart /> | ||
</HtCard> | ||
</Col> | ||
</Row> | ||
<Row> | ||
<Col> | ||
<HtCard title="Manifest count" className="p-2"> | ||
<ManifestCountBarChart /> | ||
</HtCard> | ||
</Col> | ||
</Row> | ||
</Container> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
client/app/routes/login/login.spec.tsx → client/app/features/login/login.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
client/app/routes/register/index.ts → client/app/features/register/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { RegisterHero } from '~/routes/register/RegisterHero'; | ||
import { RegisterHero } from '~/features/register/RegisterHero'; | ||
|
||
export { RegisterHero as Component }; | ||
export default RegisterHero; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,13 @@ | ||
import { createSelector } from '@reduxjs/toolkit'; | ||
import { useMemo } from 'react'; | ||
import { ProfileSlice, useGetProfileQuery } from '~/store'; | ||
import { HaztrakSite } from '~/components/HaztrakSite'; | ||
import { useGetUserHaztrakSitesQuery } from '~/store'; | ||
|
||
/** | ||
* Get select details for sites that the user has access to | ||
*/ | ||
export function useUserSiteIds() { | ||
const selectUserSiteIds = useMemo( | ||
() => | ||
createSelector( | ||
(res) => res.data, | ||
(data: ProfileSlice) => | ||
!data || !data.sites | ||
? [] | ||
: Object.values(data.sites).map((site) => ({ | ||
epaSiteId: site.handler.epaSiteId, | ||
permissions: site.permissions, | ||
})) | ||
), | ||
[] | ||
); | ||
const { data, ...rest } = useGetUserHaztrakSitesQuery(undefined); | ||
|
||
const { userSiteIds, ...rest } = useGetProfileQuery(undefined, { | ||
selectFromResult: (result) => ({ | ||
...result, | ||
userSiteIds: selectUserSiteIds(result), | ||
}), | ||
}); | ||
const userSiteIds: string[] = data?.map((site: HaztrakSite) => site.handler.epaSiteId) || []; | ||
|
||
return { userSiteIds, ...rest }; | ||
return { userSiteIds, data, ...rest }; | ||
} |
Oops, something went wrong.