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
3a400e4e
Unverified
Commit
3a400e4e
authored
2 years ago
by
Alexander Polyankin
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow using some string filters for fields without special type (#21920)
parent
51f439af
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
frontend/src/metabase/parameters/utils/filters.js
+1
-6
1 addition, 6 deletions
frontend/src/metabase/parameters/utils/filters.js
frontend/src/metabase/parameters/utils/filters.unit.spec.js
+2
-0
2 additions, 0 deletions
frontend/src/metabase/parameters/utils/filters.unit.spec.js
with
3 additions
and
6 deletions
frontend/src/metabase/parameters/utils/filters.js
+
1
−
6
View file @
3a400e4e
...
...
@@ -4,7 +4,6 @@ import { TemplateTagVariable } from "metabase-lib/lib/Variable";
export
function
fieldFilterForParameter
(
parameter
)
{
const
type
=
getParameterType
(
parameter
);
const
subtype
=
getParameterSubType
(
parameter
);
switch
(
type
)
{
case
"
date
"
:
return
field
=>
field
.
isDate
();
...
...
@@ -17,11 +16,7 @@ export function fieldFilterForParameter(parameter) {
case
"
number
"
:
return
field
=>
field
.
isNumber
()
&&
!
field
.
isCoordinate
();
case
"
string
"
:
return
field
=>
{
return
subtype
===
"
=
"
||
subtype
===
"
!=
"
?
field
.
isCategory
()
&&
!
field
.
isLocation
()
:
field
.
isString
()
&&
!
field
.
isLocation
();
};
return
field
=>
field
.
isString
()
&&
!
field
.
isLocation
();
}
return
()
=>
false
;
...
...
This diff is collapsed.
Click to expand it.
frontend/src/metabase/parameters/utils/filters.unit.spec.js
+
2
−
0
View file @
3a400e4e
...
...
@@ -71,6 +71,7 @@ describe("parameters/utils/field-filters", () => {
type
:
"
category
"
,
field
:
()
=>
({
...
field
,
isString
:
()
=>
true
,
isCategory
:
()
=>
true
,
}),
},
...
...
@@ -81,6 +82,7 @@ describe("parameters/utils/field-filters", () => {
type
:
"
category
"
,
field
:
()
=>
({
...
field
,
isString
:
()
=>
true
,
isCategory
:
()
=>
true
,
}),
},
...
...
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