devsoc-unsw / freerooms

A web application designed to aid UNSW students in finding vacant rooms.
https://freerooms.devsoc.app/
Other
18 stars 1 forks source link

425 bug available soon text aligned weird sometimes #476

Closed sobariu closed 2 months ago

sobariu commented 3 months ago

Before, the "Available Soon" text was formatted weirdly because the text was overflowing, and so that's why it takes up two lines rather than just one. This can be reproduced if you go to webster building and set time to 6/3/2024 3:25PM.

This was the image of how it looked before:

available-soon-before

I added a line of code that basically sets the text of the status of the rooms to be "nowrap", so it doesn't get the weird formatting. whiteSpace: "nowrap" This is how it looks now:

available-soon-after

In terms of testing, I struggled a bit here to test with BuildingDrawer component because I had to render with redux, but then it couldn't fetch the data of the rooms. Therefore, I had to make a new file in views called RoomAvailabilityBox.tsx, which allowed me to export the 'RoomAvailabilityBox` component and test it directly.

Note though that I didn't really delete any code from BuildingDrawer.tsx, so there's duplicate code in RoomAvailabilityBox.tsx and BuildingDrawer.tsx.

JessicaF commented 2 months ago

@sobariu Don't forget to add Richard and I as reviewers so we get notified about it via email 😎

sobariu commented 2 months ago

Hi, I pushed new changes to the branch.

SkellyBG commented 2 months ago
  • In terms of the package-lock.json file, I don't recall making any changes to the file, so I am unsure why it says i did. I double checked the file with the one in the main branch and nothing has changed.

Looks like you're adding a package-lock.json file to the monorepo root (the package-lock.json file in the frontend isn't touched!) - you may have accidentally run npm install in the root folder instead? In any case, you should remove it from the diff.

  • In terms of linting, my VSCode says there's no error, although that might be because of how my VSCode is set. I ran npm run lint to double check.

Lints seem fine on my VSCode too - @JessicaF could you send the error that your VSCode is having?

sobariu commented 2 months ago
  • In terms of the package-lock.json file, I don't recall making any changes to the file, so I am unsure why it says i did. I double checked the file with the one in the main branch and nothing has changed.

Looks like you're adding a package-lock.json file to the monorepo root (the package-lock.json file in the frontend isn't touched!) - you may have accidentally run npm install in the root folder instead? In any case, you should remove it from the diff.

Oh thank you for that! I probably did run npm install in the root folder by accident ;-; I made a new push that removes this file :)))