Skip to content

numeric ordering - #1193

Merged
Didayolo merged 3 commits into
developfrom
issue_1171
Oct 25, 2023
Merged

Didayolo merged 3 commits into
developfrom
issue_1171

Conversation

@bbearce

@bbearce bbearce commented Oct 22, 2023 •

Copy link
Copy Markdown
Collaborator

Description

Ordering was lexigraphical only due to a plugin called tablesort from src/static/js/ours/utils.js

Brief history and mental map:

  1. src/static/riot/competitions/detail/leaderboards.tag - hosts "#leaderboardTable#
  2. /src/templates/base.html imports https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css
  3. https://semantic-ui.com/collections/table.html#sortable has a tabl type called "sortable"
  4. They have a note:
    image
  5. The this_javascript link takes you to a tablesort.js file. As it turns out we copy and pasted this in src/static/js/ours/utils.js. There you can see the link the aforementioned kylefox plugin.
  6. The compare function never determines what it's sorting and that could be strings or numbers. By forcing a decision to use numbers if indeed there are numbers we can correctly sort by floats or strings.

Issues this PR resolves

  • PR failed circleci but it was a dependency but in requirements.txt

A checklist for hand testing

  • Use below bundle with sample submissions to create a leaderboard that prioritizes the Score column as sorting column. When clicking any column, you should see the correct order:

Any relevant files for testing

template_v2_bundle.zip

Checklist

  • Code review by me
  • Hand tested by me
  • I'm proud of my work
  • Code review by reviewer
  • Hand tested by reviewer
  • CircleCi tests are passing
  • Ready to merge

@Didayolo

Copy link
Copy Markdown
Member

The E2E tests are failing

@bbearce

bbearce commented Oct 23, 2023

Copy link
Copy Markdown
Collaborator Author

Will check.

@Didayolo
Didayolo merged commit 6cfb7b4 into develop Oct 25, 2023
@Didayolo
Didayolo deleted the issue_1171 branch October 25, 2023 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants