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

Not showing meta-analysis experiments in creating score set dropdown menu. #310

Merged
merged 7 commits into from
Jan 13, 2025
27 changes: 16 additions & 11 deletions src/components/screens/ScoreSetCreator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
style="width: 100%;"
>
<template #option="slotProps">
{{slotProps.option.urn}}: {{slotProps.option.title}}
{{ slotProps.option.urn }}: {{ slotProps.option.title }}
</template>
<template #empty>
<div style="padding: 10px; text-align:center;">
Expand Down Expand Up @@ -1224,15 +1224,6 @@ export default {
},

setup: () => {
const editableExperiments = useItems({
itemTypeName: 'experiment',
options: {
filter: {
query: { l: { path: 'something' }, r: { constant: 'value' } }
}
}
})

const publicationIdentifierSuggestions = useItems({ itemTypeName: 'publication-identifier-search' })
const externalPublicationIdentifierSuggestions = useItems({ itemTypeName: 'external-publication-identifier-search' })

Expand All @@ -1253,7 +1244,7 @@ export default {

...useFormatters(),
...useItem({ itemTypeName: 'scoreSet' }),
editableExperiments: editableExperiments.items,
editableExperiments: ref([]),
licenses: licenses.items,
publicationIdentifierSuggestions: publicationIdentifierSuggestions.items,
setPublicationIdentifierSearch: (text) => publicationIdentifierSuggestions.setRequestBody({ text }),
Expand Down Expand Up @@ -1570,6 +1561,10 @@ export default {
}
},

mounted: async function() {
await this.loadEditableExperiment()
},

methods: {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Contributors
Expand Down Expand Up @@ -1895,6 +1890,16 @@ export default {
// Form fields
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

loadEditableExperiment: async function() {
try {
const response = await axios.post(`${config.apiBaseUrl}/me/experiments/search`, {metaAnalysis: false})
this.editableExperiments = response.data
} catch (error) {
console.error("Error loading experiments:", error)
this.editableExperiments = [] // Reset in case of an error
}
},

populateExperimentMetadata: function (event) {
this.abstractText = event.value.abstractText
this.contributors = event.value.contributors || []
Expand Down
5 changes: 0 additions & 5 deletions src/lib/item-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ const itemTypes = {
}
}
},
'experiment': {
name: 'experiment', // TODO Redundant, change this structure
restCollectionName: 'experiments',
primaryKey: 'urn'
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will still need this definition, since it is used for the experiment creator, editor, and viewer.

Copy link
Member Author

@EstelleDa EstelleDa Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're correct. Thanks for reminding me!!

'experimentSet': {
name: 'experimentSet',
restCollectionName: 'experiment-sets',
Expand Down