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

fix: allow to display the code samples when try it panel is hidden #2624

Merged
merged 12 commits into from
Nov 5, 2024

Conversation

weyert
Copy link
Contributor

@weyert weyert commented Jul 26, 2024

Changes

  • Modified the rendering logic of the TryIt component to ensure it generates request data regardless of the TryIt panel's visibility.
  • Ensured that the request sample is consistently displayed on the page by decoupling the request data generation from the TryIt panel's display state.

Rationale

Previously, the request sample could not be displayed without rendering the TryIt panel, which was a limitation. This change allows the request sample by not visually rendering the TryIt Panel when its opted out off.

Testing

  • Verified that the request sample is correctly displayed when the TryIt panel is hidden.
  • Ensured no regressions in the display of the TryIt panel and its functionality.

Elements Default PR Template

In general, make sure you have: (check the boxes to acknowledge you've followed this template)

Other Available PR Templates:

The `TryIt`-component is responsible for generating the request data that
is used to render the request sample. This requires the component to also
be rendered when we don't want to display the TryIt panel itself.
@weyert weyert requested a review from a team as a code owner July 26, 2024 21:17
@weyert weyert requested a review from mallachari July 26, 2024 21:17
Copy link

netlify bot commented Jul 26, 2024

Deploy Preview for stoplight-elements ready!

Name Link
🔨 Latest commit 6e89828
🔍 Latest deploy log https://app.netlify.com/sites/stoplight-elements/deploys/672a09e3534c5d00085543a7
😎 Deploy Preview https://deploy-preview-2624--stoplight-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jul 26, 2024

Deploy Preview for stoplight-elements-demo ready!

Name Link
🔨 Latest commit 6e89828
🔍 Latest deploy log https://app.netlify.com/sites/stoplight-elements-demo/deploys/672a09e32c8e7800083b478d
😎 Deploy Preview https://deploy-preview-2624--stoplight-elements-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mnaumanali94
Copy link
Contributor

LGTM!

@mnaumanali94
Copy link
Contributor

@weyert Can we also update the docs please

@weyert
Copy link
Contributor Author

weyert commented Aug 1, 2024

Yeah, I will do. Probably tomorrow.

@weyert
Copy link
Contributor Author

weyert commented Aug 15, 2024

Totally forgot about it @mnaumanali94 I have added the call out in the documentation now.

@mnaumanali94 mnaumanali94 removed the request for review from mallachari August 16, 2024 10:55
@mnaumanali94 mnaumanali94 added the t/to-review To be reviewed by the team label Aug 16, 2024
@mnaumanali94 mnaumanali94 merged commit 589d49b into stoplightio:main Nov 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/to-review To be reviewed by the team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants