Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

documents: order files #301

Merged
merged 1 commit into from
Oct 19, 2020
Merged

documents: order files #301

merged 1 commit into from
Oct 19, 2020

Conversation

sebdeleze
Copy link
Contributor

This commit ensures that files are ordered correctly, for having the main file at first position. The sort is based on order property from files.

  • Adds a method to order and filter files in DocumentRecord.
  • Removes useless files_by_type filter.
  • Sorts files before dumping them in REST API.

Co-Authored-by: Sébastien Délèze sebastien.deleze@rero.ch

@sebdeleze sebdeleze marked this pull request as ready for review September 14, 2020 14:02
@sebdeleze sebdeleze requested a review from jma September 14, 2020 14:03
This commit ensures that files are ordered correctly, for having the main file at first position. The sort is based on `order` property from files.

* Adds a method to order and filter files in DocumentRecord.
* Removes useless `files_by_type` filter.
* Sorts files before dumping them in REST API.

Co-Authored-by: Sébastien Délèze <sebastien.deleze@rero.ch>
@jma
Copy link
Contributor

jma commented Sep 24, 2020

I do not understand why the order property should be added as files is already an array. Why not take care for sorting during insertion and deletion?

@sebdeleze
Copy link
Contributor Author

As discussed, it's the only way to re-order files after adding a new file to the list, for example. We don't have the ability to re-order files without keeping the order into a property.

@pronguen pronguen self-requested a review October 19, 2020 08:36
@sebdeleze sebdeleze merged commit 7c7ed15 into rero:dev Oct 19, 2020
@sebdeleze sebdeleze deleted the sed-files-order branch October 19, 2020 09:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants