Skip to content

Commit

Permalink
Quick update to increase character limits on inputs (#709)
Browse files Browse the repository at this point in the history
* Quick update to increase character limits on inputs

* Fix delete of content page version
  • Loading branch information
ebrett authored Feb 21, 2024
1 parent 71bd2d2 commit ded5f22
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 16 deletions.
4 changes: 2 additions & 2 deletions app/views/admin/content_blocks/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<%= form.govuk_error_summary order: %i[name description markdown] %>

<div data-controller='character-counter' data-character-counter-countdown-value='true'>
<%= form.govuk_text_field :name, label: {text: "Name - this should be provided by the developers, it refers to part of the fixed pages"}, disabled: content_block&.id, 'data-character-counter-target': 'input', maxlength: '254', hint: {text: "<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the name.</p>".html_safe} %>
<%= form.govuk_text_field :name, label: {text: "Name - this should be provided by the developers, it refers to part of the fixed pages"}, disabled: content_block&.id, 'data-character-counter-target': 'input', maxlength: '10000', hint: {text: "<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the name.</p>".html_safe} %>
</div>

<div data-controller='character-counter' data-character-counter-countdown-value='true'>
<%= form.govuk_text_field :description, label: {text: "Description - where does this appear in the site ?"}, 'data-character-counter-target': 'input', maxlength: '254', hint: {text: "<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the description.</p>".html_safe} %>
<%= form.govuk_text_field :description, label: {text: "Description - where does this appear in the site ?"}, 'data-character-counter-target': 'input', maxlength: '10000', hint: {text: "<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the description.</p>".html_safe} %>
</div>

<!-- This text_area is not rendered with gov_text_field because it needs to
Expand Down
10 changes: 5 additions & 5 deletions app/views/admin/content_page_versions/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<%= form.govuk_error_summary order: %i[title markdown] %>

<div data-controller='character-counter' data-character-counter-countdown-value='true'>
<%= form.govuk_text_field :title, label: {text: "Heading"}, :class => 'govuk-input govuk-!-width-three-quarters', 'data-character-counter-target': 'input', maxlength: '254' %>
<%= form.govuk_text_field :title, label: {text: "Heading"}, :class => 'govuk-input govuk-!-width-three-quarters', 'data-character-counter-target': 'input', maxlength: '10000' %>
<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the title.</p>
</div>

Expand All @@ -19,15 +19,15 @@
Introduction
</label>
<div data-controller='character-counter' data-character-counter-countdown-value='true'>
<%= form.text_area :intro, id: 'intro-editor', rows: 8, cols: 35, class: 'govuk-input govuk-textarea', 'data-character-counter-target': 'input', maxlength: '254' %>
<%= form.text_area :intro, id: 'intro-editor', rows: 8, cols: 35, class: 'govuk-input govuk-textarea', 'data-character-counter-target': 'input', maxlength: '10000' %>
<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the introduction.</p>
</div>

<label id="content-list-hint" for="content-list-editor" class="govuk-label">
Table of contents
</label>
<div data-controller='character-counter' data-character-counter-countdown-value='true'>
<%= form.text_area :content_list, id: 'content-list-editor', rows: 8, cols: 35, class: 'govuk-input govuk-textarea', 'data-character-counter-target': 'input', maxlength: '254' %>
<%= form.text_area :content_list, id: 'content-list-editor', rows: 8, cols: 35, class: 'govuk-input govuk-textarea', 'data-character-counter-target': 'input', maxlength: '10000' %>
<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the content list.</p>
</div>

Expand All @@ -42,10 +42,10 @@
<div data-controller='character-counter' data-character-counter-countdown-value='true'>
<%= form.text_area :markdown, :id => 'markdown-editor', :rows => 20, :cols => 35, :class => govuk_input_classes(:textarea, errors: @content_page_version.errors[:markdown]), 'data-character-counter-target': 'input', maxlength: '30000' %>
<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the markdown.</p>
</div>
</div>

<div data-controller='character-counter' data-character-counter-countdown-value='true'>
<%= form.govuk_text_area :description, label: {text: "Meta Description"}, 'data-character-counter-target': 'input', maxlength: '254' %>
<%= form.govuk_text_area :description, label: {text: "Meta Description"}, 'data-character-counter-target': 'input', maxlength: '10000' %>
<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the description.</p>
</div>
</div>
Expand Down
14 changes: 7 additions & 7 deletions app/views/admin/content_pages/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<%= form.govuk_error_summary order: %i[title markdown position] %>

<div data-controller='character-counter' data-character-counter-countdown-value='true'>
<%= form.govuk_text_field :title, label: {text: "Heading"}, :class => 'govuk-input govuk-!-width-three-quarters', disabled: (@content_page.title && !content_page.parent_id), 'data-character-counter-target': 'input', maxlength: '254' %>
<%= form.govuk_text_field :title, label: {text: "Heading"}, :class => 'govuk-input govuk-!-width-three-quarters', disabled: (@content_page.title && !content_page.parent_id), 'data-character-counter-target': 'input', maxlength: '10000' %>
<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the title.</p>
</div>

Expand All @@ -18,15 +18,15 @@
Introduction
</label>
<div data-controller='character-counter' data-character-counter-countdown-value='true'>
<%= form.text_area :intro, id: 'intro-editor', rows: 8, cols: 35, class: 'govuk-input govuk-textarea', 'data-character-counter-target': 'input', maxlength: '254' %>
<%= form.text_area :intro, id: 'intro-editor', rows: 8, cols: 35, class: 'govuk-input govuk-textarea', 'data-character-counter-target': 'input', maxlength: '10000' %>
<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the introduction.</p>
</div>

<label id="content-list-hint" for="content-list-editor" class="govuk-label">
Table of contents
</label>
<div data-controller='character-counter' data-character-counter-countdown-value='true'>
<%= form.text_area :content_list, id: 'content-list-editor', rows: 8, cols: 35, class: 'govuk-input govuk-textarea', 'data-character-counter-target': 'input', maxlength: '254' %>
<%= form.text_area :content_list, id: 'content-list-editor', rows: 8, cols: 35, class: 'govuk-input govuk-textarea', 'data-character-counter-target': 'input', maxlength: '10000' %>
<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the content list.</p>
</div>

Expand All @@ -41,13 +41,13 @@
<div data-controller='character-counter' data-character-counter-countdown-value='true'>
<%= form.text_area :markdown, :id => 'markdown-editor', :rows => 20, :cols => 35, :class => govuk_input_classes(:textarea, errors: @content_page.errors[:markdown]), 'data-character-counter-target': 'input', maxlength: '30000' %>
<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the markdown.</p>
</div>
</div>

<%= form.hidden_field :parent_id, id: "parent_id" %>
<%= form.govuk_text_field :position, label: {text: "Position"}%>

<div data-controller='character-counter' data-character-counter-countdown-value='true'>
<%= form.govuk_text_area :description, label: {text: "Meta Description"}, 'data-character-counter-target': 'input', maxlength: '254' %>
<%= form.govuk_text_area :description, label: {text: "Meta Description"}, 'data-character-counter-target': 'input', maxlength: '10000' %>
<p>There are <strong data-character-counter-target='counter' ></strong> remaining characters in the description.</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/content_pages/_table_of_draft_versions.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<td class="govuk-table__cell govuk-!-width-one-quarter">
<%= link_to 'Edit', edit_admin_content_page_content_page_version_path(@content_page, version), { :class => "govuk-link" } %>
<%= link_to 'Preview and Publish', preview_of_draft_admin_content_page_content_page_version_path(@content_page, version), { :class => "govuk-link" } %>
<%= link_to "Delete", admin_content_page_content_page_version_path(@content_page, version), method: :delete, data: { confirm: "Are you certain you want to delete this version ? " + version.created_at.strftime('%d/%m/%Y %I:%M') } %>
<%= link_to "Delete", admin_content_page_content_page_version_path(@content_page, version), data: { 'turbo-method': :delete, 'turbo-confirm': "Are you certain you want to delete this version ? " + version.created_at.strftime('%d/%m/%Y %I:%M') } %>
</td>
<td class="govuk-table__cell govuk-!-width-one-quarter"><%= version.author %></td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/users/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<h1 class="govuk-heading-l">Edit user</h1>
<% if policy(@user).destroy? %>
<%= button_to "Delete", [:admin, @user], method: :delete, class: "govuk-button govuk-button--warning", data: { confirm: "Are you sure you want to delete #{@user.email}?" } %>
<%= button_to "Delete", [:admin, @user], method: :delete, class: "govuk-button govuk-button--warning", data: { turbo_confirm: "Are you sure you want to delete #{@user.email}?" } %>
<% end %>
<div class="govuk-width-container">
<div class="govuk-grid-row">
Expand Down
2 changes: 2 additions & 0 deletions spec/models/web/resource_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require 'rails_helper'

RSpec.describe Web::Resource, type: :model do
before { skip 'WIP' unless Rails.application.cms? }

describe '.by_name' do
specify do
expect(described_class.by_name('test.resource')).to be_a described_class
Expand Down
4 changes: 4 additions & 0 deletions terraform-azure/terraform-azure-web/appgateway.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ resource "azurerm_web_application_firewall_policy" "agw_wafp" {
id = "933210"
enabled = false
}
rule {
id = "933180"
enabled = false
}
}
}

Expand Down

0 comments on commit ded5f22

Please sign in to comment.