Skip to content

Update sorting of channel items and fix erroneous use of sortBy#3592

Merged
rtibbles merged 3 commits intolearningequality:unstablefrom
rtibbles:ordah_ordah
Aug 31, 2022
Merged

Update sorting of channel items and fix erroneous use of sortBy#3592
rtibbles merged 3 commits intolearningequality:unstablefrom
rtibbles:ordah_ordah

Conversation

@rtibbles
Copy link
Copy Markdown
Member

@rtibbles rtibbles commented Aug 30, 2022

Summary

Description of the change(s) you made

  • sortBy was being used under the assumption that it could be passed field names prefixed with - to reverse the ordering. This is not the case.
  • Updates these uses of sortBy to use orderBy with an additional array of asc/desc to specify the order of sorting.
  • Fixes ordering on the catalog list page as the ordering from the API is lost once items are retrieved from vuex - resorts using the name parameter.

Manual verification steps performed

Checked sorting by modified time on My Channels page.
Checked sorting on Catalog list page.

Screenshots (if applicable)

Update to my channels - all channels shown in descending order of last modified:
Screenshot from 2022-08-30 15-36-07

Update to catalog list - all channels now properly sorted by name when displayed:
Screenshot from 2022-08-30 15-35-48

References

Fixes #3559
Fixes #3294

@rtibbles rtibbles marked this pull request as ready for review August 30, 2022 22:41
Copy link
Copy Markdown
Member

@MisRob MisRob left a comment

Choose a reason for hiding this comment

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

Thank you, @rtibbles. I have some issues with Studio localhost, so I wasn't able to preview changes myself, but at least checked code and it's looking good to me.

@rtibbles rtibbles merged commit acbe0b4 into learningequality:unstable Aug 31, 2022
@rtibbles rtibbles deleted the ordah_ordah branch August 31, 2022 21:23
@pcenov
Copy link
Copy Markdown
Member

pcenov commented Sep 29, 2022

@rtibbles do you think that this fix should be applied to the "Import from other channels" modal as well?

@rtibbles
Copy link
Copy Markdown
Member Author

I'll investigate to see how sorting is happening there - I did update all the code errors in this PR, but it might need another tweak there.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

My channels display has no discernable ordering Alphabetized channel list: Catalog and import from other channels is in 'random' order

3 participants