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(query-bar, schema): double space not applied from schema or query history COMPASS-6980 #5471

Merged
merged 3 commits into from
Feb 21, 2024

Conversation

Anemy
Copy link
Member

@Anemy Anemy commented Feb 20, 2024

COMPASS-6980

Pulls in mongodb-js/devtools-shared#235 To see a quick example of the bug stringify usage causes in Compass, run a query with the following:

{
 name: 'te    st'
}

And then click on it in query history and observe the multiple spaces in te st are replaced by one space.

You can also insert a document with that value and click on it in the schema tab and see the wrong value was inserted previously (fixed in these changes).

These changes also make it so we prettify queries applied from the query bar and schema clicks.

before after
Screenshot 2024-02-13 at 2 07 38 PM Screenshot 2024-02-20 at 12 08 56 PM

@Anemy Anemy marked this pull request as ready for review February 20, 2024 21:10
typeof _value === 'undefined' ? '' : toJSString(_value, 0) || '';

valueAsString = prettify(valueAsString, 'javascript-expression', {
trailingComma: 'none',
Copy link
Collaborator

Choose a reason for hiding this comment

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

I really wouldn't mind if we make this default in Compass, definitely would prefer it to the need to have different configurations in different parts of the app 🙂

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, going to mention in the slack channel, I'll do that in a separate pr if folks are on board. Thanks for mentioning!

@Anemy Anemy merged commit 83ae812 into main Feb 21, 2024
16 checks passed
@Anemy Anemy deleted the COMPASS-6980-fix-schema-double-space branch February 21, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants