diff --git a/.github/workflows/increment_sub_hash.yml b/.github/workflows/increment_sub_hash.yml new file mode 100644 index 000000000..11f5e4cc2 --- /dev/null +++ b/.github/workflows/increment_sub_hash.yml @@ -0,0 +1,49 @@ +name: Update Submodule Hash + +on: + workflow_dispatch: + +jobs: + update-submodule: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository without submodules + uses: actions/checkout@v4 + with: + submodules: false # Do not checkout submodules initially + fetch-depth: 0 # Necessary to fetch all history for branch creation + + - name: Make PR Branch + run: git checkout -b update-submodule-hash-${{ github.run_id }} + + - name: Initialize and update submodule + run: | + git submodule update --init --recursive usagov-2021 + cd usagov-2021/ + git checkout origin/main + + - name: Checkout submodule to latest main + run: | + cd usagov-2021 + git config user.name "Hash Pipeline" + git config user.email "hash@pipeline.com" + git fetch + latest_commit=$(git rev-parse origin/main) + git checkout $latest_commit + + - name: Commit changes if there are any + run: | + cd .. + git add usagov-2021 + git commit -m "Updated submodule to latest commit $latest_commit" || echo "No changes to commit" + git push --set-upstream origin update-submodule-hash-${{ github.run_id }} + + - name: Create Pull Request + uses: repo-sync/pull-request@v2 + with: + github_token: ${{ secrets.ADD_TO_PROJECT_PAT }} + pr_title: "Update Submodule to Latest Commit" + pr_body: "This pull request updates the submodule to the latest commit on main." + pr_label: "automated-pr" + destination_branch: ${{ github.ref_name }} diff --git a/benefit-finder/src/shared/components/Icon/index_icons.jsx b/benefit-finder/src/shared/components/Icon/index_icons.jsx index 325efe4e3..bec6e50fd 100644 --- a/benefit-finder/src/shared/components/Icon/index_icons.jsx +++ b/benefit-finder/src/shared/components/Icon/index_icons.jsx @@ -4,87 +4,261 @@ import Colors from '../../styles/colors/_index.js' // all-benefits export const AllBenefits = () => ( - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ) diff --git a/benefit-finder/src/shared/utils/errorHandling/index.js b/benefit-finder/src/shared/utils/errorHandling/index.js index f9c27b25e..a41636aa5 100644 --- a/benefit-finder/src/shared/utils/errorHandling/index.js +++ b/benefit-finder/src/shared/utils/errorHandling/index.js @@ -28,36 +28,40 @@ export const getNonRequiredFieldsets = ( ) => { const node = document.getElementById(`${criteriaKey}`) - const dateDataObj = data.filter(item => item.criteriaKey === criteriaKey) + const notRequired = !node.attributes.required - const dateValues = dateDataObj[0].values.value + if (notRequired) { + const dateDataObj = data.filter(item => item.criteriaKey === criteriaKey) - const isEmpty = obj => { - for (const key in obj) { - if (obj[key] !== '') { - return false // returns false if object has a non-empty string value + const dateValues = dateDataObj[0].values.value + + const isEmpty = obj => { + for (const key in obj) { + if (obj[key] !== '') { + return false // returns false if object has a non-empty string value + } } + return true // returns true if all values are empty strings } - return true // returns true if all values are empty strings - } - const addToRequiredFields = [...requiredFieldsets, node] + const addToRequiredFields = [...requiredFieldsets, node] - const makeUniq = [...new Set(addToRequiredFields)] + const makeUniq = [...new Set(addToRequiredFields)] - const removeFromRequiredFields = makeUniq.filter( - item => !item.id === criteriaKey - ) + const removeFromRequiredFields = makeUniq.filter( + item => !item.id === criteriaKey + ) - const removeFromErrorArray = hasError.filter( - item => !item.id.includes(criteriaKey) - ) + const removeFromErrorArray = hasError.filter( + item => !item.id.includes(criteriaKey) + ) - isEmpty(dateValues) && setHasError(removeFromErrorArray) + isEmpty(dateValues) && setHasError(removeFromErrorArray) - isEmpty(dateValues) - ? setHandler(removeFromRequiredFields) - : setHandler(makeUniq) + isEmpty(dateValues) + ? setHandler(removeFromRequiredFields) + : setHandler(makeUniq) + } } export const handleCheckForRequiredValues = async (