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

COM-964 Add multiselect to choose test contacts (Depends on: #78) #101

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

juliawegmayr
Copy link
Contributor

@juliawegmayr juliawegmayr commented Sep 25, 2024

At the moment, there is a text field for entering test contacts manually.

The email dispatch only works if the entered email is part of a contact list. To resolve this, the textfield is replaced with a multi-select field that only displays users from the test contact list.

Changes:
Replaced the free-text field with a multi-select field.
The multi-select field is now populated with users from the test contact list only.

Screenshots/screencasts

Screenshot 2024-09-25 at 13 54 07

Changeset

[x] I have verified if my change requires a changeset

Further information

https://vivid-planet.atlassian.net/browse/COM-964

@juliawegmayr juliawegmayr self-assigned this Sep 25, 2024
@auto-assign auto-assign bot requested a review from raphaelblum September 25, 2024 12:05
@juliawegmayr juliawegmayr marked this pull request as draft September 25, 2024 12:06
@juliawegmayr juliawegmayr force-pushed the add-multiselect-to-choose-test-contacts branch from f1c9cc5 to 14293f8 Compare September 25, 2024 12:10
@juliawegmayr juliawegmayr force-pushed the add-multiselect-to-choose-test-contacts branch from 14293f8 to fbd842d Compare November 4, 2024 13:49
@juliawegmayr juliawegmayr changed the base branch from next to main November 4, 2024 13:49
@juliawegmayr juliawegmayr force-pushed the add-multiselect-to-choose-test-contacts branch from 29d628e to f2321fe Compare December 2, 2024 12:36
@juliawegmayr juliawegmayr force-pushed the add-multiselect-to-choose-test-contacts branch from f2321fe to 76b0b6a Compare December 2, 2024 12:39
@juliawegmayr juliawegmayr marked this pull request as ready for review December 2, 2024 12:41
async function submitTestEmails({ testEmails }: FormProps) {
const emailsArray = testEmails.trim().split("\n");
const { data, loading, error } = useQuery(brevoTestContactsSelectQuery, {
variables: { offset: 0, limit: 50, email: "", scope },
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is email set here?

I doubt there will be more than 50 tests contacts but I guess this should be handled somehow... @raphaelblum what do you think about the limit?

Copy link
Collaborator

@raphaelblum raphaelblum Dec 9, 2024

Choose a reason for hiding this comment

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

I agree just loading 50 doesn't look clean. Couldn't we use Autocomplete for this?
https://storybook.comet-dxp.com/?path=/story/docs-hooks-useasyncoptionsprops--autocomplete

Copy link
Contributor

@RainbowBunchie RainbowBunchie Dec 9, 2024

Choose a reason for hiding this comment

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

I think I addressed this issue about reloading values in an async select before (in comet), I do not know if it is already possible to load more (on scrolling, input change..)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the email: 4115626

As discussed, I changed the limit to 100: 0a664db and added a check in the api to prevent creating more than 100 contacts: 13d2f5f, 5e991c3

In the frontend the button to create a new contact is disabled as soon as there are 100 contacts and a tooltip gives information about that: f2403cb

Screenshot 2024-12-13 at 10 04 13

Copy link

sonarcloud bot commented Dec 13, 2024

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