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

Add names to retroactive attendance form #407

Merged
merged 18 commits into from
Apr 30, 2024
Merged

Conversation

ryanDing26
Copy link
Contributor

@ryanDing26 ryanDing26 commented Feb 25, 2024

Info

Closes #322.

Description

What changes did you make? List all distinct problems that this PR addresses. Explain any relevant
motivation or context.

Faris wanted to change the functionality on the retroactive attendance form (within the admin dashboard) so that it displayed names in the format firstName lastName (email) so that it would be easier to autocomplete manual attendance by name instead of asking people for their email for points.

Changes

  • Changed the emailRaw variable in getAllEmails in UserRepository.ts such that it built a query with the firstName and lastName of a user from the UserModel object alongside the existing email selection
  • Changed the return statement of getAllEmails in UserRepository.ts such that instead of just mapping all the emails, it would map firstName lastName (email)

Type of Change

  • Patch (non-breaking change/bugfix)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to not work as
    expected)
  • Documentation (A change to a README/description)
  • Continuous Integration/DevOps Change (Related to deployment steps, continuous integration
    workflows, linting, etc.)
  • Other: (Fill In)

If you've selected Patch, Minor, or Major as your change type, make sure to bump the version before merging in package.json!

Testing

I have tested that my changes fully resolve the linked issue ...

  • locally.
  • on the testing API/testing database.
  • with appropriate Postman routes. Screenshots are included below.

Checklist

  • I have performed a self-review of my own code.
  • I have followed the style guidelines of this project.
  • I have appropriately edited the API version in the package.json file.
  • My changes produce no new warnings.

Screenshots

Please include a screenshot of your Postman testing passing successfully.
image

Copy link

Thanks for contributing!
If you've made changes to the API's functionality, please make sure to bump the package
version—see this guide to semantic versioning for details—and
document those changes as appropriate.

Copy link
Member

@nik-dange nik-dange left a comment

Choose a reason for hiding this comment

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

Just a small nit. You'll need to fix your tests and run the linter before being able to merge though, make sure those pass before opening a PR

repositories/UserRepository.ts Outdated Show resolved Hide resolved
@dowhep
Copy link
Contributor

dowhep commented Mar 2, 2024

Nit: Since you will be returning an array of strings that concatenate names and emails, it would be cleaner and more correct to define a new type for such strings. Maybe make the field name "namesAndEmails" or something.

Copy link
Member

@nik-dange nik-dange left a comment

Choose a reason for hiding this comment

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

lgtm. please bump package version before merging

Copy link
Member

@farisashai farisashai left a comment

Choose a reason for hiding this comment

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

sorry I have one quick but important nit

repositories/UserRepository.ts Outdated Show resolved Hide resolved
@ryanDing26
Copy link
Contributor Author

This is the final version I would like to submit for the PR. Let me know if any more changes need to be made!

Copy link
Member

@nik-dange nik-dange left a comment

Choose a reason for hiding this comment

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

One quick question

types/ApiResponses.ts Outdated Show resolved Hide resolved
services/UserAccountService.ts Outdated Show resolved Hide resolved
repositories/UserRepository.ts Outdated Show resolved Hide resolved
types/ApiResponses.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@echang594 echang594 left a comment

Choose a reason for hiding this comment

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

See my other comment

Copy link
Member

@nik-dange nik-dange left a comment

Choose a reason for hiding this comment

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

@ryanDing26 looks good to me, just threw in a return type and did some linting

@nik-dange nik-dange dismissed stale reviews from echang594 and farisashai April 30, 2024 02:30

lgtm

@nik-dange nik-dange merged commit fd7c228 into master Apr 30, 2024
5 checks passed
@nik-dange nik-dange deleted the add-name-to-getAllEmails branch May 3, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants