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
f859d1b9
Commit
f859d1b9
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
Update systemDb to work with new serverDbTable api
parent
3a2e7742
No related branches found
No related tags found
2 merge requests
!203
Foldseek pages
,
!186
Refactor facet autocomplete
Pipeline
#120221
passed with stages
in 6 minutes and 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/content/SystemDb.vue
+64
-4
64 additions, 4 deletions
components/content/SystemDb.vue
with
64 additions
and
4 deletions
components/content/SystemDb.vue
+
64
−
4
View file @
f859d1b9
<
script
setup
lang=
"ts"
>
import
type
{
SortItem
}
from
"
@/components/ServerDbTable.vue
"
import
type
{
SortItem
,
AutocompleteMeiliFacetProps
}
from
"
@/components/ServerDbTable.vue
"
import
{
ServerDbTable
}
from
"
#components
"
const
sortBy
:
Ref
<
SortItem
[]
>
=
ref
([{
key
:
'
title
'
,
order
:
"
asc
"
}])
const
itemValue
=
ref
(
"
title
"
);
const
facets
:
Ref
<
string
[]
>
=
ref
([
"
title
"
,
"
Sensor
"
,
"
Effector
"
,
"
Activator
"
,
"
PFAM.AC
"
,
"
PFAM.DE
"
])
const
dbName
=
ref
(
"
systems
"
)
onBeforeMount
(
async
()
=>
{
const
{
data
}
=
await
useAsyncMeiliSearch
({
index
:
toValue
(
dbName
),
query
:
""
,
params
:
{
facets
:
[
"
*
"
],
filter
:
[],
page
:
1
,
hitsPerPage
:
25
,
}
})
autocompleteMeiliFacetsProps
.
value
.
facetDistribution
=
toValue
(
data
)?.
facetDistribution
})
const
autocompleteMeiliFacetsProps
=
ref
<
AutocompleteMeiliFacetProps
>
({
db
:
toValue
(
dbName
),
facets
:
[
{
title
:
"
Defense System
"
,
type
:
"
subheader
"
},
{
title
:
'
System
'
,
value
:
"
title
"
,
type
:
"
facet
"
,
icon
:
""
},
{
type
:
"
divider
"
},
{
title
:
"
Mechanism
"
,
type
:
"
subheader
"
},
{
title
:
'
Sensor
'
,
value
:
"
Sensor
"
,
type
:
"
facet
"
,
icon
:
""
},
{
title
:
'
Effector
'
,
value
:
"
Effector
"
,
type
:
"
facet
"
,
icon
:
""
},
{
title
:
'
Activator
'
,
value
:
"
Activator
"
,
type
:
"
facet
"
,
icon
:
""
},
{
type
:
"
divider
"
},
{
title
:
"
PFAM
"
,
type
:
"
subheader
"
},
{
title
:
'
Acession
'
,
value
:
"
PFAM.AC
"
,
type
:
"
facet
"
,
icon
:
""
},
{
title
:
'
Description
'
,
value
:
"
PFAM.DE
"
,
type
:
"
facet
"
,
icon
:
""
}
],
facetDistribution
:
undefined
})
const
computedAutocompleteMeiliFacetsProps
=
computed
(()
=>
{
const
toValFacetDistribution
=
toValue
(
autocompleteMeiliFacetsProps
).
facetDistribution
const
toValFacets
=
toValue
(
autocompleteMeiliFacetsProps
).
facets
if
(
toValFacetDistribution
!==
undefined
&&
toValFacets
!==
undefined
)
{
return
{
...
toValue
(
autocompleteMeiliFacetsProps
),
facets
:
toValFacets
.
map
(
facet
=>
{
if
(
facet
.
type
===
"
facet
"
)
{
const
count
=
toValFacetDistribution
?.[
facet
.
value
]
?
Object
.
keys
(
toValFacetDistribution
[
facet
.
value
]).
length
:
undefined
return
count
?
{
...
facet
,
count
}
:
{
...
facet
}
}
else
{
return
{
...
facet
}
}
})
}
}
else
{
return
toValue
(
autocompleteMeiliFacetsProps
)
}
})
const
headers
:
Ref
<
Object
[]
>
=
ref
([
{
title
:
"
System
"
,
key
:
"
title
"
,
removable
:
false
},
{
title
:
"
Article
"
,
key
:
"
doi
"
,
removable
:
false
},
...
...
@@ -16,7 +77,6 @@ const headers: Ref<Object[]> = ref([
])
const
{
search
:
msSearch
,
result
:
msResult
}
=
useMeiliSearch
(
'
systems
'
)
const
defaultDataTableServerProps
=
ref
({
showExpand
:
false
...
...
@@ -34,7 +94,7 @@ const columnsToDownload = ref(['title', 'doi', 'Sensor', 'Activator', 'Effector'
</
script
>
<
template
>
<ServerDbTable
title=
"List Systems"
db=
"
systems
"
:sortBy=
"sortBy"
:
facets=
"facet
s"
<ServerDbTable
title=
"List Systems"
:
db=
"
dbName
"
:sortBy=
"sortBy"
:
autocomplete-meili-facets-props=
"computedAutocompleteMeiliFacetsProp
s"
:data-table-server-props=
"dataTableServerProps"
:columns-to-download=
"columnsToDownload"
>
...
...
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