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

TableResultPrinter to support a datatable output #2420

Merged
merged 1 commit into from Apr 16, 2017
Merged

TableResultPrinter to support a datatable output #2420

merged 1 commit into from Apr 16, 2017

Conversation

@mwjames
Copy link
Contributor

mwjames commented Apr 15, 2017

This PR is made in reference to: #

This PR addresses or contains:

  • Adds native support for a datatable output that provides in-table search and navigational display support for larger datasets by relying on the https://github.com/DataTables/DataTables/releases/tag/1.10.13 plug-in
  • It addressed accents searches [0] (PS: This is fixed only for the core datatable output not for the SRF:DataTables format)
  • class=datatable is used to switch the output display, internal code generation remains untouched and therefore is part of the TableResultPrinter
  • Requires onoi/shared-resources:~0.4 (onoi/shared-resources@5f41bc7)
  • ext.smw.tableprinter.css contains some CSS rules to make it more align with the overall SMW design instead of the default DataTables display CSS
  • ext.smw.tableprinter.js modifies the HTML table to be transformable by the DataTables plug-in and adds required translations

image

[0] https://www.semantic-mediawiki.org/wiki/Help_talk:Datatables_format#In-table_search_issue_2349

This PR includes:

  • Tests (unit/integration)
  • CI build passed
@mwjames mwjames added the feature label Apr 15, 2017
@mwjames mwjames added this to the SMW 3.0.0 milestone Apr 15, 2017
@mwjames mwjames force-pushed the datatable branch from 92d0292 to 054c053 Apr 16, 2017
@mwjames mwjames merged commit 628317f into master Apr 16, 2017
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@mwjames mwjames deleted the datatable branch Apr 16, 2017
@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Apr 16, 2017

mwjames added a commit that referenced this pull request Apr 16, 2017
@kghbln

This comment has been minimized.

Copy link
Member

kghbln commented Apr 17, 2017

So this is basically a new result printer added to SMW core. Very cool.

@kghbln

This comment has been minimized.

Copy link
Member

kghbln commented Apr 17, 2017

It will be nice to allow the printer's name be translatable for use on special page "Ask" with "smw_printername_datatable"

"smw-query-reference-link-label" : "Query reference",
"smw-format-datatable-emptytable": "No data available in table",
"smw-format-datatable-info": "Showing _START_ to _END_ of _TOTAL_ entries",
"smw-format-datatable-infoempty": "Showing 0 to 0 of 0 entries",

This comment has been minimized.

Copy link
@kghbln

kghbln Apr 17, 2017

Member

@mwjames Shouldn't this be something like "No results are shown"?

@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Apr 17, 2017

@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Apr 17, 2017

@kghbln

This comment has been minimized.

Copy link
Member

kghbln commented Apr 17, 2017

For details see, [0, 1].

So that may be changed. :)

Technically speaking it is a format=table or format=broadtable being displayed as datatable (hence the class parameter) instead of a wikitable.

Ah, I get it. All other formats use the "class" parameter for CSS adaption, so I think it will be better to call this "tabletype" like it is e.g. similarly done with "charttype" for the "Jqplotseries" printer.

@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Apr 17, 2017

@kghbln

This comment has been minimized.

Copy link
Member

kghbln commented Apr 17, 2017

Semantically, it is the same table only with a different set of CSS rules (and so it happens with some JS) but in the end it is ruled by CSS hence the class parameter.

So this is a fixed class naming schema which still can be adapted.

Another plus for "datatable". It works with the "MobileFrontend" extension while "DataTables" does not.

@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Apr 17, 2017

@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Apr 17, 2017

@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Apr 17, 2017

@kghbln

This comment has been minimized.

Copy link
Member

kghbln commented Apr 17, 2017

Thanks for your infos on this. This will help for further reference!

@kghbln

This comment has been minimized.

Copy link
Member

kghbln commented Apr 17, 2017

@mwjames mwjames mentioned this pull request Apr 22, 2017
1 of 2 tasks complete
mwjames added a commit that referenced this pull request Apr 23, 2017
@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Apr 23, 2017

This is the rule that makes the width go bonkers because of the !important attribute and invalidates any other CSS width table rule.

Fixed with 70a3e5f (based on http://stackoverflow.com/questions/11178673/how-to-override-important).

@kghbln

This comment has been minimized.

Copy link
Member

kghbln commented May 3, 2017

Note: The feature request for the "datatables" format was added here.

@mwjames mwjames mentioned this pull request Sep 30, 2017
1 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.