diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7261b681b..5d980e5b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,8 +110,10 @@ jobs: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} run: | npm install -g yarn - curl -v -L -o cf-cli_amd64.deb 'https://cli.run.pivotal.io/stable?release=debian64&source=github' - sudo dpkg -i cf-cli_amd64.deb + wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - + echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list + sudo apt-get update + sudo apt-get install cf7-cli cf -v cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org cf install-plugin blue-green-deploy -r CF-Community -f diff --git a/app/assets/javascripts/admin/applications-filter.js.coffee b/app/assets/javascripts/admin/applications-filter.js.coffee index 1b1f412be..35213169c 100644 --- a/app/assets/javascripts/admin/applications-filter.js.coffee +++ b/app/assets/javascripts/admin/applications-filter.js.coffee @@ -132,11 +132,17 @@ filterApplicationsDropdowns = () -> dropdownWrapper.removeClass("hide") dropdown = dropdownWrapper.find(".dropdown-toggle") dropdown.focus().click() + $(this).prop('disabled', true); else selected_year = $(this).val() $(this).closest(".input__award-years").find("select option[value='#{selected_year}']").attr('selected', true).change() + $(this).prop('disabled', true); $(this).closest('form').submit() + # If other option is selected on page load, disable the radio button + if $(".applications-filter .input__award-years input[type='radio']:checked").attr('id') == "other" + $(".applications-filter .input__award-years input[type='radio']:checked").prop('disabled', true); + # On clicking the award year from the other year dropdown $(document).on "click", ".applications-filter .other-years-dropdown .dropdown-menu li", (e) -> e.stopPropagation() @@ -146,4 +152,11 @@ filterApplicationsDropdowns = () -> $(this).closest(".input__award-years").find("select option[value='#{selected_year}']").attr('selected', true).change() $(this).closest('form').submit() + # On clicking the search button disable the radio button input + $(document).on "click", ".applications-filter .search-input input.search-submit", (e) -> + e.stopPropagation() + e.preventDefault() + $(".applications-filter .input__award-years input[type='radio']:checked").prop('disabled', true); + $(this).closest('form').submit() + $(document).ready(ready) diff --git a/app/assets/stylesheets/admin/base.scss b/app/assets/stylesheets/admin/base.scss index b339e12cc..5f3da1585 100644 --- a/app/assets/stylesheets/admin/base.scss +++ b/app/assets/stylesheets/admin/base.scss @@ -1583,9 +1583,9 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { } .btn-rag { - position: absolute; right: 0; top: pxToRem(-5); + padding-right: pxToRem(5); @include screen-xs-max { display: block; @@ -1598,6 +1598,25 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { } } + .btn { + padding-left: pxToRem(5) !important; + + &.rag-positive { + background-color: #CCE1D8; + color: #015A30 !important; + } + + &.rag-average { + background-color: #C0D3E8; + color: #152C48 !important; + } + + &.rag-negative { + background-color: #F6D7D2; + color: #942415 !important; + } + } + .strengths-section & { @include screen-lg-max { display: block; @@ -1624,7 +1643,7 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { .caret { position: absolute; top: 50%; - right: 0; + right: pxToRem(5); margin-top: pxToRem(-2); } @@ -1635,7 +1654,7 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { } .dropdown-toggle { - padding-right: pxToRem(25); + padding-right: pxToRem(20); padding-left: 0; @include screen-xs-max { @@ -1655,10 +1674,6 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { } } - &.rag-editable .dropdown-toggle { - padding-right: pxToRem(40); - } - .dropdown-menu { &.pull-right { @include screen-xs-max { @@ -1692,88 +1707,14 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { color: #a94442 !important; } - .rag-blank { - &, - a, - a:hover, - a:focus { - color: $black; - } - - .icon-rag { - background-image: image-url("icon-grade-blank.png"); - - @include is-retina { - background-image: image-url("icon-grade-blank@2.png"); - } - } - } - - .rag-neutral { + .rag-blank, .rag-neutral, .rag-positive, .rag-average, .rag-negative { &, a, a:hover, a:focus { color: $black; - } - - .icon-rag { - background-image: image-url("icon-grade-neutral.png"); - - @include is-retina { - background-image: image-url("icon-grade-neutral@2.png"); - } - } - } - - .rag-positive { - &, - a, - a:hover, - a:focus { - color: $green; - } - - .icon-rag { - background-image: image-url("icon-grade-green.png"); - - @include is-retina { - background-image: image-url("icon-grade-green@2.png"); - } - } - } - - .rag-average { - &, - a, - a:hover, - a:focus { - color: $amber; - } - - .icon-rag { - background-image: image-url("icon-grade-amber.png"); - - @include is-retina { - background-image: image-url("icon-grade-amber@2.png"); - } - } - } - - .rag-negative { - &, - a, - a:hover, - a:focus { - color: $red; - } - - .icon-rag { - background-image: image-url("icon-grade-red.png"); - - @include is-retina { - background-image: image-url("icon-grade-red@2.png"); - } + text-decoration: none; + font: normal pxToRem(16) 'Arial', sans-serif; } } @@ -1785,6 +1726,7 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { a:hover, a:focus { text-decoration: none; + font-weight: normal; } } } diff --git a/app/controllers/form_award_eligibilities_controller.rb b/app/controllers/form_award_eligibilities_controller.rb index 6ad0be272..5e0088325 100644 --- a/app/controllers/form_award_eligibilities_controller.rb +++ b/app/controllers/form_award_eligibilities_controller.rb @@ -39,7 +39,7 @@ def show @award_eligibility.force_validate_now = true @award_eligibility.valid? - step = @award_eligibility.errors.keys.first + step = @award_eligibility.errors.try(:keys).try(:first) end if step 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 6fa2e6e90..15459743e 100644 --- a/app/pdf_generators/case_summary_pdfs/general/data_pointer.rb +++ b/app/pdf_generators/case_summary_pdfs/general/data_pointer.rb @@ -4,9 +4,9 @@ module CaseSummaryPdfs::General::DataPointer "sustainable_development" => "Sustainable Development" } COLOR_LABELS = %w[positive average negative neutral] - POSITIVE_COLOR = "6B8E23" - AVERAGE_COLOR = "DAA520" - NEGATIVE_COLOR = "FF0000" + POSITIVE_COLOR = "017E44" + AVERAGE_COLOR = "2C5C96" + NEGATIVE_COLOR = "B72C1A" NEUTRAL_COLOR = "ECECEC" LINK_REGEXP = /((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.-]+[.][a-z]{2,4}\/)(?:[^\s()<>`!{}:;'"\[\]]*))/im @@ -186,9 +186,9 @@ def render_items end pdf_doc.text entry[0], header_text_properties + pdf_doc.move_down 3.mm pdf_doc.text entry[2], header_text_properties.merge({ color: color_by_value(entry[2], year) }) - pdf_doc.move_down 5.mm pdf_doc.text entry[1], header_text_properties.merge({ style: :normal }) diff --git a/app/views/admin/form_answers/appraisal_form_components/_rag_section.html.slim b/app/views/admin/form_answers/appraisal_form_components/_rag_section.html.slim index e565c9f92..19b24e6bd 100644 --- a/app/views/admin/form_answers/appraisal_form_components/_rag_section.html.slim +++ b/app/views/admin/form_answers/appraisal_form_components/_rag_section.html.slim @@ -4,28 +4,28 @@ .form-group.rag-section[class="#{'form-edit' if f.object.public_send(section.desc).blank? && editable} form-#{section.label.parameterize}" data-controller="element-focus"] .form-container + label.form-label.form-label-rag for="#{f.object.position}_#{section.desc}_comment" + span.rag_section_label + = section.label + = f.input section.rate, as: :select, label: false, collection: form.options, input_html: { class: "if-js-hide", "data-updated-section" => section.rate, id: "#{f.object.position}_#{section.desc}_select" } - label.form-label.form-label-rag for="#{f.object.position}_#{section.desc}_comment" - span.rag_section_label - = section.label - .btn-group.btn-rag class="#{'rag-editable' if editable}" - button.btn.btn-link.dropdown-toggle type="button" data-toggle="dropdown" aria-expanded="false" class="rag-#{form.option[1]}" - span.rag-text= form.option[0] - span.glyphicon.icon-rag - - if editable - span.caret + .btn-group.btn-rag.if-no-js-hide class="#{'rag-editable' if editable}" + button.btn.dropdown-toggle type="button" data-toggle="dropdown" aria-expanded="false" class="rag-#{form.option[1]} rag_#{f.object.public_send(section.rate)}" + span.rag-text= form.option[0] - if editable - ul.dropdown-menu.pull-right role="menu" - - form.options.each do |opt| - li class="rag-#{opt[1]}" - = link_to "#" - span.icon-rag - span.rag-text= opt[0] + span.caret + - if editable + ul.dropdown-menu role="menu" + - form.options.each do |opt| + li class="rag-#{opt[1]}" + = link_to "#" + span.icon-rag + span.rag-text= opt[0] .form-value p diff --git a/app/views/admin/form_answers/appraisal_form_components/_verdict_section.html.slim b/app/views/admin/form_answers/appraisal_form_components/_verdict_section.html.slim index a862dd28f..84680a35d 100644 --- a/app/views/admin/form_answers/appraisal_form_components/_verdict_section.html.slim +++ b/app/views/admin/form_answers/appraisal_form_components/_verdict_section.html.slim @@ -4,15 +4,16 @@ .form-group.verdict-section[class="#{'form-edit' if f.object.public_send(section.desc).blank? && editable} form-#{section.label.parameterize}" data-controller="element-focus"] .form-container + label.form-label.form-label-rag for="#{f.object.position}_verdict" + = section.label + = f.input section.rate, as: :select, label: false, collection: form.options, input_html: { class: "if-js-hide", "data-updated-section" => section.desc, id: "#{f.object.position}_#{section.desc}_select"} - label.form-label.form-label-rag for="#{f.object.position}_verdict" - = section.label - .btn-group.btn-rag class="#{'rag-editable' if rag_editable}" + .btn-group.btn-rag.if-no-js-hide class="#{'rag-editable' if rag_editable}" button.btn.btn-link.dropdown-toggle class="#{'non-editable' if !rag_editable}" type="button" data-toggle="dropdown" aria-expanded="false" class="rag-#{form.option[1]}" span.rag-text= form.option[0] span.glyphicon.icon-rag diff --git a/app/views/shared/form_answers/_admin_award_year.html.slim b/app/views/shared/form_answers/_admin_award_year.html.slim index f714c97cf..b1fc74bda 100644 --- a/app/views/shared/form_answers/_admin_award_year.html.slim +++ b/app/views/shared/form_answers/_admin_award_year.html.slim @@ -1,5 +1,5 @@ - current_year = AwardYear.current.year -- selected_year = params[:year] ? params[:year].to_i : current_year +- selected_year = params[:year] ? params[:year].to_i : namespace_name == :admin ? 'all_years' : current_year - other_years = AwardYear.admin_switch.keys.select{ |year| year <= current_year } fieldset.award-year-z-index.applications-filter.award-year-radios @@ -7,19 +7,19 @@ fieldset.award-year-z-index.applications-filter.award-year-radios ' Award year .input__award-years .if-no-js-hide - input type="radio" id="current_year" name="award_year" value="#{current_year}" checked=(current_year == params[:year].to_i || (namespace_name == :assessor && other_years.exclude?(params[:year].to_i))) + input type="radio" id="current_year" name="year" value="#{current_year}" checked=(current_year == params[:year].to_i || (namespace_name == :assessor && other_years.exclude?(params[:year].to_i))) label for="current_year" | Current year - input type="radio" id="all_years" name="award_year" value="all_years" checked=(params[:year].to_s == 'all_years' || (namespace_name == :admin && other_years.exclude?(params[:year].to_i))) + input type="radio" id="all_years" name="year" value="all_years" checked=(params[:year].to_s == 'all_years' || (namespace_name == :admin && other_years.exclude?(params[:year].to_i))) label for="all_years" | All years - input type="radio" id="other" name="award_year" value="#{selected_year}" checked=(current_year != selected_year && other_years.include?(params[:year].to_i)) + input type="radio" id="other" name="year" value="#{selected_year}" checked=(current_year != selected_year && other_years.include?(params[:year].to_i)) label for="other" | Other .dropdown.other-years-dropdown class="#{(current_year != selected_year && other_years.include?(params[:year].to_i) ? '' : 'hide')}" a.dropdown-toggle.btn.btn-block.btn-default href="#" data-toggle="dropdown" role="button" aria-expanded="false" - - current_year_text = params[:year].to_s == "all_years" || !params[:year] || !other_years.include?(params[:year].to_i) ? "All Years" : "#{selected_year - 1} - #{selected_year}" + - current_year_text = params[:year].to_s == "all_years" || !params[:year] || !other_years.include?(params[:year].to_i) || selected_year == "all_years" ? "All Years" : "#{selected_year - 1} - #{selected_year}" = current_year_text span.caret-container diff --git a/forms/appraisal_form.rb b/forms/appraisal_form.rb index 03fee18eb..816562bd0 100644 --- a/forms/appraisal_form.rb +++ b/forms/appraisal_form.rb @@ -59,9 +59,9 @@ class AppraisalForm ] RAG_OPTIONS_2025 = [ - %w[Red negative], - %w[Amber average], - %w[Green positive], + ["Does not meet expectations", "negative"], + ["Meets expectations", "average"], + ["Exceeds expectations", "positive"], ] CSR_RAG_OPTIONS_2016 = [ @@ -263,7 +263,7 @@ def self.rag_options_for(object, section) option = options.detect do |opt| opt[1] == object.public_send(section.rate) - end || ["Select RAG", "blank"] + end || ["Select evaluation", "blank"] OpenStruct.new( options: options, diff --git a/spec/support/shared_contexts/appraisal_form_context.rb b/spec/support/shared_contexts/appraisal_form_context.rb index 443c85001..e45a3e284 100644 --- a/spec/support/shared_contexts/appraisal_form_context.rb +++ b/spec/support/shared_contexts/appraisal_form_context.rb @@ -72,14 +72,14 @@ def assert_rag_change(section_id, header_id) expect(page).to have_css(section_id) # Forces capybara to wait for the section to become visible within section_id do - expect(page).to have_selector(rag, text: "Select RAG", count: 4) + expect(page).to have_selector(rag, text: "Select evaluation", count: 4) expect(page).to have_selector(rag, text: "Select verdict", count: 1) first(".btn-rag").click find(".dropdown-menu .rag-negative").click wait_for_ajax - expect(page).to have_selector(rag, text: "Select RAG", count: 3) - expect(page).to have_selector(rag, text: "Red", count: 1) + expect(page).to have_selector(rag, text: "Select evaluation", count: 3) + expect(page).to have_selector(rag, text: "Does not meet expectations", count: 1) expect(page).to have_selector(rag, text: "Select verdict", count: 1) end @@ -89,8 +89,8 @@ def assert_rag_change(section_id, header_id) take_a_nap within section_id do - expect(page).to have_selector(rag, text: "Select RAG", count: 3) - expect(page).to have_selector(rag, text: "Red", count: 1) + expect(page).to have_selector(rag, text: "Select evaluation", count: 3) + expect(page).to have_selector(rag, text: "Does not meet expectations", count: 1) expect(page).to have_selector(rag, text: "Select verdict", count: 1) end visit show_path