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

New current user entity to track logged-in user #69

Merged
merged 1 commit into from
Dec 3, 2022

Conversation

TiareMar
Copy link
Contributor

@TiareMar TiareMar commented Dec 2, 2022

OVERVIEW OF CHANGES:

  • Refactored the InstructorMainScreen for consistency to match the StudentMainScreen
  • VERY IMPORTANT: also for consistency, changed the name of the student main screen to "StudentMain" (to match "InstructorMain"). All screens that used "main" have been changed to "StudentMain". If your screen was not in the main branch yet, you need to make this change manually
  • Also, new CurrentUser class with static variable currentUser which holds the User object of the current user to address the null user bug currently in Main. See below for more details:

HOW TO USE CurrentUser:

  • By introducing the CurrentUser class, we are decoupling knowing who is logged in and the controller/interactor/presenter/etc. flow
  • Now the STATIC variable currentUser in the CurrentUser entity class is going to hold the User object of whoever is logged in
  • This (hopefully) means that 1) you don't need to access the logged-in user User object until your interactor class for your use case and 2) you don't need to know who is logged in in Main when your controllers/interactors/presenters are initialize (i.e. you can get rid of that parameter)
  • So, instead of dragging a User object through your controller to your interactor as a paramecter, you can access the currently logged-in user directly in your interactor by calling CurrentUser.getCurrentUser() (recall that currentUser is a STATIC variable)

@TiareMar TiareMar added (de)bug (Fixing) something that isn't working code style / organization Refactoring and making code clean labels Dec 2, 2022
Copy link
Contributor

@CC-3636 CC-3636 left a comment

Choose a reason for hiding this comment

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

looks good--make sure to add logic (i.e. how ppl need to change their interactors) -- thank you!!!

Copy link
Contributor

@celinelumqr celinelumqr left a comment

Choose a reason for hiding this comment

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

code follows clean architecture as far as I can tell and new classes and methods are well-documented

@TiareMar TiareMar merged commit b6fd91c into main Dec 3, 2022
@jltng jltng linked an issue Dec 3, 2022 that may be closed by this pull request
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code style / organization Refactoring and making code clean (de)bug (Fixing) something that isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature 2 - To-do Task Creation and Maintenance
4 participants