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

[PLAT-767] Fix ordering for user nodes AND quickfiles #8390

Conversation

Johnetordoff
Copy link
Contributor

@Johnetordoff Johnetordoff commented May 22, 2018

Purpose

The order of nodes modified on the OSF dashboard is out of order when based on date modified. And it also fixes the user quickfiles view from being out of order.

Changes

Dashboard:

  • Simple fix for dashboard changes the ordering criteria to be correct.

Quickfiles:

  • For the quickfiles it a far more complicated problem where the serialized order is different from the date modified order, so I've had to order it outside of a database query.
  • Add test and modified tests to include file versions so date_modified appears.

QA Notes

Dashboard:
I tested this by using the shell to change the date modified to be different then date last_logged to create the discrepancy that occurs normally. I've not sure how this could be forced to happen on staging, but recorded instances where it's known to happen should be fixed.

Quickfiles:
This bug happens because the “date modified” is the date that quickfiles are sorted by, but it’s not the date that appears to the user.

  1. Upload a file to quickfiles
  2. Upload a second file
  3. Change the name of the second file, the date and place in order should remain unchanged (previously the date wouldn't change, but the order would)

Documentation

Bug fix needs no docs.

Side Effects

None that I know of.

Ticket

https://openscience.atlassian.net/projects/PLAT/issues/PLAT-767

@Johnetordoff Johnetordoff changed the title [PLAT-767] Fix ordering for user nodes [PLAT-767] Fix ordering for user nodes AND quickfiles May 30, 2018
… into hotfix-fix-order-dasboard

* 'master' of https://github.com/CenterForOpenScience/osf.io: (623 commits)
  Anonymize IP address for Keen.
  Move back imports to prevent app startup from hanging
  Allow removing stuck registrations with addons
  fix mocking for gitlab
  Bump version and update changelog
  fix tests for non-dict based client attributes
  Update gitlab serializers for fangorn config js
  Add enforce_csrf waffle switch so that this can be merged earlier
  Update markdown-it-video with infinite loop fix
  Fix indentation
  Improve tests by using user cookie method and faster user creation
  Tests to ensure API requests with Session auth fail without CSRF protection
  Travis and Test Speed ups
  Rename --quick to --all
  Don't transact to avoid deadlocks
  Add script to fix poor mapping logic -h/t @caseyrollins
  Add same enforce_csrf method as drf's SessionAuthentication
  replace bad reverse migration with warning
  Use timezone.now() when checking for failed registrations
  Remove duplicate psyarxiv custom subject.
  ...

Signed-off-by: John Tordoff <john@cos.io>

# Conflicts:
#	api_tests/users/views/test_user_files_list.py
@coveralls
Copy link

coveralls commented Jul 26, 2018

Pull Request Test Coverage Report for Build 30739

  • 8 of 21 (38.1%) changed or added relevant lines in 2 files are covered.
  • 10444 unchanged lines in 228 files lost coverage.
  • Overall coverage increased (+18.2%) to 71.015%

Changes Missing Coverage Covered Lines Changed/Added Lines %
osf/models/files.py 4 8 50.0%
api/users/views.py 4 13 30.77%
Files with Coverage Reduction New Missed Lines %
osf/models/node_relation.py 1 92.86%
addons/googledrive/models.py 1 94.31%
api/test/views.py 1 100.0%
website/prereg/utils.py 1 100.0%
website/citations/utils.py 1 100.0%
api/institutions/serializers.py 1 98.8%
api/taxonomies/utils.py 1 100.0%
website/ember_osf_web/decorators.py 1 100.0%
addons/bitbucket/models.py 1 85.07%
addons/osfstorage/views.py 1 80.47%
Totals Coverage Status
Change from base Build 30732: 18.2%
Covered Lines: 26902
Relevant Lines: 37882

💛 - Coveralls

sloria pushed a commit that referenced this pull request Sep 18, 2018
This separates the nodes fix from #8390

**Purpose**

Fix sorting nodes in the dashboard by modified date

**Changes**

Sort nodes by last_logged instead of modified

**Ticket**

https://openscience.atlassian.net/browse/PLAT-767
@sloria
Copy link
Contributor

sloria commented Sep 18, 2018

I separated the node ordering fix into its own commit: 9f70599 . That's headed to prod.

The Quick Files fix will need further consideration.

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.

None yet

3 participants