Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
21ae344b
Unverified
Commit
21ae344b
authored
4 months ago
by
Nick Fitzpatrick
Committed by
GitHub
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
search result order (#50048)
parent
b3a46a77
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
e2e/test/scenarios/onboarding/command-palette.cy.spec.js
+25
-2
25 additions, 2 deletions
e2e/test/scenarios/onboarding/command-palette.cy.spec.js
frontend/src/metabase/palette/hooks/useCommandPalette.tsx
+1
-1
1 addition, 1 deletion
frontend/src/metabase/palette/hooks/useCommandPalette.tsx
with
26 additions
and
3 deletions
e2e/test/scenarios/onboarding/command-palette.cy.spec.js
+
25
−
2
View file @
21ae344b
...
...
@@ -87,12 +87,12 @@ describe("command palette", () => {
// Check that we are not filtering search results by action name
commandPaletteInput
().
clear
().
type
(
"
Company
"
);
cy
.
findByRole
(
"
option
"
,
{
name
:
/View and filter/
}).
should
(
"
exist
"
);
cy
.
findByRole
(
"
option
"
,
{
name
:
"
PEOPLE
"
}).
should
(
cy
.
findByRole
(
"
option
"
,
{
name
:
"
REVIEWS
"
}).
should
(
"
have.attr
"
,
"
aria-selected
"
,
"
true
"
,
);
cy
.
findByRole
(
"
option
"
,
{
name
:
"
REVIEWS
"
}).
should
(
"
exist
"
);
cy
.
findByRole
(
"
option
"
,
{
name
:
"
PEOPLE
"
}).
should
(
"
exist
"
);
cy
.
findByRole
(
"
option
"
,
{
name
:
"
PRODUCTS
"
}).
should
(
"
exist
"
);
commandPaletteInput
().
clear
();
...
...
@@ -139,6 +139,29 @@ describe("command palette", () => {
.
should
(
"
have.attr
"
,
"
aria-selected
"
,
"
true
"
);
});
it
(
"
should display search results in the order returned by the API
"
,
()
=>
{
cy
.
visit
(
"
/
"
);
cy
.
findByRole
(
"
button
"
,
{
name
:
/Search/
}).
click
();
cy
.
intercept
(
"
/api/search?*
"
).
as
(
"
searchData
"
);
commandPalette
().
within
(()
=>
{
commandPaletteInput
().
type
(
"
Cou
"
);
cy
.
wait
(
"
@searchData
"
);
cy
.
findByText
(
"
Loading...
"
).
should
(
"
not.exist
"
);
cy
.
get
(
"
@searchData
"
).
then
(({
response
})
=>
{
const
results
=
response
.
body
.
data
;
results
.
forEach
((
result
,
index
)
=>
{
cy
.
findAllByRole
(
"
option
"
)
.
eq
(
index
+
2
)
.
should
(
"
contain.text
"
,
result
.
name
);
});
});
});
});
it
(
"
should render links to site settings in settings pages
"
,
()
=>
{
cy
.
visit
(
"
/admin
"
);
cy
.
findByRole
(
"
heading
"
,
{
name
:
"
Getting set up
"
}).
should
(
"
exist
"
);
...
...
This diff is collapsed.
Click to expand it.
frontend/src/metabase/palette/hooks/useCommandPalette.tsx
+
1
−
1
View file @
21ae344b
...
...
@@ -188,7 +188,7 @@ export const useCommandPalette = ({
icon
:
icon
.
name
,
section
:
"
search
"
,
keywords
:
debouncedSearchText
,
priority
:
Priority
.
NORMAL
,
priority
:
Priority
.
NORMAL
-
index
,
perform
:
()
=>
{
trackSearchClick
(
"
item
"
,
index
,
"
command-palette
"
);
},
...
...
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