Skip to content
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