-
Notifications
You must be signed in to change notification settings - Fork 0
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
Event stats #36
Event stats #36
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I ran into a slight type issue. I created a new type called "AttendeeDetailedInformation" based on the registration data in the DB. I edited the return value of the fetchRegistrationData function to use this type. However, I realize that we are using quite a few different types (e.g. type Attendee) to represent attendee data and I'm not sure if they should all use the same type? It's causing a type error in the check but I'm hesitant to change any types and mess up another part of the code. |
|
||
data.forEach((item) => { | ||
const { label, value } = item; | ||
percentages[label] = (value / total) * 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is total always gonna be non zero?
src/types/types.ts
Outdated
}; | ||
|
||
export type AttendeeDetailedInformation = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Types should be consistent with db. So i think this here should be "Registration"
It's best to be consistent yes. I did a quick look and it should be fine using AttendeeDetailedInformation if that represents the registration information. currently fetchRegistrationData is used for the registration table on admin side and the stats page, so it won't be a large change. Please change this field to be "Registration" so that it matches the db table name. Also, the fetchBackend function is on dev now and it works. Please implement the call to the backend and fetch real data. |
Hey @AllanT102, do we need to get the backend functionality working in this PR? It might be better to merge our efforts to fetch event and registrations data on both the Stats page and the Admin Events Registrations page, otherwise we're duplicating the amount of work to get both pages working. |
True... ok let's do that @isa-leroux448 can you handle this then? Once you merge this in, I've assigned you the ticket to connect backend for registration table and stats |
PR LGTM, will approve once the Vercel build passes |
…into event-stats
I fixed the userInfo component used in the attendee information popup to use the new Registration type and be able to handle the nested user profile information. Right now I'm running into issues when building with next but I don't think they're related to my branch. I think some broken stuff got merged into dev because the package.lock syntax is off and I get a whole bunch of errors like these when I run next build: |
Is this a problem with the other PRs? Wondering if it's something I should fix in my branch or another bug fix ticket altogether |
please fix alongside this PR so it passes build, thanks |
Any updates @isa-leroux448? |
Sorry I forgot to request review again after Kevin fixed it. I've just resolved merge conflicts related to the sortable table columns. I've tested the table sorting and I think everything is working properly but might be worth a quick double-check on your end to make sure I didn't break anything. |
@voctory bump that the PR is ready to review/merge (I don't wanna accumulate more merge conflicts lol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left one comment about the getNestedValue
function if you could take a look, otherwise LGTM
|
||
const getNestedValue = (userData: Record<string, any>, field: string) => { | ||
const keys = field.split("."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the format of field
? Wondering why field.split(".")
is needed
Changes
Out Of Scope
Notes
Image
Mobile.mov