mattermost / mattermost-plugin-gitlab

GitLab plugin for Mattermost
Apache License 2.0
141 stars 85 forks source link

Added check for the 'show' prop before making API request for the link tooltip. #453

Closed raghavaggarwal2308 closed 9 months ago

raghavaggarwal2308 commented 9 months ago

Summary

What to test?

Steps to test:
  1. Connect your Gitlab account.
  2. Open the network tab of your browser.
  3. Hover over a Gitlab issue/PR link.

Ticket Link

Fixes: https://community.mattermost.com/core/pl/zao9gnwgjpf6mmeo9y9xu8kngy

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (7834d0f) 33.50% compared to head (1485e82) 33.38%. Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #453 +/- ## ========================================== - Coverage 33.50% 33.38% -0.12% ========================================== Files 22 22 Lines 4000 4014 +14 ========================================== Hits 1340 1340 - Misses 2527 2541 +14 Partials 133 133 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mickmister commented 9 months ago

I'm thinking we should also have the return value of the component be null when props.show is false, just as we are doing here:

https://github.com/mattermost/mattermost-plugin-gitlab/blob/b8940f89f252f5a85fd060c8843d1b7a724c07fb/webapp/src/components/link_tooltip/link_tooltip.jsx#L121-L123

raghavaggarwal2308 commented 9 months ago

@mickmister Updated