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

Implement contact integration to collection and dataset page #609

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

Conversation

ChengShi-1
Copy link
Contributor

@ChengShi-1 ChengShi-1 commented Feb 21, 2025

What this PR does / why we need it:

The goal is to replicate the Contact feature on the Collection Page and Dataset Page.

  • contact button with tooltip
  • contact form
  • CAPTCHA mechanism
  • notification

Which issue(s) this PR closes:

Special notes for your reviewer:

Not sure contact factory is written in a correct way or not to create contact repository

Suggestions on how to test this:

  1. Perform the following tests in both Login and Logout states: If not logged in, there is an input box for emails
  2. Verify that the Contact button:
  • Exists on the page.
  • Is clickable.
  1. Validate form submission:
  • Display errors and prevent submission if:
    • Required fields are empty.
    • The email format is incorrect.
    • The provided answer is incorrect.
  1. Allow form submission if all inputs are correct:
    Show a success alert on the page after submission.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

image
image

Is there a release notes update needed for this change?:

No

Additional documentation:

@ChengShi-1 ChengShi-1 linked an issue Feb 21, 2025 that may be closed by this pull request
@ChengShi-1 ChengShi-1 self-assigned this Feb 21, 2025
@ChengShi-1 ChengShi-1 added Size: 10 A percentage of a sprint. 7 hours. SPA: Dataset page (View) SPA: Collection Page GREI Re-arch GREI re-architecture-related Original size: 10 SPA.Q1 Not related to any specific Q1 feature FY25 Sprint 17 FY25 Sprint 17 (2025-02-12 - 2025-02-26) labels Feb 21, 2025
@coveralls
Copy link

coveralls commented Feb 21, 2025

Coverage Status

coverage: 97.636% (+0.4%) from 97.219%
when pulling 286305a on 569-implement-collection-page-contact-button-and-form
into 4338c7e on develop.

@ChengShi-1 ChengShi-1 force-pushed the 569-implement-collection-page-contact-button-and-form branch from 1e33bdb to 5cedc6c Compare February 21, 2025 16:34
@ChengShi-1 ChengShi-1 removed their assignment Feb 21, 2025
@ChengShi-1 ChengShi-1 marked this pull request as ready for review February 21, 2025 23:30
@g-saracca g-saracca self-assigned this Feb 24, 2025
Copy link
Contributor

@g-saracca g-saracca left a comment

Choose a reason for hiding this comment

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

I left some suggestions to improve the code and organize it in a better way.
I think the way you name the contact repository methods is a bit confusing, ContactDTO, submitContactInfo, useSubmitContact. Maybe something more related to what you are doing which is sending feedback to the owners.
On the other hand I think you had a confusion between repositories and factories, factories is a convention that the project has to create or instantiate the components at page level.
And repositories must be created only once in these factories and passed through props to the component that wants to use it.

Also you can simplify success message with a toast instead of an alert.

Please take a look at all the comments first and then see what needs to be changed.
If you need any help let me know, after these changes I will analyze the UI and functionality in more depth.

@ChengShi-1
Copy link
Contributor Author

@g-saracca Hi German, thanks for your feedback. I made changes regarding to reviews. Please help to check them again, ty!

Copy link
Contributor

@g-saracca g-saracca left a comment

Choose a reason for hiding this comment

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

Some more comments, thanks for addressing previous requested changes.

@@ -0,0 +1,5 @@
export interface Contact {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it ok to name it contact? isn't this the info that the use case return after success?
But isn't the same info you are sending?

Copy link
Contributor Author

@ChengShi-1 ChengShi-1 Feb 26, 2025

Choose a reason for hiding this comment

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

It has a little bit difference, the reply message's body would be Hello ${User Name},\n\nYou have just been sent the following message from ${FromEmail} via the Root hosted dataset ... but I didn't use the reply message in Contact part in front end repo. I'll rename it somehow meaningful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 17 FY25 Sprint 17 (2025-02-12 - 2025-02-26) GREI Re-arch GREI re-architecture-related Original size: 10 Size: 10 A percentage of a sprint. 7 hours. SPA: Collection Page SPA: Dataset page (View) SPA.Q1 Not related to any specific Q1 feature
Projects
Status: In Review 🔎
Development

Successfully merging this pull request may close these issues.

implement Collection Page: Contact button and form
3 participants