From 97e990a9614fa2594b689ff02978fe31deda7f3a Mon Sep 17 00:00:00 2001 From: phil-l-brockwell Date: Tue, 7 Jan 2025 10:01:21 +0000 Subject: [PATCH] Add new constants for 2026 awards --- app/models/award_year.rb | 2 +- forms/appraisal_form.rb | 174 +++++++++++++++++- .../form_answers/previous_winnings_spec.rb | 6 +- .../form_answers/past_applications_spec.rb | 1 - 4 files changed, 177 insertions(+), 6 deletions(-) diff --git a/app/models/award_year.rb b/app/models/award_year.rb index 2ea6788a4..d29e018a3 100644 --- a/app/models/award_year.rb +++ b/app/models/award_year.rb @@ -18,7 +18,7 @@ class AwardYear < ApplicationRecord after_create :create_settings - AVAILABLE_YEARS = [2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025] + AVAILABLE_YEARS = [2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026] DEFAULT_FINANCIAL_DEADLINE_DAY = 17 DEFAULT_FINANCIAL_DEADLINE_MONTH = 9 diff --git a/forms/appraisal_form.rb b/forms/appraisal_form.rb index 4303cefd0..2595238fe 100644 --- a/forms/appraisal_form.rb +++ b/forms/appraisal_form.rb @@ -2,7 +2,7 @@ class AppraisalForm # # THIS NEED TO BE UPDATED EACH YEAR # - SUPPORTED_YEARS = [2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025] + SUPPORTED_YEARS = [2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026] RAG_OPTIONS_2016 = [ %w[Red negative], @@ -64,6 +64,12 @@ class AppraisalForm %w[Green positive], ] + RAG_OPTIONS_2026 = [ + %w[Red negative], + %w[Amber average], + %w[Green positive], + ] + CSR_RAG_OPTIONS_2016 = [ ["Weak (0-15)", "negative"], ["Satisfactory (16-31)", "average"], @@ -124,6 +130,12 @@ class AppraisalForm ["Exceeds", "positive"], ] + CSR_RAG_OPTIONS_2026 = [ + ["Doesn't Meet", "negative"], + ["Meets", "average"], + ["Exceeds", "positive"], + ] + STRENGTH_OPTIONS_2016 = [ ["Insufficient Information Supplied", "neutral"], ["Priority Focus for Development", "negative"], @@ -194,6 +206,13 @@ class AppraisalForm ["Key Strength", "positive"], ] + STRENGTH_OPTIONS_2026 = [ + ["Insufficient Information Supplied", "neutral"], + ["Priority Focus for Development", "negative"], + ["Positive - Scope for Ongoing Development", "average"], + ["Key Strength", "positive"], + ] + VERDICT_OPTIONS_2016 = [ ["Not Recommended", "negative"], ["Reserved", "average"], @@ -254,6 +273,12 @@ class AppraisalForm ["Recommended", "positive"], ] + VERDICT_OPTIONS_2026 = [ + ["Not Recommended", "negative"], + ["Reserved", "average"], + ["Recommended", "positive"], + ] + def self.rag_options_for(object, section) options = if section.desc.include?("corporate_social_responsibility") const_get("CSR_RAG_OPTIONS_#{object.award_year.year}") @@ -607,6 +632,34 @@ def self.verdict_options_for(object, section) }, } + TRADE_2026 = { + overseas_earnings_growth: { + type: :rag, + label: "Overseas earnings growth:", + position: 0, + }, + commercial_success: { + type: :rag, + label: "Commercial success:", + position: 1, + }, + strategy: { + type: :rag, + label: "Strategy:", + position: 2, + }, + corporate_social_responsibility: { + type: :rag, + label: "Environmental, social and corporate governance (section E):", + position: 3, + }, + verdict: { + type: :verdict, + label: "Overall verdict:", + position: 4, + }, + } + INNOVATION_2016 = { level_of_innovation: { type: :rag, @@ -882,6 +935,34 @@ def self.verdict_options_for(object, section) }, } + INNOVATION_2026 = { + level_of_innovation: { + type: :rag, + label: "Level of innovation:", + position: 0, + }, + extent_of_value_added: { + type: :rag, + label: "Extent of value added:", + position: 1, + }, + impact_of_innovation: { + type: :rag, + label: "Impact of innovation:", + position: 2, + }, + corporate_social_responsibility: { + type: :rag, + label: "Environmental, social and corporate governance (section E):", + position: 3, + }, + verdict: { + type: :verdict, + label: "Overall verdict:", + position: 4, + }, + } + PROMOTION_2016 = { nature_of_activities: { type: :rag, @@ -1157,6 +1238,34 @@ def self.verdict_options_for(object, section) }, } + PROMOTION_2026 = { + nature_of_activities: { + type: :rag, + label: "Nature (breadth) of activities:", + position: 0, + }, + impact_achievement: { + type: :rag, + label: "Impact/achievement:", + position: 1, + }, + level_of_support: { + type: :rag, + label: "Level of support:", + position: 2, + }, + corporate_social_responsibility: { + type: :rag, + label: "Corporate social responsibility (section D):", + position: 3, + }, + verdict: { + type: :verdict, + label: "Overall verdict:", + position: 4, + }, + } + DEVELOPMENT_2016 = { product_service_contribution: { type: :rag, @@ -1502,6 +1611,29 @@ def self.verdict_options_for(object, section) }, } + DEVELOPMENT_2026 = { + strategy_and_targets: { + type: :rag, + label: "Strategy and Targets - 25% max:", + position: 0, + }, + approach: { + type: :rag, + label: "Approach - 25% max:", + position: 1, + }, + positive_impacts: { + type: :rag, + label: "Positive Impacts - 50% max:", + position: 2, + }, + verdict: { + type: :verdict, + label: "Overall verdict:", + position: 3, + }, + } + MOBILITY_2016 = { mobility_organisation_aiming_to_achieve: { type: :rag, @@ -1792,6 +1924,34 @@ def self.verdict_options_for(object, section) }, }.freeze + MOBILITY_2026 = { + mobility_organisation_aiming_to_achieve: { + type: :rag, + label: "The Social Mobility programme and its context:", + position: 0, + }, + mobility_embedding_info: { + type: :rag, + label: "Embedding the programme & Organisational culture:", + position: 1, + }, + mobility_impact_of_the_programme: { + type: :rag, + label: "Impact of the programme:", + position: 2, + }, + corporate_social_responsibility: { + type: :rag, + label: "Environmental, social and corporate governance (section E):", + position: 3, + }, + verdict: { + type: :verdict, + label: "Overall verdict:", + position: 4, + }, + }.freeze + MODERATED_2016 = { verdict: { type: :verdict, @@ -1862,6 +2022,13 @@ def self.verdict_options_for(object, section) }, } + MODERATED_2026 = { + verdict: { + type: :verdict, + label: "Overall verdict:", + }, + } + CASE_SUMMARY_METHODS_2016 = [ :application_background_section_desc, ] @@ -1902,6 +2069,10 @@ def self.verdict_options_for(object, section) :application_background_section_desc, ] + CASE_SUMMARY_METHODS_2026 = [ + :application_background_section_desc, + ] + ALL_FORMS_2016 = [TRADE_2016, INNOVATION_2016, PROMOTION_2016, DEVELOPMENT_2016, MOBILITY_2016] ALL_FORMS_2017 = [TRADE_2017, INNOVATION_2017, PROMOTION_2017, DEVELOPMENT_2017, MOBILITY_2017] ALL_FORMS_2018 = [TRADE_2018, INNOVATION_2018, PROMOTION_2018, DEVELOPMENT_2018, MOBILITY_2018] @@ -1912,6 +2083,7 @@ def self.verdict_options_for(object, section) ALL_FORMS_2023 = [TRADE_2023, INNOVATION_2023, PROMOTION_2023, DEVELOPMENT_2023, MOBILITY_2023] ALL_FORMS_2024 = [TRADE_2024, INNOVATION_2024, PROMOTION_2024, DEVELOPMENT_2024, MOBILITY_2024] ALL_FORMS_2025 = [TRADE_2025, INNOVATION_2025, PROMOTION_2025, DEVELOPMENT_2025, MOBILITY_2025] + ALL_FORMS_2026 = [TRADE_2026, INNOVATION_2026, PROMOTION_2026, DEVELOPMENT_2026, MOBILITY_2026] def self.rate(key) "#{key}_rate" diff --git a/spec/features/admin/form_answers/previous_winnings_spec.rb b/spec/features/admin/form_answers/previous_winnings_spec.rb index a0c9f2656..4b458ba92 100644 --- a/spec/features/admin/form_answers/previous_winnings_spec.rb +++ b/spec/features/admin/form_answers/previous_winnings_spec.rb @@ -17,7 +17,7 @@ it "adds previous winning" do within ".previous-wins-form" do first("option[value='innovation']").select_option - first("option[value='2015']").select_option + first("option[value='2016']").select_option find("input[type='submit']").click end within ".previous-wins-form" do @@ -32,8 +32,8 @@ form = create(:form_answer, :trade) form.document["applied_for_queen_awards_details"] = [ - { "category" => "international_trade", "year" => "2015", "outcome" => "won" }, - { "category" => "international_trade", "year" => "2015", "outcome" => "won" }, + { "category" => "international_trade", "year" => "2016", "outcome" => "won" }, + { "category" => "international_trade", "year" => "2016", "outcome" => "won" }, ] form.update_column(:document, form.document) diff --git a/spec/features/users/form_answers/past_applications_spec.rb b/spec/features/users/form_answers/past_applications_spec.rb index 8a24b1e45..628463a60 100644 --- a/spec/features/users/form_answers/past_applications_spec.rb +++ b/spec/features/users/form_answers/past_applications_spec.rb @@ -68,7 +68,6 @@ end it "should display past successful applications" do - # save_and_open_page expect(page).to have_selector("div.dashboard-post-submission", count: 1) end end