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

PLT-7591: Improved Auditor Report Upload #19

Merged
merged 10 commits into from
Oct 2, 2023
Merged

PLT-7591: Improved Auditor Report Upload #19

merged 10 commits into from
Oct 2, 2023

Conversation

EehMauro
Copy link
Collaborator

@coderabbitai: ignore

@amnambiar
Copy link
Collaborator

Note: we need to integrate changes from PR #8 here once that is approved/merged

@EehMauro EehMauro changed the base branch from master to PLT-7047 September 19, 2023 22:58
@RSoulatIOHK
Copy link
Collaborator

Love the new design.

Error messages

Ok, I don't know why, but at first, the checks for the values were not happening until I clicked on Send report. And after that it would only show me one field that was wrong. I fixed them in the order requested:

  • Auditor Information
    • Name
    • Website
    • Logo

And then, it showed all the other field with wrong values, and will display live the error messages of everything I filled wrong.

Wrong Regex

I don't get from the code why this Website value (example.com or www.example.com) is not ok for the regex:
image

@EehMauro
Copy link
Collaborator Author

Love the new design.

Error messages

Ok, I don't know why, but at first, the checks for the values were not happening until I clicked on Send report. And after that it would only show me one field that was wrong. I fixed them in the order requested:

  • Auditor Information

    • Name
    • Website
    • Logo

And then, it showed all the other field with wrong values, and will display live the error messages of everything I filled wrong.

Wrong Regex

I don't get from the code why this Website value (example.com or www.example.com) is not ok for the regex: image

Fixed!

@EehMauro
Copy link
Collaborator Author

Added Auditor Report Upload fields prefill with user profile

@amnambiar
Copy link
Collaborator

@EehMauro , Here are my thoughts -
'Auditor Report Upload' and ['Review Certification Metadata'](PR #8) are same just with Subject and Report URLs missing in the later. Rest all schema, functionalities are the same. Hence I created a common MetadataForm component to share between the two; by supplying separate configurations to build the form, and schemas (see PR #20 for latest).

Have you kept this in mind in this PR, otherwise what is your suggestion. We need to discuss over this, to reduce redundancy and make this simpler.

@amnambiar
Copy link
Collaborator

@EehMauro , Also I see you are not making use of schema validators like yup. Is there a particular reason why? Also, do you advocate in removing them throughout the app?

@amnambiar
Copy link
Collaborator

@EehMauro , Here are my thoughts - 'Auditor Report Upload' and ['Review Certification Metadata'](PR #8) are same just with Subject and Report URLs missing in the later. Rest all schema, functionalities are the same. Hence I created a common MetadataForm component to share between the two; by supplying separate configurations to build the form, and schemas (see PR #20 for latest).

Have you kept this in mind in this PR, otherwise what is your suggestion. We need to discuss over this, to reduce redundancy and make this simpler.

PR #8 was merged after a lot of integration testing / bug fixes / schema corrections 😆
If we redo the component entirely in this PR , wouldn't we have to apply the same effort here as well? I'm a bit sceptical with this 🙃

@EehMauro
Copy link
Collaborator Author

Hi @amnambiar, I can merge #20 here so I can re-use the form you made and the yup validations

Base automatically changed from PLT-7047 to master September 25, 2023 11:54
Copy link
Collaborator

@RSoulatIOHK RSoulatIOHK left a comment

Choose a reason for hiding this comment

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

Two more things but I don't know where to point it into the code but:

  • The checks on the values don't start until I click a first time on "Send report"
  • If I put a too long "Script Hash" like : 01234567890123456789012345678901234567890123456789012345678901234567890012345678901234567890123456789012345678901234567890123456789012345678900123456789012345678901234567890123456789012345678901234567890123456789001234567890123456789012345678901234567890123456789012345678901234567890 it never shows on the form that it is wrong but I get an error when clicking on "Send report"

src/compositions/InputGroup/utils/schemas.ts Outdated Show resolved Hide resolved
src/utils/utils.ts Outdated Show resolved Hide resolved
src/pages/session/index.tsx Outdated Show resolved Hide resolved
src/compositions/InputGroup/utils/index.ts Outdated Show resolved Hide resolved
src/compositions/InputGroup/utils/index.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@RSoulatIOHK RSoulatIOHK left a comment

Choose a reason for hiding this comment

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

Sorry, Missed this during the first review

src/compositions/InputGroup/utils/schemas.ts Show resolved Hide resolved
@amnambiar
Copy link
Collaborator

  1. reportURLs are to be sent as array of strings in report.reportURLs in the payload
  2. Move Add Script to after all the the DApp Scripts (like Romain mentioned)
  3. Error in form submit is retained while navigating away and coming back, even though the form is cleared. Clear errors in the form, while moving away from the page.

@EehMauro bugs/changes to be addressed here

@amnambiar
Copy link
Collaborator

@EehMauro , Pardon my bad. Can you please fix (1)

POST /auditor/reports expects . Can you fix that. And, the error 400 user error (Report URLs do not match) when you give urls to different PDFs are because they are basically NOT different urls to the same report file(expected).

"report": [
    "string"
  ],

@amnambiar
Copy link
Collaborator

@EehMauro Bugs - In Review Certification Metadata --

  1. remove fields Certification Level, Subject, Report URLs
  2. Add a cancel or close button to cancel the modal if he chooses to, as this is not mandatory

@amnambiar
Copy link
Collaborator

In Review Certification Metadata --

remove fields Certification Level, Subject, Report URLs
Add a cancel or close button to cancel the modal if he chooses to, as this is not mandatory

This is done.

Copy link
Collaborator

@amnambiar amnambiar left a comment

Choose a reason for hiding this comment

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

LGTM now

@amnambiar amnambiar merged commit 8508eb0 into master Oct 2, 2023
@amnambiar amnambiar deleted the PLT-7591 branch October 2, 2023 07:18
@amnambiar amnambiar mentioned this pull request Oct 2, 2023
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants