Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wiki
Manage
Activity
Members
Labels
Plan
Issues
53
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MDM Lab
Wiki
Commits
bb05c31c
Commit
bb05c31c
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
add download and view structure btn
parent
7b08fd54
No related branches found
No related tags found
3 merge requests
!229
Draft: Modify all articles with article struct
,
!228
Uniq molstar plugin per page
,
!226
Resolve "Design of the structure section in a system's page"
Pipeline
#127249
waiting for manual action with stages
in 8 minutes and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/content/ArticleStructure.vue
+58
-15
58 additions, 15 deletions
components/content/ArticleStructure.vue
with
58 additions
and
15 deletions
components/content/ArticleStructure.vue
+
58
−
15
View file @
bb05c31c
...
...
@@ -5,6 +5,7 @@ import MolstarPdbePlugin from './MolstarPdbePlugin.vue';
const
{
page
}
=
useContent
();
// get the structures
const
structures
=
ref
()
const
msIndexName
=
ref
<
string
>
(
"
structure
"
)
const
stuctureUrls
=
ref
<
string
[]
|
undefined
>
(
undefined
)
const
headers
=
ref
<
Record
<
string
,
any
>
[]
>
([
...
...
@@ -29,6 +30,14 @@ const groupBy = ref([
])
onBeforeMount
(()
=>
{
fetchStructures
()
})
onMounted
(()
=>
{
fetchStructures
()
})
function
namesToCollapsibleChips
(
names
:
string
[],
systemDir
:
string
,
file
:
string
|
null
=
null
)
{
if
(
file
===
null
)
{
return
names
.
filter
((
it
)
=>
it
!==
""
).
map
(
it
=>
({
title
:
it
.
split
(
"
__
"
)[
1
]
}))
...
...
@@ -41,26 +50,41 @@ function pdbNameToCif(pdbPath: string) {
return
`
${
cifPath
}
.cif`
}
function
displayStructure
(
item
)
{
stuctureUrls
.
value
=
[
`/
${
item
.
System_name_ok
}
/
${
pdbNameToCif
(
item
.
pdb
)}
`
,
`/
${
item
.
System_name_ok
}
/
${
item
.
pdb
}
`
]
stuctureUrls
.
value
=
item
.
structuresUrls
}
const
sanitizedStructures
=
computed
(()
=>
{
const
toValStructures
=
toValue
(
structures
)
if
(
toValStructures
?.
hits
?.
length
>
0
)
{
// ==================================================================================
// ASYNC PART
const
{
data
:
structures
,
error
,
refresh
}
=
await
useAsyncMeiliSearch
({
index
:
toValue
(
msIndexName
),
query
:
""
,
params
:
{
facets
:
[
"
*
"
],
filter
:
[
`System='
${
toValue
(
page
).
title
}
'`
,
"
completed='true'
"
],
return
toValStructures
.
hits
.
map
(
item
=>
{
return
{
...
item
,
structuresUrls
:
[
`/
${
item
.
System_name_ok
}
/
${
pdbNameToCif
(
item
.
pdb
)}
`
,
`/
${
item
.
System_name_ok
}
/
${
item
.
pdb
}
`
]
}
})
}
return
[]
})
if
(
error
.
value
)
{
throw
createError
(
`Cannot get structure for system:
${
page
.
title
}
`
)
}
// ==================================================================================
// ASYNC PART
async
function
fetchStructures
()
{
const
{
data
,
error
,
refresh
}
=
await
useAsyncMeiliSearch
({
index
:
toValue
(
msIndexName
),
query
:
""
,
params
:
{
facets
:
[
"
*
"
],
filter
:
[
`System='
${
toValue
(
page
).
title
}
'`
,
"
completed='true'
"
],
}
})
structures
.
value
=
data
.
value
if
(
error
.
value
)
{
throw
createError
(
`Cannot get structure for system:
${
page
.
title
}
`
)
}
}
// watch(page() => {
...
...
@@ -68,10 +92,12 @@ if (error.value) {
// refresh()
// })
console
.
log
(
structures
)
</
script
>
<
template
>
<v-card
flat
>
<v-data-table
:headers=
"headers"
:items=
"structures
.hits
"
:group-by=
"groupBy"
>
<v-data-table
:headers=
"headers"
:items=
"s
anitizedS
tructures"
:group-by=
"groupBy"
>
<template
#
[`
item.proteins_in_the_prediction
`
]=
"
{ item }">
<CollapsibleChips
:items=
"namesToCollapsibleChips(item.proteins_in_the_prediction, item.System_name_ok, item.fasta_file)"
>
...
...
@@ -92,8 +118,25 @@ console.log(structures)
</tr>
</
template
>
<
template
#
[`
item.structure
`
]=
"{ item }"
>
<v-row
no-gutters
align=
"center"
>
<v-btn
v-if=
"item?.pdb && item.pdb !== 'na'"
@
click=
"displayStructure(item)"
>
view
</v-btn>
<v-row
justify=
"space-between"
dense
no-gutters
align=
"center"
>
<v-col>
<v-btn
size=
"x-small"
variant=
"text"
icon=
"md:visibility"
@
click=
"displayStructure(item)"
></v-btn>
</v-col>
<v-col>
<v-menu>
<template
v-slot:activator=
"
{ props }">
<v-btn
:disabled=
"item.structuresUrls?.length
<
1"
size=
"x-small"
variant=
"text"
icon=
"md:download"
class=
"ml-1"
v-bind=
"props"
></v-btn>
</
template
>
<v-list>
<v-list-item
v-for=
"(url, index) in item.structuresUrls"
:key=
"index"
:value=
"index"
:href=
"url"
>
<v-list-item-title>
{{ url.split('.').slice(-1)[0] }}
</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-col>
</v-row>
</template>
</v-data-table>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment