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

ShareModal: Share link redesign under newDashboardSharingComponent FF #87011

Merged
merged 15 commits into from May 3, 2024

Conversation

juanicabanas
Copy link
Contributor

@juanicabanas juanicabanas commented Apr 26, 2024

What is this feature?

  • Adds newDashboardSharingComponent FF for share modal redesign
  • Adds Share link redesign
  • Extracts share URL and image creation in a file
  • When new button is present, it changes Edit button from primary to secondary

Why do we need this feature?

Part of #85240

Which issue(s) does this PR fix?:

Fixes #85241

Special notes for your reviewer:

new-share-button.mov

@juanicabanas juanicabanas marked this pull request as ready for review April 29, 2024 20:09
@juanicabanas juanicabanas requested review from grafanabot and a team as code owners April 29, 2024 20:09
@juanicabanas juanicabanas added no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes labels Apr 29, 2024
@juanicabanas juanicabanas added this to the 11.0.x milestone Apr 29, 2024
Copy link
Contributor

@AgnesToulet AgnesToulet left a comment

Choose a reason for hiding this comment

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

LGTM! Just left a few minor questions/suggestions.

Also, I have the same concern as Lucy. Was it validated with the dashboard squad to have the "Share" button as primary and not the "Edit" one?

Comment on lines 118 to 120
expect(screen.queryByTestId(selectors.pages.Dashboard.DashNav.shareButton)).not.toBeInTheDocument();
const newShareButton = await screen.findByTestId(selectors.pages.Dashboard.DashNav.newShareButton.container);
expect(newShareButton).toBeInTheDocument();
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity:

  • Why are we using screen.queryByTestId(selectors.pages.Dashboard.DashNav.shareButton) instead of screen.findByText('Share') as above to retrieve the old share button?
  • Why are we using findByTestId instead of queryByTestId as above to retrieve the new share button?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • It's common to change the button text (and in this test, we're not testing that the button has "Share" text). Therefore, the test would fail. Actually, in the middle of the PR I changed "Share Link" to "Share" and the test failed when I was testing another thing.
  • FindBy is async. However, the component should be already mounted. I can change it

toolbarActions.push({
group: 'new-share-dashboard-button',
condition:
config.featureToggles.newDashboardSharingComponent && uid && !isEditing && !meta.isSnapshot && !isPlaying,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this uid && !isEditing && !meta.isSnapshot && !isPlaying can be extracted into a variable to not be duplicated between the old and the new share buttons.

@juanicabanas
Copy link
Contributor Author

LGTM! Just left a few minor questions/suggestions.

Also, I have the same concern as Lucy. Was it validated with the dashboard squad to have the "Share" button as primary and not the "Edit" one?

Yes, I'm pretty sure this was validated with @Ijin08 @natydej

@natydej
Copy link

natydej commented May 3, 2024

Yes, it is validated. The wording of the CTA needs to be changed to be only "Share"

@juanicabanas
Copy link
Contributor Author

Yes, it is validated. The wording of the CTA needs to be changed to be only "Share"

@natydej
@AgnesToulet doesn't mean the wording, but the primary and secondary buttons.
The edit button is not anymore the primary, but the secondary

@juanicabanas juanicabanas merged commit d1434fa into main May 3, 2024
19 checks passed
@juanicabanas juanicabanas deleted the juanicabanas/share-internally-sharing-redesign branch May 3, 2024 15:02
@grafana-delivery-bot grafana-delivery-bot bot modified the milestones: 11.0.x, 11.1.x May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend area/frontend no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes type/docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Share internally option (old link feature)
4 participants