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

[BI-995] Failed QA Fixes #149

Merged
merged 6 commits into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion src/breeding-insight/model/Scale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {Category} from "@/breeding-insight/model/Category";

export enum DataType {
Date = "Date",
Duration = "Duration",
Nominal = "Nominal",
Numerical = "Numerical",
Ordinal = "Ordinal",
Expand Down
5 changes: 1 addition & 4 deletions src/components/ontology/OntologyTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
{{ StringFormatters.toStartCase(data.traitDescription) }}
</TableColumn>
<TableColumn name="method" v-bind:label="'Method'" v-bind:visible="!traitSidePanelState.collapseColumns">
{{ data.method.description + " " + StringFormatters.toStartCase(data.method.methodClass) }}
{{ (data.method.description ? data.method.description : "") + " " + StringFormatters.toStartCase(data.method.methodClass) }}
</TableColumn>
<TableColumn name="scaleClass" v-bind:label="'Scale Class'" v-bind:visible="!traitSidePanelState.collapseColumns">
{{ TraitStringFormatters.getScaleTypeString(data.scale) }}
Expand Down Expand Up @@ -471,9 +471,6 @@ export default class OntologyTable extends Vue {
} else if (Scale.dataTypeEquals(trait.scale!.dataType!, DataType.Numerical)) {
// Rename scale name to unit
handler.overrideMessage(0, 'scale.scaleName', 'Missing unit', 400);
} else if (Scale.dataTypeEquals(trait.scale!.dataType!, DataType.Duration)) {
// Rename scale name to unit of time
handler.overrideMessage(0, 'scale.scaleName', 'Missing unit of time', 400);
}
return deletions;
}
Expand Down
28 changes: 3 additions & 25 deletions src/components/trait/TraitDetailPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@
<span class="is-size-7 ml-2">{{data.entity}} {{data.attribute | capitalize}}</span>
</div>
</template>
<template v-if="data.method && data.method.description && data.method.methodClass">
<template v-if="data.method && data.method.methodClass">
<div class="column is-half p-0">
<span class="is-pulled-right has-text-weight-bold mr-2">Method</span>
</div>
<div class="column is-half p-0">
<span class="is-size-7 ml-2">{{ data.method.description | capitalize }} {{data.method.methodClass}}</span>
<span class="is-size-7 ml-2">{{(data.method.description ? StringFormatters.toStartCase(data.method.description) : "") }} {{ data.method.methodClass }}</span>
</div>
</template>
<template v-if="data.scale && data.scale.dataType">
Expand Down Expand Up @@ -110,28 +110,6 @@
</div>
</template>

<!-- If duration scale class then show units and range-->
<template v-if="Scale.dataTypeEquals(scaleType, DataType.Duration)">
<div class="column is-half p-0">
<span class="is-pulled-right mr-2">Unit of Time</span>
</div>
<div class="column is-half p-0">
<span class="is-size-7 ml-2">{{valueOrNA(data.scale.scaleName)}}</span>
</div>
<div class="column is-half p-0">
<span class="is-pulled-right mr-2">Minimum valid value</span>
</div>
<div class="column is-half p-0">
<span class="is-size-7 ml-2">{{valueOrNA(data.scale.validValueMin)}}</span>
</div>
<div class="column is-half p-0">
<span class="is-pulled-right mr-2">Maximum valid value</span>
</div>
<div class="column is-half p-0">
<span class="is-size-7 ml-2">{{valueOrNA(data.scale.validValueMax)}}</span>
</div>
</template>

<!-- nothing to show for date class now-->
<template v-if="scaleType && Scale.dataTypeEquals(scaleType, DataType.Date)">
</template>
Expand Down Expand Up @@ -241,7 +219,7 @@

