-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9507 from alphagov/content-modelling/610-change-name
Content modelling/610 change name to Content Block Manager
- Loading branch information
Showing
120 changed files
with
481 additions
and
481 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
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
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
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
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ument/show/document_timeline_component.rb → ...ument/show/document_timeline_component.rb
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ent/show/host_editions_table_component.rb → ...ent/show/host_editions_table_component.rb
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
File renamed without changes.
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ck_edition/new/error_summary_component.rb → ...ck_edition/new/error_summary_component.rb
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ck_edition/new/select_schema_component.rb → ...ck_edition/new/select_schema_component.rb
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...on/show/confirm_summary_list_component.rb → ...on/show/confirm_summary_list_component.rb
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
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
26 changes: 26 additions & 0 deletions
26
...block_manager/app/controllers/content_block_manager/content_block/documents_controller.rb
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class ContentBlockManager::ContentBlock::DocumentsController < ContentBlockManager::BaseController | ||
def index | ||
@content_block_documents = ContentBlockManager::ContentBlock::Document.live | ||
end | ||
|
||
def show | ||
@content_block_document = ContentBlockManager::ContentBlock::Document.find(params[:id]) | ||
@content_block_versions = @content_block_document.versions | ||
|
||
@host_content_items = ContentBlockManager::GetHostContentItems.by_embedded_document( | ||
content_block_document: @content_block_document, | ||
) | ||
end | ||
|
||
def new | ||
@schemas = ContentBlockManager::ContentBlock::Schema.all | ||
end | ||
|
||
def new_document_options_redirect | ||
if params[:block_type].present? | ||
redirect_to content_block_manager.new_content_block_manager_content_block_edition_path(block_type: params.require(:block_type)) | ||
else | ||
redirect_to content_block_manager.new_content_block_manager_content_block_document_path, flash: { error: "You must select a block type" } | ||
end | ||
end | ||
end |
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
32 changes: 32 additions & 0 deletions
32
..._block_manager/app/controllers/content_block_manager/content_block/editions_controller.rb
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
class ContentBlockManager::ContentBlock::EditionsController < ContentBlockManager::BaseController | ||
def new | ||
if params[:document_id] | ||
@content_block_document = ContentBlockManager::ContentBlock::Document.find(params[:document_id]) | ||
@schema = ContentBlockManager::ContentBlock::Schema.find_by_block_type(@content_block_document.block_type) | ||
content_block_edition = @content_block_document.latest_edition | ||
else | ||
@schema = ContentBlockManager::ContentBlock::Schema.find_by_block_type(params[:block_type].underscore) | ||
content_block_edition = ContentBlockManager::ContentBlock::Edition.new | ||
end | ||
@form = ContentBlockManager::ContentBlock::EditionForm.for( | ||
content_block_edition:, | ||
schema: @schema, | ||
) | ||
end | ||
|
||
def create | ||
@schema = ContentBlockManager::ContentBlock::Schema.find_by_block_type(block_type_param) | ||
new_edition = ContentBlockManager::CreateEditionService.new(@schema).call(edition_params, document_id: params[:document_id]) | ||
step = params[:document_id] ? ContentBlockManager::ContentBlock::Editions::WorkflowController::UPDATE_BLOCK_STEPS[:review_links] : ContentBlockManager::ContentBlock::Editions::WorkflowController::NEW_BLOCK_STEPS[:review] | ||
redirect_to content_block_manager.content_block_manager_content_block_workflow_path(id: new_edition.id, step:) | ||
rescue ActiveRecord::RecordInvalid => e | ||
@form = ContentBlockManager::ContentBlock::EditionForm.for(content_block_edition: e.record, schema: @schema) | ||
render "content_block_manager/content_block/editions/new" | ||
end | ||
|
||
private | ||
|
||
def block_type_param | ||
params.require("content_block/edition").require("document_attributes").require(:block_type) | ||
end | ||
end |
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
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
2 changes: 1 addition & 1 deletion
2
...els/content_object_store/content_block.rb → ...ls/content_block_manager/content_block.rb
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
6 changes: 3 additions & 3 deletions
6
...nt_object_store/content_block/document.rb → ...t_block_manager/content_block/document.rb
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
2 changes: 1 addition & 1 deletion
2
...ent_object_store/content_block/edition.rb → ...nt_block_manager/content_block/edition.rb
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
2 changes: 1 addition & 1 deletion
2
...ore/content_block/edition/documentable.rb → ...ger/content_block/edition/documentable.rb
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
2 changes: 1 addition & 1 deletion
2
.../content_block/edition/has_audit_trail.rb → .../content_block/edition/has_audit_trail.rb
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
Oops, something went wrong.