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 potentially unsafe 'title' field visit #1425

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function getLabel(data: any): string {

const labelOverrides = ConceptLabels[data.$type];

if (labelOverrides.title) {
if (labelOverrides && labelOverrides.title) {
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps we should make title required, and make this

if (labelOverirides) {
return labelOverride.title;
}
?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image
image
Just checked the schema, sometimes its false to indicate show nothing.

Copy link
Contributor

Choose a reason for hiding this comment

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

My suggestion is we make that required? like "title: string". will that be more simple?

Copy link
Contributor

Choose a reason for hiding this comment

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

It is designed to allow for user's to completely hide a label or description. I would like to keep it like this because it would be a nice reference in the future for when we expand the capabilities of the editor schema.

return labelOverrides.title;
}

Expand Down