@Component({
components: {EditDataForm, SidePanel, BaseTraitForm, HelpCircleIcon, ProgressBar},
data: () => ({DataType, MethodClass, Scale, Method}),
data: () => ({DataType, MethodClass, Scale, Method, StringFormatters}),
filters: {
capitalize: function(value: string | undefined) : string | undefined {
if (value === undefined) value = '';
Expand Down
5 changes: 1 addition & 4 deletions src/components/trait/TraitListsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
{{ StringFormatters.toStartCase(data.traitDescription) }}
</TableColumn>
<TableColumn name="method" v-bind:label="'Method'" v-bind:visible="!traitSidePanelState.collapseColumns">
{{ data.method.description + " " + StringFormatters.toStartCase(data.method.methodClass) }}
{{ (data.method.description ? data.method.description : "") + " " + StringFormatters.toStartCase(data.method.methodClass) }}
</TableColumn>
<TableColumn name="scaleClass" v-bind:label="'Scale Class'" v-bind:visible="!traitSidePanelState.collapseColumns">
{{ TraitStringFormatters.getScaleTypeString(data.scale) }}
Expand Down Expand Up @@ -446,9 +446,6 @@ export default class TraitTable extends Vue {
} else if (Scale.dataTypeEquals(trait.scale!.dataType!, DataType.Numerical)) {
// Rename scale name to unit
handler.overrideMessage(0, 'scale.scaleName', 'Missing unit', 400);
} else if (Scale.dataTypeEquals(trait.scale!.dataType!, DataType.Duration)) {
// Rename scale name to unit of time
handler.overrideMessage(0, 'scale.scaleName', 'Missing unit of time', 400);
}
return deletions;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/trait/TraitsImportTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
{{ StringFormatters.toStartCase(data.traitDescription) }}
</TableColumn>
<TableColumn name="method" v-bind:label="'Method'" v-bind:visible="!collapseColumns">
{{ data.method.description + " " + StringFormatters.toStartCase(data.method.methodClass) }}
{{ (data.method.description ? data.method.description : "") + " " + StringFormatters.toStartCase(data.method.methodClass) }}
</TableColumn>
<TableColumn name="scaleClass" v-bind:label="'Scale Class'" v-bind:visible="!collapseColumns">
{{ TraitStringFormatters.getScaleTypeString(data.scale) }}
Expand Down
22 changes: 2 additions & 20 deletions src/components/trait/forms/BaseTraitForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<span class="has-text-weight-bold">Method = Description + Class {{ methodName }}</span>
</div>
<div class="column is-2">
<span class="is-pulled-right required new-term pb-2 pr-3">Description</span>
<span class="is-pulled-right new-term pb-2 pr-3">Description</span>
</div>
<div class="column new-term is-10">
<AutoCompleteField
Expand Down Expand Up @@ -235,24 +235,6 @@
</div>
</template>

<!-- duration options-->
<template v-if="trait.scale && Scale.dataTypeEquals(trait.scale.dataType, DataType.Duration)">
<div class="column is-full">
<DurationTraitForm
class="p-0"
v-bind:unit="trait.scale.scaleName"
v-bind:valid-min="trait.scale.validValueMin"
v-bind:valid-max="trait.scale.validValueMax"
v-on:unit-change="trait.scale.scaleName = $event"
v-on:min-change="trait.scale.validValueMin = $event"
v-on:max-change="trait.scale.validValueMax = $event"
v-bind:client-validations="clientValidations"
v-bind:validation-handler="validationHandler"
v-bind:validation-index="0"
/>
</div>
</template>

<!-- numerical options-->
<template v-if="trait.scale && Scale.dataTypeEquals(trait.scale.dataType, DataType.Numerical)">
<div class="column is-full">
Expand Down Expand Up @@ -472,7 +454,7 @@ export default class BaseTraitForm extends Vue {
this.trait.scale.dataType = value;

// Allow for units in the numerical and duration traits
if (Scale.dataTypeEquals(value, DataType.Numerical) || Scale.dataTypeEquals(value, DataType.Duration)) {
if (Scale.dataTypeEquals(value, DataType.Numerical)) {
this.trait!.scale!.scaleName = undefined;

} else {
Expand Down
14 changes: 1 addition & 13 deletions src/components/trials/forms/BaseStudyForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,6 @@
<template v-if="trait.scale && Scale.dataTypeEquals(trait.scale.dataType, DataType.Date)">
<DateTraitForm />
</template>
<template v-if="trait.scale && Scale.dataTypeEquals(trait.scale.dataType, DataType.Duration)">
<DurationTraitForm
v-bind:unit="trait.scale.scaleName"
v-bind:valid-min="trait.scale.validValueMin"
v-bind:valid-max="trait.scale.validValueMax"
v-on:unit-change="trait.scale.scaleName = $event"
v-on:min-change="trait.scale.validValueMin = $event"
v-on:max-change="trait.scale.validValueMax = $event"
v-bind:validation-handler="validationHandler"
v-bind:validation-index="0"
/>
</template>
<template v-if="trait.scale && Scale.dataTypeEquals(trait.scale.dataType, DataType.Numerical)">
<NumericalTraitForm
v-bind:unit="trait.scale.scaleName"
Expand Down Expand Up @@ -265,7 +253,7 @@ export default class BaseTraitForm extends Vue {
this.trait.scale.dataType = value;

// Allow for units in the numerical and duration traits
if (Scale.dataTypeEquals(value, DataType.Numerical) || Scale.dataTypeEquals(value, DataType.Duration)) {
if (Scale.dataTypeEquals(value, DataType.Numerical)) {
this.trait!.scale!.scaleName = undefined;
} else {
this.trait!.scale!.scaleName = value;
Expand Down