Skip to content

Commit

Permalink
More display at the top of detail component
Browse files Browse the repository at this point in the history
  • Loading branch information
dannon committed Feb 29, 2024
1 parent f4b9ca6 commit 8fc18f3
Showing 1 changed file with 37 additions and 6 deletions.
43 changes: 37 additions & 6 deletions client/src/components/Dataset/DatasetView.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<script setup lang="ts">
import { BTab, BTabs } from "bootstrap-vue";
import { computed } from "vue";
import { computed, ref} from "vue";
import { STATES } from "@/components/History/Content/model/states";
import { useDatasetStore } from "@/stores/datasetStore";
import Heading from "../Common/Heading.vue";
import DatasetAttributes from "@/components/DatasetInformation/DatasetAttributes.vue";
import DatasetDetails from "@/components/DatasetInformation/DatasetDetails.vue";
import VisualizationsList from "@/components/Visualizations/Index.vue";
const datasetStore = useDatasetStore();
const props = defineProps({
datasetId: {
type: String,
Expand All @@ -14,14 +20,35 @@ const props = defineProps({
// Move toplevel routes to this component with subrouting
});
// const activeTab = ref("activeTab");
const dataset = computed(() => datasetStore.getDataset(props.datasetId));
const isLoading = computed(() => datasetStore.isLoadingDataset(props.datasetId));
const stateText = computed(() => dataset.value && STATES[dataset.value.state] && STATES[dataset.value.state].text);
const activeTab = ref("activeTab");
const displayUrl = computed(() => `/datasets/${props.datasetId}/display/?preview=true`);
</script>
<template>
<div>
<div v-if="dataset && !isLoading">
<header class="dataset-header">
<h2>Dataset {{ datasetId }}</h2>
<code>More toplevel details here</code>
<Heading h2>{{ dataset.name }}</Heading>
<div v-if="stateText" class="mb-1">{{ stateText }}</div>
<div v-else-if="dataset.misc_blurb" class="blurb">
<span class="value">{{ dataset.misc_blurb }}</span>
</div>
<span v-if="dataset.file_ext" class="datatype">
<span v-localize class="prompt">format</span>
<span class="value">{{ dataset.file_ext }}</span>
</span>
<span v-if="dataset.genome_build" class="dbkey">
<span v-localize class="prompt">database</span>
<BLink class="value" data-label="Database/Build" @click.stop="activeTab = 'edit'">{{
dataset.genome_build
}}</BLink>
</span>
<div v-if="dataset.misc_info" class="info">
<span class="value">{{ dataset.misc_info }}</span>
</div>
</header>
<div class="dataset-tabs h-100">
<BTabs pills card>
Expand All @@ -48,4 +75,8 @@ const displayUrl = computed(() => `/datasets/${props.datasetId}/display/?preview
</div>
</template>

<style scoped></style>
<style scoped>
.dataset-header {
margin-bottom: 1.5rem;
}
</style>

0 comments on commit 8fc18f3

Please sign in to comment.