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 all 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.

26 changes: 26 additions & 0 deletions src/pages/admin/Event/EventStats/EventStatsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
import {
Field, Form, Formik
} from "formik";
import { array } from "yup";

const styles = {
stats: {
Expand Down Expand Up @@ -123,6 +124,8 @@ export class EventStatsTable extends Component {
partnerColumns: {
},
presentedPartnerColumns: [],
registrationNumbersWithPartners: {
},
registrationNumbers: {
},
faculties: {
Expand Down Expand Up @@ -271,9 +274,26 @@ export class EventStatsTable extends Component {
return heardFrom;
}

registrationNumbersWithPartners(users) {
// const partners = [];

// for (let i = 0; i < users.length; i++) {
// if (users[i].isPartner) {
// partners.push(users[i]);
// }
// }

// let numberOfPartners = partners.length;

// will add implementation to calculate the ratio of number of participants and partners
// add a new stay showing this ratio
}

registrationNumbers(users) {
// console.log(users);
const registrationNumbers = {
};
users = users.filter(user => user.isPartner === false);
users.forEach((user) => {
if (user.registrationStatus) {
registrationNumbers[user.registrationStatus] = registrationNumbers[
Expand Down Expand Up @@ -310,6 +330,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 Expand Up @@ -657,6 +678,11 @@ export class EventStatsTable extends Component {
padding: "10px"
}} />

<Statistic
statName="Registered partners and students: "
statObj={this.state.registrationNumbers}
/>

<Statistic
statName="Registration status: "
statObj={this.state.registrationNumbers}
Expand Down