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

Remove tooltip after Cover Image Load #8489

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Jacobjeevan
Copy link
Contributor

Proposed Changes

@ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

@Jacobjeevan Jacobjeevan requested a review from a team as a code owner September 5, 2024 07:11
Copy link

netlify bot commented Sep 5, 2024

👷 Deploy request for care-ohc pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 872e353

@Jacobjeevan Jacobjeevan marked this pull request as draft September 5, 2024 07:12
@Jacobjeevan
Copy link
Contributor Author

Converting back to draft as I just saw the comment about cache invalidation #8480 (comment)

@github-actions github-actions bot added the stale label Sep 14, 2024
- Refresh cover image on page, right after save
	- Previously required page reload for changes to show up on page
@Jacobjeevan Jacobjeevan marked this pull request as ready for review September 17, 2024 14:35
Comment on lines 189 to 191
facilityFetch();
fetchImage();
setCoverImageEdited(true);
Copy link
Member

Choose a reason for hiding this comment

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

Can we wait till the fetch image is done (in the loading state itself of the image edit modal) before running facility fetch?

Comment on lines +156 to 159
{coverImageEdited && !coverImageLoaded && (
<div className="absolute inset-x-0 bottom-0 w-full rounded-b-md bg-black/70 px-2 pb-0.5 backdrop-blur-sm">
<span className="text-center text-xs font-medium text-secondary-100">
{t("cover_image_updated_note")}
Copy link
Member

Choose a reason for hiding this comment

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

That way we can remove this tooltip altogether

Comment on lines +61 to +62
const [coverImageLoaded, setCoverImageLoaded] = useState(false);
const [coverImageUrl, setCoverImageUrl] = useState<string | undefined>("");
Copy link
Member

Choose a reason for hiding this comment

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

And these unnecessay useStates too could be removed that way.

Comment on lines +89 to +90
imageUrl += "?" + Date.now();
setCoverImageUrl(imageUrl);
Copy link
Member

@rithviknishad rithviknishad Sep 17, 2024

Choose a reason for hiding this comment

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

Let's not add query params. We know for sure that it always fetches the latest image with query params present. There's no need to perform the vary header method when giving query params right.

Comment on lines +86 to +87
credentials: "include",
mode: "no-cors",
Copy link
Member

Choose a reason for hiding this comment

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

are these headers required? how does this differ from with and without these?

@github-actions github-actions bot removed the stale label Sep 18, 2024
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.

Remove the Tooltip Message After Successful Cover Image Loading
2 participants