Skip to content

Commit 8ebbd5b

Browse files
Change images_enabled to images
1 parent 12ea761 commit 8ebbd5b

12 files changed

Lines changed: 39 additions & 15 deletions

File tree

app/models/configurable_document_types/government_response.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@
7979
"publishing_api_schema_name": "news_article",
8080
"publishing_api_document_type": "government_response",
8181
"rendering_app": "frontend",
82-
"images_enabled": true,
82+
"images": {
83+
"enabled": true
84+
},
8385
"send_change_history": true,
8486
"file_attachments_enabled": true,
8587
"organisations": null,

app/models/configurable_document_types/history_page.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@
7272
"publishing_api_schema_name": "history",
7373
"publishing_api_document_type": "history",
7474
"rendering_app": "frontend",
75-
"images_enabled": true,
75+
"images": {
76+
"enabled": true
77+
},
7678
"send_change_history": false,
7779
"organisations": ["af07d5a5-df63-4ddc-9383-6a666845ebe9"],
7880
"backdating_enabled": false,

app/models/configurable_document_types/news_story.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@
7979
"publishing_api_schema_name": "news_article",
8080
"publishing_api_document_type": "news_story",
8181
"rendering_app": "frontend",
82-
"images_enabled": true,
82+
"images": {
83+
"enabled": true
84+
},
8385
"send_change_history": true,
8486
"file_attachments_enabled": true,
8587
"organisations": null,

app/models/configurable_document_types/press_release.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@
7979
"publishing_api_schema_name": "news_article",
8080
"publishing_api_document_type": "press_release",
8181
"rendering_app": "frontend",
82-
"images_enabled": true,
82+
"images": {
83+
"enabled": true
84+
},
8385
"send_change_history": true,
8486
"file_attachments_enabled": true,
8587
"organisations": null,

app/models/configurable_document_types/topical_event.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@
8080
"publishing_api_schema_name": "topical_event",
8181
"publishing_api_document_type": "topical_event",
8282
"rendering_app": "collections",
83-
"images_enabled": false,
83+
"images": {
84+
"enabled": true
85+
},
8486
"send_change_history": true,
8587
"file_attachments_enabled": false,
8688
"organisations": null,

app/models/configurable_document_types/world_news_story.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@
7878
"publishing_api_schema_name": "news_article",
7979
"publishing_api_document_type": "world_news_story",
8080
"rendering_app": "frontend",
81-
"images_enabled": true,
81+
"images": {
82+
"enabled": true
83+
},
8284
"send_change_history": true,
8385
"file_attachments_enabled": true,
8486
"organisations": null,

app/models/standard_edition.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def locale_can_be_changed?
6060
end
6161

6262
def allows_image_attachments?
63-
type_instance.settings["images_enabled"]
63+
(type_instance.settings["images"] || {})["enabled"]
6464
end
6565

6666
def allows_file_attachments?

features/fixtures/test_configurable_document_type_group.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@
4949
"organisations": null,
5050
"backdating_enabled": false,
5151
"translations_enabled": true,
52-
"images_enabled": true
52+
"images": {
53+
"enabled": true
54+
}
5355
}
5456
},
5557
{
@@ -102,7 +104,9 @@
102104
"organisations": null,
103105
"backdating_enabled": false,
104106
"translations_enabled": true,
105-
"images_enabled": true
107+
"images": {
108+
"enabled": true
109+
}
106110
}
107111
}
108112
]

test/support/configurable_document_type_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ def build_configurable_document_type(type, attributes = {})
3232
"publishing_api_schema_name" => "test_article",
3333
"publishing_api_document_type" => "test_story",
3434
"rendering_app" => "frontend",
35-
"images_enabled" => false,
35+
"images_enabled" => {
36+
"enabled" => false,
37+
},
3638
"organisations" => nil,
3739
"backdating_enabled" => false,
3840
"history_mode_enabled" => false,

test/unit/app/helpers/admin/tabbed_nav_helper_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def current_user
202202
end
203203

204204
test "#secondary_navigation_tabs_items for other persisted edition types with no attachments or images" do
205-
ConfigurableDocumentType.setup_test_types(build_configurable_document_type("test_type", { "settings" => { "file_attachments_enabled" => true, "images_enabled" => true } }))
205+
ConfigurableDocumentType.setup_test_types(build_configurable_document_type("test_type", { "settings" => { "file_attachments_enabled" => true, "images" => { "enabled" => true } } }))
206206

207207
%i[detailed_guide publication standard_edition].each do |type|
208208
if type == :corporate_information_page
@@ -235,7 +235,7 @@ def current_user
235235
end
236236

237237
test "#secondary_navigation_tabs_items for other persisted edition types with attachments and images" do
238-
ConfigurableDocumentType.setup_test_types(build_configurable_document_type("test_type", { "settings" => { "file_attachments_enabled" => true, "images_enabled" => true } }))
238+
ConfigurableDocumentType.setup_test_types(build_configurable_document_type("test_type", { "settings" => { "file_attachments_enabled" => true, "images" => { "enabled" => true } } }))
239239

240240
%i[detailed_guide publication standard_edition].each do |type|
241241
if type == :corporate_information_page

0 commit comments

Comments
 (0)