Skip to content

Commit

Permalink
Merge pull request #310 from VariantEffect/estelle/excludeMetaAnalysi…
Browse files Browse the repository at this point in the history
…sExperiment

Not showing meta-analysis experiments in creating score set dropdown menu.
  • Loading branch information
EstelleDa authored Jan 13, 2025
2 parents 21c1c65 + 0b60019 commit 0c0afde
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
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
24 changes: 15 additions & 9 deletions src/components/screens/ScoreSetEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -787,14 +787,6 @@ import { TARGET_GENE_CATEGORIES, textForTargetGeneCategory } from '@/lib/target-
components: { AutoComplete, Button, Card, Chips, Column, Checkbox, DataTable, DefaultLayout, Dropdown, EmailPrompt, EntityLink, FileUpload, InputGroup, InputGroupAddon, InputNumber, InputText, Message, Multiselect, ProgressSpinner, SelectButton, TabPanel, TabView, Textarea },
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' })
const targetGeneIdentifierSuggestions = {}
Expand All @@ -812,7 +804,7 @@ import { TARGET_GENE_CATEGORIES, textForTargetGeneCategory } from '@/lib/target-
return {
...useFormatters(),
...useItem({ itemTypeName: 'scoreSet' }),
editableExperiments: editableExperiments.items,
editableExperiments: ref([]),
licenses: licenses.items,
publicationIdentifierSuggestions: publicationIdentifierSuggestions.items,
setPublicationIdentifierSearch: (text) => publicationIdentifierSuggestions.setRequestBody({ text }),
Expand Down Expand Up @@ -1056,6 +1048,10 @@ import { TARGET_GENE_CATEGORIES, textForTargetGeneCategory } from '@/lib/target-
},
},
mounted: async function() {
await this.loadEditableExperiment()
},
methods: {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Contributors
Expand Down Expand Up @@ -1291,6 +1287,16 @@ import { TARGET_GENE_CATEGORIES, textForTargetGeneCategory } from '@/lib/target-
// 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.doiIdentifiers = event.value.doiIdentifiers
this.publicationIdentifiers = _.concat(event.value.primaryPublicationIdentifiers, event.value.secondaryPublicationIdentifiers)
Expand Down

0 comments on commit 0c0afde

Please # to comment.