Skip to content

Commit

Permalink
add the list of project team members to acquisition files.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinleighsmith committed Dec 30, 2024
1 parent 0b75930 commit 30435b2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import LoadingBackdrop from '@/components/common/LoadingBackdrop';
import { useMapStateMachine } from '@/components/common/mapFSM/MapStateMachineContext';
import { InventoryTabNames } from '@/features/mapSideBar/property/InventoryTabs';
import { useAcquisitionProvider } from '@/hooks/repositories/useAcquisitionProvider';
import { useProjectProvider } from '@/hooks/repositories/useProjectProvider';
import { usePropertyAssociations } from '@/hooks/repositories/usePropertyAssociations';
import { useQuery } from '@/hooks/use-query';
import useApiUserOverride from '@/hooks/useApiUserOverride';
Expand Down Expand Up @@ -84,6 +85,9 @@ export const AcquisitionContainer: React.FunctionComponent<IAcquisitionContainer
getAcquisitionFileChecklist: { execute: retrieveAcquisitionFileChecklist },
getLastUpdatedBy: { execute: getLastUpdatedBy, loading: loadingGetLastUpdatedBy },
} = useAcquisitionProvider();
const {
getProject: { execute: getProjectFunction },
} = useProjectProvider();

const { setModalContent, setDisplayModal } = useModalContext();
const { execute: getPropertyAssociations } = usePropertyAssociations();
Expand Down Expand Up @@ -132,6 +136,9 @@ export const AcquisitionContainer: React.FunctionComponent<IAcquisitionContainer
const fetchAcquisitionFile = useCallback(async () => {
const retrieved = await retrieveAcquisitionFile(acquisitionFileId);
if (exists(retrieved)) {
if (isValidId(retrieved.projectId)) {
retrieved.project = await getProjectFunction(retrieved.projectId);
}
// retrieve related entities (ie properties, checklist items) in parallel
const acquisitionPropertiesTask = retrieveAcquisitionFileProperties(acquisitionFileId);
const acquisitionChecklistTask = retrieveAcquisitionFileChecklist(acquisitionFileId);
Expand All @@ -152,6 +159,7 @@ export const AcquisitionContainer: React.FunctionComponent<IAcquisitionContainer
retrieveAcquisitionFileChecklist,
setFile,
setStaleFile,
getProjectFunction,
]);

const fetchLastUpdatedBy = React.useCallback(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ const AcquisitionSummaryView: React.FC<IAcquisitionSummaryViewProps> = ({
{acquisitionFile?.fundingTypeCode?.id === 'OTHER' && (
<SectionField label="Other funding">{acquisitionFile.fundingOther}</SectionField>
)}
{acquisitionFile?.project?.projectPersons?.map((teamMember, index) => (
<React.Fragment key={`project-team-${index}`}>
<SectionField label="Management team member">
<StyledLink
target="_blank"
rel="noopener noreferrer"
to={`/contact/P${teamMember?.personId}`}
>
<span>{formatApiPersonNames(teamMember?.person)}</span>
<FaExternalLinkAlt className="ml-2" size="1rem" />
</StyledLink>
</SectionField>
</React.Fragment>
))}
</Section>
<Section header="Schedule">
<SectionField label="Assigned date" valueTestId="assigned-date">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const ProjectSummaryView: React.FunctionComponent<
<Section header="Project Management Team">
{project?.projectPersons?.map((teamMember, index) => (
<React.Fragment key={`project-team-${index}`}>
<SectionField label="Management Team Member">
<SectionField label="Management team member">
<StyledLink
target="_blank"
rel="noopener noreferrer"
Expand Down

0 comments on commit 30435b2

Please sign in to comment.