-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- landing page content items are now fully available from content store (in practise) and publishing-api schemas (during tests), so this scaffolding is now no longer necessary. - we no longer need to skip the before action.
- Loading branch information
Showing
1 changed file
with
0 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,3 @@ | ||
class LandingPageController < ContentItemsController | ||
slimmer_template "gem_layout_full_width" | ||
skip_before_action :set_content_item_and_cache_control | ||
|
||
private | ||
|
||
# SCAFFOLDING: can be removed when basic content items are available | ||
# from content-store | ||
def content_item | ||
@content_item ||= ContentItemFactory.build(old_scaffolding_content_item) | ||
end | ||
|
||
# SCAFFOLDING: can be removed when basic content items are available | ||
# from content-store | ||
def old_scaffolding_content_item | ||
result = ContentItemLoader.for_request(request).load(request.path) | ||
return result.to_h if result.is_a?(GdsApi::Response) | ||
|
||
fake_data | ||
end | ||
|
||
# SCAFFOLDING: can be removed when basic content items are available | ||
# from content-store | ||
def fake_data | ||
{ | ||
"base_path" => request.path, | ||
"title" => "Landing Page", | ||
"description" => "A landing page example", | ||
"locale" => "en", | ||
"document_type" => "landing_page", | ||
"schema_name" => "landing_page", | ||
"publishing_app" => "whitehall", | ||
"rendering_app" => "frontend", | ||
"update_type" => "major", | ||
"details" => {}, | ||
"routes" => [ | ||
{ | ||
"type" => "exact", | ||
"path" => request.path, | ||
}, | ||
], | ||
} | ||
end | ||
end |