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

Catch all collection #403

Merged
merged 3 commits into from
Jul 24, 2024
Merged

Catch all collection #403

merged 3 commits into from
Jul 24, 2024

Conversation

damisul
Copy link
Collaborator

@damisul damisul commented Jul 22, 2024

One of prerequisites of creating root collection functionality is to implement 'catch all' colleciton for all uncollected works per authority.

This PR adds new collection type 'uncollected', and adds authorities.uncollected_works_collection_id column to link those collections with authorities. So each authority can have own collection.

There is a new service RefreshUncollectedWorksCollection, used to create or update uncollected collection per authority.

For test purpose I've added a new link 'Refresh uncollected works collection' to Author's TOC page, which calls this service. Later we can remove it and made service to be run automatically on certain events. This service does two things:

  • it removes from uncollected works collection all items included in any collection of other type
  • it adds works which are either not included in any collections, or only added to other 'uncollected' collections to other authorities.

NOTE: I've created new AuthoritiesController in admin namespace for this purpose. I propose to move all non-public actions related to authorities theres instead of AuthorsController (in future we can make AuthorsController to be responsible for public functionality, and admin/authorities controller to be responsible for editor functions).

@damisul damisul changed the base branch from master to coll_squash July 22, 2024 16:18
app/models/authority.rb Show resolved Hide resolved
app/models/authority.rb Show resolved Hide resolved
app/models/collection.rb Show resolved Hide resolved

!= '   '
%span.static-btn
%b= link_to 'Refresh uncollected works',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Temporary link to call service to refresh uncollected works collection. I did not bothered about I18n, as it is a temporary solution.

@@ -37,5 +37,5 @@
- else
.headline-3-v02
= t(:text)
:
\:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Without escaping this line caused error.

@abartov abartov merged commit 52b6ebe into coll_squash Jul 24, 2024
@abartov abartov deleted the catch_all_collection branch July 24, 2024 22:19
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.

Implement catch all 'Uncollected works' collections for not-grouped works by authority
2 participants