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?
We extend the handleSaveAnnotations method within the ReceivedHighlightsAlert component to persist the highlightsToken in local storage, so that we maintain a record that the user has chosen to save a copy of the shared annotations.
The ShareArticleModal component was changed to read from local storage to determine if the highlights token included in the URL has been persisted to the users' local storage and show/hide the save message based on an existing prop: showHighlightsRecipientMessage
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
How was this tested?
Locally through linking this revision of the x-dash x-gift-article package to a local instance of next-article and verifying the behaviour works as intended.
The test suite for x-gift-article was extended to cover the new behaviour around hiding the save annotations message for users who have already saved this information.
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
: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?
handleSaveAnnotations
method within theReceivedHighlightsAlert
component to persist thehighlightsToken
in local storage, so that we maintain a record that the user has chosen to save a copy of the shared annotations.ShareArticleModal
component was changed to read from local storage to determine if the highlights token included in the URL has been persisted to the users' local storage and show/hide the save message based on an existing prop:showHighlightsRecipientMessage
UI changes
How was this tested?
x-gift-article
package to a local instance of next-article and verifying the behaviour works as intended.x-gift-article
was extended to cover the new behaviour around hiding the save annotations message for users who have already saved this information.