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

Sorting by Days (uptime fact) sorts incorrectly #469

Closed
jgrammen-agilitypr opened this issue May 18, 2018 · 17 comments
Closed

Sorting by Days (uptime fact) sorts incorrectly #469

jgrammen-agilitypr opened this issue May 18, 2018 · 17 comments
Labels

Comments

@jgrammen-agilitypr
Copy link
Contributor

in the facts tab, if you sort by value (date) the sort or is incorrect.
It sorts by the leading number not by the actual value
as you can see in the picture below which should be sorted in ascending length of days:

puppetboard-sortdate

@jgrammen-agilitypr
Copy link
Contributor Author

@emlun007
Copy link
Contributor

emlun007 commented Sep 7, 2018

Do not use tablesorter and datatables together, as it will give you an error because both will try to access jquery.

If you are using datatables, In _macros.html change the type of your data:

"columnDefs": [
{ "type": "numeric-comma", targets: 3 }
]

See documentation here: https://datatables.net/plug-ins/sorting/

@jgrammen-agilitypr
Copy link
Contributor Author

verified to still be an issue in 1.0. The sort behaviour is different in 1.0 but still incorrect.
uptime_fact_sort
The text is quite small, but you should still be able to see that 23 days is in the wrong spot, as well as 23:23 hours.

@anarcat
Copy link

anarcat commented Oct 4, 2019

it would be great to remove the tablesort dependencies as it's one of the blockers in packaging this in debian

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754796

@bastelfreak
Copy link
Member

@anarcat can you provide a PR for this?

@jgrammen-agilitypr
Copy link
Contributor Author

sort order still incorrect in version 2.1.2

sorting

@jgrammen-agilitypr
Copy link
Contributor Author

I have attempted to resolve this issue by using : https://datatables.net/plug-ins/sorting/natural-time-delta
but could not get the plugin to work correctly

i added <script src="//cdn.datatables.net/plug-ins/1.10.21/sorting/natural-time-delta.js"></script>
to layout.html

and added : "type": "natural-time-delta-pre",
to _macros.html line 63

but it does not sort the table correct and i cannot tell if the plugin doesn't work is is not being used.

@jgrammen-agilitypr
Copy link
Contributor Author

I pushed my test changes to my fork,
github.com/jgrammen-agilitypr/puppetboard/commit/e66d69143be45b8eece5853b83c5e97e4c3e918d

Also i realized that adjusting the table column sorting will affect columns which are not messed up like the uptime one.
somehow this needs to be only applied for the uptime fact or columns that have "english" timestamps (3 days, 5 hours )

@anarcat
Copy link

anarcat commented Sep 21, 2020

@jgrammen-agilitypr could you make a pull request for this?

@jgrammen-agilitypr
Copy link
Contributor Author

pull req created, #591
but honestly I think there is work to do before it is merged

@gdubicki gdubicki added the bug label Apr 11, 2021
@gdubicki
Copy link
Contributor

gdubicki commented Feb 5, 2022

This has been fixed in v3.4.0rc2, which includes the above PR. A final version will be released soon.

@gdubicki gdubicki closed this as completed Feb 5, 2022
@jgrammen-agilitypr
Copy link
Contributor Author

can this please be re-opened. Today I upgraded to 4.2.1 the latest release at time of commenting, and the sorting is broken again

uptime_sorting

@gdubicki gdubicki reopened this Nov 29, 2022
@gdubicki
Copy link
Contributor

I suspect that it got broken in the big frontend refactor of https://github.com/voxpupuli/puppetboard/blob/master/CHANGELOG.md#410. Can you please test if the issue also occurs in the last version < 4.1.0, @jgrammen-agilitypr ?

@jgrammen-agilitypr
Copy link
Contributor Author

I don't have a picture to share but I can confirm that the uptime fact order is correct (not broken) on 4.0.3

@gdubicki
Copy link
Contributor

gdubicki commented Dec 1, 2022

Would you be so kind to take a look at it, @melck? If you do and have the time then probably it would be the fastest for you.

@gdubicki
Copy link
Contributor

Ok, this regression turned out to be easy to backtrack so I fixed it myself. Fixed in v4.2.3 released a moment ago.

Thanks for reporting the problem @jgrammen-agilitypr and sorry for the regression.

@jgrammen-agilitypr
Copy link
Contributor Author

I can confirm that the issue is resolved. Thank you for the fast fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants