diff --git a/LICENSE b/LICENSE
index 6290a73505..db83a0b1ff 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (C) 2014 Crown Copyright (Department for Business, Energy & Industrial Strategy) & Bit Zesty
+Copyright (C) 2014 Crown Copyright (Department for Business and Trade) & Bit Zesty
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/app/assets/javascripts/ckeditor/plugins/wordcount/plugin.js b/app/assets/javascripts/ckeditor/plugins/wordcount/plugin.js
index 79c4632820..911036acee 100644
--- a/app/assets/javascripts/ckeditor/plugins/wordcount/plugin.js
+++ b/app/assets/javascripts/ckeditor/plugins/wordcount/plugin.js
@@ -293,52 +293,6 @@ CKEDITOR.plugins.add("wordcount", {
return true;
}
- //If the limit is already over, allow the deletion of characters/words. Otherwise,
- //the user would have to delete at one go the number of offending characters
- var deltaWord = wordCount - lastWordCount;
- var deltaChar = charCount - lastCharCount;
-
- lastWordCount = wordCount;
- lastCharCount = charCount;
-
- if (lastWordCount == -1) {
- lastWordCount = wordCount;
- }
- if (lastCharCount == -1) {
- lastCharCount = charCount;
- }
-
- // Check for word limit and/or char limit
- if ((config.maxWordCount > -1 && wordCount > maxWordCountWithBuffer(config.maxWordCount) && deltaWord > 0) ||
- (config.maxCharCount > -1 && charCount > config.maxCharCount && deltaChar > 0)) {
-
- limitReached(editorInstance, limitReachedNotified);
- } else if ((config.maxWordCount == -1 || wordCount <= maxWordCountWithBuffer(config.maxWordCount)) &&
- (config.maxCharCount == -1 || charCount <= config.maxCharCount)) {
-
- limitRestored(editorInstance);
- } else {
- snapShot = editorInstance.getSnapshot();
- }
-
- // Fire Custom Events
- if (config.charCountGreaterThanMaxLengthEvent && config.charCountLessThanMaxLengthEvent) {
- if (charCount > config.maxCharCount && config.maxCharCount > -1) {
- config.charCountGreaterThanMaxLengthEvent(charCount, config.maxCharCount);
- } else {
- config.charCountLessThanMaxLengthEvent(charCount, config.maxCharCount);
- }
- }
-
- if (config.wordCountGreaterThanMaxLengthEvent && config.wordCountLessThanMaxLengthEvent) {
- if (wordCount > maxWordCountWithBuffer(config.maxWordCount) && config.maxWordCount > -1) {
- config.wordCountGreaterThanMaxLengthEvent(wordCount, config.maxWordCount);
-
- } else {
- config.wordCountLessThanMaxLengthEvent(wordCount, config.maxWordCount);
- }
- }
-
return true;
}
@@ -381,53 +335,6 @@ CKEDITOR.plugins.add("wordcount", {
updateCounter(event.editor);
}, editor, null, 100);
- editor.on("paste", function(event) {
- if (config.maxWordCount > 0 || config.maxCharCount > 0) {
-
- // Check if pasted content is above the limits
- var wordCount = -1,
- charCount = -1,
- text = event.editor.getData() + event.data.dataValue;
-
-
- if (config.showCharCount) {
- charCount = countCharacters(text, event.editor);
- }
-
- if (config.showWordCount) {
- wordCount = countWords(text);
- }
-
-
- // Instantiate the notification when needed and only have one instance
- if(notification === null) {
- notification = new CKEDITOR.plugins.notification(event.editor, {
- message: event.editor.lang.wordcount.pasteWarning,
- type: 'warning',
- duration: config.pasteWarningDuration
- });
- }
-
- if (config.maxCharCount > 0 && charCount > config.maxCharCount && config.hardLimit) {
- if(!notification.isVisible()) {
- notification.show();
- }
- event.cancel();
- }
-
- if (config.maxWordCount > 0 && wordCount > maxWordCountWithBuffer(config.maxWordCount) && config.hardLimit) {
- if(!notification.isVisible()) {
- notification.show();
- }
- event.cancel();
- }
- }
- }, editor, null, 100);
-
- editor.on("afterPaste", function (event) {
- updateCounter(event.editor);
- }, editor, null, 100);
-
editor.on("blur", function () {
if (intervalId) {
window.clearInterval(intervalId);
diff --git a/app/assets/javascripts/frontend/form-validation.js.coffee b/app/assets/javascripts/frontend/form-validation.js.coffee
index f74d764e99..28f2874999 100644
--- a/app/assets/javascripts/frontend/form-validation.js.coffee
+++ b/app/assets/javascripts/frontend/form-validation.js.coffee
@@ -138,11 +138,31 @@ window.FormValidation =
return question.find("input[type='checkbox']").filter(":checked").length
validateWordLimit: (question) ->
- wordLimit = $(question.context).attr("data-word-max")
- wordCount = $(question.context).val().split(" ").length
- if wordCount > wordLimit
- @logThis(question, "validateWordLimit", "Word limit exceeded")
- @addErrorMessage(question, "Exceeded #{wordLimit} word limit.")
+ questionRef = question.attr("data-question_ref")
+ textarea = question.find("textarea")
+ wordLimit = textarea.attr("data-word-max")
+ wordLimitWithBuffer = 0
+ if wordLimit > 15
+ wordLimitWithBuffer = parseInt(wordLimit * 1.1);
+ else
+ wordLimitWithBuffer = wordLimit;
+
+ editorInstance = CKEDITOR.instances[textarea.attr("id")]
+ if editorInstance?
+ editorContent = editorInstance.getData()
+ normalizedContent = editorContent
+ .replace(/<[^>]*>/g, ' ') # Remove HTML tags
+ .replace(/ /g, ' ') # Replace non-breaking spaces
+ .replace(/\s+/g, ' ') # Replace multiple spaces with single space
+ .trim()
+ wordCount = normalizedContent.split(' ').length
+
+ if wordCount > wordLimitWithBuffer
+ @logThis(question, "validateWordLimit", "Word limit of #{wordLimit} exceeded. Word count at #{wordCount}.")
+ if wordLimit > 15
+ @addErrorMessage(question, "Question #{questionRef} has a word limit of #{wordLimit}. Your answer has to be #{wordLimitWithBuffer} words or less (as we allow 10% leeway).")
+ else
+ @addErrorMessage(question, "Question #{questionRef} has a word limit of #{wordLimit}. Your answer has to be #{wordLimitWithBuffer} words or less.")
validateSubfieldWordLimit: (question) ->
wordLimit = $(question.context).attr("data-word-max")
diff --git a/app/assets/javascripts/frontend/vat_returns_upload.js.coffee b/app/assets/javascripts/frontend/vat_returns_upload.js.coffee
index fb70364da4..86f0066b84 100644
--- a/app/assets/javascripts/frontend/vat_returns_upload.js.coffee
+++ b/app/assets/javascripts/frontend/vat_returns_upload.js.coffee
@@ -1,5 +1,12 @@
window.VatReturnsUpload =
init: ->
+ list = $('.vat-returns-wrapper .js-uploaded-list')
+ parent = list.closest('div.js-upload-wrapper')
+ max = parent.data('max-attachments')
+ govuk_button = $('.upload-file-btn')
+
+ updateUploadListVisiblity(list, govuk_button, max)
+
$('.js-vat-returns-upload').each (idx, el) ->
VatReturnsUpload.fileupload_init(el)
@@ -14,8 +21,10 @@ window.VatReturnsUpload =
$el = $(el)
parent = $el.closest('div.js-upload-wrapper')
+ max = parent.data('max-attachments')
list = parent.find('.js-uploaded-list')
form = parent.find('form.vat-returns-upload-form')
+ govuk_button = $('.upload-file-btn')
progress_all = (e, data) ->
# TODO
@@ -60,6 +69,8 @@ window.VatReturnsUpload =
list.find(".li-figures-upload").removeClass("govuk-!-display-none")
$(".js-vat-returns-status-message").remove()
+ updateUploadListVisiblity(list, govuk_button, max)
+
failed = (error_message) ->
parent.find(".govuk-error-message").html(error_message)
list.addClass("govuk-!-display-none")
@@ -91,3 +102,17 @@ window.VatReturnsUpload =
send: upload_started
always: success_or_error
)
+
+updateUploadListVisiblity = (list, button, max) ->
+ list_elements = list.find("li").not('.dummy')
+ count = list_elements.length
+ wrapper = button.closest('div.js-upload-wrapper')
+
+ if count > 0
+ list.removeClass("hide")
+
+ if !max || count < max
+ button.removeClass("hide")
+
+ else
+ button.addClass("hide")
diff --git a/app/decorators/form_answer_decorator.rb b/app/decorators/form_answer_decorator.rb
index d6249ea6df..2af88ea826 100644
--- a/app/decorators/form_answer_decorator.rb
+++ b/app/decorators/form_answer_decorator.rb
@@ -336,6 +336,10 @@ def website_url
document["website_url"]
end
+ def social_media_links
+ document["social_media_links"]
+ end
+
def head_of_business_title
document["head_of_business_title"] || document["head__of_bussines_title"]
end
diff --git a/app/decorators/user_decorator.rb b/app/decorators/user_decorator.rb
index 5e24381992..5ba0c9a75a 100644
--- a/app/decorators/user_decorator.rb
+++ b/app/decorators/user_decorator.rb
@@ -34,13 +34,17 @@ def role
end
def role_name
- case object.role.to_s.humanize
- when "Account admin"
- "Admin and collaborator"
- when "Regular"
- "Collaborator only"
+ if account.owner == self
+ "Account owner"
else
- object.role.to_s.humanize
+ case role.to_s.humanize
+ when "Account admin"
+ "Admin and collaborator"
+ when "Regular"
+ "Collaborator only"
+ else
+ role.to_s.humanize
+ end
end
end
diff --git a/app/models/reports/admin_report.rb b/app/models/reports/admin_report.rb
index 9565d3e5a0..91d8013182 100644
--- a/app/models/reports/admin_report.rb
+++ b/app/models/reports/admin_report.rb
@@ -61,6 +61,8 @@ def csv_filename
"#{category}_award#{sub_type}_#{id}_#{time}.csv"
when "reception-buckingham-palace"
"royal-reception-guest-list.csv"
+ when "registered-users"
+ "users-of-started-applications.csv"
end
end
diff --git a/app/models/reports/case_index_report.rb b/app/models/reports/case_index_report.rb
index e42825c794..638cab5b07 100644
--- a/app/models/reports/case_index_report.rb
+++ b/app/models/reports/case_index_report.rb
@@ -64,7 +64,7 @@ def scoped_collection
scope = @year.form_answers
.shortlisted
.where(award_type: @category)
- .order(:sic_code)
+ .order(Arel.sql("form_answers.document #>> '{sic_code}', form_answers.company_or_nominee_name"))
if @category == "trade"
years_mode_query = (@years_mode.to_s == "3") ? "3 to 5" : "6 plus"
diff --git a/app/models/reports/form_answer.rb b/app/models/reports/form_answer.rb
index 0930b00db7..12e53d73f5 100644
--- a/app/models/reports/form_answer.rb
+++ b/app/models/reports/form_answer.rb
@@ -79,7 +79,7 @@ def ac_received
if po_sd_provided_actual_figures?
"N/A - provided actual figures"
else
- bool obj.audit_certificate.present?
+ bool(obj.audit_certificate.present? || obj.shortlisted_documents_submitted?)
end
end
@@ -87,7 +87,7 @@ def ac_checked
if po_sd_provided_actual_figures?
"N/A"
else
- bool obj.audit_certificate.try(:reviewed?)
+ bool(obj.audit_certificate.try(:reviewed?) || obj.shortlisted_documents_wrapper&.reviewed?)
end
end
diff --git a/app/pdf_generators/case_summary_pdfs/base.rb b/app/pdf_generators/case_summary_pdfs/base.rb
index b981e29a25..4b65055da7 100644
--- a/app/pdf_generators/case_summary_pdfs/base.rb
+++ b/app/pdf_generators/case_summary_pdfs/base.rb
@@ -44,7 +44,7 @@ def set_form_answers
.group("form_answers.id")
.having("count(assessor_assignments) > 0")
.where("assessor_assignments.submitted_at IS NOT NULL AND assessor_assignments.position IN (3,4)")
- .order(Arel.sql("form_answers.award_year_id, form_answers.document #>> '{sic_code}'"))
+ .order(Arel.sql("form_answers.award_year_id, form_answers.document #>> '{sic_code}', form_answers.company_or_nominee_name"))
.group("form_answers.id")
.where("form_answers.award_year_id =?", award_year.id)
diff --git a/app/pdf_generators/case_summary_pdfs/general/data_pointer.rb b/app/pdf_generators/case_summary_pdfs/general/data_pointer.rb
index f2e02e0943..6fa2e6e904 100644
--- a/app/pdf_generators/case_summary_pdfs/general/data_pointer.rb
+++ b/app/pdf_generators/case_summary_pdfs/general/data_pointer.rb
@@ -8,6 +8,7 @@ module CaseSummaryPdfs::General::DataPointer
AVERAGE_COLOR = "DAA520"
NEGATIVE_COLOR = "FF0000"
NEUTRAL_COLOR = "ECECEC"
+ LINK_REGEXP = /((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.-]+[.][a-z]{2,4}\/)(?:[^\s()<>`!{}:;'"\[\]]*))/im
def undefined_value
FeedbackPdfs::Pointer::UNDEFINED_VALUE
@@ -55,6 +56,16 @@ def current_awards
end
end
+ def website_url
+ matches = LINK_REGEXP.match(form_answer.decorate.website_url)
+ matches ? matches[0] : ""
+ end
+
+ def social_media_links
+ text = form_answer.decorate.social_media_links
+ text ? text.scan(LINK_REGEXP).flatten.map { |v| v.sub(/^https?:\/\/(www.)?/, "") } : []
+ end
+
def case_summaries_table_headers
[
[
diff --git a/app/pdf_generators/case_summary_pdfs/general/draw_elements.rb b/app/pdf_generators/case_summary_pdfs/general/draw_elements.rb
index 69f9772212..8b0132d94f 100644
--- a/app/pdf_generators/case_summary_pdfs/general/draw_elements.rb
+++ b/app/pdf_generators/case_summary_pdfs/general/draw_elements.rb
@@ -13,23 +13,37 @@ def sic_code_offset
end
end
+ def social_media_links_offset
+ @_social_media_links_offset ||= case social_media_links.size
+ when 0..1 then 0
+ when 2..3 then -2.5.mm
+ when 4..6 then -5.mm
+ else -7.5.mm
+ end
+ end
+
def main_header
render_official_sensitive(105, 137.5)
render_logo(695, 127.5)
render_urn(0, 127)
render_applicant(0, 119.5)
- unless form_answer.promotion?
+ if form_answer.promotion?
+ render_website_address(offset: 15.mm)
+ render_social_media_links(offset: 15.mm)
+ else
render_organization_type
render_sic_code
+ render_website_address(offset: sic_code_offset)
+ render_social_media_links(offset: sic_code_offset)
if (form_answer.development? || form_answer.mobility?) && form_answer.award_year.year >= 2020
# type and sub category Qs are missing for SD2020+, so need to move up
- render_current_awards(offset: ONE_LINE_OFFSET + sic_code_offset)
+ render_current_awards(offset: ONE_LINE_OFFSET + sic_code_offset + social_media_links_offset)
else
- render_type(offset: sic_code_offset)
- render_current_awards(offset: sic_code_offset)
- render_sub_category(0, y_coord("sub_category") + sic_code_offset.to_i)
+ render_type(offset: sic_code_offset + social_media_links_offset)
+ render_current_awards(offset: sic_code_offset + social_media_links_offset)
+ render_sub_category(0, y_coord("sub_category") + sic_code_offset.to_i + (social_media_links_offset / 3)) # No idea why division by 3 is needed but it seems to work and offset the text properly
end
end
@@ -38,15 +52,15 @@ def main_header
end
def render_organization_type
- pdf_doc.text_box "Organisation Type: #{organisation_type}", header_text_properties.merge(
+ pdf_doc.text_box "Organisation Type: #{organisation_type}", description_list_properties.merge(
at: [0.mm, 112.mm + default_offset],
)
end
def render_type(offset: 0.mm)
- pdf_doc.text_box "Type: #{application_type}",
- header_text_properties.merge(
- at: [0.mm, 97.mm + default_offset + offset],
+ pdf_doc.text_box "Type: #{application_type}",
+ description_list_properties.merge(
+ at: [0.mm, 82.mm + default_offset + offset],
width: 272.mm,
)
end
@@ -66,20 +80,44 @@ def y_coord(mode)
application_type_answer.size > 0
case application_type_answer.size
when 1
- [79, 71, 75]
+ [64, 56, 90] # [79, 71, 75] <~ ORIGINAL VALUES
when 2
- [74, 67, 81]
+ [59, 52, 96] # [74, 67, 81] <~ ORIGINAL VALUES
when 3
- [69, 62, 85]
+ [54, 47, 100] # [69, 62, 85] <~ ORIGINAL VALUES
end
else
- [89, 81, 65]
+ [74, 66, 80] # [89, 81, 65] <~ ORIGINAL VALUES
end[mode_number]
end
def render_sic_code
- pdf_doc.text_box "SIC code: #{sic_code}",
- header_text_properties.merge(width: 272.mm, at: [0.mm, 104.5.mm + default_offset])
+ pdf_doc.text_box "SIC code: #{sic_code}",
+ description_list_properties.merge(width: 272.mm, at: [0.mm, 104.5.mm + default_offset])
+ end
+
+ def render_website_address(offset: 0)
+ pdf_doc.formatted_text_box(
+ [
+ { text: "Website address: ", styles: [:bold], **description_list_properties },
+ { text: website_url, link: website_url, styles: [:underline], color: "035DA5", **description_list_properties },
+ ],
+ at: [0.mm, 97.mm + default_offset + offset],
+ width: 272.mm,
+ )
+ end
+
+ def render_social_media_links(offset: 0)
+ pdf_doc.formatted_text_box(
+ [
+ { text: "Links to social media accounts: ", styles: [:bold], **description_list_properties },
+ { text: social_media_links.join(", "), **description_list_properties },
+ ],
+ at: [0.mm, 89.5.mm + default_offset + offset],
+ width: 272.mm,
+ )
+
+ pdf_doc.move_down(social_media_links_offset.abs)
end
def render_current_awards(offset: 0)
@@ -88,8 +126,8 @@ def render_current_awards(offset: 0)
awards.each_with_index do |awards_line, index|
if index == 0
- pdf_doc.text_box "Current Awards: #{awards_line}",
- header_text_properties.merge(width: 650.mm, at: [0.mm, y_coord("awards").mm + default_offset + offset])
+ pdf_doc.text_box "Current Awards: #{awards_line}",
+ description_list_properties.merge(width: 650.mm, at: [0.mm, y_coord("awards").mm + default_offset + offset])
else
pdf_doc.text_box awards_line.to_s,
header_text_properties.merge(width: 650.mm, at: [0.mm, y_coord("awards").mm + default_offset + offset - index * ONE_LINE_OFFSET])
diff --git a/app/pdf_generators/pdf_audit_certificates/general/shared_elements.rb b/app/pdf_generators/pdf_audit_certificates/general/shared_elements.rb
index bcc73427e6..25a669f52d 100644
--- a/app/pdf_generators/pdf_audit_certificates/general/shared_elements.rb
+++ b/app/pdf_generators/pdf_audit_certificates/general/shared_elements.rb
@@ -17,7 +17,7 @@ def render_certificate_info
end
def render_recipients_info
- render_text_line("To: The Kings Award’s Office, The Department for Business, Energy & Industrial Strategy", 1, inline_format: true)
+ render_text_line("To: The Kings Award's Office, The Department for Business and Trade", 1, inline_format: true)
end
def render_company_info
diff --git a/app/pdf_generators/qae_pdf_forms/general/draw_elements.rb b/app/pdf_generators/qae_pdf_forms/general/draw_elements.rb
index eeba908b85..0ffe5cba92 100644
--- a/app/pdf_generators/qae_pdf_forms/general/draw_elements.rb
+++ b/app/pdf_generators/qae_pdf_forms/general/draw_elements.rb
@@ -153,16 +153,31 @@ def render_guidance_block
render_text(block_2)
+ render_text("Copying answers from a document into online application forms", size: 14, style: :bold)
+ render_text("If you want to copy your answers from a text document like Microsoft Word into an online application form, please paste text without formatting for it to appear correctly. You can do so in one of three ways:")
+
+ block_3 = %(
+ 1. Remove formatting when pasting
+ #{bullet} Use the shortcut Ctrl+Shift+V (Windows) or Command+Shift+V (Mac) to paste text without formatting.
+ 2. First remove formatting in Microsoft Word
+ #{bullet} Option 1: Select the text and press Ctrl+Shift+N (Windows) or Command+Shift+N (Mac).
+ #{bullet} Option 2: Select the text and click the ‘Clear Formatting’ button on the Home tab.
+ 3. Use an online tool
+ #{bullet} Use an online tool to remove formatting, such as https://www.striphtml.com/.
+ )
+
+ render_text(block_3)
+
render_text("Use of web-based AI and editing tools in King's Awards applications:", size: 14, style: :bold)
render_text("We recognise that web-based AI and editing tools can greatly assist writing and editing and can help improve grammar and overall style. There may be issues to consider when entering information and generating text via web-based AI and online editing tools. We have included more guidance online in the 'Useful Application Info' section.")
render_text("Need help?", size: 14, style: :bold)
- block_3 = %(If you need digital assistance with filling in the form or have any questions, please feel free to get in touch with us:
+ block_4 = %(If you need digital assistance with filling in the form or have any questions, please feel free to get in touch with us:
By calling 020 4551 0081
Or emailing kingsawards@businessandtrade.gov.uk)
- render_text(block_3)
+ render_text(block_4)
end
def render_logo
diff --git a/app/pdf_generators/shared_pdf_helpers/draw_elements.rb b/app/pdf_generators/shared_pdf_helpers/draw_elements.rb
index 013247dfeb..e804d68f77 100644
--- a/app/pdf_generators/shared_pdf_helpers/draw_elements.rb
+++ b/app/pdf_generators/shared_pdf_helpers/draw_elements.rb
@@ -16,18 +16,18 @@ def render_logo(x_coord, y_coord)
end
def render_urn(x_coord, y_coord)
- pdf_doc.text_box "KA Ref: #{form_answer.urn}",
- header_text_properties.merge(at: [x_coord.mm, y_coord.mm + DEFAULT_OFFSET])
+ pdf_doc.text_box "KA Ref: #{form_answer.urn}",
+ description_list_properties.merge(at: [x_coord.mm, y_coord.mm + DEFAULT_OFFSET])
end
def render_applicant(x_coord, y_coord)
- pdf_doc.text_box "Applicant: #{form_answer.decorate.company_nominee_or_application_name}",
- header_text_properties.merge(at: [x_coord.mm, y_coord.mm + DEFAULT_OFFSET])
+ pdf_doc.text_box "Applicant: #{form_answer.decorate.company_nominee_or_application_name}",
+ description_list_properties.merge(at: [x_coord.mm, y_coord.mm + DEFAULT_OFFSET])
end
def render_sub_category(x_coord, y_coord)
- pdf_doc.text_box "Sub-category: #{sub_category}",
- header_text_properties.merge(at: [x_coord.mm, y_coord.mm + DEFAULT_OFFSET])
+ pdf_doc.text_box "Sub-category: #{sub_category}",
+ description_list_properties.merge(at: [x_coord.mm, y_coord.mm + DEFAULT_OFFSET])
end
def render_award_general_information(x_coord, y_coord)
@@ -88,4 +88,8 @@ def header_text_properties
style: :bold,
}
end
+
+ def description_list_properties
+ header_text_properties.merge(style: :normal, inline_format: true)
+ end
end
diff --git a/app/search/form_answer_search.rb b/app/search/form_answer_search.rb
index 1146dadc89..d27ec2e6ed 100644
--- a/app/search/form_answer_search.rb
+++ b/app/search/form_answer_search.rb
@@ -36,7 +36,7 @@ def sort_by_applied_before(scoped_results, desc = false)
end
def sort_by_sic_code(scoped_results, desc = false)
- scoped_results.order(Arel.sql("(form_answers.document #>> '{sic_code}') #{sort_order(desc)}"))
+ scoped_results.order(Arel.sql("(form_answers.document #>> '{sic_code}') #{sort_order(desc)}, form_answers.company_or_nominee_name #{sort_order(desc)}"))
end
def sort_by_primary_assessor_name(scoped_results, desc = false)
diff --git a/app/search/user_search.rb b/app/search/user_search.rb
index 90fbf82cb3..160ee0b64a 100644
--- a/app/search/user_search.rb
+++ b/app/search/user_search.rb
@@ -1,10 +1,5 @@
class UserSearch < Search
- DEFAULT_SEARCH = {
- sort: "full_name",
- search_filter: {
- role: User.role.values,
- },
- }
+ DEFAULT_SEARCH = { sort: "full_name" }
include FullNameSort
end
diff --git a/app/views/account/collaborators/_item.html.slim b/app/views/account/collaborators/_item.html.slim
index 48e5df34eb..d3550b5d40 100644
--- a/app/views/account/collaborators/_item.html.slim
+++ b/app/views/account/collaborators/_item.html.slim
@@ -1,4 +1,4 @@
-li.list-group-item id=dom_id(collaborator) aria-label="#{role = collaborator == account_owner ? "Account owner" : collaborator.role_name} summary"
+li.list-group-item id=dom_id(collaborator) aria-label="#{role = collaborator.role_name} summary"
h3.collaborator__name.govuk-heading-s
= collaborator.full_name_with_status
p.collaborator__jobtitle.govuk-body
diff --git a/app/views/account_mailers/notify_shortlisted_mailer/notify_po_sd.text.erb b/app/views/account_mailers/notify_shortlisted_mailer/notify_po_sd.text.erb
index 4bbc3dd8d3..71d973d4cf 100644
--- a/app/views/account_mailers/notify_shortlisted_mailer/notify_po_sd.text.erb
+++ b/app/views/account_mailers/notify_shortlisted_mailer/notify_po_sd.text.erb
@@ -13,7 +13,7 @@ Please follow the steps below:
1. Log into your King's Awards for Enterprise dashboard and follow the steps to upload any latest financial statements and VAT returns by following the “Provide the latest financial information” link here:
<%= users_form_answer_audit_certificate_url(@form_answer) %>
- 2. Check how the estimated figures you provided in section C of your application form compare with the actuals. If you do not have access to your application, you can download it from the King's Award for Enterprise account dashboard.
+ 2. Check how the estimated figures you provided in section D of your application form compare with the actuals. If you do not have access to your application, you can download it from the King's Award for Enterprise account dashboard.
3. You will have to submit a separate variance explanation document if:
a) any of the actual figures have decreased by 10% or more. If this is the case, please explain the reason(s) for the difference.
b) the actuals include losses which were not previously stated on your application form. If this is the case, please explain the reasons for the losses and how your business remains financially viable.
diff --git a/app/views/account_mailers/notify_shortlisted_mailer/preview/notify_po_sd.html.slim b/app/views/account_mailers/notify_shortlisted_mailer/preview/notify_po_sd.html.slim
index 8eaae4f31d..5536977d56 100644
--- a/app/views/account_mailers/notify_shortlisted_mailer/preview/notify_po_sd.html.slim
+++ b/app/views/account_mailers/notify_shortlisted_mailer/preview/notify_po_sd.html.slim
@@ -23,7 +23,7 @@ p style="font-size: 19px; line-height: 1.315789474; margin: 0 0 30px 0;"
= link_to(users_form_answer_audit_certificate_url(@form_answer), users_form_answer_audit_certificate_url(@form_answer))
p style="font-size: 19px; line-height: 1.315789474; margin: 0 0 30px 0;"
- | 2. Check how the estimated figures you provided in section C of your application form compare with the actuals. If you do not have access to your application, you can download it from the King's Award for Enterprise account dashboard.
+ | 2. Check how the estimated figures you provided in section D of your application form compare with the actuals. If you do not have access to your application, you can download it from the King's Award for Enterprise account dashboard.
p style="font-size: 19px; line-height: 1.315789474; margin: 0 0 30px 0;"
| 3. You will have to submit a separate variance explanation document if:
br
diff --git a/app/views/accounts/_form_contact_settings.html.slim b/app/views/accounts/_form_contact_settings.html.slim
index 3f481f6621..4dc90c5d73 100644
--- a/app/views/accounts/_form_contact_settings.html.slim
+++ b/app/views/accounts/_form_contact_settings.html.slim
@@ -15,7 +15,7 @@
= f.input :subscribed_to_emails, checkbox: true, label: "I am happy to be contacted about King's Awards for Enterprise issues not related to my application (for example, request to act as a case study, newsletters, other information).", wrapper_class: "selectable"
- = f.input :agree_being_contacted_by_department_of_business, label: "I am happy to be contacted by the Department for Business, Energy and Industrial Strategy.", wrapper_class: "selectable"
+ = f.input :agree_being_contacted_by_department_of_business, label: "I am happy to be contacted by the Department for Business and Trade.", wrapper_class: "selectable"
= f.input :agree_sharing_of_details_with_lieutenancies, checkbox: true, label: "I am happy for my and my organisation's name, contact details and application status to be shared with Lieutenancies so that they can contact us to assist as appropriate.
For example, what steps did you take following a major Health and Safety incident.
diff --git a/forms/award_years/v2025/innovation/innovation_step2.rb b/forms/award_years/v2025/innovation/innovation_step2.rb index 0c7c6a44da..42e649da43 100644 --- a/forms/award_years/v2025/innovation/innovation_step2.rb +++ b/forms/award_years/v2025/innovation/innovation_step2.rb @@ -40,7 +40,7 @@ def innovation_step2 end textarea :invoicing_unit_relations, "Explain your relationship with the invoicing unit and the arrangements made." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "B 2.1" required conditional :principal_business, :no @@ -347,7 +347,7 @@ def innovation_step2 end textarea :other_awards_desc, "List the awards you have won in the past." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "B 13.1" required context "If you can't fit all of your awards below, then choose those you're most proud of.
" diff --git a/forms/award_years/v2025/innovation/innovation_step3.rb b/forms/award_years/v2025/innovation/innovation_step3.rb index 6fa436ae33..ee941cbc4c 100644 --- a/forms/award_years/v2025/innovation/innovation_step3.rb +++ b/forms/award_years/v2025/innovation/innovation_step3.rb @@ -36,7 +36,7 @@ def innovation_step3 textarea :innovation_desc_short, "Provide a one-line description of your innovative product, service, business model or process." do sub_section :innovation_background_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 1.2" required context %( @@ -105,7 +105,7 @@ def innovation_step3 textarea :innovation_hold_existing_patent_details, "Provide a link to your published patent document. If you do not have a patent, please explain the reasons why not." do sub_section :innovation_background_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 1.4.1" required context %( @@ -133,7 +133,7 @@ def innovation_step3 textarea :innovation_other_countries_it_was_developed, "Describe in what other countries and, if applicable, by what parties it was developed." do sub_section :innovation_background_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 1.5.1" required conditional :innovation_conceived_and_developed, :no @@ -161,7 +161,7 @@ def innovation_step3 textarea :innovation_contributors, "Please enter their names." do sub_section :innovation_background_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 1.6.1" required conditional :innovation_joint_contributors, :yes @@ -184,7 +184,7 @@ def innovation_step3 textarea :innovation_external_contributors, "Name any external organisations or individuals that contributed to your innovation and explain their contributions." do sub_section :innovation_background_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 1.7.1" required conditional :innovation_any_contributors, :yes @@ -215,7 +215,7 @@ def innovation_step3 textarea :innovation_contributors_why_organisations, "Explain why external organisations or individuals that contributed to your innovation are not all aware of this application." do sub_section :innovation_background_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 1.7.3" required conditional :innovation_any_contributors, :yes @@ -234,7 +234,7 @@ def innovation_step3 textarea :innovation_license_terms, "Briefly describe the licensing arrangement." do sub_section :innovation_background_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 1.8.1" required conditional :innovation_under_license, :yes @@ -278,7 +278,7 @@ def innovation_step3 textarea :innovation_context, "Describe the market conditions that led to the creation of your innovation and how you identified a gap in the market." do sub_section :innovation_timeline_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 2.3" required context %( @@ -292,7 +292,7 @@ def innovation_step3 textarea :innovation_desc_long, "Describe your innovation and why it is innovative." do sub_section :innovation_timeline_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 2.4" required context %( @@ -343,7 +343,7 @@ def innovation_step3 textarea :innovation_selection_details, "How did you select this innovation as the one to satisfy the gap in the market?" do sub_section :innovation_timeline_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 2.5" required context %( @@ -357,7 +357,7 @@ def innovation_step3 textarea :innovation_overcomes_issues, "Describe any challenges you encountered in developing your innovation and how you overcame them." do sub_section :innovation_timeline_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 2.6" required context %( @@ -371,7 +371,7 @@ def innovation_step3 textarea :innovation_strategies, "Explain the market opportunities and what strategies you used to penetrate the market." do sub_section :innovation_timeline_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 2.7" required context %( @@ -385,7 +385,7 @@ def innovation_step3 textarea :innovation_competitors, "Who offers products, services or business models that compete with yours?" do sub_section :innovation_timeline_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 2.8" required context %( @@ -399,7 +399,7 @@ def innovation_step3 textarea :innovation_protect_market_position_details, "How might you protect the market position you have created?" do sub_section :innovation_timeline_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 2.9" required context %( @@ -413,7 +413,7 @@ def innovation_step3 textarea :innovation_additional_comments, "Additional comments (optional)" do sub_section :innovation_timeline_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 2.10" context %(@@ -451,7 +451,7 @@ def innovation_step3 textarea :innovation_befits_details_business, "How has the innovation added value to your business?" do sub_section :innovation_value_add_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 3.1" required context %( @@ -506,7 +506,7 @@ def innovation_step3 textarea :innovation_befits_details_customers, "Does the innovation benefit your customers, and if so, how?" do sub_section :innovation_value_add_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 3.2" required context %( @@ -552,7 +552,7 @@ def innovation_step3 textarea :beyond_your_immediate_customers, "Beyond your immediate customers, does the innovation benefit others, and if so, how and to whom?" do sub_section :innovation_value_add_header - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 3.3" required context %( diff --git a/forms/award_years/v2025/innovation/innovation_step4.rb b/forms/award_years/v2025/innovation/innovation_step4.rb index ff5f4178c2..61da144c7d 100644 --- a/forms/award_years/v2025/innovation/innovation_step4.rb +++ b/forms/award_years/v2025/innovation/innovation_step4.rb @@ -55,7 +55,7 @@ def innovation_step4 end textarea :adjustments_explanation, "Explain adjustments to figures." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "D 2.2" required rows 2 @@ -72,7 +72,7 @@ def innovation_step4 end textarea :financial_year_date_changed_explaination, "Explain why your year-end date changed." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "D 2.3" required rows 1 @@ -203,7 +203,7 @@ def innovation_step4 end textarea :drops_in_turnover, "Explain any losses, drops in the total turnover, export sales, total net assets or reductions in net profit." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "D 4.6" required rows 3 @@ -219,7 +219,7 @@ def innovation_step4 end textarea :drops_explain_how_your_business_is_financially_viable, "Explain how your business is financially viable in terms of cash flow, cash generated, and investment received." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "D 4.7" required context %( @@ -235,7 +235,7 @@ def innovation_step4 end textarea :investments_details, "Enter details of all your investments in the innovation. Include all investments made both during and before your entry period. Also, include the years in which they were made." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "D 4.8" required rows 3 @@ -248,7 +248,7 @@ def innovation_step4 end textarea :roi_details, "Please provide calculations on how you have recovered or will recover the investments outlined in question D4.8. How long did it take or will it take to recover the investments?" do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "D 4.9" required rows 3 @@ -372,7 +372,7 @@ def innovation_step4 end textarea :drops_in_sales, "Explain any drop in sales or the number of units sold (if applicable)." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "D 6.5" section :innovation_financials rows 2 @@ -400,7 +400,7 @@ def innovation_step4 end textarea :avg_unit_price_desc, "Explain your unit selling prices or contract values, highlighting any changes over the above periods (if applicable)." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "D 6.7" section :innovation_financials rows 2 @@ -425,7 +425,7 @@ def innovation_step4 end textarea :costs_change_desc, "Explain your direct unit or contract costs, highlighting any changes over the above periods (if applicable)." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "D 6.9" section :innovation_financials rows 2 @@ -439,6 +439,7 @@ def innovation_step4 textarea :innovation_performance, "Describe how, when, and to what extent the innovation has improved the commercial performance of your business." do ref "D 7" + classes "text-words-max" required context %(
@@ -476,6 +477,7 @@ def innovation_step4 textarea :covid_impact_details, "Explain how your business has been responding to the economic uncertainty experienced nationally and globally in recent years." do ref "D 8" + classes "text-words-max" required context %(
@@ -37,6 +38,7 @@ def innovation_step5 textarea :impact_on_environment, "The environmental impact of your business operations." do ref "E 2" + classes "text-words-max" required context %(
@@ -76,6 +78,7 @@ def innovation_step5 textarea :employees_relations, "Relations with your workforce." do ref "E 3" + classes "text-words-max" required context %(
@@ -111,6 +114,7 @@ def innovation_step5 textarea :partners_relations, "Relations with customers and suppliers." do ref "E 4" + classes "text-words-max" required context %(
@@ -140,6 +144,7 @@ def innovation_step5 textarea :governance, "Additional environmental, social, and corporate governance (ESG) examples. (optional)" do ref "E 5" + classes "text-words-max" context %(
Feel free to provide any additional information about your ESG practices. If you have already covered your ESG practices in full in this section or section C of the form, just state so. diff --git a/forms/award_years/v2025/international_trade/international_trade_step1.rb b/forms/award_years/v2025/international_trade/international_trade_step1.rb index 31d76214c5..236833e4e8 100644 --- a/forms/award_years/v2025/international_trade/international_trade_step1.rb +++ b/forms/award_years/v2025/international_trade/international_trade_step1.rb @@ -186,7 +186,7 @@ def trade_step1 textarea :major_issues_overcome, "Please explain any major issues that you have overcome in recent years and the remedial steps you have taken." do ref "A 2.2" - classes "sub-question" + classes "sub-question text-words-max" required context %(
For example, what steps did you take following a major Health and Safety incident.
diff --git a/forms/award_years/v2025/international_trade/international_trade_step2.rb b/forms/award_years/v2025/international_trade/international_trade_step2.rb index 6f159eaddf..ffc54591fd 100644 --- a/forms/award_years/v2025/international_trade/international_trade_step2.rb +++ b/forms/award_years/v2025/international_trade/international_trade_step2.rb @@ -35,7 +35,7 @@ def trade_step2 end textarea :invoicing_unit_relations, "Explain your relationship with the invoicing unit, and the arrangements made." do - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "B 2.1" required conditional :principal_business, :no @@ -250,7 +250,7 @@ def trade_step2 end textarea :pareent_group_why_excluding_members, "Please explain why you are excluding any members of your group from this application." do - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "B 10.2" rows 5 words_max 100 @@ -411,7 +411,7 @@ def trade_step2 end textarea :other_awards_desc, "List the awards you have won in the past." do - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "B 17.1" required form_hint "If you can't fit all of your awards below, then choose those you're most proud of." diff --git a/forms/award_years/v2025/international_trade/international_trade_step3.rb b/forms/award_years/v2025/international_trade/international_trade_step3.rb index 50e5981190..ced6ab5377 100644 --- a/forms/award_years/v2025/international_trade/international_trade_step3.rb +++ b/forms/award_years/v2025/international_trade/international_trade_step3.rb @@ -7,7 +7,7 @@ def trade_step3 end textarea :trade_business_as_a_whole, "Describe your business as a whole." do - classes "word-max-strict" + classes "word-max-strict text-words-max" sub_ref "C 1" required rows 5 @@ -15,7 +15,7 @@ def trade_step3 end textarea :trade_brief_history, "Provide a brief history of your company, corporate targets and direction." do - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 1.1" required rows 5 @@ -23,7 +23,7 @@ def trade_step3 end textarea :trade_overall_importance, "Explain the overall importance of exporting to your company." do - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" ref "C 2" required rows 5 @@ -31,7 +31,7 @@ def trade_step3 end textarea :trade_description_short, "Provide a one-line description of your international trade." do - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 2.1" context %(@@ -97,7 +97,7 @@ def trade_step3 textarea :trade_plans_desc, "Describe your international trade strategy." do ref "C 3" - classes "word-max-strict" + classes "word-max-strict text-words-max" required context %(
@@ -131,7 +131,7 @@ def trade_step3 textarea :actual_planned_performance_comparison, "Please explain how your actual performance compared to your planned performance as outlined in question C3." do sub_ref "C 3.1" - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" required rows 3 words_max 250 @@ -147,7 +147,7 @@ def trade_step3 textarea :markets_geo_spread, "Describe the geographical spread of your overseas markets." do required sub_ref "C 4.1" - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" context %(
Include evidence of how you segment and manage geographical regions to demonstrate your company's focus. Please supply market share information. @@ -158,7 +158,7 @@ def trade_step3 end textarea :top_overseas_sales, "What percentage of total overseas sales was made to each of your top 5 overseas markets (individual countries) during the final year of your entry?" do - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 4.2" required rows 1 @@ -166,7 +166,7 @@ def trade_step3 end textarea :identify_new_overseas, "Identify new overseas markets established during your period of entry and their contribution to total overseas sales." do - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 4.3" required rows 3 @@ -186,7 +186,7 @@ def trade_step3 end textarea :operate_model_benefits, "Explain your franchise or other business models and the rationale for this. Describe the benefits this brings to the UK (or Channel Islands or Isle of Man)." do - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "C 5.1" required rows 3 @@ -195,7 +195,7 @@ def trade_step3 textarea :economic_uncertainty_response, "Explain how your business has been responding to the economic uncertainty experienced nationally and globally in recent years." do sub_ref "C 6" - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" required context %(
@@ -40,6 +41,7 @@ def trade_step5 textarea :impact_on_environment, "The environmental impact of your business operations." do ref "E 2" + classes "text-words-max" required context %(
@@ -80,6 +82,7 @@ def trade_step5 textarea :employees_relations, "Relations with your workforce." do ref "E 3" required + classes "text-words-max" context %(
Examples of areas you may wish to describe: @@ -114,6 +117,7 @@ def trade_step5 textarea :partners_relations, "Relations with customers and suppliers." do ref "E 4" + classes "text-words-max" required context %(
@@ -146,6 +150,7 @@ def trade_step5 textarea :governance, "Additional environmental, social, and corporate governance (ESG) examples. (optional)" do ref "E 5" + classes "text-words-max" context %(
Feel free to provide any additional information about your ESG practices. If you have already covered your ESG practices in full in this section or section C of the form, just state so. diff --git a/forms/award_years/v2025/social_mobility/social_mobility_step1.rb b/forms/award_years/v2025/social_mobility/social_mobility_step1.rb index 26548e0600..be678c9f76 100644 --- a/forms/award_years/v2025/social_mobility/social_mobility_step1.rb +++ b/forms/award_years/v2025/social_mobility/social_mobility_step1.rb @@ -184,7 +184,7 @@ def mobility_step1 textarea :major_issues_overcome, "Please explain any major issues that you have overcome in recent years and the remedial steps you have taken." do ref "A 2.2" - classes "sub-question" + classes "sub-question text-words-max" required context %(
For example, what steps did you take following a major Health and Safety incident.
diff --git a/forms/award_years/v2025/social_mobility/social_mobility_step2.rb b/forms/award_years/v2025/social_mobility/social_mobility_step2.rb index 2fae724e5c..ed77d76dd9 100644 --- a/forms/award_years/v2025/social_mobility/social_mobility_step2.rb +++ b/forms/award_years/v2025/social_mobility/social_mobility_step2.rb @@ -35,7 +35,7 @@ def mobility_step2 end textarea :invoicing_unit_relations, "Explain your relationship with the invoicing unit and the arrangements made." do - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "B 2.1" required conditional :principal_business, :no @@ -305,7 +305,7 @@ def mobility_step2 end textarea :part_of_joint_entry_names, "Please enter their names." do - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "B 12.1" required conditional :part_of_joint_entry, "yes" @@ -330,7 +330,7 @@ def mobility_step2 textarea :external_specify_organisations_contributions, "Specify the organisations that have contributed, and state what, how and when they contributed." do sub_ref "B 13.1" required - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" words_max 100 rows 1 conditional :external_contribute_to_sustainable_product, "yes" @@ -411,7 +411,7 @@ def mobility_step2 end textarea :other_awards_desc, "List the awards you have won in the past." do - classes "sub-question word-max-strict" + classes "sub-question word-max-strict text-words-max" sub_ref "B 15.1" required context %( diff --git a/forms/award_years/v2025/social_mobility/social_mobility_step3.rb b/forms/award_years/v2025/social_mobility/social_mobility_step3.rb index ea31762c0d..6a49cb33ae 100644 --- a/forms/award_years/v2025/social_mobility/social_mobility_step3.rb +++ b/forms/award_years/v2025/social_mobility/social_mobility_step3.rb @@ -378,7 +378,7 @@ def mobility_step3 textarea :initiative_activities_other_specify, "Please list other activity types" do required - classes "sub-question js-conditional-question-checkbox" + classes "sub-question js-conditional-question-checkbox text-words-max" sub_ref "C 2.1" conditional :initiative_activities, "other_activity_types" words_max 50 @@ -390,7 +390,7 @@ def mobility_step3 end textarea :initiative_desc_short, "Provide a one-line description of your initiative." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "C 3.1" required context %( @@ -406,14 +406,14 @@ def mobility_step3 end textarea :initiative_desc_medium, "Briefly describe the initiative, its aims, what it provides and how it promotes opportunity through social mobility." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "C 3.2" required words_max 300 end textarea :initiative_motivations, "Outline the factors or issues that motivated your organisation to provide the initiative." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "C 3.3" required context %( @@ -431,7 +431,7 @@ def mobility_step3 end textarea :initiative_exemplary_evidence, "Describe what makes your initiative exemplary." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "C 3.4" required context %( @@ -449,7 +449,7 @@ def mobility_step3 textarea :initiative_evidence_exemplary, "Provide evidence of what makes your initiative exemplary." do sub_ref "C 3.5" required - classes "sub-question" + classes "sub-question text-words-max" words_max 200 context %(To support your answer in C3.4, provide third-party evidence of what makes your initiative exemplary compared to other similar initiatives and how you are going 'above and beyond' compared to your sector. For example, provide links to independent evaluation reports, details of awards won, client feedback ratings and how that compares with other similar organisations.
@@ -457,7 +457,7 @@ def mobility_step3 end textarea :initiative_day_to_day_running, "Who is responsible for and who runs the initiative day-to-day?" do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "C 3.6" required words_max 200 @@ -467,7 +467,7 @@ def mobility_step3 end textarea :goals_targets_monitor, "Describe what goals or targets you set and how you monitor them in the context of your initiative." do - classes "question" + classes "question text-words-max" ref "C 4" required words_max 500 @@ -492,7 +492,7 @@ def mobility_step3 end textarea :goals_targets_compare, "Describe how the goals or targets you set compare to the outcomes." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "C 4.1" required words_max 200 @@ -502,7 +502,7 @@ def mobility_step3 end textarea :addressing_shortfalls, "Explain any shortfalls and if you do anything to address them." do - classes "sub-question" + classes "sub-question text-words-max" sub_ref "C 4.2" required words_max 200 @@ -663,6 +663,7 @@ def mobility_step3 textarea :disadvantaged_group_not_in_list, "If you are putting forward a group that is not on this list, please provide details and explain why you believe the group you support should be considered disadvantaged." do sub_ref "C 5.4.1" + classes "text-words-max" context %(
Answer this question if you provided numbers for 'Other disadvantaged group' in question C5.4.
@@ -719,7 +720,7 @@ def mobility_step3
end
textarea :disadvantaged_groups_impact_employment_explained, "If, in question C5.5, jobs retained for more than a year are significantly lower than those secured during the support or within a year of support ending, please explain why." do
- classes "sub-question"
+ classes "sub-question text-words-max"
sub_ref "C 5.5.1"
required
words_max 150
@@ -820,7 +821,7 @@ def mobility_step3
end
textarea :disadvantaged_groups_numbers_explained, "Explain how you collected the impact numbers." do
- classes "sub-question"
+ classes "sub-question text-words-max"
sub_ref "C 5.8"
required
context %(
@@ -830,7 +831,7 @@ def mobility_step3
end
textarea :initiative_qualitative_impact, "Provide qualitative evidence on the impact that your initiative has achieved for your participants." do
- classes "sub-question"
+ classes "sub-question text-words-max"
sub_ref "C 5.9"
required
context %(
@@ -857,7 +858,7 @@ def mobility_step3
end
textarea :initiative_feedback, "Describe what feedback, if any, you sought on how your initiative could be improved. What, if any, of the suggested improvements have you implemented?" do
- classes "sub-question"
+ classes "sub-question text-words-max"
sub_ref "C 5.10"
required
context %(
@@ -882,7 +883,7 @@ def mobility_step3
end
textarea :initiative_impact_sharing, "Explain if and how you share and celebrate the evidence of the initiative’s impact across the organisation." do
- classes "sub-question"
+ classes "sub-question text-words-max"
sub_ref "C 6.1"
required
context %(
@@ -892,21 +893,21 @@ def mobility_step3
end
textarea :initiative_member_engagement, "Explain if and how you engage the organisation’s members or workforce in the design and implementation of your initiative." do
- classes "sub-question"
+ classes "sub-question text-words-max"
sub_ref "C 6.2"
required
words_max 200
end
textarea :initiative_long_term_plans, "What are your long-term plans for ensuring your organisation continues to promote opportunities through social mobility beyond what you already do?" do
- classes "sub-question"
+ classes "sub-question text-words-max"
sub_ref "C 6.3"
required
words_max 200
end
textarea :initiative_organisation_benefits, "Are there any other benefits of the initiative to your organisation that you haven't yet outlined in the previous responses?" do
- classes "sub-question"
+ classes "sub-question text-words-max"
sub_ref "C 6.4"
required
context %(
@@ -925,6 +926,7 @@ def mobility_step3
textarea :initiative_community_society_impact, "Impact on community and society." do
sub_ref "C 7"
+ classes "text-words-max"
required
context %(
What is the impact of your initiative on the local community and at a regional and national level, and how is this exemplary?
@@ -77,7 +78,7 @@ def mobility_step4
end
textarea :financial_adjustments_explanation, "Explain adjustments to figures." do
- classes "sub-question word-max-strict"
+ classes "sub-question word-max-strict text-words-max"
sub_ref "D 2.4"
required
context %(
@@ -91,7 +92,7 @@ def mobility_step4
end
textarea :financial_year_date_changed_explaination, "Explain why your year-end date changed." do
- classes "sub-question word-max-strict"
+ classes "sub-question word-max-strict text-words-max"
sub_ref "D 2.5"
required
rows 2
@@ -168,7 +169,7 @@ def mobility_step4
end
textarea :drops_in_turnover, "If you have had any losses, drops in turnover (or income), or reductions in net profit, please explain them." do
- classes "sub-question"
+ classes "sub-question text-words-max"
sub_ref "D 4.4"
required
context %(
@@ -190,6 +191,7 @@ def mobility_step4
textarea :covid_impact_details, "Explain how your business has been responding to the economic uncertainty experienced nationally and globally in recent years." do
ref "D 5"
+ classes "text-words-max"
required
context %(
@@ -37,6 +38,7 @@ def mobility_step5
textarea :impact_on_environment, "The environmental impact of your business operations." do
ref "E 2"
+ classes "text-words-max"
required
context %(
@@ -76,6 +78,7 @@ def mobility_step5
textarea :employees_relations, "Relations with your workforce." do
ref "E 3"
+ classes "text-words-max"
required
context %(
@@ -111,6 +114,7 @@ def mobility_step5
textarea :partners_relations, "Relations with customers and suppliers." do
ref "E 4"
+ classes "text-words-max"
required
context %(
@@ -140,6 +144,7 @@ def mobility_step5
textarea :governance, "Additional environmental, social, and corporate governance (ESG) examples. (optional)" do
ref "E 5"
+ classes "text-words-max"
required
context %(
diff --git a/forms/award_years/v2025/sustainable_development/sustainable_development_step1.rb b/forms/award_years/v2025/sustainable_development/sustainable_development_step1.rb
index 19378c7b82..3e9930f7b2 100644
--- a/forms/award_years/v2025/sustainable_development/sustainable_development_step1.rb
+++ b/forms/award_years/v2025/sustainable_development/sustainable_development_step1.rb
@@ -184,7 +184,7 @@ def development_step1
textarea :major_issues_overcome, "Please explain any major issues that you have overcome in recent years and the remedial steps you have taken." do
ref "A 2.2"
- classes "sub-question"
+ classes "sub-question text-words-max"
required
context %(
For example, what steps did you take following a major Health and Safety incident. Please note, when evaluating your application, the assessors may check your organisation's online presence.
@@ -70,7 +70,7 @@ def development_step3
end
textarea :describe_previous_situation_before_sustainability, "What was the situation before your organisation adopted a sustainability purpose, objectives and interventions?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 2.2"
required
rows 2
@@ -78,7 +78,7 @@ def development_step3
end
textarea :why_these_particular_interventions, "Why did you choose these particular interventions, and how do they align with the core aims and values of your organisation?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 2.3"
required
rows 3
@@ -86,7 +86,7 @@ def development_step3
end
textarea :how_have_you_embedded_sustainability_objectives, "How have you embedded sustainability objectives or purpose in your organisation?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 2.4"
required
rows 2
@@ -94,7 +94,7 @@ def development_step3
end
textarea :explain_how_the_business_operates_sustainably, "If your application is focused on particular sustainable development interventions, explain how your whole business also operates sustainably, especially in terms of climate change." do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 2.5"
required
context %{
@@ -146,7 +146,7 @@ def development_step3
end
textarea :how_sustainability_interventions_benefit_business_strategy, "How do sustainability interventions benefit the overall business strategy?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 2.6"
required
rows 2
@@ -154,7 +154,7 @@ def development_step3
end
textarea :explain_your_strategy_in_developing_sustainably, "Explain your strategy in developing sustainably for the future." do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 2.7"
required
context %(
@@ -176,7 +176,7 @@ def development_step3
end
textarea :describe_the_driving_force_of_your_organisation, "Who is ultimately responsible for the organisation's sustainability interventions and their success?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 3.1"
required
rows 2
@@ -184,7 +184,7 @@ def development_step3
end
textarea :who_is_responsible_for_day_to_day_management, "Who is responsible for the day-to-day management, and the main areas of sustainability, in your organisation?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 3.2"
required
context %(
@@ -195,7 +195,7 @@ def development_step3
end
textarea :describe_the_senior_decision_makers_commitment_to_sustainability, "What is the senior decision maker's commitment to the future sustainable growth of the organisation?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 3.3"
required
rows 2
@@ -203,7 +203,7 @@ def development_step3
end
textarea :how_does_your_organisation_inspire_others, "How does your organisation inspire other organisations to be more sustainable?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 3.4"
required
context %(
@@ -216,7 +216,7 @@ def development_step3
end
textarea :how_do_you_collaborate_with_partners, "How do you collaborate with partners and others to develop best practice?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 3.5"
required
rows 2
@@ -224,7 +224,7 @@ def development_step3
end
textarea :describe_your_organisation_diversity, "How does your organisation attract, recruit, promote and retain a diverse workforce?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 3.6"
required
context %(
@@ -237,7 +237,7 @@ def development_step3
end
textarea :describe_how_employee_relations_improved_their_motivation, "How do you ensure workforce motivation, well-being and satisfaction?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 3.7"
required
rows 2
@@ -254,7 +254,7 @@ def development_step3
end
textarea :culture_and_values_regarding_sustainability, "How is sustainability embedded in your organisation's culture and values?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 4.1"
required
rows 2
@@ -262,7 +262,7 @@ def development_step3
end
textarea :how_do_you_increase_positive_perception_of_sustainability, "How do you increase positive perceptions of your organisation's sustainability among stakeholders, such as your workforce, supply chain, customers, communities, and media?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 4.2"
context %(
@@ -281,7 +281,7 @@ def development_step3
end
textarea :what_are_your_long_term_plans_for_sustainability, "What are your long-term plans for ensuring your organisation provides the leadership, innovation or interventions to enable greater sustainable development?" do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 4.3"
required
rows 2
@@ -302,7 +302,7 @@ def development_step3
textarea :describe_your_interventions_using_un, "Which UN SDGs are your efforts targeted towards?" do
required
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
sub_ref "C 5.1"
context %(
@@ -314,7 +314,7 @@ def development_step3
end
textarea :aims_of_the_interventions, "The aims of the interventions." do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 5.2"
required
context %(
@@ -327,7 +327,7 @@ def development_step3
end
textarea :proportion_of_interventions_compared_to_organisation_size, "The proportion of these interventions compared to your whole organisation's size." do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 5.3"
required
context %(
@@ -340,7 +340,7 @@ def development_step3
end
textarea :evidence_of_exemplary_interventions, "Provide evidence of what makes your interventions exemplary." do
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
ref "C 5.4"
required
context %(
@@ -385,7 +385,7 @@ def development_step3
textarea :how_do_you_measure_the_success_of_interventions, "How do you measure the success of your sustainability intervention?" do
ref "C 6.1"
- classes "word-max-strict sub-question"
+ classes "word-max-strict sub-question text-words-max"
required
context %(
For example, are key performance indicators (KPIs) or targets used? If so, how are they set and monitored? Are the KPIs or targets being met, and what happens if they are not?
diff --git a/forms/award_years/v2025/sustainable_development/sustainable_development_step4.rb b/forms/award_years/v2025/sustainable_development/sustainable_development_step4.rb
index eeb4259add..df661f7172 100644
--- a/forms/award_years/v2025/sustainable_development/sustainable_development_step4.rb
+++ b/forms/award_years/v2025/sustainable_development/sustainable_development_step4.rb
@@ -8,6 +8,7 @@ def development_step4
textarea :explain_why_your_organisation_is_financially_viable, "Explain how your organisation is financially viable." do
ref "D 1"
+ classes "text-words-max"
required
context %(
@@ -77,7 +78,7 @@ def development_step4
end
textarea :financial_adjustments_explanation, "Explain adjustments to figures." do
- classes "sub-question word-max-strict"
+ classes "sub-question word-max-strict text-words-max"
sub_ref "D 2.4"
context %(
@@ -91,7 +92,7 @@ def development_step4
end
textarea :financial_year_date_changed_explaination, "Explain why your year-end date changed." do
- classes "sub-question"
+ classes "sub-question text-words-max"
sub_ref "D 2.5"
required
rows 2
@@ -185,7 +186,7 @@ def development_step4
end
textarea :drops_in_turnover, "If you have had any losses, drops in turnover (or income), or reductions in net profit, please explain them." do
- classes "sub-question"
+ classes "sub-question text-words-max"
sub_ref "D 4.6"
required
rows 5
@@ -206,6 +207,7 @@ def development_step4
textarea :investments_details, "Please enter details of all investments and reinvestments (capital and operating costs) in your sustainable development actions or interventions. If none, please state so." do
ref "D 5"
+ classes "text-words-max"
required
context %(
@@ -218,6 +220,7 @@ def development_step4
textarea :covid_impact_details, "Explain how your business has been responding to the economic uncertainty experienced nationally and globally in recent years." do
ref "D 6"
+ classes "text-words-max"
required
context %(
@@ -219,7 +221,7 @@ def mobility_step4
end
textarea :funding_details, "Provide details of dates, sources, types and, if relevant, amounts of the government support." do
- classes "sub-question word-max-strict"
+ classes "sub-question word-max-strict text-words-max"
sub_ref "D 6.1"
required
context %(
@@ -252,7 +254,7 @@ def mobility_step4
end
textarea :product_estimates_use, "Explain the use of estimates and how much of these are actual receipts or firm orders." do
- classes "sub-question"
+ classes "sub-question text-words-max"
sub_ref "D 7.2"
required
rows 5
diff --git a/forms/award_years/v2025/social_mobility/social_mobility_step5.rb b/forms/award_years/v2025/social_mobility/social_mobility_step5.rb
index a269ae3409..e98914bef4 100644
--- a/forms/award_years/v2025/social_mobility/social_mobility_step5.rb
+++ b/forms/award_years/v2025/social_mobility/social_mobility_step5.rb
@@ -8,6 +8,7 @@ def mobility_step5
textarea :impact_on_society, "The impact of your business operations on society." do
ref "E 1"
+ classes "text-words-max"
required
context %(
@@ -247,7 +250,7 @@ def development_step4
end
textarea :funding_details, "Provide details of dates, sources, types and, if relevant, amounts of the government support." do
- classes "sub-question word-max-strict"
+ classes "sub-question word-max-strict text-words-max"
sub_ref "D 7.1"
required
context %(
@@ -281,7 +284,7 @@ def development_step4
end
textarea :product_estimates_use, "Explain the use of estimates and how much of these are actual receipts or firm orders." do
- classes "sub-question"
+ classes "sub-question text-words-max"
sub_ref "D 8.2"
required
rows 5
diff --git a/forms/qae_form_builder/textarea_question.rb b/forms/qae_form_builder/textarea_question.rb
index 12d24100ec..30c57e766e 100644
--- a/forms/qae_form_builder/textarea_question.rb
+++ b/forms/qae_form_builder/textarea_question.rb
@@ -9,9 +9,14 @@ def errors
limit = question.delegate_obj.words_max
- if limit && limit_with_buffer(limit) && length && length > limit_with_buffer(limit)
+ if limit && limit_with_buffer(limit) && length && length > (limit_with_buffer(limit) - 1)
result[question.hash_key] ||= ""
- result[question.hash_key] << " Exceeded #{limit} words limit."
+ error = if limit_with_buffer(limit) > 15
+ " Question #{question.ref} has a word limit of #{limit}. Your answer has to be #{limit_with_buffer(limit) - 1} words or less (as we allow 10% leeway)."
+ else
+ " Question #{question.ref} has a word limit of #{limit}. Your answer has to be #{limit_with_buffer(limit) - 1} word or less."
+ end
+ result[question.hash_key] << error
end
result
diff --git a/public/ckeditor/plugins/wordcount/plugin.js b/public/ckeditor/plugins/wordcount/plugin.js
index 79c4632820..911036acee 100644
--- a/public/ckeditor/plugins/wordcount/plugin.js
+++ b/public/ckeditor/plugins/wordcount/plugin.js
@@ -293,52 +293,6 @@ CKEDITOR.plugins.add("wordcount", {
return true;
}
- //If the limit is already over, allow the deletion of characters/words. Otherwise,
- //the user would have to delete at one go the number of offending characters
- var deltaWord = wordCount - lastWordCount;
- var deltaChar = charCount - lastCharCount;
-
- lastWordCount = wordCount;
- lastCharCount = charCount;
-
- if (lastWordCount == -1) {
- lastWordCount = wordCount;
- }
- if (lastCharCount == -1) {
- lastCharCount = charCount;
- }
-
- // Check for word limit and/or char limit
- if ((config.maxWordCount > -1 && wordCount > maxWordCountWithBuffer(config.maxWordCount) && deltaWord > 0) ||
- (config.maxCharCount > -1 && charCount > config.maxCharCount && deltaChar > 0)) {
-
- limitReached(editorInstance, limitReachedNotified);
- } else if ((config.maxWordCount == -1 || wordCount <= maxWordCountWithBuffer(config.maxWordCount)) &&
- (config.maxCharCount == -1 || charCount <= config.maxCharCount)) {
-
- limitRestored(editorInstance);
- } else {
- snapShot = editorInstance.getSnapshot();
- }
-
- // Fire Custom Events
- if (config.charCountGreaterThanMaxLengthEvent && config.charCountLessThanMaxLengthEvent) {
- if (charCount > config.maxCharCount && config.maxCharCount > -1) {
- config.charCountGreaterThanMaxLengthEvent(charCount, config.maxCharCount);
- } else {
- config.charCountLessThanMaxLengthEvent(charCount, config.maxCharCount);
- }
- }
-
- if (config.wordCountGreaterThanMaxLengthEvent && config.wordCountLessThanMaxLengthEvent) {
- if (wordCount > maxWordCountWithBuffer(config.maxWordCount) && config.maxWordCount > -1) {
- config.wordCountGreaterThanMaxLengthEvent(wordCount, config.maxWordCount);
-
- } else {
- config.wordCountLessThanMaxLengthEvent(wordCount, config.maxWordCount);
- }
- }
-
return true;
}
@@ -381,53 +335,6 @@ CKEDITOR.plugins.add("wordcount", {
updateCounter(event.editor);
}, editor, null, 100);
- editor.on("paste", function(event) {
- if (config.maxWordCount > 0 || config.maxCharCount > 0) {
-
- // Check if pasted content is above the limits
- var wordCount = -1,
- charCount = -1,
- text = event.editor.getData() + event.data.dataValue;
-
-
- if (config.showCharCount) {
- charCount = countCharacters(text, event.editor);
- }
-
- if (config.showWordCount) {
- wordCount = countWords(text);
- }
-
-
- // Instantiate the notification when needed and only have one instance
- if(notification === null) {
- notification = new CKEDITOR.plugins.notification(event.editor, {
- message: event.editor.lang.wordcount.pasteWarning,
- type: 'warning',
- duration: config.pasteWarningDuration
- });
- }
-
- if (config.maxCharCount > 0 && charCount > config.maxCharCount && config.hardLimit) {
- if(!notification.isVisible()) {
- notification.show();
- }
- event.cancel();
- }
-
- if (config.maxWordCount > 0 && wordCount > maxWordCountWithBuffer(config.maxWordCount) && config.hardLimit) {
- if(!notification.isVisible()) {
- notification.show();
- }
- event.cancel();
- }
- }
- }, editor, null, 100);
-
- editor.on("afterPaste", function (event) {
- updateCounter(event.editor);
- }, editor, null, 100);
-
editor.on("blur", function () {
if (intervalId) {
window.clearInterval(intervalId);
diff --git a/spec/decorators/user_decorator_spec.rb b/spec/decorators/user_decorator_spec.rb
index 85d7f6b1d8..508e232297 100644
--- a/spec/decorators/user_decorator_spec.rb
+++ b/spec/decorators/user_decorator_spec.rb
@@ -7,6 +7,7 @@
last_name: "Bar",
role: "account_admin",
company_name: "Umbrella Corporation",
+ account: Account.new(owner: User.new),
)
}
@@ -95,6 +96,13 @@
end
describe "#role_name" do
+ context "when user is account owner" do
+ it "returns Account owner" do
+ user.account.owner = user
+ expect(subject.role_name).to eq("Account owner")
+ end
+ end
+
context "when user is account_admin" do
it "returns Admin and collaborator" do
user.role = "account_admin"
diff --git a/spec/fixtures/form_answer_innovation.json b/spec/fixtures/form_answer_innovation.json
index 80a26f0a7b..371df991ab 100644
--- a/spec/fixtures/form_answer_innovation.json
+++ b/spec/fixtures/form_answer_innovation.json
@@ -8,6 +8,7 @@
"sales_5of5": "0",
"roi_details": "1",
"website_url": "www.example.com",
+"social_media_links": "\u003cp\u003eFacebook: https://www.facebook.com/MassiveDynamics\u003c/p\u003e\r\n\r\n\u003cp\u003eLinkedIn: https://www.linkedin.com/company/massive-dynamics/mycompany/\u003c/p\u003e\r\n\r\n\u003cp\u003eInstagram: https://www.instagram.com/massivedynamics/\u003c/p\u003e\r\n\r\n\u003cp\u003eYouTube: https://www.youtube.com/@massive-dynamics\u003c/p\u003e\r\n\r\n\u003cp\u003e\r\n",
"applying_for": "organisation",
"company_name": "1231",
"exports_1of2": "1000000",
diff --git a/spec/fixtures/form_answer_mobility.json b/spec/fixtures/form_answer_mobility.json
index 04af92b6ab..f861f46d0b 100644
--- a/spec/fixtures/form_answer_mobility.json
+++ b/spec/fixtures/form_answer_mobility.json
@@ -5,6 +5,7 @@
"product_age": "4",
"roi_details": "1",
"website_url": "example.com",
+"social_media_links": "\u003cp\u003eFacebook: https://www.facebook.com/MassiveDynamics\u003c/p\u003e\r\n\r\n\u003cp\u003eLinkedIn: https://www.linkedin.com/company/massive-dynamics/mycompany/\u003c/p\u003e\r\n\r\n\u003cp\u003eInstagram: https://www.instagram.com/massivedynamics/\u003c/p\u003e\r\n\r\n\u003cp\u003eYouTube: https://www.youtube.com/@massive-dynamics\u003c/p\u003e\r\n\r\n\u003cp\u003e\r\n",
"applying_for": "organisation",
"company_name": "1231",
"exports_1of3": "",
diff --git a/spec/fixtures/form_answer_promotion.json b/spec/fixtures/form_answer_promotion.json
index 7fcea10607..5737e2cd78 100644
--- a/spec/fixtures/form_answer_promotion.json
+++ b/spec/fixtures/form_answer_promotion.json
@@ -2,6 +2,7 @@
"supporters": "[\"{\\\"supporter_id\\\":\\\"\\\",\\\"first_name\\\":\\\"\\\",\\\"last_name\\\":\\\"\\\",\\\"relationship_to_nominee\\\":\\\"\\\",\\\"email\\\":\\\"\\\"}\",\"{\\\"supporter_id\\\":33,\\\"first_name\\\":\\\"1\\\",\\\"last_name\\\":\\\"2\\\",\\\"relationship_to_nominee\\\":\\\"3\\\",\\\"email\\\":\\\"4@ex.com\\\"}\",\"{\\\"supporter_id\\\":34,\\\"first_name\\\":\\\"1\\\",\\\"last_name\\\":\\\"2\\\",\\\"relationship_to_nominee\\\":\\\"3\\\",\\\"email\\\":\\\"4@ex.com\\\"}\"]",
"former_name": "1",
"website_url": "www.example.com",
+"social_media_links": "\u003cp\u003eFacebook: https://www.facebook.com/MassiveDynamics\u003c/p\u003e\r\n\r\n\u003cp\u003eLinkedIn: https://www.linkedin.com/company/massive-dynamics/mycompany/\u003c/p\u003e\r\n\r\n\u003cp\u003eInstagram: https://www.instagram.com/massivedynamics/\u003c/p\u003e\r\n\r\n\u003cp\u003eYouTube: https://www.youtube.com/@massive-dynamics\u003c/p\u003e\r\n\r\n\u003cp\u003e\r\n",
"award_holder": "no",
"nominee_email": "testo@example.com",
"nominee_phone": "123123",
diff --git a/spec/fixtures/form_answer_trade.json b/spec/fixtures/form_answer_trade.json
index 66e2f5a9ff..907db434d0 100644
--- a/spec/fixtures/form_answer_trade.json
+++ b/spec/fixtures/form_answer_trade.json
@@ -1,6 +1,7 @@
{"head_of_business_email": "ceo@example.com",
"export_unit": "yes",
"website_url": "www.example.com",
+"social_media_links": "\u003cp\u003eFacebook: https://www.facebook.com/MassiveDynamics\u003c/p\u003e\r\n\r\n\u003cp\u003eLinkedIn: https://www.linkedin.com/company/massive-dynamics/mycompany/\u003c/p\u003e\r\n\r\n\u003cp\u003eInstagram: https://www.instagram.com/massivedynamics/\u003c/p\u003e\r\n\r\n\u003cp\u003eYouTube: https://www.youtube.com/@massive-dynamics\u003c/p\u003e\r\n\r\n\u003cp\u003e\r\n",
"applying_for": "organisation",
"company_name": "123134",
"export_agent": "yes",
diff --git a/spec/support/shared_contexts/admin_case_summary_pdf_file_checks.rb b/spec/support/shared_contexts/admin_case_summary_pdf_file_checks.rb
index fbe239fe80..bc512587b7 100644
--- a/spec/support/shared_contexts/admin_case_summary_pdf_file_checks.rb
+++ b/spec/support/shared_contexts/admin_case_summary_pdf_file_checks.rb
@@ -38,7 +38,7 @@
let(:pdf_content) do
rendered_pdf = pdf_generator.render
- PDF::Inspector::Text.analyze(rendered_pdf).strings
+ PDF::Inspector::Text.analyze(rendered_pdf).strings.join
end
let(:urn) do
@@ -49,6 +49,14 @@
"Applicant: #{form_answer.decorate.company_nominee_or_application_name}"
end
+ let(:website_url) do
+ "Website address: #{form_answer.decorate.website_url}"
+ end
+
+ let(:social_media_links) do
+ "Links to social media accounts: facebook.com/MassiveDynamics, linkedin.com/company/massive-dynamics/mycompany/,instagram.com/massivedynamics/, youtube.com/@massive-dynamics"
+ end
+
let(:award_general_information) do
"#{SharedPdfHelpers::DrawElements::AWARD_GENERAL_INFO_PREFIX} #{form_answer.award_year.year}"
end
@@ -61,6 +69,8 @@
it "should include main header information" do
expect(pdf_content).to include(urn)
expect(pdf_content).to include(applicant)
+ expect(pdf_content).to include(website_url)
+ expect(pdf_content).to include(social_media_links)
expect(pdf_content).to include(award_general_information)
expect(pdf_content).to include(award_title)
end
diff --git a/spec/support/shared_contexts/admin_feedback_pdf_file_checks.rb b/spec/support/shared_contexts/admin_feedback_pdf_file_checks.rb
index dcd215209d..9a51436834 100644
--- a/spec/support/shared_contexts/admin_feedback_pdf_file_checks.rb
+++ b/spec/support/shared_contexts/admin_feedback_pdf_file_checks.rb
@@ -40,7 +40,7 @@
let(:pdf_content) do
rendered_pdf = pdf_generator.render
- PDF::Inspector::Text.analyze(rendered_pdf).strings
+ PDF::Inspector::Text.analyze(rendered_pdf).strings.join
end
let(:urn) do