Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Value stream analytics
Contributor 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
Arkindex
Frontend
Commits
704322d6
Commit
704322d6
authored
3 years ago
by
Erwan Rouchet
Committed by
Bastien Abadie
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Prevent duplicate search queries
parent
2282c924
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1081
Prevent duplicate search queries
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vue/Search/Form.vue
+5
-6
5 additions, 6 deletions
vue/Search/Form.vue
with
5 additions
and
6 deletions
vue/Search/Form.vue
+
5
−
6
View file @
704322d6
...
...
@@ -4,7 +4,7 @@
<span
class=
"select is-fullwidth mb-4"
>
<select
v-model=
"corpusId"
:disabled=
"loading"
v-on:change=
"reset"
>
<option
value=
""
selected
disabled
>
Choose a project
</option>
<option
v-for=
"corpus in indexableCorp
us
"
:key=
"corpus.id"
:value=
"corpus.id"
>
{{
corpus
.
name
}}
</option>
<option
v-for=
"corpus in indexableCorp
ora
"
:key=
"corpus.id"
:value=
"corpus.id"
>
{{
corpus
.
name
}}
</option>
</select>
</span>
<template
v-if=
"corpusId"
>
...
...
@@ -162,8 +162,7 @@ export default {
// Ignore the corpus query param if it is not a known corpus ID
if
(
!
this
.
params
.
corpus
||
(
this
.
indexableCorpus
&&
!
this
.
indexableCorpus
.
filter
(
c
=>
c
.
id
===
this
.
params
.
corpus
)
!
this
.
indexableCorpora
?.
find
(
c
=>
c
.
id
===
this
.
params
.
corpus
)
))
{
this
.
corpusId
=
''
}
else
{
...
...
@@ -191,7 +190,7 @@ export default {
},
async
search
()
{
// Run the actual search
if
(
!
this
.
isValid
())
return
if
(
!
this
.
isValid
()
||
this
.
loading
)
return
this
.
loading
=
true
try
{
const
payload
=
this
.
parsedQuery
...
...
@@ -206,7 +205,7 @@ export default {
}
},
computed
:
{
indexableCorp
us
()
{
indexableCorp
ora
()
{
if
(
!
this
.
corpora
)
return
[]
return
Object
.
values
(
this
.
corpora
).
filter
(
c
=>
c
.
indexable
)
},
...
...
@@ -236,7 +235,7 @@ export default {
},
watch
:
{
allFacets
:
'
updateFacets
'
,
indexableCorp
us
:
'
parseParams
'
,
indexableCorp
ora
:
'
parseParams
'
,
/*
* Start a search immediately once a project is picked as this can cause confusion,
* or search again if we switch to another project
...
...
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