Skip to content

Contact Collection and Dataset owner feature#609

Merged
ofahimIQSS merged 23 commits intodevelopfrom
569-implement-collection-page-contact-button-and-form
Mar 20, 2025
Merged

Contact Collection and Dataset owner feature#609
ofahimIQSS merged 23 commits intodevelopfrom
569-implement-collection-page-contact-button-and-form

Conversation

@ChengShi-1
Copy link
Copy Markdown
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
Copy Markdown

coveralls commented Feb 21, 2025

Coverage Status

coverage: 97.39% (+0.1%) from 97.241%
when pulling f6ff9cd on 569-implement-collection-page-contact-button-and-form
into fa6299a 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
Copy Markdown
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.

Comment thread packages/design-system/src/lib/components/alert/Alert.tsx Outdated
Comment thread public/locales/en/contact.json Outdated
Comment thread src/contact/domain/repositories/ContactRepository.ts Outdated
Comment thread src/contact/domain/useCases/submitContact.ts Outdated
Comment thread src/sections/contact/ContactButton.tsx
Comment thread src/sections/contact/contactFactory.tsx Outdated
Comment thread src/sections/dataset/Dataset.tsx Outdated
Comment thread src/sections/dataset/Dataset.tsx Outdated
Comment thread src/sections/dataset/dataset-action-buttons/DatasetActionButtons.tsx Outdated
Comment thread src/sections/shared/contact-modal/contact-modal.tsx Outdated
@g-saracca g-saracca moved this from Ready for QA ⏩ to In Review 🔎 in IQSS Dataverse Project Feb 27, 2025
@g-saracca
Copy link
Copy Markdown
Contributor

I've approved but I saw that component test coverage is not reaching the branch coverage min of 95%.
Please check what code branches you are not testing, thanks, almost there! 🤞🏼

@g-saracca
Copy link
Copy Markdown
Contributor

I think you are missing testing closing the dialog? See https://coveralls.io/builds/72453589/source?filename=src%2Fsections%2Fshared%2Fcontact%2Fcontact-modal%2Fcontact-modal.tsx#L74

g-saracca
g-saracca previously approved these changes Feb 27, 2025
Copy link
Copy Markdown
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.

Looks good! Approving!

@github-project-automation github-project-automation Bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Feb 27, 2025
@g-saracca g-saracca changed the title Implement contact integration to collection and dataset page Contact Collection and Dataset owner feature Feb 27, 2025
@cmbz cmbz added the FY25 Sprint 19 FY25 Sprint 19 (2025-03-12 - 2025-03-26) label Mar 12, 2025
@ofahimIQSS ofahimIQSS self-assigned this Mar 19, 2025
@ofahimIQSS ofahimIQSS moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Mar 19, 2025
@ofahimIQSS
Copy link
Copy Markdown
Contributor

Hello! One quick observation - after a user sends an email, click on contact again. I noticed that the email form doesn't reset and all the previous data is still present. Can be reproduced in both states (Authenticated/non authenticated user).
I compared against JSF and in there, the form does reset after sending an email. See video:

Screen.Recording.2025-03-19.at.3.25.23.PM.mov

@ofahimIQSS
Copy link
Copy Markdown
Contributor

tested updating User email successfully:

Screen.Recording.2025-03-19.at.3.46.13.PM.mov

@github-project-automation github-project-automation Bot moved this from QA ✅ to Ready for QA ⏩ in IQSS Dataverse Project Mar 20, 2025
@ofahimIQSS ofahimIQSS moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Mar 20, 2025
@ofahimIQSS
Copy link
Copy Markdown
Contributor

Looks good from my end, merging PR

@ofahimIQSS ofahimIQSS merged commit 4027556 into develop Mar 20, 2025
8 checks passed
@github-project-automation github-project-automation Bot moved this from QA ✅ to Merged 🚀 in IQSS Dataverse Project Mar 20, 2025
@ofahimIQSS ofahimIQSS deleted the 569-implement-collection-page-contact-button-and-form branch March 20, 2025 13:56
@ofahimIQSS ofahimIQSS removed their assignment Mar 20, 2025
@scolapasta scolapasta moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Mar 20, 2025
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) FY25 Sprint 18 FY25 Sprint 18 (2025-02-26 - 2025-03-12) FY25 Sprint 19 FY25 Sprint 19 (2025-03-12 - 2025-03-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: Done 🧹

Development

Successfully merging this pull request may close these issues.

implement Collection Page: Contact button and form

6 participants