Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Operate
Environments
Terraform modules
Monitor
Service Desk
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
subugoe
ahiqar
Website
Commits
c2c610a1
Commit
c2c610a1
authored
3 years ago
by
Paul Pestov
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/
#66
-enable-search-using-real-data' into 'develop'
Enable search using real data Closes
#66
See merge request
!26
parents
1e38a819
263d5880
No related branches found
No related tags found
1 merge request
!26
Enable search using real data
Pipeline
#214328
passed
3 years ago
Stage: build
Stage: pages
Stage: preserve-pages
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/.vuepress/api/api.js
+9
-27
9 additions, 27 deletions
src/.vuepress/api/api.js
src/.vuepress/components/SearchResultList.vue
+25
-6
25 additions, 6 deletions
src/.vuepress/components/SearchResultList.vue
with
34 additions
and
33 deletions
src/.vuepress/api/api.js
+
9
−
27
View file @
c2c610a1
...
...
@@ -15,33 +15,15 @@ class ApiService {
}
async
search
(
value
)
{
// TODO: Uncomment this when the real search endpoint is ready
// return this.request('/search', 'POST', {
// query: {
// simple_query_string: {
// query: value
// }
// },
// from: 0,
// size: 10
// })
return
Promise
.
resolve
({
"
hits
"
:
{
"
total
"
:
{
"
value
"
:
2
},
"
hits
"
:
[{
"
item
"
:
"
/api/textapi/ahikar/syriac/3r678-186v/latest/item.json
"
,
"
label
"
:
"
Cod. Arab. 236 Copenhagen
"
,
"
n
"
:
"
123v
"
},
{
"
item
"
:
"
/api/textapi/ahikar/syriac/3r678-126r/latest/item.json
"
,
"
label
"
:
"
Cod. Arab. 236 Copenhagen
"
,
"
n
"
:
"
126r
"
}]
return
this
.
request
(
'
/search
'
,
'
POST
'
,
{
query
:
{
simple_query_string
:
{
query
:
value
}
},
"
took
"
:
1
});
from
:
0
,
size
:
10
})
}
async
request
(
url
,
method
,
data
,
params
)
{
...
...
@@ -54,4 +36,4 @@ class ApiService {
}
}
export
default
new
ApiService
(
'
/
'
);
export
default
new
ApiService
(
'
https://ahikar-dev.sub.uni-goettingen.de/api
'
);
This diff is collapsed.
Click to expand it.
src/.vuepress/components/SearchResultList.vue
+
25
−
6
View file @
c2c610a1
...
...
@@ -6,10 +6,10 @@
>
<v-list-item
v-for=
"item in items"
:key=
"item.item"
>
<v-list-item-content>
<a
:href=
"
viewerBaseUrl + '/#/?i
tem
u
rl
=' + item.item
"
target=
"_blank"
>
<v-list-item-title>
{{
item
.
n
}}
</v-list-item-title>
<v-list-item-subtitle>
{{
item
.
label
}}
</v-list-item-subtitle>
<v-list-item-subtitle>
Manifest: manifest title
</v-list-item-subtitle>
<a
:href=
"
getI
tem
U
rl
(item)
"
target=
"_blank"
>
<v-list-item-title>
{{
item
.
label
}}
</v-list-item-title>
<v-list-item-subtitle>
Sheet
{{
item
.
n
}}
</v-list-item-subtitle>
<v-list-item-subtitle>
{{
getLanguage
(
item
.
lang
)
}}
</v-list-item-subtitle>
</a>
</v-list-item-content>
</v-list-item>
...
...
@@ -27,19 +27,38 @@
export
default
{
data
()
{
return
{
page
:
1
page
:
1
,
languagesMap
:
{
ara
:
'
Arabic
'
,
syc
:
'
Syriac
'
,
}
}
},
computed
:
{
viewerBaseUrl
()
{
return
'
https://ahikar-dev.sub.uni-goettingen.de
'
;
}
}
,
},
props
:
{
items
:
{
type
:
Array
,
default
:
[]
}
},
methods
:
{
getLanguage
(
code
)
{
return
this
.
languagesMap
[
code
]
||
'
Unknown
'
;
},
getItemUrl
(
item
)
{
let
language
=
''
;
if
(
item
.
lang
===
'
ara
'
)
{
language
=
'
arabic-karshuni
'
;
}
else
if
(
item
.
lang
===
'
syc
'
)
{
language
=
'
syriac
'
}
return
this
.
viewerBaseUrl
+
'
/
'
+
language
+
'
/#/?itemurl=
'
+
item
.
item
}
}
}
</
script
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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