Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registration stat tix #473

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 41 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/pages/admin/Event/EventStats/EventStatsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ export class EventStatsTable extends Component {
registrationNumbers(users) {
const registrationNumbers = {
};
for (let i = 0; i < users.length; i++) {
users = users.filter(user => user.isPartner === false);
}
Copy link
Member

Choose a reason for hiding this comment

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

this can be rewritten the same if you remove the for loop. Notice how you are not using "i" in line 276. See the documentation for array.filter to see how filter operates on the entire array and not just a single item.

users.forEach((user) => {
if (user.registrationStatus) {
registrationNumbers[user.registrationStatus] = registrationNumbers[
Expand Down Expand Up @@ -308,6 +311,7 @@ export class EventStatsTable extends Component {
? faculties[user.basicInformation?.faculty] + 1
: 1;
}

if (user.basicInformation?.year) {
const yearInt = parseInt(user.basicInformation?.year);
if (yearInt) {
Expand Down