Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3385 - Regional staff submission history #3490

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

jtimpe
Copy link

@jtimpe jtimpe commented Feb 25, 2025

Summary of Changes

Pull request closes #3385

  • Creates a "read only" version of submission history for OFA Regional Staff users
  • Regional Staff can only view submission history of locations assocaited with their region
  • Reorganizes cypress test data from django management commands to django fixtures. Creates a cypress test for regional staff workflow

How to Test

cd tdrs-backend && docker-compose up --build
cd tdrs-frontend && docker-compose up --build
  1. Open http://localhost:3000/ and sign in.
  2. Assign your user the OFA Regional Staff role. Add one or more regions.
  3. Navigate to the Data Files page. Use the STT Combobox to select a location. Verify list of available locations is limited to those associated with your user's region.
  4. Submit the search form. Verify the upload form cannot be viewed, only submission history can be viewed. Verify that files cannot be downloaded.

Deliverables

More details on how deliverables herein are assessed included here.

Deliverable 1: Accepted Features

Checklist of ACs:

  • Regional user can view submission history for STTs in their region.
  • Regional user can't upload files to any section of TDP.
  • Regional user can't download data files from TDP.
  • Clicking 'Search' automatically shows Submission History.
  • lfrohlich and/or adpennington confirmed that ACs are met.

Deliverable 2: Tested Code

  • Are all areas of code introduced in this PR meaningfully tested?
    • If this PR introduces backend code changes, are they meaningfully tested?
    • If this PR introduces frontend code changes, are they meaningfully tested?
  • Are code coverage minimums met?
    • Frontend coverage: [insert coverage %] (see CodeCov Report comment in PR)
    • Backend coverage: [insert coverage %] (see CodeCov Report comment in PR)

Deliverable 3: Properly Styled Code

  • Are backend code style checks passing on CircleCI?
  • Are frontend code style checks passing on CircleCI?
  • Are code maintainability principles being followed?

Deliverable 4: Accessible

  • Does this PR complete the epic?
  • Are links included to any other gov-approved PRs associated with epic?
  • Does PR include documentation for Raft's a11y review?
  • Did automated and manual testing with iamjolly and ttran-hub using Accessibility Insights reveal any errors introduced in this PR?

Deliverable 5: Deployed

  • Was the code successfully deployed via automated CircleCI process to development on Cloud.gov?

Deliverable 6: Documented

  • Does this PR provide background for why coding decisions were made?
  • If this PR introduces backend code, is that code easy to understand and sufficiently documented, both inline and overall?
  • If this PR introduces frontend code, is that code easy to understand and sufficiently documented, both inline and overall?
  • If this PR introduces dependencies, are their licenses documented?
  • Can reviewer explain and take ownership of these elements presented in this code review?

Deliverable 7: Secure

  • Does the OWASP Scan pass on CircleCI?
  • Do manual code review and manual testing detect any new security issues?
  • If new issues detected, is investigation and/or remediation plan documented?

Deliverable 8: User Research

Research product(s) clearly articulate(s):

  • the purpose of the research
  • methods used to conduct the research
  • who participated in the research
  • what was tested and how
  • impact of research on TDP
  • (if applicable) final design mockups produced for TDP development

@jtimpe jtimpe self-assigned this Feb 25, 2025
@jtimpe jtimpe added raft review This issue is ready for raft review a11y-review PR is ready for accessibility review labels Feb 25, 2025
@reitermb reitermb added the Deploy with CircleCI-a11y Deploy to https://tdp-frontend-a11y.app.cloud.gov through CircleCI label Feb 25, 2025
Copy link

codecov bot commented Feb 25, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 5 lines in your changes missing coverage. Please review.

Project coverage is 90.66%. Comparing base (8ffdb0f) to head (314b03a).

Files with missing lines Patch % Lines
tdrs-frontend/src/selectors/stts.js 50.00% 2 Missing ⚠️
tdrs-frontend/src/components/Reports/Reports.jsx 90.00% 1 Missing ⚠️
...mponents/SubmissionHistory/CaseAggregatesTable.jsx 66.66% 1 Missing ⚠️
...ponents/SubmissionHistory/TotalAggregatesTable.jsx 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3490      +/-   ##
===========================================
+ Coverage    90.64%   90.66%   +0.01%     
===========================================
  Files          310      311       +1     
  Lines         8908     8924      +16     
  Branches       677      680       +3     
===========================================
+ Hits          8075     8091      +16     
- Misses         704      706       +2     
+ Partials       129      127       -2     
Flag Coverage Δ
dev-backend 90.45% <100.00%> (+<0.01%) ⬆️
dev-frontend 92.15% <80.76%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tdrs-backend/tdpservice/settings/common.py 99.34% <100.00%> (+<0.01%) ⬆️
tdrs-backend/tdpservice/users/permissions.py 100.00% <100.00%> (ø)
...rontend/src/components/STTComboBox/STTComboBox.jsx 90.90% <100.00%> (ø)
...components/SubmissionHistory/SubmissionHistory.jsx 100.00% <ø> (ø)
tdrs-frontend/src/selectors/auth.js 97.50% <100.00%> (+0.13%) ⬆️
tdrs-frontend/src/components/Reports/Reports.jsx 87.82% <90.00%> (+0.21%) ⬆️
...mponents/SubmissionHistory/CaseAggregatesTable.jsx 93.75% <66.66%> (+0.89%) ⬆️
...ponents/SubmissionHistory/TotalAggregatesTable.jsx 86.66% <66.66%> (+17.43%) ⬆️
tdrs-frontend/src/selectors/stts.js 50.00% <50.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ffdb0f...314b03a. Read the comment docs.

@jtimpe jtimpe added Deploy with CircleCI-a11y Deploy to https://tdp-frontend-a11y.app.cloud.gov through CircleCI and removed Deploy with CircleCI-a11y Deploy to https://tdp-frontend-a11y.app.cloud.gov through CircleCI labels Feb 25, 2025
@reitermb
Copy link

image
Looking good! Clear scan and expected screenreader behavior

@reitermb reitermb removed the Deploy with CircleCI-a11y Deploy to https://tdp-frontend-a11y.app.cloud.gov through CircleCI label Feb 26, 2025
@@ -14,7 +14,7 @@ All tests added into the `tdrs-frontend/cypress/e2e/` folder will be run against
1. In a new terminal, set up test users by running
```bash
cd tdrs-backend
docker-compose exec web python manage.py generate_cypress_users
docker-compose exec web python manage.py loaddata cypress/users cypress/data_files

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

Copy link

@raftmsohani raftmsohani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

response = self.post_data_file_file(api_client, regional_data_file_data)
"""Test OFA Regional Staff cannot download datafiles."""
post_client = self.login_as(data_analyst)
response = self.post_data_file_file(post_client, regional_data_file_data)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you didn't write this func, but it has a confusing/awkward name. Are you open to renaming it to something like post_datafile?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

})

cy.clearCookie('sessionid')
cy.clearCookie('csrftoken')
})

Cypress.Commands.add(
'adminApiRequest',
'adminConsoleFormRequest',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this name change to help us remember it is admin form fields in the future!

accountIsRegionalStaff(state)
? selectUser(state)
.regions?.map((region) => region.stts)
.flat()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we alphabetize this list?

Copy link

@elipe17 elipe17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of nits. Otherwise this looks great, LGTM!

@jtimpe jtimpe added QASP Review and removed raft review This issue is ready for raft review a11y-review PR is ready for accessibility review labels Feb 27, 2025
@jtimpe jtimpe requested a review from ADPennington February 27, 2025 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Data Files page for regional staff
6 participants