Skip to content
Open
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
5 changes: 3 additions & 2 deletions Client/src/Utils/CategoryUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export type IndividualNode = OntologyNode<{
wdkReference: {
name: string;
displayName: string;
description?: string;
help?: string;
summary?: string;
};
Expand Down Expand Up @@ -96,7 +97,7 @@ export function getDisplayName(node: CategoryTreeNode) {
}

export function getDescription(node: CategoryTreeNode) {
return isIndividual(node) ? node.wdkReference.help
return isIndividual(node) ? node.wdkReference.description
Comment on lines -99 to +100
Copy link
Contributor

Choose a reason for hiding this comment

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

Any idea why we were returning help here? Was there a good reason for it?

Copy link
Contributor

@jtlong3rd jtlong3rd Sep 23, 2020

Choose a reason for hiding this comment

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

My guess is that it has to do with the current implementation of getTooltipContent - in that function, we seem to be delegating to getDescription when the node either (1) isn't an individual or (2) doesn't have a "search" property.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, right. I think it also has to do with the fact that AttributeField doesn't have a description property. I think we might need to have some branching logic based on the type of wdkReference.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes the help is for attributes

Copy link
Member Author

Choose a reason for hiding this comment

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

summary for questions.... for questions we would not want to deal with description...

: getPropertyValue('hasDefinition', node);
}

Expand Down Expand Up @@ -226,7 +227,7 @@ export function BasicNodeComponent(props: {node: CategoryTreeNode}) {
*/
export function nodeSearchPredicate(node: CategoryTreeNode, searchQueryTerms: string[]): boolean {
return areTermsInString(searchQueryTerms, getDisplayName(node) + ' ' +
getTooltipContent(node));
getTooltipContent(node) + ' ' + getDescription(node));
}

/**
Expand Down