SOA-01 / monolith-wanderwise

SOA 2024 UPSTART "Trip Planner"
0 stars 1 forks source link

DEVELOP 06: Presentation Layer Refactoring  #32

Open jerry914 opened 1 week ago

jerry914 commented 1 week ago
  1. Manage user sessions:

    • [x] Use cookie-based sessions to maintain any history or information about the user’s experience
    • [x] Configure Roda to use cookies to manage user sessions
    • [x] Create a hashing secret for the cookies (Use: rake new_session_secret - in Rakefile)
  2. Add error-checking to your routes

    • [x] Distinguish the steps of each route (get data from API, store data in DB, etc.) and leave simple comments in your code identifying these steps
    • [x] Check and catch errors at each step:
    • [x] Use conditional logic (e.g, if-else) to check the validity of the output of steps
    • [x] Catch (rescue) expected or unexpected errors in each step
    • [x] Display notice / error flash messages (cookie-based)
  3. Refactor your views

    • [ ] Identify all the places your views use domain objects (entities/values)
    • [ ] Create View Objects in your domain
    • [ ] Implement the major functionality your views need
    • [ ] Some view object methods might simply call the same method on domain objects
    • [ ] Give descriptive names to the complex behavior
    • [ ] You might have to make several view objects corresponding to smaller entities and values
    • [ ] Ensure controller is only passing a view objects to views
    • [ ] Refactor views (e.g., slim files) to only use view objects
  4. Deploy to Heroku

    • [ ] Merge your refactor-presentation branch into main and push both branches to Github (Not found in Github)
    • [ ] Deploy your updates to main branch on Heroku (Error message: undefined method `map' for nil:NilClass flights = flight_data['data'].map { |flight| build_entity(flight) }.compact # Remove nil entries ^^^^)
    • [x] Don’t forget to add a SESSION_SECRET environment variable to Heroku

Notes:

  1. For your weekly code change, please make a new branch with a naming based on that week's feature, for example refactor-presentation for week 10, and then merge back to the main branch! Otherwise, it's hard for us to see if you are finishing the weekly homework on time. (From the commit history, it looks like you are still working on last week's progress)
Arijus1979 commented 1 week ago

Hello, there is a refactor-presentation branch and it is already merged into main: https://github.com/SOA-01/WanderWise/tree/refactor-presentation

Also, refactor-presentation has been deployed to Heroku: https://wanderwise-5adb4693c491.herokuapp.com/

Adrenno commented 1 week ago

Hi, TA, i created new_session_secret in the rakefile. please let me know if I'm missing anything

Screenshot 2024-11-18 114756

jerry914 commented 1 week ago

Great, I saw your changes for refactor-presentation!

A few questions:

  1. The deploy version, if I enter the date before the current date, the website will not respond. I would suggest adding some error messages to help the users.
  2. I couldn't find the search history on the website; please make sure you implement the session-based memory function on the front end.
  3. I was wondering if you finished the refactor-application for Week 11? Please push and merge it ASAP~
Arijus1979 commented 1 week ago

Thank you for your suggestions, we will try to implement them ASAP.

Views refactoring has been done here: https://github.com/SOA-01/WanderWise/pull/33

As for the refactor-application, we are still working on it and will try to finish this week.