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
43c0775b
Commit
43c0775b
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
update component that use useFetchArticle with new api
parent
fdd408ab
No related branches found
No related tags found
1 merge request
!224
Resolve "Rework references"
Pipeline
#125017
waiting for manual action with stages
in 10 minutes and 40 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/content/ArticleReference.vue
+0
-55
0 additions, 55 deletions
components/content/ArticleReference.vue
components/content/RefArticle.vue
+9
-2
9 additions, 2 deletions
components/content/RefArticle.vue
with
9 additions
and
57 deletions
components/content/ArticleReference.vue
deleted
100644 → 0
+
0
−
55
View file @
fdd408ab
<
script
setup
lang=
"ts"
>
import
{
useDisplay
}
from
"
vuetify
"
;
export
interface
Props
{
index
?:
number
;
doi
:
string
;
divider
?:
boolean
;
enumerate
?:
boolean
;
title
?:
string
;
abstract
?:
string
;
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
enumerate
:
true
,
divider
:
false
,
});
const
{
article
}
=
useFetchArticle
(
props
.
doi
);
const
{
mobile
}
=
useDisplay
();
const
articleTitle
=
computed
(()
=>
{
return
props
?.
title
??
article
?.
value
?.
title
??
props
.
doi
;
});
const
articleAuthorsString
=
computed
(()
=>
{
// console.log(article.value)
// console.log(props.doi)
return
article
.
value
?.
author
?.
length
>
0
?
`
${
article
.
value
.
author
[
0
].
family
}
& al`
:
null
})
</
script
>
<
template
>
<v-list-item
v-if=
"article"
:href=
"article?.href"
:id=
"`ref-$
{props.doi}`" :target="article?.target" density="compact"
class="px-1">
<template
#prepend
v-if=
"!mobile && enumerate"
>
<v-avatar
color=
"primary"
size=
"small"
density=
"compact"
variant=
"tonal"
>
{{
props
?.
index
??
"
#
"
}}
</v-avatar>
</
template
>
<
template
#title
>
<span
class=
"text-subtitle-1 font-weight-bold"
>
{{
articleTitle
}}
</span>
</
template
>
<
template
#subtitle
><span
class=
"text-caption"
>
{{
articleAuthorsString
}}
</span></
template
>
<
template
#append
v-if=
"!mobile"
>
<span>
{{
article
?.
containerTitle
??
"
no containerTitle
"
}}
(
{{
article
?.
year
}}
)
</span>
</
template
>
</v-list-item>
<v-divider
v-if=
"props.divider"
inset
></v-divider>
</template>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
components/content/RefArticle.vue
+
9
−
2
View file @
43c0775b
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
useTheme
}
from
"
vuetify
"
;
import
{
useTheme
}
from
"
vuetify
"
;
import
type
{
WikiArticle
}
from
'
@/types/articles
'
;
const
theme
=
useTheme
();
const
theme
=
useTheme
();
export
interface
Props
{
export
interface
Props
{
doi
:
string
;
doi
:
string
;
}
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{});
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{});
const
article
=
ref
<
WikiArticle
|
undefined
>
(
undefined
)
const
{
article
}
=
useFetchArticle
(
props
.
doi
);
// const { article } = useFetchArticle(props.doi);
onBeforeMount
(
async
()
=>
{
const
{
article
:
articleOnMounted
}
=
await
useFetchArticle
(
props
.
doi
);
article
.
value
=
articleOnMounted
.
value
})
</
script
>
</
script
>
<
template
>
<
template
>
<!--
<v-chip
v-if=
"article"
variant=
"text"
:href=
"`#ref-$
{props.doi}`" class="pa-0 font-italic">
{{
<!--
<v-chip
v-if=
"article"
variant=
"text"
:href=
"`#ref-$
{props.doi}`" class="pa-0 font-italic">
{{
...
...
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