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

Show cookie toggle for embedded landing pages #7358

Conversation

esilverm
Copy link
Contributor

@esilverm esilverm commented Feb 6, 2023

JIRA
Related embed PR

This code relies on several other PRs to be approved/merged, so I will keep it as a draft until it is ready.

Context

Users are getting confused because the embedded sandbox doesn't show the includeCookies toggle. This toggle should be visible for AS4 users when they are in embedded sandbox.

What Changed

This adjusts the way the getEmbeddedHTML helpers use the landing page config options. These options should stay the same and the user shouldn't experience any changes to how they need to configure their Apollo Server configuration.

Instead, we use the includeCookies value as an initial value for the cookie toggle in explorer, pass it to initialState, and turn off a hideCookieToggle flag to expose this value to users in explorer.

How to test

Use codesandbox link below

@netlify
Copy link

netlify bot commented Feb 6, 2023

Deploy Preview for apollo-server-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 794215b
🔍 Latest deploy log https://app.netlify.com/sites/apollo-server-docs/deploys/63ed2d56b0def90008689fc3
😎 Deploy Preview https://deploy-preview-7358--apollo-server-docs.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 settings.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 6, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 794215b:

Sandbox Source
Apollo Server Typescript Configuration
Apollo Server Configuration

@esilverm
Copy link
Contributor Author

@mayakoneval

@esilverm esilverm marked this pull request as ready for review February 14, 2023 17:16
Copy link
Member

@trevor-scheer trevor-scheer left a comment

Choose a reason for hiding this comment

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

Changes lgtm! I was able to test this using the codesandbox link on this PR. I see the include cookies toggle and can configure the default setting to true if I provide a configured version of the plugin myself.

Can you add a minor changeset please?

@trevor-scheer trevor-scheer merged commit f2d433b into apollographql:main Feb 15, 2023
@github-actions github-actions bot mentioned this pull request Feb 15, 2023
trevor-scheer pushed a commit that referenced this pull request Feb 15, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @apollo/server@4.4.0

### Minor Changes

- [#7358](#7358)
[`f2d433b4f`](f2d433b)
Thanks [@esilverm](https://github.com/esilverm)! - Show "Include
Cookies" toggle in Embedded Sandbox landing page.

## @apollo/server-integration-testsuite@4.4.0

### Patch Changes

- Updated dependencies
\[[`f2d433b4f`](f2d433b)]:
    -   @apollo/server@4.4.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Comment on lines 44 to 46

includeCookies?: boolean; // defaults to 'false'
hideCookieToggle?: boolean; // defaults to 'true'
}
Copy link
Contributor

@mayakoneval mayakoneval Mar 8, 2023

Choose a reason for hiding this comment

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

@esilverm @trevor-scheer we don't support hideCookieToggle for the embedded Explorer, only Sandbox.

This section of code should be reverted iiuc. I am adding it to this PR #7431

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants