Skip to content

Display Test Failures & Refactor Formpage#474

Merged
HassanAbouelela merged 8 commits into
mainfrom
display-test-failures
Jul 1, 2022
Merged

Display Test Failures & Refactor Formpage#474
HassanAbouelela merged 8 commits into
mainfrom
display-test-failures

Conversation

@HassanAbouelela
Copy link
Copy Markdown
Contributor

@HassanAbouelela HassanAbouelela commented Jun 30, 2022

This PR includes a few things:

  • An update to the error message component (see 6854505). This is mostly standalone, but it's useful for another change
  • Unittest failures now display the reason of failure. This was included in this PR, as the restructuring of formpage made it easier to accomplish
  • Refactoring of formpage. This is where the bulk of the changes are, but it's mostly just a straight copy-paste of old code into new files. It does contain a few changes - which should hopefully improve things - such as:
    • Errors are no longer suppressed on submission. We at least alert the user about them. I'd like to expand on this later
    • Submission has been broken up into about a million better-structured functions. This should make it easier to store state and control it in general

Note: I've tagged this as critical, since it dips it's toes into about half the codebase, and other PRs would likely create painful conflicts 😄. Also CJ is active now, and this would be nice to have.

@HassanAbouelela HassanAbouelela added area: front-end priority: critical type: enhancement Changes or improvements to existing features labels Jun 30, 2022
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 30, 2022

Deploy Preview for pydis-forms ready!

Name Link
🔨 Latest commit 09f25be
🔍 Latest deploy log https://app.netlify.com/sites/pydis-forms/deploys/62bef4a5d798270009481233
😎 Deploy Preview https://deploy-preview-474--pydis-forms.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@HassanAbouelela HassanAbouelela marked this pull request as ready for review June 30, 2022 20:47
@HassanAbouelela HassanAbouelela requested a review from ks129 as a code owner June 30, 2022 20:47
Comment thread src/api/question.ts Outdated
Comment thread src/components/ErrorMessage.tsx
Add transitions to the error message component, and allow more
flexibility by allowing the caller to specify the inner component of the
message.

Signed-off-by: Hassan Abouelela <hassan@hassanamr.com>
Signed-off-by: Hassan Abouelela <hassan@hassanamr.com>
Signed-off-by: Hassan Abouelela <hassan@hassanamr.com>
The main FormPage component had gotten very out of hand, with many
moving parts that were hard to parse, understand, or modify. This
refactors breaks things up into separate files with better defined
goals.

Most changes are just straight copies without much change, however some
structural changes have been introduced as a foundation for improving
the app.

Signed-off-by: Hassan Abouelela <hassan@hassanamr.com>
Signed-off-by: Hassan Abouelela <hassan@hassanamr.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 30, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b83dff7
Status:⚡️  Build in progress...

View logs

Comment thread src/pages/FormPage/ErrorPage.tsx Outdated
Comment thread src/components/ErrorMessage.tsx Outdated
Comment thread src/pages/FormPage/submit.ts
Comment thread src/components/Question.tsx Outdated
Unify the string and element types on the interface to clarify they are
mutually exclusive.

Signed-off-by: Hassan Abouelela <hassan@hassanamr.com>
Signed-off-by: Hassan Abouelela <hassan@hassanamr.com>
Uses an interface to define the RenderedQuestion component state, to
reduce the required type and existence checks in the rest of the
codebase.

Signed-off-by: Hassan Abouelela <hassan@hassanamr.com>
@HassanAbouelela HassanAbouelela merged commit e0f9989 into main Jul 1, 2022
@HassanAbouelela HassanAbouelela deleted the display-test-failures branch July 1, 2022 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: front-end priority: critical type: enhancement Changes or improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants