-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
Disable buttons/links to share data with other websites depending on environment variables #1528
Disable buttons/links to share data with other websites depending on environment variables #1528
Conversation
✅ Deploy Preview for mermaidjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
431a63f
to
771f658
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @bluprince13!
Need some minor changes.
771f658
to
e6b5415
Compare
e6b5415
to
f663318
Compare
Updated to address comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to destructure if we're only using it once.
Co-authored-by: Sidharth Vinod <[email protected]>
Co-authored-by: Sidharth Vinod <[email protected]>
Is there anything more required here or is this mergeable? |
Hey @bluprince13, I started looking into the failing tests, but got distracted. Do you mind fixing those as well? If the failures are valid, it's okay to update the values appropriately. |
@sidharthv96 oh I thought that was just 1 of 3 tries that was failing. I guess not. Will look into it. |
@sidharthv96 isn't this just running the same test suite 3 times? 2/3 times it was successful. So, the tests are just flaky? See https://github.com/mermaid-js/mermaid-live-editor/blob/develop/.github/workflows/tests.yml#L15 On the the 3rd run, there are failures on:
|
It's running 3 copies of the same job, but the tests being run in each job is different, as we have the parallel flag set in cypress.
|
Merging this PR, as the failures are unrelated. Will fix separately. |
📑 Summary
One of the reasons users might self-host is because they want to prevent data being leaked out of their company/org. However, there are buttons on the UI that allow users to share their diagram with other website. For example, with mermaid.ink or kroki.io or mermaidchart.com. This PR allows disabling those buttons via environment variables.
Resolves #1511
📏 Design Decisions
Describe the way your implementation works or what design decisions you made if applicable:
With no values for the environment variables as shown below, the data sharing buttons/links are not shown:
With these environment variable values, the UI looks the same as before.
Let me know if you'd prefer the .env file to have values filled in. Since the changes are simple, I haven't added any tests, but can do if you wish. I wanted to get feedback on the approach first.
📋 Tasks
Make sure you
develop
branch