-
Notifications
You must be signed in to change notification settings - Fork 194
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
Editionable worldwide organisation logo formatted name #8684
Conversation
}, | ||
}, | ||
document_type: item.class.name.underscore, | ||
document_type: "worldwide_organisation", |
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.
Is this okay? I was in the middle of changing Publishing API, and I wondering if we actually needed these to be different? We can distinguish the old ones from new through the base path instead?
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.
We could revert this if this is okay alphagov/publishing-api#2578
If not, happy to add in the editionable_worldwide_organisation
to the schema types.
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.
It's probably fine to keep both editionable and non-editionable as having the same document type, since the same code will be rendering both versions.
app/models/worldwide_organisation.rb
Outdated
def title | ||
name | ||
end |
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.
Could this be done with alias_method
? E.g. alias_method :title :name
.
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.
I'll update this 👍
}, | ||
}, | ||
document_type: item.class.name.underscore, | ||
document_type: "worldwide_organisation", |
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.
It's probably fine to keep both editionable and non-editionable as having the same document type, since the same code will be rendering both versions.
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 all looks good to me 👍. Just added a couple of non-blocking comments.
2b05ae6
to
de44601
Compare
The new editionable worldwide organisation model uses the `title` method instead of `name`. This adds `title` to the legacy worldwide organisation model so that views and helpers etc. can be compatible with both model types.
We don't need a new document type here, we can use the existing one.
This is required for editionable worldwide organisations.
These have been broken for some time. They remained broken when the rendering of these pages was moved to Government Frontend. Presenting these correctly will allow us to fix them on the frontend and restore their proper functionality.
The presenter isn't currently valid against the schema because it's missing the logo formatted name.
This allows users to add a logo formatted name for the new editionable worldwide organisations.
de44601
to
b56a787
Compare
In alphagov/whitehall#8684, we fixed the presenter for Worldwide Organisations to correctly include the HTML for formatted titles on Worldwide Organisation pages. This updates the example to match.
In alphagov/whitehall#8684, we fixed the presenter for Worldwide Organisations to correctly include the HTML for formatted titles on Worldwide Organisation pages. This updates the example to match.
In alphagov/whitehall#8684, we fixed the presenter for Worldwide Organisations to correctly include the HTML for formatted titles on Worldwide Organisation pages. This updates the example to match.
https://trello.com/c/12wQrTlH
Add title method to worldwide organisation
The new editionable worldwide organisation model uses the
title
methodinstead of
name
.This adds
title
to the legacy worldwide organisation model so that views andhelpers etc. can be compatible with both model types.
Use the
worldwide_organisation
document typeWe don't need a new document type here, we can use the existing one.
Add logo formatted name to editions
This is required for editionable worldwide organisations.
Present logo formatted title for worldwide organisations
These have been broken for some time. They remained broken when the rendering
of these pages was moved to Government Frontend.
Presenting these correctly will allow us to fix them on the frontend and
restore their proper functionality.
Present logo formatted name for editionable worldwide organisations
The presenter isn't currently valid against the schema because it's missing the
logo formatted name.
Add logo formatted name textarea for editionable worldwide organisations
This allows users to add a logo formatted name for the new editionable
worldwide organisations.
Follow these steps if you are doing a Rails upgrade.