Skip to content

Commit

Permalink
Merge pull request #152 from Breeding-Insight/bug/BI-1158
Browse files Browse the repository at this point in the history
Bug/bi 1158
  • Loading branch information
davedrp authored Dec 15, 2021
2 parents 6e0ae91 + 77d0084 commit 32f5fd2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
6 changes: 1 addition & 5 deletions src/breeding-insight/model/Trait.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class Trait {
traitDescription?: string;
method?: Method;
scale?: Scale;
abbreviations?: Array<string>;
synonyms: string[] = [];
mainAbbreviation?: string;
active?: boolean;
Expand All @@ -46,7 +45,6 @@ export class Trait {
traitDescription?: string,
method?: Method,
scale?: Scale,
abbreviations?: Array<string>,
synonyms?: Array<string>,
active?: boolean,
tags?: string[],
Expand Down Expand Up @@ -74,7 +72,6 @@ export class Trait {
} else {
this.scale = new Scale();
}
this.abbreviations = abbreviations;
if (synonyms){
this.synonyms = Array.from(synonyms);
}
Expand All @@ -92,7 +89,7 @@ export class Trait {

static assign(trait: Trait): Trait {
return new Trait(trait.id, trait.traitName, trait.observationVariableName, trait.programObservationLevel, trait.entity, trait.attribute,
trait.traitDescription, trait.method, trait.scale, trait.abbreviations, trait.synonyms, trait.active, trait.tags, trait.fullName, trait.isDup);
trait.traitDescription, trait.method, trait.scale, trait.synonyms, trait.active, trait.tags, trait.fullName, trait.isDup);
}

checkStringListEquals(list: string[] | undefined, otherList: string[] | undefined): boolean {
Expand All @@ -114,7 +111,6 @@ export class Trait {
(this.traitName === trait.traitName) &&
(this.observationVariableName === trait.observationVariableName) &&
(this.fullName === trait.fullName) &&
(this.checkStringListEquals(this.abbreviations, trait.abbreviations)) &&
(this.checkStringListEquals(this.synonyms, trait.synonyms)) &&
(this.mainAbbreviation === trait.mainAbbreviation) &&
(this.entity === trait.entity) &&
Expand Down
1 change: 0 additions & 1 deletion src/breeding-insight/model/TraitSelector.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export enum TraitField {
NAME = 'name',
ABBREVIATIONS = 'abbreviations',
MAIN_ABBREVIATION = 'mainAbbreviation',
SYNONYMS = 'synonyms',
LEVEL = 'level',
Expand Down
4 changes: 1 addition & 3 deletions src/components/trait/TraitDetailPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,7 @@

abbreviationsSynonymsString(synonymsMaxLength: number) : string | undefined {
let abbSyn = "";
if (this.data && this.data.abbreviations && this.data.abbreviations.length > 0) {
abbSyn = this.data.abbreviations[0];
}

if (this.data && this.data.synonyms && this.data.synonyms.length > 0) {
// Up to synonymsMaxLength synonyms will be shown before , ... cutoff
const synonyms = this.data.synonyms.slice(0, Math.min(this.data.synonyms.length, synonymsMaxLength)).join(", ");
Expand Down
3 changes: 1 addition & 2 deletions src/components/trials/forms/BaseStudyForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,8 @@ export default class BaseTraitForm extends Vue {
}
setAbbreviations(value: string) {
const abbreviations = this.parseSemiColonList(value);
this.trait.abbreviations = abbreviations;
if (abbreviations.length > 0) {this.trait.mainAbbreviation = this.trait.abbreviations[0]}
}
parseSemiColonList(value: string): string[] {
return value.split(';');
}
Expand Down
4 changes: 2 additions & 2 deletions src/views/trait/TraitsImport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<template v-if="state === ImportState.CHOOSE_FILE || state === ImportState.FILE_CHOSEN">
<h1 class="title" v-if="showTitle">Import Ontology</h1>
<ImportInfoTemplateMessageBox v-bind:import-type-name="'Ontology'"
v-bind:template-url="'https://cornell.box.com/shared/static/pdphm5nr8vd6wc60n2cg6bvtndmkg4vr.xls'"
v-bind:template-url="'https://cornell.box.com/shared/static/n3oapshmoqjju0yzuhlgh01cuevbzlj5.xls'"
class="mb-5">
<strong>Before You Import...</strong>
<br/>Prepare ontology information for import using the provided template.
Expand Down Expand Up @@ -81,7 +81,7 @@
<template v-if="state === ImportState.IMPORT_ERROR">
<h1 class="title">Importing...</h1>
<ImportInfoTemplateMessageBox v-bind:import-type-name="'Ontology'"
v-bind:template-url="'https://cornell.box.com/shared/static/pdphm5nr8vd6wc60n2cg6bvtndmkg4vr.xls'"
v-bind:template-url="'https://cornell.box.com/shared/static/n3oapshmoqjju0yzuhlgh01cuevbzlj5.xls'"
class="mb-5">
<strong>Before You Import...</strong>
<br/>Prepare ontology information for import using the provided template.
Expand Down

0 comments on commit 32f5fd2

Please sign in to comment.