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

Clean Up State Management and API Calls #573

Open
1 of 8 tasks
steets250 opened this issue Jul 8, 2022 · 0 comments
Open
1 of 8 tasks

Clean Up State Management and API Calls #573

steets250 opened this issue Jul 8, 2022 · 0 comments
Assignees

Comments

@steets250
Copy link
Member

steets250 commented Jul 8, 2022

The goal of resolving this issue is to make the portal more easily accessible to casual developers along with new members of dev team. There are certain aspects of the portal that require prior knowledge to know why they were set up in a specific way, or are currently done in a more complex than necessary way. My goal is for this to be my last PR, such that knowledge gained by figuring out older features of the portal can be used to simplify them, rather than needing to explain the weird way to others.

As I go through and review the code, I'll list changed and explanations here:

  • Dangling Konami Code Reference: There used to be a feature on the portal where entering the Konami code would redirect to a hidden bread cutting mini game (still located at https://members.acmucsd.com/bread). We removed the Konami code library and functionality, but a singular line in react-app-env.d.ts got left behind.
  • Isolate Backend Functionality: We currently have the goal for backend to publish a package containing the types used for API requests and responses, along with functions corresponding to each possible API call. In preparation, it would be beneficial to isolate API calls from within components and helper files, so that when the package is published, it can be easily swapped out.
  • Use React Context Hooks: We currently use Redux for state management. There are outdated events that are no longer dispatched, or dispatched events that have an unnecessary affect on state. (As an example, the passwordFail event that sets state.error = true;, where that property of state is never read.) Right now, only the user state needs to be shared between components and shouldn't be reloaded multiple times per session. In the event that information doesn't persist when pages are browsed through, then static information like the list of events, store items, and user's store orders can also be stored in context.
  • Clean Admin Actions: Portal administrative actions like awarding bonus points and retroactively checking members in use outdated components or behave in a clunky manner. Fixing these up will make the pages more straightforward for both someone looking over the code used, as well as someone using the page itself.
  • Solidify Role of Components and Containers: Right now, there isn't much of a standardization of where functionality goes, where state is accessed, and how props should be passed from containers to components. This should be written out in the readme and checked for future PRs.
  • Specify Source of Majors: There is a majors.json file which is used to supply the list of majors that a user can select when creating an account. It is currently unknown where this list came from or how to properly update it.
  • Remove Discord Tab: ACM's social media links are listed in the "Explore ACM" tab (https://members.acmucsd.com/about), as well as the main website (https://acmucsd.com/#contact). The inclusion of the Discord iFrame appears to be unhelpful, and also means that the react-iframe library is used.
  • Remove Config File: The API paths can be stored in the folder containing API-related code, the AWS_URL property is no longer used, and about property can be directly inserted in the about page, since it is only used once on the site.
@steets250 steets250 self-assigned this Jul 8, 2022
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

No branches or pull requests

1 participant