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

Lots of dynamic notification banners when I invite a couple people on the doc #246

Open
virgile-dev opened this issue Sep 11, 2024 · 3 comments
Labels
enhancement New feature or request frontend good first issue Good for newcomers

Comments

@virgile-dev
Copy link
Collaborator

virgile-dev commented Sep 11, 2024

Feature Request

Is your feature request related to a problem or unsupported use case? Please describe.
If I invite a few people on the doc, one notification banner appears for each user. Which is annoying

Describe the solution you'd like
Can we make a single notification for the whole group or just change the UX.
Or better if invitations went through, just close the pane and notify me if there is an error.

@AntoLC AntoLC added enhancement New feature or request frontend labels Sep 18, 2024
@AntoLC AntoLC added the good first issue Good for newcomers label Oct 14, 2024
@virgile-dev virgile-dev removed the next label Oct 17, 2024
@PanchoutNathan
Copy link
Collaborator

It has to come from the back first. Because it is impossible to add several members at once, we have to do a foreach. I think this is a pretty bad practice for several reasons. Like error handling or performance too. @sampaccoud @AntoLC

@AntoLC
Copy link
Collaborator

AntoLC commented Oct 22, 2024

I think you can, when all the promises are made, we foreach them to show our toast popup, see:

settledPromises.forEach((settledPromise) => {
switch (settledPromise.status) {
case 'rejected':
onError(settledPromise.reason as APIErrorUser);
break;
case 'fulfilled':
onSuccess(settledPromise.value);
break;
}
});
};

I think we should keep this mechanism for onError, it is nice to know with which member the endpoint failed, but when it is successful, to show only 1 toast is probably enough, moreover they are listed in real time in your member list.

@PanchoutNathan
Copy link
Collaborator

Yes, it is clearly possible on the front side not to display several toasts. But I find it a shame to do so many "tricks" when it would be enough for the back to accept a batch of members to be added in a single POST.

Because regarding performance or even simpler error management (because in the case where there are lots of errors, it amounts to displaying n toasts, or if we only display one error toast, we will not have the detail, except by tinkering)

But if you have to do the front version, no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend good first issue Good for newcomers
Projects
Status: To do
Development

No branches or pull requests

3 participants