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

Tabulator: fix default values of a list header filter #3826

Merged
merged 4 commits into from Sep 14, 2022

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Sep 12, 2022

Before the Tabulator JS upgrade values: True was alright but now we need to use valuesLookup: True.

@codecov
Copy link

codecov bot commented Sep 12, 2022

Codecov Report

Merging #3826 (6ec3c1e) into master (5db6674) will increase coverage by 0.02%.
The diff coverage is 97.95%.

@@            Coverage Diff             @@
##           master    #3826      +/-   ##
==========================================
+ Coverage   83.00%   83.03%   +0.02%     
==========================================
  Files         221      221              
  Lines       32312    32362      +50     
==========================================
+ Hits        26821    26871      +50     
  Misses       5491     5491              
Flag Coverage Δ
ui-tests 34.19% <30.61%> (+0.04%) ⬆️
unitexamples-tests 75.47% <79.59%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
panel/widgets/tables.py 88.43% <95.23%> (+0.01%) ⬆️
panel/tests/ui/widgets/test_tabulator.py 98.86% <100.00%> (+0.01%) ⬆️
panel/tests/widgets/test_tables.py 99.66% <100.00%> (+<0.01%) ⬆️
panel/tests/util.py 87.12% <0.00%> (+1.98%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -216,7 +216,7 @@
" 'int': None,\n",
" 'float': {'type': 'number', 'max': 10, 'step': 0.1},\n",
" 'bool': {'type': 'tickCross', 'tristate': True, 'indeterminateValue': None},\n",
" 'str': {'type': 'autocomplete', 'values': True},\n",
" 'str': {'type': 'list', 'valuesLookup': True},\n",
Copy link
Member

Choose a reason for hiding this comment

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

Is 'values' entirely ignored now or does it have another meaning? Trying to work out whether we can provide backward compatibility.

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems to be that when values is set to True it is just ignored by Tabulator JS. Otherwise values accept a list of values or dict of value/label.

We could look for values in the editor or header filter params, when its type is select or autocomplete, and replace it by valuesLookup?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good!

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'm adding backwards compatibility to select and autocomplete in 6ec3c1e, for the editor and header filter. The editor didn't set values to True by default, so I'm sticking to that.

I've also added a warning to encourage users to switch to list and lookupValues. Used self.param.warning, is that the preferred way over warnings.warn? I'm never sure.

Copy link
Member

Choose a reason for hiding this comment

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

Honestly I have lost track about warnings too, I think at some point we just need to go through and make everything consistent.

@philippjfr
Copy link
Member

Looks good, thanks!

@philippjfr philippjfr merged commit d2e6671 into master Sep 14, 2022
@philippjfr philippjfr deleted the tabulator_list_editor_values branch September 14, 2022 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants