Skip to content

Commit

Permalink
Merge pull request #3138 from GSA-TTS/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jadudm authored Jan 5, 2024
2 parents 80fe9c4 + 917bc27 commit d2b40ff
Show file tree
Hide file tree
Showing 9 changed files with 823 additions and 591 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,25 @@ jobs:
CYPRESS_LOGIN_TEST_OTP_SECRET_AUDITEE: ${{ secrets.CYPRESS_LOGIN_TEST_OTP_SECRET_AUDITEE }}
DISABLE_AUTH: False
# useful for debugging but otherwise complete overwhelm
# DEBUG: cypress:*
# DEBUG: cypress:server:util:process_profiler
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Create .env file
run: touch .env

- name: Run Cypress full submission test
uses: Wandalen/wretry.action@master
uses: cypress-io/github-action@v6
with:
action: cypress-io/github-action@v6
with: |
working-directory: ./backend
spec: cypress/e2e/full-submission.cy.js
attempt_limit: 5
attempt_delay: 2000
browser: chrome
working-directory: ./backend
spec: cypress/e2e/full-submission.cy.js

- uses: actions/upload-artifact@v3
# add the line below to store screenshots only on failures
Expand Down
4 changes: 3 additions & 1 deletion backend/.stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"selector-class-pattern": null,
"no-descending-specificity": null,
"function-no-unknown": null,
"media-feature-range-notation": "prefix"
"media-feature-range-notation": "prefix",
"scss/at-import-no-partial-leading-underscore": null,
"scss/load-no-partial-leading-underscore": null
}
}
39 changes: 24 additions & 15 deletions backend/audit/templates/audit/manage-submission-change-access.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,41 @@
method="post">
{% csrf_token %}
<fieldset class="usa-fieldset">

{% if role != "editor" %}
<h1 id="role-management">Change {{ friendly_role }}</h1>
<p class="font-sans-md">
There may only be one {{ friendly_role }} per single audit submission. By submitting a new official, you will be removing the current official listed below.
</p>
<p>
<strong>Name: </strong>{{ certifier_name }}
</p>
<p>
<strong>Email: </strong>{{ email }}
</p>
<h1 id="role-management">Change {{ friendly_role }}</h1>
<p class="font-sans-md">
There may only be one {{ friendly_role }} per single audit submission. By submitting a new official, you will be removing the current official listed below.
</p>
<p class="font-sans-md">
For the changes to take effect, users must log out and log back in to their account.
</p>
<p>
<strong>Name: </strong>{{ certifier_name }}
</p>
<p>
<strong>Email: </strong>{{ email }}
</p>
{% else %}
<h1 id="role-management">Add editor</h1>
<p class="font-sans-md">
Grant basic access to this submission to a new user by entering their name and email address below:
</p>
<h1 id="role-management">Add Audit Editor</h1>
<p class="font-sans-md">
Enter the name and email address of the new Audit Editor. Audit Editors may make changes to the single audit submission, as well as manage the roles of other users.
</p>
<p class="font-sans-md">
For the changes to take effect, users must log out and log back in to their account.
</p>
{% endif %}

<hr />

{% if errors %}
<ul>
{% for error in errors %}<li class="usa-error-message">{{ error }}</li>{% endfor %}
</ul>
{% endif %}

<label class="usa-label" for="fullname">New name:</label>
<input class="usa-input" id="name" name="fullname" placeholder="[name]" />

<label class="usa-label" for="email">New email address:</label>
<input class="usa-input"
id="email"
Expand Down
23 changes: 8 additions & 15 deletions backend/audit/templates/audit/manage-submission.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@
<tr>
<td>{{ entry.name }}</td>
<td>{{ entry.role }}</td>
{% comment %}
Removed the flags for the time being, to reduce initial complexity.
<td>{{ entry.email }} {{ entry.never_logged_in_flag }}</td>
{% endcomment %}
<td>{{ entry.email }}</td>
<td>{{ entry.email }} {{ entry.never_logged_in_flag }}</td>
<td>
{% if entry.role == 'Auditee Certifying Official' %}
<a href="{{ change_cert_auditee_url }}">Edit</a>
Expand All @@ -69,16 +65,13 @@
{% endfor %}
</tbody>
</table>
{% comment %}
Uncomment if/when we chose to keep the flags.
<p class="font-sans-xs">(<strong>*</strong>) Indicates user has not logged in to view this submission.</p>
{% endcomment %}
<a class="usa-button usa-button margin-top-5"
href="{{ add_editor_url }}"
aria-controls="add-editor">Add editor</a>
<a class="usa-button usa-button--unstyled margin-left-2"
href="{{ progress_url }}"
aria-controls="return-to-checklist">Return to checklist</a>
<p class="font-sans-xs">(<strong>*</strong>) Indicates user has not logged in to view this submission.</p>
<a class="usa-button usa-button margin-top-5"
href="{{ add_editor_url }}"
aria-controls="add-editor">Add editor</a>
<a class="usa-button usa-button--unstyled margin-left-2"
href="{{ progress_url }}"
aria-controls="return-to-checklist">Return to checklist</a>
</div>
</div>
{% include "audit-metadata.html" %}
Expand Down
4 changes: 2 additions & 2 deletions backend/census_historical_migration/change_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ def retrieve_change_records(mappings, objects):
change_record["gsa_fac_data"] = GsaFacRecord(
m.in_sheet, attribute_value
).to_dict()
change_record["transformation_function"].append(m.type)
change_record["transformation_function"].append(m.type.__name__)
else:
change_record["gsa_fac_data"] = GsaFacRecord(
m.in_dissem, attribute_value
).to_dict()
change_record["transformation_function"].append(m.type)
change_record["transformation_function"].append(m.type.__name__)

change_records.append(change_record)

Expand Down
21 changes: 11 additions & 10 deletions backend/cypress/support/workbook-uploads.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
// testWorkbookUpload('/audit/excel/federal-awards-expended/*', '#file-input-federal-awards-xlsx', 'federal-awards-expended-UPDATE.xlsx')
// assumes you are on the appropriate upload page already
function testWorkbookUpload(interceptUrl, uploadSelector, filename, will_intercept = true) {
cy.intercept(interceptUrl + '*', (req) => {
if (will_intercept) {
// return a success fixture
req.reply({ fixture: 'success-res.json' });
} else {
// with no intercept, don't intervene
req.continue();
}
if (will_intercept) {
cy.intercept('POST', interceptUrl + '*', (req) => {
req.reply({ fixture: 'success-res.json' });
}).as('uploadSuccess');
} else {
cy.intercept('POST', interceptUrl + '*').as('uploadSuccess');
}

cy.get(uploadSelector).attachFile(filename);
// Upload url (POST /audit/excel/workbookname) returns a redirect to "/" on successful upload. So, 302.
cy.wait('@uploadSuccess').its('response.statusCode').should('eq', 302);
cy.get('#info_box')
cy.wait('@uploadSuccess').should(({request, response}) => {
expect(response.statusCode, 'Response status code').to.equal(302);
});
cy.get('#info_box', { timeout: 10000 })
.should(
'have.text',
'File successfully validated! Your work has been saved.'
Expand Down
2 changes: 1 addition & 1 deletion backend/manifests/vars/vars-preview.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
app_name: gsa-fac
mem_amount: 512M
mem_amount: 6G
cf_env_name: PREVIEW
env_name: preview
service_name: preview
Expand Down
Loading

0 comments on commit d2b40ff

Please sign in to comment.