Skip to content

Commit

Permalink
Fix could not change feature type in heatmap selection wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
pverscha committed Feb 8, 2024
1 parent 46a4d25 commit 851f298
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unipept-web-components",
"version": "2.1.4",
"version": "2.1.5",
"scripts": {
"dev": "vite",
"build": "vue-tsc --emitDeclarationOnly && vite build && tsc --emitDeclarationOnly && tsc-alias && rm -rf types/test types/plugins types/main.d.ts",
Expand Down
3 changes: 1 addition & 2 deletions src/components/tables/DataSourceTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<v-data-table
v-model="selectedItems"
:headers="headers"
:items="allItems"
:items="items"
:loading="loading"
:search="selectedCategory"
:custom-filter="categoryFilter"
Expand Down Expand Up @@ -87,7 +87,6 @@ const headers = readonly([
const selectedCategory = ref<string>("All");
const selectedItems = ref<DataSourceItem[]>([]);
const allItems = ref<DataSourceItem[]>(props.items);
const selectAll = () => {
selectedItems.value = props.items;
Expand Down
22 changes: 12 additions & 10 deletions src/components/visualizations/heatmap/single/DataSourceSingle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<script setup lang="ts">
import DataSourceSingleItem from './DataSourceSingleItem';
import DataSourceTable from '@/components/tables/DataSourceTable.vue';
import { computed, ref } from 'vue';
import { computed, ref, toRaw } from "vue";
import FunctionalDefinition from '@/logic/ontology/functional/FunctionalDefinition';
import { LcaCountTableProcessor, Ontology, NcbiId, NcbiTaxon, NcbiRank, NcbiTree, EcCountTableProcessor, EcCode, EcDefinition, EcNamespace, GoCode, GoCountTableProcessor, GoDefinition, InterproCode, InterproCountTableProcessor, InterproDefinition, GoNamespace, InterproNamespace } from '@/logic';
Expand Down Expand Up @@ -51,27 +51,29 @@ const dataSources: string[] = [
const selectedDataSource = ref<string>("NCBI taxonomy");
const selectedDataSourceItems = computed(() => {
if (selectedDataSource.value === "NCBI taxonomy") {
const selectedSource = toRaw(selectedDataSource.value);
if (selectedSource === "NCBI taxonomy") {
return ncbiItems.value;
} else if (selectedDataSource.value === "Enzyme Commission") {
} else if (selectedSource === "Enzyme Commission") {
return ecItems.value;
} else if (selectedDataSource.value === "Gene Ontology") {
} else if (selectedSource === "Gene Ontology") {
return goItems.value;
} else if (selectedDataSource.value === "Interpro") {
} else if (selectedSource === "Interpro") {
return interproItems.value;
} else {
return [];
}
});
const categories = computed(() => {
if (selectedDataSource.value === "NCBI taxonomy") {
const selectedSource = toRaw(selectedDataSource.value);
if (selectedSource === "NCBI taxonomy") {
return ["All", ...Object.values(NcbiRank)];
} else if (selectedDataSource.value === "Enzyme Commission") {
} else if (selectedSource === "Enzyme Commission") {
return ["All", ...Object.values(EcNamespace)];
} else if (selectedDataSource.value === "Gene Ontology") {
} else if (selectedSource === "Gene Ontology") {
return ["All", ...Object.values(GoNamespace)];
} else if (selectedDataSource.value === "Interpro") {
} else if (selectedSource === "Interpro") {
return ["All", ...Object.values(InterproNamespace)];
} else {
return [];
Expand Down Expand Up @@ -105,7 +107,7 @@ const computeItems = (
let category: string = "";
let count: number = 0;
if("rank" in definition) {
if ("rank" in definition) {
category = definition["rank"];
count = props.ncbiTree.nodes.get(id)?.count || 0;
} else {
Expand Down

0 comments on commit 851f298

Please sign in to comment.