Skip to content

Commit

Permalink
Merge pull request #2667 from alphagov/revert-ww-org-multipart
Browse files Browse the repository at this point in the history
Remove support for multi-part Worldwide Organisation content
  • Loading branch information
brucebolt authored Mar 12, 2024
2 parents 1b9c821 + c82ab01 commit 4cbc5c0
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 505 deletions.
5 changes: 1 addition & 4 deletions app/validators/routes_and_redirects_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ def validate(record, attribute, route, base_path)
def below_base_path?(path, base_path)
return true if path =~ %r{^#{base_path}\.[\w-]+\z}

suffix = /\.([\w-]+\z)$/.match(base_path).to_a&.first || ""
base_path_without_suffix = base_path.gsub(suffix, "")

/^#{base_path_without_suffix}.*#{suffix}/.match?(path)
/^#{base_path}/.match?(path)
end

def segments(path)
Expand Down
10 changes: 0 additions & 10 deletions content_schemas/dist/formats/worldwide_office/frontend/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,6 @@
"change_history": {
"$ref": "#/definitions/change_history"
},
"contact_content_id": {
"$ref": "#/definitions/guid"
},
"services": {
"type": "array",
"items": {
Expand All @@ -333,13 +330,6 @@
},
"uniqueItems": true
},
"slug": {
"type": "string",
"format": "uri"
},
"title": {
"type": "string"
},
"type": {
"description": "The type of Worldwide Office.",
"type": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,6 @@
"change_history": {
"$ref": "#/definitions/change_history"
},
"contact_content_id": {
"$ref": "#/definitions/guid"
},
"services": {
"type": "array",
"items": {
Expand All @@ -432,13 +429,6 @@
},
"uniqueItems": true
},
"slug": {
"type": "string",
"format": "uri"
},
"title": {
"type": "string"
},
"type": {
"description": "The type of Worldwide Office.",
"type": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,6 @@
"null"
]
},
"contact_content_id": {
"$ref": "#/definitions/guid"
},
"services": {
"type": "array",
"items": {
Expand All @@ -204,13 +201,6 @@
},
"uniqueItems": true
},
"slug": {
"type": "string",
"format": "uri"
},
"title": {
"type": "string"
},
"type": {
"description": "The type of Worldwide Office.",
"type": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,63 +341,6 @@
"default_news_image": {
"$ref": "#/definitions/image"
},
"home_page_office_parts": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"access_and_opening_times": {
"description": "The access and opening times for this Worldwide Office.",
"type": [
"string",
"null"
]
},
"contact_content_id": {
"$ref": "#/definitions/guid"
},
"services": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"title": {
"description": "The name of the service provided by this Worldwide Office.",
"type": [
"string",
"null"
]
},
"type": {
"description": "The type of service provided by this Worldwide Office.",
"type": [
"string",
"null"
]
}
}
},
"uniqueItems": true
},
"slug": {
"type": "string",
"format": "uri"
},
"title": {
"type": "string"
},
"type": {
"description": "The type of Worldwide Office.",
"type": [
"string",
"null"
]
}
}
}
},
"logo": {
"description": "The organisation's logo, including the logo image and formatted name.",
"type": "object",
Expand Down Expand Up @@ -430,63 +373,6 @@
}
}
},
"main_office_parts": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"access_and_opening_times": {
"description": "The access and opening times for this Worldwide Office.",
"type": [
"string",
"null"
]
},
"contact_content_id": {
"$ref": "#/definitions/guid"
},
"services": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"title": {
"description": "The name of the service provided by this Worldwide Office.",
"type": [
"string",
"null"
]
},
"type": {
"description": "The type of service provided by this Worldwide Office.",
"type": [
"string",
"null"
]
}
}
},
"uniqueItems": true
},
"slug": {
"type": "string",
"format": "uri"
},
"title": {
"type": "string"
},
"type": {
"description": "The type of Worldwide Office.",
"type": [
"string",
"null"
]
}
}
}
},
"office_contact_associations": {
"type": "array",
"items": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,63 +476,6 @@
"default_news_image": {
"$ref": "#/definitions/image"
},
"home_page_office_parts": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"access_and_opening_times": {
"description": "The access and opening times for this Worldwide Office.",
"type": [
"string",
"null"
]
},
"contact_content_id": {
"$ref": "#/definitions/guid"
},
"services": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"title": {
"description": "The name of the service provided by this Worldwide Office.",
"type": [
"string",
"null"
]
},
"type": {
"description": "The type of service provided by this Worldwide Office.",
"type": [
"string",
"null"
]
}
}
},
"uniqueItems": true
},
"slug": {
"type": "string",
"format": "uri"
},
"title": {
"type": "string"
},
"type": {
"description": "The type of Worldwide Office.",
"type": [
"string",
"null"
]
}
}
}
},
"logo": {
"description": "The organisation's logo, including the logo image and formatted name.",
"type": "object",
Expand Down Expand Up @@ -565,63 +508,6 @@
}
}
},
"main_office_parts": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"access_and_opening_times": {
"description": "The access and opening times for this Worldwide Office.",
"type": [
"string",
"null"
]
},
"contact_content_id": {
"$ref": "#/definitions/guid"
},
"services": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"title": {
"description": "The name of the service provided by this Worldwide Office.",
"type": [
"string",
"null"
]
},
"type": {
"description": "The type of service provided by this Worldwide Office.",
"type": [
"string",
"null"
]
}
}
},
"uniqueItems": true
},
"slug": {
"type": "string",
"format": "uri"
},
"title": {
"type": "string"
},
"type": {
"description": "The type of Worldwide Office.",
"type": [
"string",
"null"
]
}
}
}
},
"office_contact_associations": {
"type": "array",
"items": {
Expand Down
Loading

0 comments on commit 4cbc5c0

Please sign in to comment.