-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
8 changed files
with
382 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
frontend/src/components/StaticViews/DataVersionsView.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { setupMountedComponents } from '@bihealth/reev-frontend-lib/lib/testUtils' | ||
import { describe, it, vi } from 'vitest' | ||
|
||
import { StoreState } from '@/stores' | ||
|
||
import DataVersionsView from './DataVersionsView.vue' | ||
|
||
describe.concurrent('DataVersionsView', async () => { | ||
it.skip('renders the main content', async () => { | ||
// arrange: | ||
const mockInitialize = vi.fn().mockImplementation(async () => {}) | ||
const { wrapper } = await setupMountedComponents( | ||
{ component: DataVersionsView }, | ||
{ | ||
initialStoreState: { | ||
misc: { | ||
storeState: StoreState.Active, | ||
appVersion: 'v0.0.0', | ||
dataVersions: { | ||
alphamissense: '2021-01-01', | ||
clingen_gene: '2021-01-01' | ||
}, | ||
initialize: mockInitialize | ||
} | ||
} | ||
} | ||
) | ||
|
||
// act: nothing, only test rendering | ||
|
||
// assert: | ||
console.log(wrapper.html()) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<script setup lang="ts"> | ||
import { onMounted, ref } from 'vue' | ||
import { useMiscStore } from '@/stores/misc' | ||
const miscStore = useMiscStore() | ||
/** Data version to display. */ | ||
const transformedDataVersions = ref<{ name: string; version: string }[]>([]) | ||
/** Define table headers */ | ||
const headers = ref([ | ||
{ text: 'Resource', value: 'name' }, | ||
{ text: 'Version', value: 'version' } | ||
]) | ||
const initializeDataVersions = async () => { | ||
await miscStore.initialize() | ||
const transformDataVersions = () => { | ||
if (miscStore.dataVersions) { | ||
return Object.entries(miscStore.dataVersions).map(([name, version]) => ({ | ||
name, | ||
version: version ? String(version) : '' | ||
})) | ||
} else { | ||
return [] | ||
} | ||
} | ||
transformedDataVersions.value = transformDataVersions() | ||
} | ||
onMounted(initializeDataVersions) | ||
</script> | ||
|
||
<template> | ||
<v-card> | ||
<v-card-title>Data Sources</v-card-title> | ||
<v-card-subtitle> | ||
The following data sources and service versions are used in REEV application. | ||
</v-card-subtitle> | ||
<v-card-text> | ||
<div v-if="transformedDataVersions && transformedDataVersions.length > 0"></div> | ||
<v-table> | ||
<thead> | ||
<tr> | ||
<!-- Table Headers --> | ||
<th v-for="header in headers" :key="header.value"> | ||
{{ header.text }} | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<!-- Table Rows --> | ||
<tr v-for="(item, index) in transformedDataVersions" :key="index"> | ||
<td>{{ item.name }}</td> | ||
<td>{{ item.version }}</td> | ||
</tr> | ||
</tbody> | ||
</v-table> | ||
</v-card-text> | ||
</v-card> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.