-
Notifications
You must be signed in to change notification settings - Fork 20
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
[WIP] Model organisation backup #4663
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Organisation model will be used to model the organisation links in a ContentItem as well as eventually be used to render the organisation page itself when it is moved from collections. We're using OpenStruct to model logo since it gives us a light model and we don't need to attach any code to it. Co-authored-by: Deborah Chua <deborah.chua@digital.cabinet-office.gov.uk> Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk> Co-authored-by: Keith Lawrence <keith.lawrence@digital.cabinet-office.gov.uk> Co-authored-by: Ramya Vidapanakal<ramya.vidapanakal@digital.cabinet-office.gov.uk>
Co-authored-by: Deborah Chua <deborah.chua@digital.cabinet-office.gov.uk> Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk> Co-authored-by: Keith Lawrence <keith.lawrence@digital.cabinet-office.gov.uk> Co-authored-by: Ramya Vidapanakal<ramya.vidapanakal@digital.cabinet-office.gov.uk>
- add test - organisations method relies on a private method that gets and models links. Almost all content items have organisations, so we are safe to add that utility method. Co-authored-by: Deborah Chua <deborah.chua@digital.cabinet-office.gov.uk> Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk> Co-authored-by: Keith Lawrence <keith.lawrence@digital.cabinet-office.gov.uk> Co-authored-by: Ramya Vidapanakal<ramya.vidapanakal@digital.cabinet-office.gov.uk>
Co-authored-by: Deborah Chua <deborah.chua@digital.cabinet-office.gov.uk> Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk> Co-authored-by: Keith Lawrence <keith.lawrence@digital.cabinet-office.gov.uk> Co-authored-by: Ramya Vidapanakal<ramya.vidapanakal@digital.cabinet-office.gov.uk>
- test uses examples - code maps Organisation models to hash Co-authored-by: Deborah Chua <deborah.chua@digital.cabinet-office.gov.uk> Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk> Co-authored-by: Keith Lawrence <keith.lawrence@digital.cabinet-office.gov.uk> Co-authored-by: Ramya Vidapanakal<ramya.vidapanakal@digital.cabinet-office.gov.uk>
Co-authored-by: Deborah Chua <deborah.chua@digital.cabinet-office.gov.uk> Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk> Co-authored-by: Keith Lawrence <keith.lawrence@digital.cabinet-office.gov.uk> Co-authored-by: Ramya Vidapanakal<ramya.vidapanakal@digital.cabinet-office.gov.uk>
…lude in CaseStudy explicitly Co-authored-by: Deborah Chua <deborah.chua@digital.cabinet-office.gov.uk> Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk> Co-authored-by: Keith Lawrence <keith.lawrence@digital.cabinet-office.gov.uk> Co-authored-by: Ramya Vidapanakal<ramya.vidapanakal@digital.cabinet-office.gov.uk>
Co-authored-by: Deborah Chua <deborah.chua@digital.cabinet-office.gov.uk> Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk> Co-authored-by: Keith Lawrence <keith.lawrence@digital.cabinet-office.gov.uk> Co-authored-by: Ramya Vidapanakal<ramya.vidapanakal@digital.cabinet-office.gov.uk>
Co-authored-by: Deborah Chua <deborah.chua@digital.cabinet-office.gov.uk> Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk> Co-authored-by: Keith Lawrence <keith.lawrence@digital.cabinet-office.gov.uk> Co-authored-by: Ramya Vidapanakal<ramya.vidapanakal@digital.cabinet-office.gov.uk>
This allows us to simplify how the contributors list is built. We should only need to create the contributors has once by passing it a list of link models rather than duplicating the mapping code in all of the content item models. The idea is that each contributors method in the child class will pass the contributors method in the parent ContentItem class as list of objects. For example for CaseStudy, that would be a list of modelled Organisation and Worldwide Organisation objects. This is the `content_items` list that is passed in. It still defaults to "organisations" as that is the bare minimum that appears in the "From" field on documents that this contributors method is used to populate. Event though the list of content items can be different, as they all inherit from ContentItem, we know that they will have a title and base_path, so can be processed in the same way. Co-authored-by: Deborah Chua <deborah.chua@digital.cabinet-office.gov.uk> Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk> Co-authored-by: Keith Lawrence <keith.lawrence@digital.cabinet-office.gov.uk> Co-authored-by: Ramya Vidapanakal<ramya.vidapanakal@digital.cabinet-office.gov.uk>
Updates the emphasised organisations test to check the that first organisation in a list of organisation models. Co-authored-by: Deborah Chua <deborah.chua@digital.cabinet-office.gov.uk> Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk> Co-authored-by: Keith Lawrence <keith.lawrence@digital.cabinet-office.gov.uk> Co-authored-by: Ramya Vidapanakal<ramya.vidapanakal@digital.cabinet-office.gov.uk>
Co-authored-by: Deborah Chua <deborah.chua@digital.cabinet-office.gov.uk> Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk> Co-authored-by: Keith Lawrence <keith.lawrence@digital.cabinet-office.gov.uk> Co-authored-by: Ramya Vidapanakal<ramya.vidapanakal@digital.cabinet-office.gov.uk>
The contributors method now passes a list of emphasised organisations objects and worldwide organisations object to the parent class contributors method. Co-authored-by: Deborah Chua <deborah.chua@digital.cabinet-office.gov.uk> Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk> Co-authored-by: Keith Lawrence <keith.lawrence@digital.cabinet-office.gov.uk> Co-authored-by: Ramya Vidapanakal<ramya.vidapanakal@digital.cabinet-office.gov.uk>
Main branch merged in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Why
Trello card?
How
Screenshots?