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

Removes the TopBar form #103

Merged
merged 2 commits into from
Mar 3, 2024
Merged

Removes the TopBar form #103

merged 2 commits into from
Mar 3, 2024

Conversation

codefromthecrypt
Copy link
Member

This removes the TopBar form, which removes any problems around it. Our doc page is only for our current API.

Note, this doesn't need any custom build to accomplish, just a (non-intuitive) change to swagger-initializer.js. I found out about this by searching issues in github and several are doing the same thing.

As this change is against the gh-pages branch, I can't also update build-bin/README.md on master. I'll do that in a separate PR once it is verified to fix the issue.

Later, we can make GH automation to regenerate the dist by unzipping the swagger dist overwriting everything except our IDL and swagger-initializer.js.

Before:
Screenshot 2024-03-03 at 11 16 44

Now:
Screenshot 2024-03-03 at 11 17 31

This removes the TopBar form, which removes any problems around it.
Our doc page is only for our current API.

Note, this doesn't need any custom build to accomplish, just a
(non-intuitive) change to swagger-initializer.js.

As this change is against the gh-pages branch, I can't also update
build-bin/README.md on master. I'll do that in a separate PR once it is
verified to fix the issue.

Later, we can make GH automation to regenerate the dist by unzipping the
swagger dist overwriting everything except our IDL and
swagger-initializer.js.

Signed-off-by: Adrian Cole <[email protected]>
@codefromthecrypt
Copy link
Member Author

codefromthecrypt commented Mar 3, 2024

@openzipkin/ui fyi as we have very little folks doing close looks at any UI change lately, I'm becoming more and more feature pessimistic. Anything we can disable is better as there are an army of vulnerability finding people out there, and it is hugely time consuming to answer them.

@@ -1,14 1,15 @@
window.onload = function() {
Copy link
Member Author

Choose a reason for hiding this comment

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

docs will basically say this file is from our site, and the rest of things that aren't IDL are from swagger. capiche? ;)

basically it should be obvious how extremely simple this gh-pages branch is, and that it is entirely intentionally dumb. I'll take on this documentation

window.ui = SwaggerUIBundle({
url: "https://zipkin.io/zipkin-api/zipkin2-api.yaml",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
SwaggerUIStandalonePreset.slice(1) // index zero is the TopBar
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe worth linking the file since I guess this is reflecting implementation detail

https://github.com/swagger-api/swagger-ui/blob/master/src/standalone/presets/standalone/index.js

Copy link
Member Author

Choose a reason for hiding this comment

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

done. that's a very good idea.

Signed-off-by: Adrian Cole <[email protected]>
@codefromthecrypt codefromthecrypt merged commit 115da0b into gh-pages Mar 3, 2024
@codefromthecrypt codefromthecrypt deleted the no-topbar branch March 3, 2024 22:33
@codefromthecrypt
Copy link
Member Author

thanks for the review @anuraaga!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants