-
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
Model organisations #4653
Model organisations #4653
Conversation
08c3443
to
592435e
Compare
592435e
to
e34f949
Compare
e34f949
to
4f8c194
Compare
4f8c194
to
31a09e6
Compare
31a09e6
to
5bb2af4
Compare
5bb2af4
to
d39219a
Compare
d39219a
to
7d2a464
Compare
7d2a464
to
88ee8d1
Compare
88ee8d1
to
5f4a27c
Compare
5f4a27c
to
6698cf5
Compare
6698cf5
to
522a4c0
Compare
522a4c0
to
f154dca
Compare
f154dca
to
d5d1565
Compare
d5d1565
to
b30bc1c
Compare
b81043c
to
311e733
Compare
311e733
to
2ff585a
Compare
2ff585a
to
24381a3
Compare
24381a3
to
bf746ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Thanks for organising the commits.
One minor thing. I think the commit to add "content_id" to ContentItem should come before "Rename Organisations concern -> EmphasisedOrganisations" as that's where it's being used.
- Added image,crest and formatted title to the logo model - This model will be used in the organisation model
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. Added logo and brand to organisation model in preparation for moving corporate information pages from government-frontend 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>
bf746ba
to
1acd947
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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>
This allows us to simplify how the contributors list is built. We should only need to create the contributors 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 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. Even 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>
The contributors method now passes a list of emphasised organisations objects and worldwide organisations object to the parent class contributors method. Since worldwide organisations are not always present, add a test for them, which also adds coverage to the private linked method in content_item. 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>
We now model organisations separately, so this concern can be updated to deal with emphasised organisations. Updated the emphasised organisations test to check that the first organisation is an emphasised 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>
…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>
We call the linked method in the content_item model which returns the title and base path 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>
1acd947
to
4bc7fa8
Compare
LGTM 👍 |
What
Many of the document types like Case studies, Speeches, Corporate Information pages that need to be moved from government-frontend to frontend as part of app consolidation render Organisations.The idea is to create an organisation model that inherits from content item. but could then be reused when organisation pages are consolidated.
Why
By modelling organisations separately this will make consolidation easier, and also in preparation for consolidating organisations from the Collections app.
Trello card
Collaborators
Deborah Chua deborah.chua@digital.cabinet-office.gov.uk
Leena Gupte leena.gupte@digital.cabinet-office.gov.uk
Keith Lawrence keith.lawrence@digital.cabinet-office.gov.uk
Ramya Vidapanakalramya.vidapanakal@digital.cabinet-office.gov.uk