Skip to content

Conversation

@kea-roy
Copy link
Member

@kea-roy kea-roy commented Oct 6, 2024

Summary

It can be really frustrating as a user when you post photos or other personal content in a review and have no way to completely remove a review.

With this feature, the delete reviews functionality provides users with more control over the data they provide to the platform.

Changes Made

What I've done:

  • Back-end:

    • Secured current delete-review endpoint and updated update-review-status
      • This endpoint is not used, just added authentication to make sure API is robust.
      • Adjusted authentication checks in update-review-status for security.
      • Improved documentation on permissions.
      • Testing with Postman
  • Front-end:

    • Created icon menu (option menu)
      • Replaced stub icons with actual icons based on Figma
      • Link clicking options to actual functionality
    • Created dialog for confirmation of deletion (temporary)
      • Connected to ReviewComponent icon menu
      • Connected to the back-end API request
    • Added documentation for ReviewComponent
    • Create icon menu
      • Fix design to match figma
      • Check responsiveness.
    • Create actual delete confirmation modal
      • Match design with Figma.
      • Create buttons and text and styling.
      • Check responsiveness.
    • Create toast
      • Add to all the pages and find a way to trigger on pages.
      • Made edit and delete function required props for safety checking across pages.
    • Fixed responsiveness of review
      • resolve padding issues
      • shorten date text on small screens to prevent wrapping
      • shorten bedrooms text on small screens to prevent wrapping
      • ensure kebab is always in correct position and doesn't wrap
  • End-to-End:

    • Testing done on all pages with reviewcomponent

Test Plan

I conducted thorough testing of both the front-end and back-end features I implemented.

On the back-end, I tested the secured delete-review endpoint by ensuring that appropriate authentication measures were in place, even though the endpoint is not currently in use, to guarantee robustness in future use cases. I also verified the adjusted authentication checks in the update-review-status endpoint, ensuring that permissions were correctly enforced, and that the changes were accurately documented for future reference.

On the front-end, I tested the new icon menu by replacing the stub icons with those from Figma and confirming that clicking each option triggered the correct functionality. For the temporary delete confirmation dialog, I verified that it successfully connected with the ReviewComponent and accurately sent the delete request to the back-end API by creating dummy reviews to test on. Through both functional testing and manual interaction with the UI, I ensured that these implementations worked smoothly across their intended components. I also tested the responsiveness of the menu and delete pop up to make sure it works on all screen sizes.

For end-to-end testing, I made sure that when a user deletes their review, the page correctly refreshes immediately to reflect this change. I also refreshed the page and checked the database itself to make sure the review was successfully marked as deleted. I repeated this process for all pages, including bookmarks, profile, apartment, and landlord pages.

I've also tested regular user permissions by removing myself from the admin list and re-testing the above using postman. The API request successfully declines any review modification attempts except for deleting it and editing it.

Test Plan Photos from Responsiveness Testing

Screenshot 2024-11-06 at 1 50 54 AM Screenshot 2024-11-06 at 1 51 02 AM Screenshot 2024-11-06 at 1 51 09 AM

- this endpoint is not used, just added authentication to make sure api is robust.
- adjusted authentication checks in update-review-status for security.
- improved documentation on permissions
@dti-github-bot
Copy link
Member

dti-github-bot commented Oct 6, 2024

[diff-counting] Significant lines: 409.

Base automatically changed from edit-reviews to main October 8, 2024 22:51
@kea-roy kea-roy marked this pull request as ready for review October 15, 2024 22:30
@kea-roy kea-roy changed the title [WIP] Implemented Delete Reviews Feature Implemented Delete Reviews Feature Oct 15, 2024
Copy link
Contributor

@ggsawatyanon ggsawatyanon left a comment

Choose a reason for hiding this comment

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

This PR was really well done and I appreciate the extensive test plan description. Overall, this PR has achieved everything required by the task requirements. I only have 1 frontend change to request which is that when zooming in, the 3 dot menu (fun fact: also known as the "kebab menu" in the UI world) should always be at the top right of the review card (the first row) and other details like the date/price/bedrooms etc. can be on the second row. This is particularly noticeable with reviews that have the price and bedroom data and in different window sizes such as this example for the iPad Pro:
image
Or when zoomed in on a normal desktop:
image

No complains about mobile view!

ggsawatyanon and others added 3 commits October 27, 2024 23:57
- resolve padding issues
- shorten date text on small screens to prevent wrapping
- shorten bedrooms text on small screens to prevent wrapping
- ensure kebab is always in correct position and doesn't wrap
@kea-roy
Copy link
Member Author

kea-roy commented Nov 6, 2024

PR Changes

Fixed responsiveness of review

  • resolve padding issues
  • shorten date text on small screens to prevent wrapping
  • shorten bedrooms text on small screens to prevent wrapping
  • ensure kebab is always in correct position and doesn't wrap

Test plan images:
Screenshot 2024-11-06 at 1 50 54 AM
Screenshot 2024-11-06 at 1 51 02 AM
Screenshot 2024-11-06 at 1 51 09 AM

@kea-roy kea-roy dismissed ggsawatyanon’s stale review November 6, 2024 06:54

Resolved requested changes

Copy link
Contributor

@ggsawatyanon ggsawatyanon left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the frontend issues! This PR completes the new edit reviews/delete reviews feature which is an important improvement for the user experience of our product, good job again on this PR.

@ggsawatyanon ggsawatyanon merged commit ca4337c into main Nov 16, 2024
4 checks passed
@ggsawatyanon ggsawatyanon deleted the delete-reviews-from-edit branch November 16, 2024 19:26
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.

4 participants