SemanticMediaWiki / SemanticResultFormats

Provides additional visualizations (result formats) for Semantic MediaWiki
https://www.semantic-mediawiki.org/wiki/Extension:Semantic_Result_Formats
Other
45 stars 75 forks source link

Datatable v2 (rebased) #771

Closed thomas-topway-it closed 1 year ago

thomas-topway-it commented 1 year ago

A complete refactoring of the datatables result format implementing a dedicated api and a SMW BeforeQueryResultLookupComplete hook in order to perform some preprocessing of the table data.

It includes the legacy datatables format with the format name datatables-legacy

Here is the complete documentation

https://www.semantic-mediawiki.org/wiki/Help:Datatables_format_(v2)

Key features:

thomas-topway-it commented 1 year ago

@JeroenDeDauw in the file SemanticResultFormats/tests/phpunit/Integration/JSONScript/TestCases/datatables-01.json I had to remove *data-count for it to work in MW 1.38 and 1.39. This attribute is placed by the hook SMW::Store::BeforeQueryResultLookupComplete however the hooks is not called on tests execution. By contrast is called correctly on normal use.

kghbln commented 1 year ago

@thomas-topway-it Does this replace the existing datatabel format, or is this an additional and separate implementation?

thomas-topway-it commented 1 year ago

Hello Karsten, I was just trying to rename https://www.semantic-mediawiki.org/wiki/Help:Datatables_format_(v2) to https://www.semantic-mediawiki.org/wiki/Help:Datatables_format, after moving https://www.semantic-mediawiki.org/wiki/Help:Datatables_format to https://www.semantic-mediawiki.org/wiki/Help:Datatables_format_(legacy)

but perhaps the redirect has to be deleted before ?

So it replaces the old datatable format but at the same time the old datatable format is accessible using format=datatables-legacy

However, it is not a breaking change, you can just purge the page without to edit the askquery and it will work with the new version ! Let me know if there is any issue !

kghbln commented 1 year ago

Thanks for the info. The docu issues have more or less been sorted out.

To cut it short: It is an additional result printer, and to me, it is indeed breaking for users: All current users are using format=datatables all over the place, which will now show the new printer instead of the legacy printer without further modifications. I do not know how the new standard datatables compare to datatables-legacy when using the drop-in replacement. Still, we should inform people of this in the wiki docu and via the release notes once SRF 4.1.0 gets published.

thomas-topway-it commented 1 year ago

hello Karsten, so I think the replacement happened in a natural way because at a first stage of development we did not want to replace the previous datatables format and to create a new format, but to enhance the previous one. Following, it required a substantial rewriting that led to the removal of some of the existing features, like the bootstrap theme, the "query-panel" and "instant update". For this reason I've preferred to keep the old format using the name "datatables-legacy". The drop-in replacement should be seamless apart for these features, and the bugs affecting the display of data should have been fixed. Of course I can contribute to the release notes when SRF 4.1.0 will be published, and if you note something that doesn't work properly with regard of the "drop-in replacement" itself we can try to take the required measures promptly.

kghbln commented 1 year ago

Thank you for your insight. I like your work, and it is fantastic that someone, in this case, you, had a go at the format. Ultimately, users will not get what they are used to out of the box from previous versions. Thus we should leave a note in the release notes and on the docu page telling them they could switch back and start migrating step by step. Given the new feature set, I am sure that users will want to migrate and add new features. If they are happy with the seamless change - even better. I am not suggesting changing the result printer name to retain the old format without modifications.

thomas-topway-it commented 1 year ago

hello Karsten, ok great, Actually we could have named the new datatables format "datatables-v2" and to leave the previous as it is, but the current solution seems more natural even if it implies some change. Also, the work was directed by @krabina so it complies with his requirements.

kghbln commented 1 year ago

Hi Thomas. it is fine as it is. We just have to inform users of the software about it as I have done on the smw wiki in the meantime. Once SRF 4.1 we can also do so in the release notes. All good. :)