Skip to content

Commit

Permalink
Show all applicants (#4426)
Browse files Browse the repository at this point in the history
* Show all applicants

All applicants means all. Hiding withdrawn (ie. not hired) distorts historic opening view.

* Show all hired, fix stats

* prettier

* Show all hires

---------

Co-authored-by: Joystream Stats <dev@joystreamstats.live>
  • Loading branch information
traumschule and Joystream Stats committed Jun 12, 2023
1 parent 36b9aa0 commit f7918ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
14 changes: 9 additions & 5 deletions packages/ui/src/app/pages/WorkingGroups/WorkingGroupsOpening.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export const WorkingGroupOpening = () => {
}
}, [opening?.applications])

const hiringApplication = useMemo(() => {
const hiredApplicants = useMemo(() => {
if (activeApplications) {
return activeApplications.find(({ status }) => status === 'ApplicationStatusAccepted')
return activeApplications.filter(({ status }) => status === 'ApplicationStatusAccepted')
}
}, [opening?.id])
const myApplication = useMemo(() => {
Expand Down Expand Up @@ -161,7 +161,11 @@ export const WorkingGroupOpening = () => {
tooltipLinkURL="https://joystream.gitbook.io/testnet-workspace/system/working-groups#staking"
value={opening.stake}
/>
<ApplicationStats applicants={opening.applicants} hiring={opening.hiring} status={opening.status} />
<ApplicationStats
applicants={opening.applications?.length ?? 0}
hiring={opening.hiring}
status={opening.status}
/>
</Statistics>
</RowGapBlock>
</PageHeaderWrapper>
Expand All @@ -174,9 +178,9 @@ export const WorkingGroupOpening = () => {
sidebar={
<SidePanel scrollable>
<ApplicantsList
allApplicants={activeApplications}
allApplicants={opening.applications}
myApplication={myApplication}
hired={hiringApplication}
hired={hiredApplicants}
hiringComplete={opening.status !== OpeningStatuses.OPEN}
/>
{opening.status === OpeningStatuses.OPEN && !activeApplications?.length && <ApplicationStatus />}
Expand Down
6 changes: 4 additions & 2 deletions packages/ui/src/working-groups/components/ApplicantsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Worker } from './Worker'

export interface WorkersListProps {
myApplication?: WorkingGroupOpeningApplication
hired?: WorkingGroupOpeningApplication
hired?: WorkingGroupOpeningApplication[]
allApplicants?: WorkingGroupOpeningApplication[]
hiringComplete: boolean
}
Expand All @@ -35,7 +35,9 @@ export const ApplicantsList = ({ hired, allApplicants, myApplication, hiringComp
{hired && (
<ContentWithTabs>
<Label>Hired</Label>
<Worker member={hired.member} applicationId={hired.id} />
{hired.map((application, index) => (
<Worker key={index} member={application.member} applicationId={application.id} />
))}
</ContentWithTabs>
)}
<ContentWithTabs>
Expand Down

2 comments on commit f7918ff

@vercel
Copy link

@vercel vercel bot commented on f7918ff Jun 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on f7918ff Jun 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pioneer-2 – ./

pioneer-2-git-dev-joystream.vercel.app
pioneer-2.vercel.app
pioneer-2-joystream.vercel.app

Please sign in to comment.