-
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.
Migrate select primary keys to UUID and Haztrak Organization's Site L…
…ist API View (#645) * remove CoreBaseModel absract model used for inheritence (learning the hard way that inheritence is a double edged sword) * Temporaryily remove all migrations (including data migrations) and use UUID as primary key for RcrainfoProfile * use UUID for haztrak profile and haztrak user as I do not want there to be a ordering relationship between these models and a UUID will make it more difficult for people to guess other users IDs we also are makign a minor update to our fixture factory for waste code to work with both state and federal waste codes * indicate whether a site is integrated with RCRAInfo * add endpoint for retrieving a Haztrak Organization's sites * show other sites in the user's haztrak organization in the user's profile * add data migrations back in (static information like DOT information and waste codes but still useful to be in a db)
- Loading branch information
1 parent
6218596
commit 90f81de
Showing
37 changed files
with
585 additions
and
1,584 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { HaztrakSite } from 'components/HaztrakSite'; | ||
import React from 'react'; | ||
import { Row, Table } from 'react-bootstrap'; | ||
import { useGetOrgSitesQuery } from 'store'; | ||
import { HaztrakProfileOrg } from 'store/profileSlice/profile.slice'; | ||
|
||
interface MyOrgSitesProps { | ||
org: HaztrakProfileOrg; | ||
} | ||
|
||
export function MyOrgSites({ org }: MyOrgSitesProps) { | ||
const { data, isLoading, error } = useGetOrgSitesQuery(org.id); | ||
return ( | ||
<Row className="my-2"> | ||
<Table hover responsive> | ||
<thead> | ||
<tr> | ||
<th>EPA ID</th> | ||
<th>Site Type</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{data && | ||
Object.values(data as HaztrakSite[]).map((site) => ( | ||
<tr key={`${site.handler.epaSiteId}`}> | ||
<td>{site.handler.epaSiteId}</td> | ||
<td>{site.handler.siteType}</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</Table> | ||
<i>Contact your Haztrak admin obtain access to additional sites within your organization</i> | ||
</Row> | ||
); | ||
} |
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,59 @@ | ||
import { faCheck, faX } from '@fortawesome/free-solid-svg-icons'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { MyOrgSites } from 'components/UserProfile/MyOrgSites'; | ||
import { MySitePermissions } from 'components/UserProfile/MySitePermissions'; | ||
import React from 'react'; | ||
import { Col, Row, Tab, Tabs } from 'react-bootstrap'; | ||
import { ProfileState } from 'store'; | ||
import { HaztrakProfileOrg } from 'store/profileSlice/profile.slice'; | ||
|
||
interface MandatoryOrgProfile extends ProfileState { | ||
org: HaztrakProfileOrg; | ||
} | ||
|
||
interface UserOrgProps { | ||
profile: MandatoryOrgProfile; | ||
} | ||
|
||
export function UserOrg({ profile }: UserOrgProps) { | ||
return ( | ||
<> | ||
<Row> | ||
<hr /> | ||
<h3 className="text-center">Organization</h3> | ||
<Col> | ||
<h6> | ||
<b>Name</b> | ||
</h6> | ||
<p>{profile.org.name ?? 'My Organization'}</p> | ||
</Col> | ||
<Col> | ||
<h6> | ||
<b>Integrated with Rcrainfo?</b> | ||
</h6> | ||
<p> | ||
{profile.org.rcrainfoIntegrated ? ( | ||
<span> | ||
Yes <FontAwesomeIcon icon={faCheck} className="text-success" /> | ||
</span> | ||
) : ( | ||
<span> | ||
No <FontAwesomeIcon icon={faX} className="text-danger" /> | ||
</span> | ||
)} | ||
</p> | ||
</Col> | ||
</Row> | ||
<Row> | ||
<Tabs fill> | ||
<Tab title="My Sites" eventKey="mySites"> | ||
<MySitePermissions sites={profile.sites} /> | ||
</Tab> | ||
<Tab title="Other Sites in My Organization" eventKey="orgSites"> | ||
<MyOrgSites org={profile.org} /> | ||
</Tab> | ||
</Tabs> | ||
</Row> | ||
</> | ||
); | ||
} |
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
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
Oops, something went wrong.