Skip to content

Commit

Permalink
Merge pull request #9689 from alphagov/content-modelling/743-select-c…
Browse files Browse the repository at this point in the history
…ontent-block

Content modelling/743 select content block
  • Loading branch information
Harriethw authored Dec 3, 2024
2 parents 7ed7824 + b25c533 commit 4986366
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@
schemas: @schemas,
) %>

<%= render "govuk_publishing_components/components/button", {
text: "Save and continue",
name: "save_and_continue",
value: "Save and continue",
type: "submit",
} %>
<div class="govuk-button-group">
<%= render "govuk_publishing_components/components/button", {
text: "Save and continue",
name: "save_and_continue",
value: "Save and continue",
type: "submit",
} %>
<%= render "govuk_publishing_components/components/button", {
text: "Cancel",
name: "cancel",
value: "cancel",
href: content_block_manager.content_block_manager_content_block_documents_path,
secondary_solid: true,
} %>
</div>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<% content_for :context, product_name %>
<% content_for :context, "Create a content block" %>

<% if @schemas %>
<% content_for :back_link do %>
<%= render "govuk_publishing_components/components/back_link", {
href: content_block_manager.content_block_manager_content_block_documents_path,
} %>
<% end %>
<% content_for :page_title, "Select a block type" %>
<% content_for :page_title, "Select a content block" %>
<%= render partial: "content_block_manager/content_block/documents/schemas", locals: { schemas: @schemas} %>
<% else %>
<% content_for :back_link do %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Feature: Create a content object
And I click to create an object
Then I should see all the schemas listed
And I should see a back link to the document list page
And I should see a Cancel button to the document list page
When I click on the "email_address" schema
Then I should see a form for the schema
And I should see a back link to the select schema page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
expect(page).to have_link("Back", href: content_block_manager.content_block_manager_content_block_documents_path)
end

Then("I should see a Cancel button to the document list page") do
expect(page).to have_link("Cancel", href: content_block_manager.content_block_manager_content_block_documents_path)
end

Then("I should see a back link to the select schema page") do
expect(page).to have_link("Back", href: content_block_manager.new_content_block_manager_content_block_document_path)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class ContentBlockManager::ContentBlock::DocumentsTest < ActionDispatch::Integra

visit new_content_block_manager_content_block_document_path

assert_text "Select a block type"
assert_text "Select a content block"
end
end

Expand Down

0 comments on commit 4986366

Please sign in to comment.