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

Schema View Comments Fixes #918

Merged
merged 11 commits into from
Jan 14, 2019
Merged

Schema View Comments Fixes #918

merged 11 commits into from
Jan 14, 2019

Conversation

rajinwonderland
Copy link
Contributor

@rajinwonderland rajinwonderland commented Dec 20, 2018

Fixes (for supporting """ Comments """)

  • Syntax Highlighting on Comments in SDLView.tsx for
  • Regex to hide Schema Comments in SDLView.tsx

Background:
The major issue was that the printSchema() function was not converting comments
i.e """ Some Comment"""
to a description
i.e # Some description

The addLinebreak() function was replacing the # token, not the """ token. Which is what lead to the syntax highlighting for the Codemirror component reading the comments as an invalid character.

Also the cause for why the commentsDisabled property may not have worked for those using the """ method of commenting on their schemas.

Screenshots 📸 🖥

electron

Changes proposed in this pull request:

  • Added default params to getSDL(..., commentsDisabled: boolean = true)

  • Added default argument of true for printSchema(..., commentDescriptions: boolean = true)

  • Tested on Electron & React app.

Note
I'm not sure how versioning works with the electron & react apps, but I tested this via yarn link

@huv1k huv1k merged commit a16bde1 into graphql:master Jan 14, 2019
@huv1k
Copy link
Collaborator

huv1k commented Jan 14, 2019

@rajinwonderland Thanks for your PR! It will be in next release. 🚀

cgxxv pushed a commit to cgxxv/graphql-playground that referenced this pull request Mar 25, 2022
* Merged from sdl-tabs https://github.com/Novvum/graphql-playground.git

* Added and integrated setting's key for 'schema.disableComments'

* Merged changes from disableComments branch

* Fixes and style changes matching @kuldar's design specs. Details on graphql#897 comments

* Still not able to cmd+save settings. Might be a deeper issue. However, save button saves disabled comments

* Added tabWidth prop to SideTab.tsx to provide specific widths for different tabs.

* Fix for Tab Spacing in collapsed state
Fix for additional line-breaks after each item

* Updates for using 'esc' on keydown to close tabs

* Updated createSDL.tsx

Schema will now default to true for commentsDisabled
and commentDescription properties

* Fixed Electron
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