-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Feature: #2471 notification on_close #2519
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
base: develop
Are you sure you want to change the base?
Conversation
Hello there, I have some doubts that I would like to share. First and foremost this is my work until now:
The final result can be seen by the following code and prints:
My questionI don't understand if the changes requested are these or if the reasons"forced" and "timeout" should be something that the user never has to actually state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do not commit file that are not related to the PR
I suppose this PR is missing a front-end part ?
How should that part be handled ?
Hello there @FredLL-Avaiga, thank you for the reply
For now there are no front-end modifications, I just wanted to clarify my previous question so that I am aware on what needs to be done |
Hello there @FabienLelaquais, I don't understand if the changes requested are the ones that I made (the user inputs the reason whenever he closes the notification), or if the reasons "forced" and "timeout" should be something that the user never has to actually state. You also said this:
However, when I try create multiple notifications there is a limit of 5 notifications that are displayed simultaneously, and whenever there is a sixth notification, one of the older notifications will be removed (in a First In First Out manner) . Looking forward to hearing from you |
Hi @Andre-Pestana0 Now. Does that makes sense? |
@FabienLelaquais |
Hello there @FredLL-Avaiga @FabienLelaquais I think I'm almost at the solution, but I'm missing something...
I have been trying to understand how to to gather this data from the backend, but with no success. |
Hello @FredLL-Avaiga, Thank you so much for your reply. I will make sure to implement the requested changes. Sorry for bringing this up again, but I'm still having some difficulty understanding how the communication between the frontend and backend is happening. I understand that by using the dispatch function, I'll be sending information to the frontend, but I'm not quite sure how to inspect what data is being sent and how to retrieve that same data from the backend (but understanding how is it being sent will help me figure out this part). Could you please help me understand how I can view the data being sent from the frontend to the backend? I've tried using console.log, which helped a bit, but I'm still missing some details. I appreciate your help and hope I’m not burdening you with too many questions. Thank you again! |
In this case, you want to trigger a back-end callback from the front-end. You can find an example of its use in the Button component |
Hello there @FredLL-Avaiga, I've been working on the notification callback for on_close and this is what I’ve done so far: Backend:
Frontend:
At one point, I was able to make this work, but after making some changes, the callback stopped being passed correctly. The on_close value in the frontend is always undefined. I suspect the issue might be happening during the transition from the backend to the frontend. I’ve checked the backend and confirmed that the on_close_str is not None before sending the notification. Would appreciate any pointers on what might be causing this or what I might have missed. Thank you so much for your time! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to change the createNotificationAction to handle the on_close callback name
Hello there. I believe I did almost all of the requested changes. My only problem now is regarding the callback that is always undefined Notification.tsx
gui.py
In the gui.py i have done some prints and I am positive that "on_close_str" is indeed a valid string. I have tried to use Is there anything else I'm missing? |
Hello there, thank you for the reply.
Im trying to call I added a Thank you so much for your time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose you still need to change the case Types.SetNotification ...
Hello there, Thank you so much for your help, i had to do that and
Now everything is working! Thank you so much for your time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there
Well done
Hello there @FredLL-Avaiga |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any test ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there but you really need to remove those files from the PR ...
Hello there @FredLL-Avaiga, thank you for the reply! I think i did the change to the backend test. Thank you so much for your time! |
This PR has been labelled as "🥶Waiting for contributor" because it has been inactive for more than 14 days. If you would like to continue working on this PR, then please add new commit or another comment, otherwise this PR will be closed in 14 days. For more information please refer to the contributing guidelines. |
Hello there! @FredLL-Avaiga Is this version of the tests acceptable? Thank you very much for your time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, can you fix the errors ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and check the linter errors
Hello there! @FredLL-Avaiga Thank you for your time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, tx a lot @Andre-Pestana0
any input @FabienLelaquais ?
This PR has been labelled as "🥶Waiting for contributor" because it has been inactive for more than 14 days. If you would like to continue working on this PR, then please add new commit or another comment, otherwise this PR will be closed in 14 days. For more information please refer to the contributing guidelines. |
What type of PR is this?
Description
Implementation of a way to know if a notification was closed or not, including a callback function for the notification and the reason behind it.
Related Issue
Checklist