-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Use orthogonal data for DataTables #865
Use orthogonal data for DataTables #865
Conversation
Instead of assigning HTML directly as data, we can use assign an object with the following keys: - display - The display value of the data (same as what we had) - filter - Value used for filtering (e.g. SearchBuilder) - order - Value used for sorting This will make DataTables easier to expand in the long run. Since we can assign different attributes to the data. Also fixes SemanticMediaWiki#831
We don't need it anymore because values are assigned a sorting key
Looks good. @thomas-topway-it can you also check this? |
The code change looks fine, although I didn't do any manual tests. Are there any possible backward compatibility issues here? Since this changes what the PHP outputs, I imagine pages with outdated caches will serve the old HTML with the new Javascript and then break. (Again, not manually confirmed, just checking.) |
It would not be backward compatible and require a parser purge on the affected pages. |
for some reason I've missed this pull request until today. I've still to test it by the way it is great that you are moving to use orthogonal data (which as far as I understand are suitable to display structured data, like sub-objects in the context of SMW). Regarding the sorting enhancement it seems an optimal solution, I will test with one of our demo (with the sorting relying on any-number to double check how it works) @malberts you are correct, the old html may break the new javascript, however I don't see this as a "backward compatibility issue", just the requirement to update the pages |
@thomas-topway-it so you will test this soonish? |
@JeroenDeDauw I cannot access the demo server currently, however it looks a cutting-edge solution, so if there is any issue I or @alistair3149 can fix it afterwards |
this can also be merged https://github.com/SemanticMediaWiki/SemanticResultFormats/compare/master...OpenSemanticLab:SemanticResultFormats:dev?expand=1 but I guess it should be rebased @simontaurus |
Is it the same as this PR? #861 |
@thomas-topway-it would you be able to review the PR? |
@alistair3149 I'm testing, a few minutes ... I have seen the new theme, is really beautiful but shouldn't be enabled via a parameter ? |
I have tested and think I understood how it works. Could we add
or something similar before
since Also, the idea is really clever, and of course the best solution so I totally agree to commit it, however how pseudo numeric titles are handled, like : -- 1_Some title I think there was something similar in one of our demos ... |
We can either add a MW config key to disable that globally or/and add a datatable parameter to disable that . We did some modifications on both the styles and script to build the UI so we might have to refactor the changes together into the same place. |
It should be handled now. Would you be able to test it again?
I'm not quite grasping the concept. Would you mind elaborating further? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #865 +/- ##
=========================================
Coverage ? 45.51%
Complexity ? 2320
=========================================
Files ? 80
Lines ? 9043
Branches ? 0
=========================================
Hits ? 4116
Misses ? 4927
Partials ? 0 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested, thanks a lot
This will make DataTables easier to expand and maintain. Now we can assign different attributes to the data, and this will resolve any sorting and filtering issues that we had.
Added
Instead of assigning HTML directly as data, we can assign an object with the following keys:
display
- The display value of the data (same as what we had)filter
- Value used for filtering (e.g. SearchBuilder)sort
- Value used for sortingRemoved
any-number
- Not needed anymore because sort key are always sortabledatatables-column.type
- Same reason as abovehttps://datatables.net/manual/data/orthogonal-data
Fix #831