Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[feature] Added generic message notification type (shown in dialg box) #275
[feature] Added generic message notification type (shown in dialg box) #275
Changes from 9 commits
c207c9d
1025bfb
2605a09
bf3ba25
a15a284
3a0377d
2be7037
581cc90
a7c792d
9e7c1fc
2608c11
2a922a6
0686c2d
8106f3e
cc528df
aca39bc
1e6b840
00ec345
e69600f
bbff510
8dfcfce
df10915
6e5db98
6de368f
b0725b1
9ed5982
4a9956b
4593ef3
9f11de6
b09cd6f
8229268
08ab21b
69bfb39
0020c21
859734e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The click on the notification element doesn't seem to be clicking properly. I'm not sure why this occurs, but when manually clicked, it has no issues.
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 suspect this event handler is interfering with the functionality of opening dialog box.
openwisp-notifications/openwisp_notifications/static/openwisp-notifications/js/notifications.js
Lines 316 to 328 in 6ea7022
If I execute
self.web_driver.find_element(By.ID, f'ow-{notification.id}').click()
twice, then the test case pases without any error.I think, we should add a special case for the generic notifications. Maybe, we can add a CSS class for only generic notifications and exclude those elements from this event handler. Do we have information on the frontend apart from the notification type?
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.
Yeah running twice fixes the issue. The dialog appears when the description is available for any type of notification.
openwisp-notifications/openwisp_notifications/static/openwisp-notifications/js/notifications.js
Line 329 in a7c792d
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 think we can use that to add an additional CSS class to the notification element. If that class is present, the the logic for marking notification as read is skipped and it opens the notification dialog directly. We can also use a data attribute for this.
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 have tried a different approach to solving it, but is it okay to let it be
unread
even if the user has read that message?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.
No, it is not.