Skip to content

Commit

Permalink
Flatten edition links for Worldwide Organisations
Browse files Browse the repository at this point in the history
As edition links do not support multi-level or recursive link expansion,
we need to explicitly include all the sub-links that we require to
render this page.

This also includes a new field in `details` which contains the mapping
between people, roles and role appointments.
  • Loading branch information
brucebolt committed Jan 22, 2024
1 parent 57c3e62 commit 097fe6c
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
"description": "Link type automatically added by Publishing API",
"$ref": "#/definitions/frontend_links_with_base_path"
},
"contacts": {
"description": "The contacts linked to offices of this Worldwide Organisation",
"$ref": "#/definitions/frontend_links_with_base_path"
},
"corporate_information_pages": {
"description": "Corporate information pages for this Worldwide Organisation",
"$ref": "#/definitions/frontend_links_with_base_path"
Expand Down Expand Up @@ -154,8 +158,8 @@
"$ref": "#/definitions/frontend_links_with_base_path"
},
"role_appointments": {
"description": "Link type automatically added by Publishing API",
"$ref": "#/definitions/frontend_links"
"description": "Role appointments associated with people from this Worldwide Organisation",
"$ref": "#/definitions/frontend_links_with_base_path"
},
"roles": {
"description": "All roles associated with this Worldwide Organisation",
Expand Down Expand Up @@ -386,6 +390,41 @@
}
}
},
"people_role_associations": {
"type": "array",
"items": {
"type": "object",
"required": [
"person_content_id",
"role_appointments"
],
"additionalProperties": false,
"properties": {
"person_content_id": {
"$ref": "#/definitions/guid"
},
"role_appointments": {
"type": "array",
"items": {
"type": "object",
"required": [
"role_appointment_content_id",
"role_content_id"
],
"additionalProperties": false,
"properties": {
"role_appointment_content_id": {
"$ref": "#/definitions/guid"
},
"role_content_id": {
"$ref": "#/definitions/guid"
}
}
}
}
}
}
},
"secondary_corporate_information_pages": {
"description": "A string containing sentences and links to corporate information pages that are not included in ordered_corporate_information_pages.",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
"description": "Link type automatically added by Publishing API",
"$ref": "#/definitions/frontend_links_with_base_path"
},
"contacts": {
"description": "The contacts linked to offices of this Worldwide Organisation",
"$ref": "#/definitions/frontend_links_with_base_path"
},
"corporate_information_pages": {
"description": "Corporate information pages for this Worldwide Organisation",
"$ref": "#/definitions/frontend_links_with_base_path"
Expand Down Expand Up @@ -172,8 +176,8 @@
"$ref": "#/definitions/frontend_links_with_base_path"
},
"role_appointments": {
"description": "Link type automatically added by Publishing API",
"$ref": "#/definitions/frontend_links"
"description": "Role appointments associated with people from this Worldwide Organisation",
"$ref": "#/definitions/frontend_links_with_base_path"
},
"roles": {
"description": "All roles associated with this Worldwide Organisation",
Expand Down Expand Up @@ -227,6 +231,10 @@
"type": "object",
"additionalProperties": false,
"properties": {
"contacts": {
"description": "The contacts linked to offices of this Worldwide Organisation",
"$ref": "#/definitions/guid_list"
},
"corporate_information_pages": {
"description": "Corporate information pages for this Worldwide Organisation",
"$ref": "#/definitions/guid_list"
Expand Down Expand Up @@ -293,6 +301,10 @@
"description": "The person currently appointed to a primary role in this Worldwide Organisation",
"$ref": "#/definitions/guid_list"
},
"role_appointments": {
"description": "Role appointments associated with people from this Worldwide Organisation",
"$ref": "#/definitions/guid_list"
},
"roles": {
"description": "All roles associated with this Worldwide Organisation",
"$ref": "#/definitions/guid_list"
Expand Down Expand Up @@ -513,6 +525,41 @@
}
}
},
"people_role_associations": {
"type": "array",
"items": {
"type": "object",
"required": [
"person_content_id",
"role_appointments"
],
"additionalProperties": false,
"properties": {
"person_content_id": {
"$ref": "#/definitions/guid"
},
"role_appointments": {
"type": "array",
"items": {
"type": "object",
"required": [
"role_appointment_content_id",
"role_content_id"
],
"additionalProperties": false,
"properties": {
"role_appointment_content_id": {
"$ref": "#/definitions/guid"
},
"role_content_id": {
"$ref": "#/definitions/guid"
}
}
}
}
}
}
},
"secondary_corporate_information_pages": {
"description": "A string containing sentences and links to corporate information pages that are not included in ordered_corporate_information_pages.",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
"type": "object",
"additionalProperties": false,
"properties": {
"contacts": {
"description": "The contacts linked to offices of this Worldwide Organisation",
"$ref": "#/definitions/guid_list"
},
"corporate_information_pages": {
"description": "Corporate information pages for this Worldwide Organisation",
"$ref": "#/definitions/guid_list"
Expand All @@ -83,6 +87,10 @@
"description": "The person currently appointed to a primary role in this Worldwide Organisation",
"$ref": "#/definitions/guid_list"
},
"role_appointments": {
"description": "Role appointments associated with people from this Worldwide Organisation",
"$ref": "#/definitions/guid_list"
},
"roles": {
"description": "All roles associated with this Worldwide Organisation",
"$ref": "#/definitions/guid_list"
Expand Down Expand Up @@ -265,6 +273,41 @@
}
}
},
"people_role_associations": {
"type": "array",
"items": {
"type": "object",
"required": [
"person_content_id",
"role_appointments"
],
"additionalProperties": false,
"properties": {
"person_content_id": {
"$ref": "#/definitions/guid"
},
"role_appointments": {
"type": "array",
"items": {
"type": "object",
"required": [
"role_appointment_content_id",
"role_content_id"
],
"additionalProperties": false,
"properties": {
"role_appointment_content_id": {
"$ref": "#/definitions/guid"
},
"role_content_id": {
"$ref": "#/definitions/guid"
}
}
}
}
}
}
},
"secondary_corporate_information_pages": {
"description": "A string containing sentences and links to corporate information pages that are not included in ordered_corporate_information_pages.",
"type": "string"
Expand Down
37 changes: 37 additions & 0 deletions content_schemas/formats/worldwide_organisation.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,41 @@
},
description: "A set of links to corporate information pages to display for the worldwide organisation.",
},
people_role_associations: {
type: "array",
items: {
type: "object",
additionalProperties: false,
required: [
"person_content_id",
"role_appointments",
],
properties: {
person_content_id: {
"$ref": "#/definitions/guid",
},
role_appointments: {
type: "array",
items: {
type: "object",
additionalProperties: false,
required: [
"role_appointment_content_id",
"role_content_id",
],
properties: {
role_appointment_content_id: {
"$ref": "#/definitions/guid",
},
role_content_id: {
"$ref": "#/definitions/guid",
},
},
},
},
},
},
},
secondary_corporate_information_pages: {
type: "string",
description: "A string containing sentences and links to corporate information pages that are not included in ordered_corporate_information_pages.",
Expand Down Expand Up @@ -69,6 +104,7 @@
roles: "All roles associated with this Worldwide Organisation",
},
edition_links: (import "shared/base_edition_links.jsonnet") + {
contacts: "The contacts linked to offices of this Worldwide Organisation",
corporate_information_pages: "Corporate information pages for this Worldwide Organisation",
main_office: "The main office for this Worldwide Organisation",
home_page_offices: "The offices, other than the main office, to be shown on the home page of this Worldwide Organisation",
Expand All @@ -77,6 +113,7 @@
office_staff: "People currently appointed to office staff roles in this Worldwide Organisation",
sponsoring_organisations: "Sponsoring organisations for this Worldwide Organisation",
world_locations: "World Locations associated with this Worldwide Organisation",
role_appointments: "Role appointments associated with people from this Worldwide Organisation",
roles: "All roles associated with this Worldwide Organisation",
},
}

0 comments on commit 097fe6c

Please sign in to comment.