Financial-Times / x-dash

:x::heavy_minus_sign::newspaper: shared front-end components for FT.com and the FT Apps
https://financial-times.github.io/x-dash
38 stars 6 forks source link

ENTST-526 (x-gift-article) | Record whether a highlight token has been saved, and hide the 'save' message if this is the case. #756

Closed ob6160 closed 8 months ago

ob6160 commented 8 months ago

Background

We're looking to change the visibility logic around the following message that is included in the advanced sharing modal included as part of x-gift-article:

"If you wish to share the article with the highlights, you need to save the highlights first."

The requirement is for the message mentioned above to be hidden if the user has already saved the annotations included in the article that has been shared with this. This PR is a twin of https://github.com/Financial-Times/user-annotations-editor/pull/86 and uses largely the same methodology around saving the highlights token to the browser local storage to to achieve this.

What does this change?

UI changes

Before After
B2B users who are on an article where they have already saved shared annotations can see the "save the highlights" message B2B users who are on an article where they have already saved shared annotations are not shown the "save the highlights" message
Message visible before saving to local storage Message not shown after the highlights token has been persisted to local storage

How was this tested?