Skip to content

Commit

Permalink
Add new constants for 2026 awards
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-l-brockwell committed Jan 20, 2025
1 parent f219de8 commit 97e990a
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/models/award_year.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
174 changes: 173 additions & 1 deletion forms/appraisal_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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}")
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
]
Expand Down Expand Up @@ -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]
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions spec/features/admin/form_answers/previous_winnings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
1 change: 0 additions & 1 deletion spec/features/users/form_answers/past_applications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97e990a

Please sign in to comment.