Collaboration
diff --git a/apps/directory/src/functions/viewmodelMapper.js b/apps/directory/src/functions/viewmodelMapper.js
index 776957ab255..9824228d683 100644
--- a/apps/directory/src/functions/viewmodelMapper.js
+++ b/apps/directory/src/functions/viewmodelMapper.js
@@ -265,6 +265,16 @@ export function getCollectionDetails(collection, isBiobankWithdrawn) {
};
}
+export function getStudyDetails(study) {
+ const settingsStore = useSettingsStore();
+ const viewmodel = getViewmodel(study, settingsStore.config.studyColumns);
+
+ return {
+ ...study,
+ viewmodel,
+ };
+}
+
export const getBiobankDetails = (biobank) => {
const settingsStore = useSettingsStore();
@@ -336,6 +346,14 @@ export const collectionReportInformation = (collection) => {
collectionReport.certifications = mapQualityStandards(collection.quality);
}
+ if (collection.study) {
+ collectionReport.study = {
+ id: collection.study.id,
+ title: collection.study.title,
+ report: `/study/${collection.study.id}`,
+ };
+ }
+
collectionReport.collaboration = [];
if (collection.collaboration_commercial) {
@@ -357,6 +375,14 @@ export const collectionReportInformation = (collection) => {
return collectionReport;
};
+export const studyReportInformation = (study) => {
+ const studyReport = {};
+
+ studyReport.also_known = study.also_known ? mapAlsoKnownIn(study) : undefined;
+
+ return studyReport;
+};
+
export const mapNetworkInfo = (data) => {
return data.network.map((network) => {
return {
diff --git a/apps/directory/src/property-config/initialCollectionColumns.js b/apps/directory/src/property-config/initialCollectionColumns.js
index a707dcbb588..335a89a06ac 100644
--- a/apps/directory/src/property-config/initialCollectionColumns.js
+++ b/apps/directory/src/property-config/initialCollectionColumns.js
@@ -78,6 +78,11 @@ const initialCollectionColumns = [
column: { data_use: ["label", "ontologyTermURI"] },
type: "array",
},
+ {
+ label: "Study:",
+ column: { study: ["id", "title"] },
+ type: "xref",
+ },
{
column: [
"name",
diff --git a/apps/directory/src/router/index.js b/apps/directory/src/router/index.js
index ed35657def6..4fe9213b49d 100644
--- a/apps/directory/src/router/index.js
+++ b/apps/directory/src/router/index.js
@@ -5,6 +5,7 @@ import Landingpage from "../views/Landingpage.vue";
import BiobankReport from "../views/BiobankReport.vue";
import NetworkReport from "../views/NetworkReport.vue";
import CollectionReport from "../views/CollectionReport.vue";
+import StudyReport from "../views/StudyReport.vue";
import ConfigurationScreen from "../views/ConfigurationScreen.vue";
import { useSettingsStore } from "../stores/settingsStore";
@@ -32,6 +33,11 @@ const router = createRouter({
component: BiobankReport,
},
{ path: "/network/:id", name: "networkdetails", component: NetworkReport },
+ {
+ path: "/study/:id",
+ name: "studydetails",
+ component: StudyReport,
+ },
{
path: "/configuration",
component: ConfigurationScreen,
diff --git a/apps/directory/src/stores/settingsStore.js b/apps/directory/src/stores/settingsStore.js
index c55fa35fc20..f9dfc14c2f7 100644
--- a/apps/directory/src/stores/settingsStore.js
+++ b/apps/directory/src/stores/settingsStore.js
@@ -7,6 +7,7 @@ import initialBiobankColumns from "../property-config/initialBiobankColumns";
import initialBiobankReportColumns from "../property-config/initialBiobankReportColumns";
import initialLandingpage from "../property-config/initialLandingpage";
import { QueryEMX2 } from "molgenis-components";
+import initialStudyColumns from "../property-config/initialStudyColumns";
/**
* Settings store is where all the configuration of the application is handled.
* This means that user config from the database is merged with the defaults here.
@@ -28,6 +29,7 @@ export const useSettingsStore = defineStore("settingsStore", () => {
biobankColumns: initialBiobankColumns,
biobankReportColumns: initialBiobankReportColumns,
collectionColumns: initialCollectionColumns,
+ studyColumns: initialStudyColumns,
filterFacets: initialFilterFacets,
filterMenuInitiallyFolded: false,
biobankCardShowCollections: true,