mirror of
https://github.com/apache/superset.git
synced 2026-04-14 05:34:38 +00:00
[explore] fix autocomplete on verbose names (#5204)
* [explore] fix autocomplete on verbose names Currently when searching for metrics or groupbys, the autocomplete search functionality only matches based on the metric_name, though in some cases the verbose_name is displayed and disregarded for search purposes. Also another issue is that not all pre-defined metrics show up in the drop down which is confusing. Users may have simple metrics for which they setup a nice verbose name and/or description and expect to see those in the dropdown. This PR addresses it for metric and column-related dropdowns. * Add unit test
This commit is contained in:
committed by
GitHub
parent
de0aaf42ed
commit
d5ebc430c2
@@ -224,7 +224,7 @@ describe('MetricsControl', () => {
|
||||
|
||||
expect(!!wrapper.instance().selectFilterOption(
|
||||
{ type: 'VARCHAR(255)', column_name: 'source', optionName: '_col_source' },
|
||||
'Sou',
|
||||
'sou',
|
||||
)).to.be.true;
|
||||
|
||||
expect(!!wrapper.instance().selectFilterOption(
|
||||
@@ -233,6 +233,15 @@ describe('MetricsControl', () => {
|
||||
)).to.be.true;
|
||||
});
|
||||
|
||||
it('includes columns based on verbose_name', () => {
|
||||
const { wrapper } = setup();
|
||||
|
||||
expect(!!wrapper.instance().selectFilterOption(
|
||||
{ metric_name: 'sum__num', verbose_name: 'babies', optionName: '_col_sum_num' },
|
||||
'bab',
|
||||
)).to.be.true;
|
||||
});
|
||||
|
||||
it('excludes auto generated avg metrics for sqla', () => {
|
||||
const { wrapper } = setup();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user