Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sqllab] fix data grid's instant search function #4717

Merged
merged 2 commits into from Mar 30, 2018

Conversation

mistercrunch
Copy link
Member

It looks like any non-string type would break the search feature.
of FilterableTable.
closes #4713

It looks like any non-string type would break the search feature.
of `FilterableTable`
@codecov-io
Copy link

codecov-io commented Mar 29, 2018

Codecov Report

Merging #4717 into master will increase coverage by 4.56%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4717      +/-   ##
==========================================
+ Coverage   71.88%   76.45%   +4.56%     
==========================================
  Files         204       44     -160     
  Lines       15332     8408    -6924     
  Branches     1177        0    -1177     
==========================================
- Hits        11021     6428    -4593     
+ Misses       4308     1980    -2328     
+ Partials        3        0       -3
Impacted Files Coverage Δ
...scripts/SqlLab/components/TemplateParamsEditor.jsx
...uperset/assets/javascripts/explore/exploreUtils.js
...scripts/SqlLab/components/RunQueryActionButton.jsx
superset/assets/javascripts/SqlLab/reducers.js
superset/assets/javascripts/SqlLab/actions.js
...rset/assets/javascripts/components/VictoryTheme.js
...ipts/explore/components/controls/BoundsControl.jsx
...set/assets/javascripts/components/ModalTrigger.jsx
superset/assets/javascripts/theme.js
superset/assets/javascripts/dashboard/actions.js
... and 148 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2967868...8d01cd5. Read the comment docs.

return metrics.width;
if (context) {
// Won't work outside of a browser context (ie unit tests)
context.font = fontDetails;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: context = {...context, font: fontDetails}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think that works for objects with methods...

Copy link
Member

@hughhhh hughhhh Mar 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it in my console:

> test_obj = { my_func: () => 'test'}
{ my_func: [Function: my_func] }

> new_test_obj = {...test_obj}
{ my_func: [Function: my_func] }

> new_test_obj
{ my_func: [Function: my_func] }

> new_test_obj.my_func()
'test'

It seems like it works, but no biggie if you want to keep it as is. I'm not 💯% sure it won't break at runtime

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant prototype "inherited" funcs

// Won't work outside of a browser context (ie unit tests)
context.font = fontDetails;
const metrics = context.measureText(text);
return metrics.width;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: just return context.measureText(text).width

@hughhhh
Copy link
Member

hughhhh commented Mar 29, 2018

🚢

@mistercrunch mistercrunch merged commit 069d61c into apache:master Mar 30, 2018
@mistercrunch mistercrunch deleted the fix_sqllab_search branch March 30, 2018 17:22
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request Mar 30, 2018
* [sqllab] fix data grid's instant search function

It looks like any non-string type would break the search feature.
of `FilterableTable`

* Addressing comments
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request Mar 30, 2018
* [sqllab] fix data grid's instant search function

It looks like any non-string type would break the search feature.
of `FilterableTable`

* Addressing comments
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request Mar 30, 2018
* [sqllab] fix data grid's instant search function

It looks like any non-string type would break the search feature.
of `FilterableTable`

* Addressing comments
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request Mar 30, 2018
* [sqllab] fix data grid's instant search function

It looks like any non-string type would break the search feature.
of `FilterableTable`

* Addressing comments
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request Mar 30, 2018
* [sqllab] fix data grid's instant search function

It looks like any non-string type would break the search feature.
of `FilterableTable`

* Addressing comments
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request Apr 4, 2018
* [sqllab] fix data grid's instant search function

It looks like any non-string type would break the search feature.
of `FilterableTable`

* Addressing comments
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request Apr 11, 2018
* [sqllab] fix data grid's instant search function

It looks like any non-string type would break the search feature.
of `FilterableTable`

* Addressing comments
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
* [sqllab] fix data grid's instant search function

It looks like any non-string type would break the search feature.
of `FilterableTable`

* Addressing comments
timifasubaa pushed a commit to timifasubaa/incubator-superset that referenced this pull request May 31, 2018
* [sqllab] fix data grid's instant search function

It looks like any non-string type would break the search feature.
of `FilterableTable`

* Addressing comments
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* [sqllab] fix data grid's instant search function

It looks like any non-string type would break the search feature.
of `FilterableTable`

* Addressing comments
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.25.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.25.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[sql lab] search text box in query results isn't working
3 participants