Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Feature/[smd 151] show error state on errors screen #109

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

Connor-OS
Copy link
Contributor

@Connor-OS Connor-OS commented Nov 27, 2023

This PR

Refactor so we no longer return un-necesary success boolian.

When a user goes to upload a file they will now only see .xlsx files that are on there machine instead of all types of files

Change description

A brief description of the pull request

  • Unit tests and other appropriate tests added or updated
  • README and other documentation has been updated / added (if needed)
  • Commit messages are meaningful and follow good commit message guidelines (e.g. "FS-XXXX: Add margin to nav items preventing overlapping of logo")

How to test

If manual testing is needed, give suggested testing steps

Screenshots of UI changes (if applicable)

Copy link
Contributor

@Joel-Pearce Joel-Pearce left a comment

Choose a reason for hiding this comment

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

Do we ideally want some testing on this? There's a lot of conditional code here, and it currently has no test coverage.

It's possible to test JS EventListeners, but how we integrate that with our Flask test suite is another question.

@Connor-OS
Copy link
Contributor Author

Do we ideally want some testing on this? There's a lot of conditional code here, and it currently has no test coverage.

It's possible to test JS EventListeners, but how we integrate that with our Flask test suite is another question.

Yes, I think we definatly do. I suppose I can do some "black box" type of testing with Beautiful soup to check the on page HTML is what we expect in certain cases.

@Connor-OS Connor-OS force-pushed the feature/SMD-151-show-error-state-on-errors-screen branch from 6971440 to c9e7502 Compare November 27, 2023 12:14
@Joel-Pearce
Copy link
Contributor

Do we ideally want some testing on this? There's a lot of conditional code here, and it currently has no test coverage.
It's possible to test JS EventListeners, but how we integrate that with our Flask test suite is another question.

Yes, I think we definatly do. I suppose I can do some "black box" type of testing with Beautiful soup to check the on page HTML is what we expect in certain cases.

We can add in some tests asserting correct output against a series of reasonable scenarios. Probably best to get Adam's input on unit testing the specific event listener - it will require us to update github actions, and presumably to run a second JS test suite alongside the current Python one.

@Connor-OS Connor-OS force-pushed the feature/SMD-151-show-error-state-on-errors-screen branch 2 times, most recently from 11fd4b3 to 13b0fbe Compare November 29, 2023 17:02
Copy link
Contributor

@Joel-Pearce Joel-Pearce left a comment

Choose a reason for hiding this comment

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

LGTM

@Connor-OS Connor-OS force-pushed the feature/SMD-151-show-error-state-on-errors-screen branch 3 times, most recently from e54d1aa to f63cb13 Compare December 5, 2023 15:35
Copy link
Contributor

@cyrusdobbs cyrusdobbs left a comment

Choose a reason for hiding this comment

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

requesting changes to block merge for now

app/main/routes.py Outdated Show resolved Hide resolved
@Connor-OS Connor-OS force-pushed the feature/SMD-151-show-error-state-on-errors-screen branch 2 times, most recently from c33427b to f68f7d3 Compare December 7, 2023 14:50
Copy link
Contributor

@cyrusdobbs cyrusdobbs left a comment

Choose a reason for hiding this comment

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

Looking better 👍

I'm still a bit worried that this still doesn't solve the scenario where:

  1. User submits for a place
  2. gets validation errors
  3. submits again after fixing some, but now gets a pre-validation error
  4. It will now show their old validation errors AND their new pre-validation error

We need to be clear with design that this is a side effect of the new behaviour.

tests/test_routes.py Outdated Show resolved Hide resolved
app/main/routes.py Outdated Show resolved Hide resolved
app/main/routes.py Outdated Show resolved Hide resolved
app/main/routes.py Show resolved Hide resolved
@Connor-OS Connor-OS force-pushed the feature/SMD-151-show-error-state-on-errors-screen branch from f68f7d3 to d8ee621 Compare December 7, 2023 16:19
@Connor-OS
Copy link
Contributor Author

Looking better 👍

I'm still a bit worried that this still doesn't solve the scenario where:

1. User submits for a place

2. gets validation errors

3. submits again after fixing some, but now gets a pre-validation error

4. It will now show their old validation errors AND their new pre-validation error

We need to be clear with design that this is a side effect of the new behaviour.

They will now only get "same screen pre-validation" errors if they have a file error. From what design have said they do not consider these "same screen" errors as being another whole upload attempt/ moving to a new screen so the content in the table shouldn't be updated. I belive that design have accepted this iteration currently in the PR

@Connor-OS Connor-OS force-pushed the feature/SMD-151-show-error-state-on-errors-screen branch from d8ee621 to 3f44bc5 Compare December 13, 2023 11:52
app/main/routes.py Outdated Show resolved Hide resolved
app/templates/main/validation-errors.html Outdated Show resolved Hide resolved
app/templates/main/errorSummary.html Outdated Show resolved Hide resolved
@Connor-OS Connor-OS force-pushed the feature/SMD-151-show-error-state-on-errors-screen branch from c7ad877 to 835f8aa Compare December 13, 2023 12:08
WIP add javascript event listener to detect if form is submitted empty

...

...

...

...

store validation errors between request in session object and remove JS

...

...

...

...

..

...

...

...

...
@Connor-OS Connor-OS force-pushed the feature/SMD-151-show-error-state-on-errors-screen branch from 835f8aa to 8b2c3da Compare December 13, 2023 12:11
Copy link
Contributor

@cyrusdobbs cyrusdobbs left a comment

Choose a reason for hiding this comment

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

LGTM

@Connor-OS Connor-OS merged commit e2f56fd into main Dec 15, 2023
1 check passed
@Connor-OS Connor-OS deleted the feature/SMD-151-show-error-state-on-errors-screen branch December 15, 2023 10:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants