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-997 BI-1061]-2 Update Trait Import (clean redo) #125

Merged
merged 7 commits into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
15 changes: 10 additions & 5 deletions src/components/trait/TraitsImportTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,22 @@
-->
<template v-slot:columns="data">
<TableColumn name="name" v-bind:label="'Name'">
{{ data.traitName }}
{{ data.observationVariableName }}
</TableColumn>
<TableColumn name="level" v-bind:label="'Level'" v-bind:visible="!collapseColumns">
{{ data.programObservationLevel.name }}
<TableColumn name="trait" v-bind:label="'Trait'" v-bind:visible="!collapseColumns">
{{ StringFormatters.toStartCase(data.traitDescription) }}
</TableColumn>
<TableColumn name="method" v-bind:label="'Method'" v-bind:visible="!collapseColumns">
{{ StringFormatters.toStartCase(data.method.methodClass) }}
{{ data.method.description + " " + StringFormatters.toStartCase(data.method.methodClass) }}
</TableColumn>
<TableColumn name="scale" v-bind:label="'Scale'" v-bind:visible="!collapseColumns">
<TableColumn name="scaleClass" v-bind:label="'Scale Class'" v-bind:visible="!collapseColumns">
{{ TraitStringFormatters.getScaleTypeString(data.scale) }}
</TableColumn>
<TableColumn name="unit" v-bind:label="'Unit'" v-bind:visible="!traitSidePanelState.collapseColumns">
<template v-if="data.scale.dataType==='NUMERICAL'">
{{ data.scale.scaleName }}
</template>
</TableColumn>
</template>

<!--
Expand Down
14 changes: 7 additions & 7 deletions src/views/trait/TraitsImport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
>
<section>
<p class="has-text-dark" :class="this.$modalTextClass">
No traits will be added, and the import in progress will be completely removed.
No ontology terms will be added, and the import in progress will be completely removed.
</p>
</section>
<div class="columns">
Expand All @@ -46,9 +46,9 @@
</WarningModal>

<template v-if="state === ImportState.CHOOSE_FILE || state === ImportState.FILE_CHOSEN">
<h1 class="title" v-if="showTitle">Import Traits</h1>
<ImportInfoTemplateMessageBox v-bind:import-type-name="'Trait'"
v-bind:template-url="'https://cornell.box.com/shared/static/u9vuob3vvu2cgwyoe26b2722u41b8f6o.xls'"
<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/8sp0qvccpjotosiv8576tczeg09nnvao.xls'"
Copy link
Member

Choose a reason for hiding this comment

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

This template link is to v9. The previous link is to v10. I think we want v10 as the link, @dmeidlin can you verify?

Copy link
Contributor

Choose a reason for hiding this comment

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

v10 has the new required fields for the ontology mvp, so, yes, keep the previous link.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rectified

class="mb-5">
<strong>Before You Import...</strong>
<br/>Prepare ontology information for import using the provided template.
Expand All @@ -67,7 +67,7 @@

<template v-if="state === ImportState.LOADING || state === ImportState.CURATE">
<template v-if="tableLoaded">
<h1 class="title">Curate and Confirm New Traits</h1>
<h1 class="title">Confirm New Ontology Term</h1>
<ConfirmImportMessageBox v-bind:num-traits="numTraits"
v-on:abort="showAbortModal = true"
v-on:confirm="importService.send(ImportEvent.CONFIRMED)"
Expand Down Expand Up @@ -322,15 +322,15 @@ export default class TraitsImport extends ProgramsBase {
await TraitUploadService.confirmUpload(this.activeProgram!.id!, upload!.id!);

// show all program traits
this.$emit('show-success-notification', `Imported traits have been added to ${name}.`);
this.$emit('show-success-notification', `Imported ontology terms have been added to ${name}.`);
this.$router.push({
name: 'traits-list',
params: {
programId: this.activeProgram!.id!
},
});
} catch(err) {
const note = err.message ? err.message : `Error: Imported traits were not added to ${name}.`;
const note = err.message ? err.message : `Error: Imported ontology terms were not added to ${name}.`;
this.$emit('show-error-notification', `${note}`);
Vue.$log.error(err);
}
Expand Down