Skip to content

Commit

Permalink
fix javascript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ssundahlTTD committed Oct 10, 2023
1 parent f3b241a commit 2fa6c43
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ function ParticipantApprovalForm({
{!selectedSite && (
<SearchBarResults className='site-search-results'>
{siteSearchResults?.map((s) => (
<button type='button' className='text-button' onClick={() => onSiteClick(s.item)}>
<button
key={s.item.id}
type='button'
className='text-button'
onClick={() => onSiteClick(s.item)}
>
<HighlightedResult result={s} /> (Site ID: {s.item.id})
</button>
))}
Expand Down
78 changes: 38 additions & 40 deletions src/web/components/ParticipantRequests/ParticipantRequestItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,45 +43,43 @@ export function ParticipantRequestItem({
};

return (
<>
<tr className='participant-request-item'>
<td>
<div className='participant-name'>{participant.name}</div>
</td>
<td>
<div className='participant-types'>{getParticipantTypes(participant.types)}</div>
</td>
<td>
<div className='participant-request-name'>{participant.requestingUser.fullName}</div>
</td>
<td>
<div className='participant-request-email'>{participant.requestingUser.email}</div>
</td>
<td>
<div className='participant-request-job-function'>{participant.requestingUser.role}</div>
</td>
<td className='action'>
<div className='action-cell'>
{hasError && <InlineMessage message='An error has occurred' type='Error' />}
<button type='button' className='transparent-button' onClick={() => setOpen(true)}>
Approve
</button>
</div>
</td>
</tr>
<Dialog
title='Approve Participant Request'
closeButton='Cancel'
open={open}
onOpenChange={setOpen}
className='participants-request-dialog'
>
<ParticipantApprovalForm
onApprove={handleApprove}
participant={participant}
participantTypes={participantTypes}
/>
</Dialog>
</>
<tr className='participant-request-item'>
<td>
<div className='participant-name'>{participant.name}</div>
</td>
<td>
<div className='participant-types'>{getParticipantTypes(participant.types)}</div>
</td>
<td>
<div className='participant-request-name'>{participant.requestingUser.fullName}</div>
</td>
<td>
<div className='participant-request-email'>{participant.requestingUser.email}</div>
</td>
<td>
<div className='participant-request-job-function'>{participant.requestingUser.role}</div>
</td>
<td className='action'>
<div className='action-cell'>
{hasError && <InlineMessage message='An error has occurred' type='Error' />}
<button type='button' className='transparent-button' onClick={() => setOpen(true)}>
Approve
</button>
<Dialog
title='Approve Participant Request'
closeButton='Cancel'
open={open}
onOpenChange={setOpen}
className='participants-request-dialog'
>
<ParticipantApprovalForm
onApprove={handleApprove}
participant={participant}
participantTypes={participantTypes}
/>
</Dialog>
</div>
</td>
</tr>
);
}

0 comments on commit 2fa6c43

Please sign in to comment.