Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
55c49edc
Commit
55c49edc
authored
6 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
warning when search result hits maximum
parent
606847cc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!630
WIP: Resolve "The privileges of a new user are not saved in some cases"
,
!496
Resolve "Inform about exceeding max number of search results"
Pipeline
#7320
passed
6 years ago
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend-js/src/main/js/gui/leftPanel/GenericSearchPanel.js
+16
-4
16 additions, 4 deletions
frontend-js/src/main/js/gui/leftPanel/GenericSearchPanel.js
with
16 additions
and
4 deletions
frontend-js/src/main/js/gui/leftPanel/GenericSearchPanel.js
+
16
−
4
View file @
55c49edc
...
...
@@ -6,6 +6,8 @@ var Promise = require("bluebird");
var
AbstractDbPanel
=
require
(
'
./AbstractDbPanel
'
);
var
Alias
=
require
(
'
../../map/data/Alias
'
);
var
ConfigurationType
=
require
(
'
../../ConfigurationType
'
);
var
GuiConnector
=
require
(
'
../../GuiConnector
'
);
var
IdentifiedElement
=
require
(
'
../../map/data/IdentifiedElement
'
);
var
InvalidArgumentError
=
require
(
'
../../InvalidArgumentError
'
);
var
PanelControlElementType
=
require
(
'
../PanelControlElementType
'
);
...
...
@@ -19,16 +21,17 @@ var Functions = require('../../Functions');
/**
*
* @param params
* @param {Configuration} params.configuration
* @constructor
* @extends AbstractDbPanel
*/
function
GenericSearchPanel
(
params
)
{
var
self
=
this
;
params
.
panelName
=
"
search
"
;
params
.
helpTip
=
"
<p>search tab allows to search for particular elements or interactions in the map</p>
"
params
[
"
panelName
"
]
=
"
search
"
;
params
[
"
helpTip
"
]
=
"
<p>search tab allows to search for particular elements or interactions in the map</p>
"
+
"
<p>perfect match tick box active: only terms with an exact match to the query will be returned</p>
"
+
"
<p>separate multiple search by semicolon</p>
"
;
params
.
placeholder
=
"
keyword
"
;
params
[
"
placeholder
"
]
=
"
keyword
"
;
AbstractDbPanel
.
call
(
self
,
params
);
...
...
@@ -190,7 +193,16 @@ GenericSearchPanel.prototype.searchByQuery = function () {
var
self
=
this
;
var
query
=
this
.
getControlElement
(
PanelControlElementType
.
SEARCH_INPUT
).
value
;
var
perfect
=
this
.
getControlElement
(
PanelControlElementType
.
SEARCH_PERFECT_MATCH_CHECKBOX
).
checked
;
return
self
.
getOverlayDb
().
searchByQuery
(
query
,
perfect
,
true
);
return
self
.
getOverlayDb
().
searchByQuery
(
query
,
perfect
,
true
).
then
(
function
(
result
)
{
var
max
=
0
;
for
(
var
i
=
0
;
i
<
result
.
length
;
i
++
)
{
max
=
Math
.
max
(
max
,
result
[
i
].
length
);
}
if
(
max
>=
parseInt
(
self
.
getConfiguration
().
getOption
(
ConfigurationType
.
SEARCH_RESULT_NUMBER
).
getValue
()))
{
GuiConnector
.
warn
(
"
Max number of results is exceeded - some results are omitted;
"
+
"
please narrow you criteria to see all results or use 'perfect match'
"
);
}
});
};
/**
...
...
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