-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(details): Add additional fields to SEATool transform; Display in…
… UI (#266) * Initial commit: add fields to seatool schema and transform * Fix undefined error * Fixes types * Updates to property names * Add ReviewTeam UI * Wire in new fields; try to fix disposition date * Format final disposition date * Reorder view * Status date update * Rename CPOC * Add user type gates * Refactor Details page sections to reuse code * Remove cpoc attribute * Move components to proper directory * More file structurer stuff
- Loading branch information
Kevin Haube
authored
Dec 19, 2023
1 parent
e83c99c
commit 147b66e
Showing
10 changed files
with
213 additions
and
139 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
71 changes: 0 additions & 71 deletions
71
src/services/ui/src/components/PackageDetails/ChipSpaPackageDetails.tsx
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
src/services/ui/src/components/PackageDetails/DetailItemsGrid.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { useGetUser } from "@/api/useGetUser"; | ||
import { DetailSectionItem } from "@/pages/detail/setup/spa"; | ||
|
||
export const DetailItemsGrid = ({ | ||
displayItems, | ||
}: { | ||
displayItems: DetailSectionItem[]; | ||
}) => { | ||
const { data: user } = useGetUser(); | ||
return ( | ||
<> | ||
<div className="grid grid-cols-2 gap-4"> | ||
{displayItems.map(({ label, value, canView }) => { | ||
return !canView(user) ? null : ( | ||
<div key={label}> | ||
<h3 className="text-sm">{label}</h3> | ||
{value} | ||
</div> | ||
); | ||
})} | ||
</div> | ||
<hr className="my-4" /> | ||
</> | ||
); | ||
}; |
26 changes: 26 additions & 0 deletions
26
src/services/ui/src/components/PackageDetails/ReviewTeamList.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useMemo, useState } from "react"; | ||
import { BLANK_VALUE } from "@/consts"; | ||
|
||
export const ReviewTeamList = ({ team }: { team: string[] | undefined }) => { | ||
const [expanded, setExpanded] = useState(false); | ||
const displayTeam = useMemo( | ||
() => (expanded ? team : team?.slice(0, 3)), | ||
[expanded, team] | ||
); | ||
return !displayTeam || !displayTeam.length ? ( | ||
BLANK_VALUE | ||
) : ( | ||
<ul> | ||
{displayTeam.map((reviewer, idx) => ( | ||
<li key={`reviewteam-ul-${reviewer}-${idx}`}>{reviewer}</li> | ||
))} | ||
{team && team?.length > 3 && ( | ||
<li className={"text-xs text-sky-600 hover:cursor-pointer"}> | ||
<button onClick={() => setExpanded((prev) => !prev)}> | ||
{expanded ? "Show less" : "Show more"} | ||
</button> | ||
</li> | ||
)} | ||
</ul> | ||
); | ||
}; |
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,2 @@ | ||
export * from "./ChipSpaPackageDetails"; | ||
export * from "./DetailItemsGrid"; | ||
export * from "./ReviewTeamList"; |
This file was deleted.
Oops, something went wrong.
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.