Skip to content

Commit

Permalink
Merge pull request #976 from PathwayCommons/iss969_keep-name
Browse files Browse the repository at this point in the history
Retain the data source's 'name' in grounding tooltip entry
  • Loading branch information
jvwong committed May 13, 2021
2 parents a155a7c + d2a00ef commit 5234a1a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/client/components/element-info/entity-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,22 @@ class EntityInfo extends DataComponent {
delete match.typeOfGene; // n.b. the model overrides via this field
}

// If label is different from match 'name', add latter to shortSynonyms
let matchShortSyns = _.get( match, 'shortSynonyms', [] );
let inputNotMatchName = _.toLower( s.name ) !== _.toLower( match.name );
if ( inputNotMatchName ) {
let newShortSyns = _.uniq( _.concat( match.name, matchShortSyns ) );
_.set( match, 'shortSynonyms', newShortSyns );
}

// Remove the match 'name' from the current association, if exists
const assoc = el.association();
if( assoc ) {
let shortSyns = _.get( assoc, 'shortSynonyms', [] );
let newShortSyns = _.without( shortSyns, assoc.name );
_.set( assoc, 'shortSynonyms', newShortSyns );
}

el.associate( match );
el.complete();

Expand Down

0 comments on commit 5234a1a

Please sign in to comment.