Steemnova - fixed/improved sorting by status in the alliance memberlist

in utopian-io •  7 years ago  (edited)

Bug Fix

What was the issue?

If you tried to sort by status the users that were recently online would be at the bottom or at the top instead of inbetween the online and the offline users.
For more details you can also look into this utopian post.

What was the solution?

The sorting is done on the client side by the jQuery-TableSorter plugin.
To implement the correct behaviour I added a custom parser that maps from status text to number.

image.png

As you can see I implemented following logic:

  • If the player is online I sort like the value is 0.
  • If the player is offline I sort like the value is 999.
  • If the player was recently online, I only take the numeric part of the text.
  • That means for example "11 min" would be a value of 11.
  • Then the values are sorted numerical resulting in the following correct behaviour:

Relevant Links

The images were reused with @rivalzzz permission



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Thank you! :)

Hey @mwfiae I am @utopian-io. I have just upvoted you!

Achievements

  • WOW WOW WOW People loved what you did here. GREAT JOB!
  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

hello friends, visit my blog and reply any of my post and vote me i will reply on your post and will vote you too.
https://steemit.com/@fakheralamsher
thankyou..

Nice post

Thank you, what did you like the most?
How is your name on steemnova?

please follow me @putra2017

I asked for your name in the steemnova game: https://steemnova.intinte.org/

You surely know about steemnova, otherwise you would have no reason to find my post nice...

I am not play this games but my friend play this . I like it this reason i say nice post

To be honest, I don't believe you.

Please stop spamming your generic comments under every post you find...
If you don't add value to the platform you can't expect to get rewarded.

Has this ever worked for somebody?
In my opinion you will not only not get any rewards for this, but also lose all of your reputation thanks to people like @steemcleaners. (Thanks for doing a great job!)

Thank you for your great opinion