-
Notifications
You must be signed in to change notification settings - Fork 17
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
Filter people roles by organisation #2906
Conversation
People linked to a worldwide organisation may have multiple roles, some of which are related to other organsaitions. Currently, we are incorrectly displaying these roles on the world wide organisation pages. This copies the approach taken in alphagov/collections#1719. We link to all roles from the worldwide organisation, then filter out the incorrect ones in the rendering app. See also alphagov/whitehall#8162 and alphagov/government-frontend#2906.
People linked to a worldwide organisation may have multiple roles, some of which are related to other organsaitions. Currently, we are incorrectly displaying these roles on the world wide organisation pages. This copies the approach taken in alphagov/collections#1719. We link to all roles from the worldwide organisation, then filter out the incorrect ones in the rendering app. See also alphagov/publishing-api#2478 and alphagov/government-frontend#2906.
People linked to a worldwide organisation may have multiple roles, some of which are related to other organsaitions. Currently, we are incorrectly displaying these roles on the worldwide organisation pages. This copies the approach taken in alphagov/collections#1719. We link to all roles from the worldwide organisation, then filter out the incorrect ones in the rendering app. See also alphagov/publishing-api#2478 and alphagov/whitehall#8162.
b11fe8d
to
10e559c
Compare
@@ -6,15 +6,25 @@ def schema_name | |||
end | |||
|
|||
test "description of primary_role_person should have spaces between roles" do | |||
presenter = create_presenter(WorldwideOrganisationPresenter, content_item: { "links" => { "primary_role_person" => [{ "details" => { "image" => {} }, "links" => { "role_appointments" => [{ "details" => { "current" => true }, "links" => { "role" => [{ "title" => "Example Role 1" }] } }, { "details" => { "current" => true }, "links" => { "role" => [{ "title" => "Example Role 2" }] } }] } }] } }) | |||
presenter = create_presenter(WorldwideOrganisationPresenter, content_item: { "links" => { "primary_role_person" => [{ "details" => { "image" => {} }, "links" => { "role_appointments" => [{ "details" => { "current" => true }, "links" => { "role" => [{ "content_id" => "1", "title" => "Example Role 1" }] } }, { "details" => { "current" => true }, "links" => { "role" => [{ "content_id" => "2", "title" => "Example Role 2" }] } }] } }], "roles" => [{ "content_id" => "1" }, { "content_id" => "2" }] } }) |
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 is an existing ailment of the test, but would there be value in adding a test to check that when a person doesn't have any current roles for this org the presenter doesn't blow up?
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.
If the persons role isn't in the filter list, they won't be in the content item at all, so this should be a non-problem. I'm wary of adding too many tests if they aren't needed.
I did wonder what happens if a role appointment doesn't have a role, but I don't think that is possible either, and that would have errored previously too
People linked to a worldwide organisation may have multiple roles, some of which are related to other organsaitions. Currently, we are incorrectly displaying these roles on the world wide organisation pages. This copies the approach taken in alphagov/collections#1719. We link to all roles from the worldwide organisation, then filter out the incorrect ones in the rendering app. See also alphagov/publishing-api#2478 and alphagov/government-frontend#2906.
Warning
🚨 Do not merge! 🚨
Depends on alphagov/whitehall#8162 being merged and all worldwide organisations being republished
https://trello.com/c/54I3mDxr
People linked to a worldwide organisation may have multiple roles, some of which are related to other organsaitions. Currently, we are incorrectly displaying these roles on the world wide organisation pages.
This copies the approach taken in alphagov/collections#1719. We link to all roles from the worldwide organisation, then filter out the incorrect ones in the rendering app.
See also alphagov/publishing-api#2478 and alphagov/whitehall#8162.
Follow these steps if you are doing a Rails upgrade.