Skip to content

Fix test result ordering by test timestamps - #12533

Open
jayasree-007 wants to merge 4 commits into
inventree:masterfrom
jayasree-007:fix-test-result-ordering
Open

Fix test result ordering by test timestamps#12533
jayasree-007 wants to merge 4 commits into
inventree:masterfrom
jayasree-007:fix-test-result-ordering

Conversation

@jayasree-007

Copy link
Copy Markdown

Summary

This PR updates the default ordering of StockItemTestResult to prioritize:

  1. finished_datetime
  2. started_datetime
  3. date
  4. pk

It also updates the frontend ordering in StockItemTestResultTable and BuildOutputTable so the displayed "latest" test result follows the same ordering logic.

Fixes #12509

@netlify

netlify Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit a8d7a12
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6a6e7784d4d48d0008c63e7e
😎 Deploy Preview https://deploy-preview-12533--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 97 (no change from production)
Accessibility: 81 (no change from production)
Best Practices: 100 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@SchrodingersGat SchrodingersGat added bug Identifies a bug which needs to be addressed stock Related to Stock models api Relates to the API User Interface Related to the frontend / User Interface labels Aug 1, 2026
@SchrodingersGat SchrodingersGat added this to the 1.5.0 milestone Aug 1, 2026
? new Date(b.finished_datetime).getTime()
: null;

if (finishedA !== finishedB) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this repeated comparison pattern could be refactored into a helper? It's repeated three times here, and three times again in the other file

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. I've refactored the comparison logic into a shared helper and updated both BuildOutputTable and StockItemTestResultTable to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Relates to the API bug Identifies a bug which needs to be addressed stock Related to Stock models User Interface Related to the frontend / User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test results not showing most recent test by date-time

2 participants