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

Feature/add content to metadata summary #71

Merged
merged 7 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
38 changes: 38 additions & 0 deletions src/components/EnvironmentMetadata.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<script setup lang="ts">
import type { PropType } from "vue";
import { type Environment } from "@/model/Metadata";

defineProps({
environment: { type: Object as PropType<Environment>, required: true },
});
</script>

<template>
<tr class="ps-2">
<th class="text-end">Biome:</th>
<td class="ps-5" v-if="environment.biome">
{{ environment.biome }}
</td>
<td class="ps-5" v-else>?</td>
</tr>
<tr>
<th class="text-end">Feature:</th>
<td class="ps-5" v-if="environment.feature">
{{ environment.feature }}
</td>
<td class="ps-5" v-else>?</td>
</tr>
<tr>
<th class="text-end">Material:</th>
<td class="ps-5" v-if="environment.material">
{{ environment.material }}
</td>
<td class="ps-5" v-else>?</td>
</tr>
</template>

<style scoped>
th {
font-weight: normal;
}
</style>
crsct marked this conversation as resolved.
Show resolved Hide resolved
34 changes: 23 additions & 11 deletions src/views/show-results/DisplayMetadata.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import type { Metadata } from "@/model/Metadata";
import type { PropType } from "vue";
import EnvironmentMetadata from "@/components/EnvironmentMetadata.vue";

const props = defineProps({
id: { type: String },
Expand All @@ -11,21 +12,32 @@ const props = defineProps({
<template>
<table>
<tbody>
<tr v-if="metadata.project_name">
<th class="text-end">Project Name:</th>
<td class="ps-5">{{ metadata.project_name }}</td>
</tr>
<tr v-if="metadata.sample?.collection_date">
<tr>
<th class="text-end">Collection Date:</th>
<td class="ps-5">{{ metadata.sample.collection_date }}</td>
<td class="ps-5" v-if="metadata.sample?.collection_date">
{{ metadata.sample?.collection_date }}
</td>
<td class="ps-5" v-else>?</td>
</tr>
<tr v-if="metadata.sample?.country">
<tr>
<th class="text-end">Country:</th>
<td class="ps-5">{{ metadata.sample.country }}</td>
<td class="ps-5" v-if="metadata.sample?.country">
{{ metadata.sample?.country }}
</td>
<td class="ps-5" v-else>?</td>
</tr>
<tr>
<th class="text-end">Environment:</th>
</tr>
<tr v-if="metadata.sequencing?.instrument_model">
<th class="text-end">Sequencing Instrument:</th>
<td class="ps-5">{{ metadata.sequencing?.instrument_model }}</td>
<template v-if="metadata.sample?.environment">
lukasjelonek marked this conversation as resolved.
Show resolved Hide resolved
<EnvironmentMetadata :environment="metadata.sample.environment" />
</template>
<tr>
<th class="text-end">Isolation Source:</th>
<td class="ps-5" v-if="metadata.sample?.isolation_source">
{{ metadata.sample?.isolation_source }}
</td>
<td class="ps-5" v-else>?</td>
crsct marked this conversation as resolved.
Show resolved Hide resolved
</tr>
</tbody>
</table>
Expand Down