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

Removing unneccessary calls when opening/editing a post #1463

Open
wants to merge 9 commits into
base: development
Choose a base branch
from

Conversation

Angamanga
Copy link
Contributor

@Angamanga Angamanga commented Nov 17, 2024

This PR introduce a resolver instead of a guard for post-detail/post-edit view. In this way, we can still check the permissions and also reuse the post-object in the components, and in that way removing an unneccessary call to the API that slowed down the opening of the post.
To test:

  1. Go to feed-view
  2. Click on a post
  • The post should open (but faster!!)
  1. Click on the pen on the post
  • The edit-view should open with the correct info (but faster!!)
  1. Test all kinds of actions, changing status, adding to collections etc etc, they should all work and be reflected in the UI
  2. Test on small screens and on the map, the modal should open and all functionality should work as before
  3. Test accessing the edit-url as a logged out user
  • You should get redirected to the "not found" url
  1. Test accessing a post under review as a logged out user
  • You should get redirected to the "not found" url

Note: While testing this, I found an existing bug in the mapview:
https://linear.app/ushahidi/issue/USH-1677/changing-status-on-a-post-in-map-view-doesnt-update-the-ui-to-reflect I have not fixed that in this PR.

Copy link

linear bot commented Nov 17, 2024

@Angamanga Angamanga marked this pull request as ready for review November 17, 2024 21:27
Copy link
Member

@Ifycode Ifycode left a comment

Choose a reason for hiding this comment

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

@Angamanga I did notice something with the UI and it's dependence on the API call before it responds to user action. Affects card preview slide out on click and Mode switch in general on feed view.

Link to video here: https://ushahidi.slack.com/archives/C03T5716QE5/p1731926348116819

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.

2 participants