From 38cbfc13e414c82a490df9ad016956670fb0a73f Mon Sep 17 00:00:00 2001 From: Ben Capodanno Date: Mon, 4 Nov 2024 11:38:53 -0800 Subject: [PATCH] Display Target Categories in a User Friendly Way --- src/components/ScoreSetTable.vue | 4 +++- src/components/common/SelectList.vue | 8 ++++++-- src/components/screens/ExperimentView.vue | 6 ++++-- src/components/screens/ScoreSetCreator.vue | 16 +++++++--------- src/components/screens/ScoreSetEditor.vue | 16 +++++++--------- src/components/screens/ScoreSetView.vue | 4 +++- src/components/screens/SearchView.vue | 4 +++- src/lib/target-genes.ts | 20 ++++++++++++++++++++ 8 files changed, 53 insertions(+), 25 deletions(-) create mode 100644 src/lib/target-genes.ts diff --git a/src/components/ScoreSetTable.vue b/src/components/ScoreSetTable.vue index c7980e12..6786539e 100644 --- a/src/components/ScoreSetTable.vue +++ b/src/components/ScoreSetTable.vue @@ -15,6 +15,7 @@ import $ from "jquery"; import _ from "lodash"; +import { textForTargetGeneCategory } from "@/lib/target-genes" import useFormatters from "@/composition/formatters"; import FlexDataTable from "@/components/common/FlexDataTable"; @@ -25,6 +26,7 @@ export default { setup: () => { return { ...useFormatters(), + textForTargetGeneCategory: textForTargetGeneCategory }; }, @@ -79,7 +81,7 @@ export default { title: "Target", }, { - data: (x) => _.get(x, "targetGenes[0].category", "null category"), + data: (x) => textForTargetGeneCategory(_.get(x, "targetGenes[0].category", undefined)) || "null category", title: "Target type", }, { diff --git a/src/components/common/SelectList.vue b/src/components/common/SelectList.vue index 6be371b5..238807de 100644 --- a/src/components/common/SelectList.vue +++ b/src/components/common/SelectList.vue @@ -15,9 +15,9 @@
-