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

Add support for schema pattern attribute #32

Merged
merged 3 commits into from
Sep 20, 2018
Merged

Conversation

chrisdudley
Copy link
Contributor

@chrisdudley chrisdudley commented Sep 20, 2018

This very simple change also allows the display of schema pattern attributes

If this could be merged and an updated release pushed to npmjs that would be appreciated please!

@@ -142,6 +143,10 @@ export default class JSONSchemaView {
<span class="range maxLength">maxLength:${this.schema.maxLength}</span>
`}

${_if(!this.isCollapsed && this.schema.pattern)`
<span class="range pattern">pattern:${this.schema.pattern}</span>
Copy link
Owner

Choose a reason for hiding this comment

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

Do you want to add some css to this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't have any specific CSS requirements in mind - i added the class just in case....
If my UX designer suddenly throws some requirements at me I'll put in another PR if thats OK?

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, we want tot make sure this is not a value and is just a modifier like range and others.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure I follow. Do I need to add some additional checks?

image

Thats how it currently looks. Which is good enough for my purposes.

@chrisdudley
Copy link
Contributor Author

@mohsen1 OK, since you mentioned if... I've added some rudimentary support to at least make it legible if happen to be using the dark theme!
Realised I hadn't pushed updated built files for the dist folder either, so have included them too.
Thanks a lot!

@mohsen1 mohsen1 merged commit 23b8cb8 into mohsen1:master Sep 20, 2018
@chrisdudley
Copy link
Contributor Author

Thanks for merging.... can you publish 2.0.1 to npmjs please?

@mohsen1
Copy link
Owner

mohsen1 commented Sep 21, 2018

Done
https://github.com/mohsen1/json-schema-view-js/releases/tag/v2.0.1

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.

None yet

2 participants