diff --git a/features/show_hide_columns.feature b/features/show_hide_columns.feature index 84b1bd30..1d3ac6e0 100644 --- a/features/show_hide_columns.feature +++ b/features/show_hide_columns.feature @@ -1,6 +1,6 @@ Feature: Show/hide a forecast column - Scenario: Clicking the NAC column hide link hides the NAC column - Given the user wants to hide the NAC column - When the user clicks the hide NAC column - Then the NAC column is hidden + Scenario: Clicking the NAC code column hide link hides the NAC code column + Given the user wants to hide the NAC code column + When the user clicks the hide NAC code column + Then the NAC code column is hidden diff --git a/features/steps/show_hide_columns.py b/features/steps/show_hide_columns.py index 0d571bbd..1d378971 100644 --- a/features/steps/show_hide_columns.py +++ b/features/steps/show_hide_columns.py @@ -7,13 +7,13 @@ from features.environment import TEST_COST_CENTRE_CODE, create_test_user -@given("the user wants to hide the NAC column") +@given("the user wants to hide the NAC code column") def step_impl(context): create_test_user(context) context.browser.get(f"{context.base_url}/forecast/edit/{TEST_COST_CENTRE_CODE}/") -@when("the user clicks the hide NAC column") +@when("the user clicks the hide NAC code column") def step_impl(context): filter_switch_button = WebDriverWait(context.browser, 500).until( ec.presence_of_element_located((By.ID, "action-bar-switch")) @@ -21,13 +21,13 @@ def step_impl(context): filter_switch_button.click() - show_hide_nac = WebDriverWait(context.browser, 500).until( - ec.presence_of_element_located((By.ID, "show_hide_nac")) + show_hide_nac_code = WebDriverWait(context.browser, 500).until( + ec.presence_of_element_located((By.ID, "show_hide_nac_code")) ) - show_hide_nac.click() + show_hide_nac_code.click() -@then("the NAC column is hidden") +@then("the NAC code column is hidden") def step_impl(context): header_hidden = False diff --git a/front_end/src/Components/ActualsHeaderRow/index.jsx b/front_end/src/Components/ActualsHeaderRow/index.jsx index f99ce4b2..a0b828d7 100644 --- a/front_end/src/Components/ActualsHeaderRow/index.jsx +++ b/front_end/src/Components/ActualsHeaderRow/index.jsx @@ -1,14 +1,24 @@ import React, { useEffect, useState } from "react"; +import { useSelector } from "react-redux"; const ActualsHeaderRow = () => { - const [numActuals, setNumActuals] = useState(0); + const [actualsCount, setActualsCount] = useState(0); + + const hiddenColsCount = useSelector( + (state) => state.hiddenCols.hiddenCols.length, + ); + + // Number of columns from Select All to Budget + const colsBeforeMonths = 9; + // Number of columns from Apr to Variance % + const forecastColCount = 18; useEffect(() => { const timer = () => { setTimeout(() => { if (window.actuals) { if (window.actuals.length > 0) { - setNumActuals(window.actuals.length); + setActualsCount(window.actuals.length); } } else { timer(); @@ -20,17 +30,23 @@ const ActualsHeaderRow = () => { return (