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
7ca60365
Commit
7ca60365
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
dynamic title for structure
parent
7982e1c5
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
#127253
waiting for manual action with stages
in 6 minutes and 38 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/content/ArticleStructure.vue
+4
-1
4 additions, 1 deletion
components/content/ArticleStructure.vue
components/content/PdbeMolstarPlugin.vue
+7
-24
7 additions, 24 deletions
components/content/PdbeMolstarPlugin.vue
with
11 additions
and
25 deletions
components/content/ArticleStructure.vue
+
4
−
1
View file @
7ca60365
...
@@ -6,6 +6,7 @@ import MolstarPdbePlugin from './MolstarPdbePlugin.vue';
...
@@ -6,6 +6,7 @@ import MolstarPdbePlugin from './MolstarPdbePlugin.vue';
const
{
page
}
=
useContent
();
const
{
page
}
=
useContent
();
// get the structures
// get the structures
const
structures
=
ref
()
const
structures
=
ref
()
const
structureTitle
=
ref
(
"
Structure
"
)
const
msIndexName
=
ref
<
string
>
(
"
structure
"
)
const
msIndexName
=
ref
<
string
>
(
"
structure
"
)
const
stuctureUrls
=
ref
<
string
[]
|
undefined
>
(
undefined
)
const
stuctureUrls
=
ref
<
string
[]
|
undefined
>
(
undefined
)
const
headers
=
ref
<
Record
<
string
,
any
>
[]
>
([
const
headers
=
ref
<
Record
<
string
,
any
>
[]
>
([
...
@@ -51,6 +52,8 @@ function pdbNameToCif(pdbPath: string) {
...
@@ -51,6 +52,8 @@ function pdbNameToCif(pdbPath: string) {
}
}
function
displayStructure
(
item
)
{
function
displayStructure
(
item
)
{
stuctureUrls
.
value
=
item
.
structuresUrls
stuctureUrls
.
value
=
item
.
structuresUrls
console
.
log
(
item
)
structureTitle
.
value
=
`
${
item
.
subtype
}
-
${
item
.
gene_name
}
`
}
}
...
@@ -145,6 +148,6 @@ console.log(structures)
...
@@ -145,6 +148,6 @@ console.log(structures)
</v-row>
</v-row>
</template>
</template>
</v-data-table>
</v-data-table>
<PdbeMolstarPlugin
v-model=
"stuctureUrls"
/>
<PdbeMolstarPlugin
v-model=
"stuctureUrls"
v-model:title=
"structureTitle"
/>
</v-card>
</v-card>
</template>
</template>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
components/content/PdbeMolstarPlugin.vue
+
7
−
24
View file @
7ca60365
...
@@ -45,6 +45,7 @@ const props = withDefaults(defineProps<Props>(), {
...
@@ -45,6 +45,7 @@ const props = withDefaults(defineProps<Props>(), {
})
})
const
dataUrls
=
defineModel
()
const
dataUrls
=
defineModel
()
const
title
=
defineModel
(
'
title
'
)
const
pdbeMolstarComponent
=
ref
(
null
)
const
pdbeMolstarComponent
=
ref
(
null
)
const
dialog
=
ref
(
false
)
const
dialog
=
ref
(
false
)
...
@@ -62,15 +63,7 @@ const computedHeight = computed(() => {
...
@@ -62,15 +63,7 @@ const computedHeight = computed(() => {
return
height
.
value
-
250
return
height
.
value
-
250
})
})
function
refinedUrl
(
url
:
string
)
{
if
(
url
?.
startsWith
(
'
/
'
)
&&
!
url
.
startsWith
(
'
//
'
))
{
const
_base
=
withLeadingSlash
(
withTrailingSlash
(
useRuntimeConfig
().
app
.
baseURL
))
if
(
_base
!==
'
/
'
&&
!
url
.
startsWith
(
_base
))
{
return
joinURL
(
_base
,
url
)
}
}
return
url
}
function
viewPdb
(
pdbPath
:
string
|
null
)
{
function
viewPdb
(
pdbPath
:
string
|
null
)
{
if
(
pdbPath
!==
null
)
{
if
(
pdbPath
!==
null
)
{
dialog
.
value
=
true
dialog
.
value
=
true
...
@@ -85,20 +78,10 @@ function viewPdb(pdbPath: string | null) {
...
@@ -85,20 +78,10 @@ function viewPdb(pdbPath: string | null) {
}
}
}
}
const
refinedDataUrls
=
computed
(()
=>
{
const
toValDataUrls
=
toValue
(
dataUrls
)
if
(
toValDataUrls
!==
undefined
&&
toValDataUrls
.
length
>
0
)
{
return
toValDataUrls
.
map
((
dataUrl
)
=>
{
return
refinedUrl
(
dataUrl
)
// return dataUrl
})
}
return
toValDataUrls
})
function
closeStructure
()
{
function
closeStructure
()
{
selectedPdb
.
value
=
null
selectedPdb
.
value
=
null
dataUrls
.
value
=
undefined
dialog
.
value
=
false
dialog
.
value
=
false
}
}
watch
(
selectedPdb
,
(
newSelectedPdb
,
prevSelectPdb
)
=>
{
watch
(
selectedPdb
,
(
newSelectedPdb
,
prevSelectPdb
)
=>
{
...
@@ -107,9 +90,10 @@ watch(selectedPdb, (newSelectedPdb, prevSelectPdb) => {
...
@@ -107,9 +90,10 @@ watch(selectedPdb, (newSelectedPdb, prevSelectPdb) => {
})
})
watchEffect
(()
=>
{
watchEffect
(()
=>
{
const
toValUrl
=
toValue
(
refinedD
ataUrls
)
const
toValUrl
=
toValue
(
d
ataUrls
)
if
(
toValUrl
?.
length
>
0
)
{
if
(
toValUrl
?.
length
>
0
)
{
dialog
.
value
=
true
dialog
.
value
=
true
selectedPdb
.
value
=
dataUrls
.
value
[
0
]
}
}
else
{
else
{
dialog
.
value
=
false
dialog
.
value
=
false
...
@@ -121,9 +105,8 @@ watchEffect(() => {
...
@@ -121,9 +105,8 @@ watchEffect(() => {
<v-dialog
v-model=
"dialog"
transition=
"dialog-bottom-transition"
fullscreen
:scrim=
"false"
>
<v-dialog
v-model=
"dialog"
transition=
"dialog-bottom-transition"
fullscreen
:scrim=
"false"
>
<v-card
flat
:rounded=
"false"
>
<v-card
flat
:rounded=
"false"
>
<v-toolbar>
<v-toolbar>
<v-toolbar-title>
Structures
</v-toolbar-title>
<v-toolbar-title>
{{
title
}}
</v-toolbar-title>
<v-select
v-model=
"selectedPdb"
label=
"Select PDB"
:items=
"refinedDataUrls"
<v-select
v-model=
"selectedPdb"
label=
"Select PDB"
:items=
"dataUrls"
hide-details=
"auto"
></v-select>
hide-details=
"auto"
></v-select>
<v-spacer></v-spacer>
<v-spacer></v-spacer>
<v-btn
:disabled=
"!selectedPdb"
icon=
"md:download"
:href=
"structureToDownload"
></v-btn>
<v-btn
:disabled=
"!selectedPdb"
icon=
"md:download"
:href=
"structureToDownload"
></v-btn>
...
...
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