Mark Notification Download 6.1.2.0

5.0
us Michieal ~ Coder ~ 2 years ago

This component adds in the ability to mark a notification as read, or to delete a notification without leaving the page that you are on. No more having to click the various notifications to mark them as read. This utility grants the user the ability to delete their own notifications (and thus help keep your database clean). Modeled off of how Facebook allows you to just mark a notification as read, or to delete those annoying "this person liked your comment" notifications.

Suggestions for improvement, or bug fixes (or simply finding one and letting me know) are always welcome!

This is the initial release of the component, and I have tested it on a live site.

Comments
German Michael Zülsdorff Replied 2 years ago

and it doesn't on the fly refresh the all notifications page content.

jquery will be your friend ... you would use something like

$('.anchor-to-be-deleted').remove();

Study OssnComment's delete action + accompanying script and you'll get an idea. :)

cl Erassus ︎ ︎ Replied 2 years ago

Hi Michieal, nice update, all working great.

I added the spanish locale file in the github.

Regards.

us Michieal ~ Coder ~ Replied 2 years ago

V6.1.2.0 ~ Added happy javascript to perform the calls so that the page doesn't have to refresh each time you mark or delete a notification.

Added the Delete All Reactions as a button on the bottom of the Notifications dropdown, next to the See All link.

It's not 100% exactly what I want it to be, but it's very, very close. Ie., it doesn't (yet) have the ability to on the fly refresh just the notifications drop down, and it doesn't on the fly refresh the all notifications page content.
If anyone is willing to help with this, I would be extremely happy!

us Michieal ~ Coder ~ Replied 2 years ago

I would do a pull request, as I can merge it right in.

Because I haven't figured out how to make use of the "friends" on here.

cl Erassus ︎ ︎ Replied 2 years ago

Hi Michiel, how i can send you the locale file? i added you here.

Or i fork your repository and i open a pull request?

us Michieal ~ Coder ~ Replied 2 years ago

I was going off of the comment in the code, that said that the section was to delete the notification as a failsafe, when encountering a broken notification. But, I 100% agree with you that it doesn't remove the notification and you will get directed to a blank page or a 404.

I think, that it should have some kind of automatic notification "cleaner" for when something like that happens and the system has a broken notification... But the "Delete" link in MarkNotifications will do exactly that, albeit not automatically.

German Michael Zülsdorff Replied 2 years ago

The Notifications code (OssnNotifications) has a built in "failsafe" that when a user clicks on it, it tries to delete the notification. It doesn't always work.

Can't agree to that. OssnNotifacation does not actually delete the notification, it marks a notification as 'viewed' by removing the NULL value in the database. And it does it always onclick, even if the URL doesn't exist.

You may verify this by inserting a fake notification via phpmyadmin like
enter image description here

Here, member Honey Bunny (4) is trying to join a not existing group (999999) owned by me (1)

Thus, when entering my home, I see (note the missing group name!)
enter image description here


Clicking that notification tries to forward me to my group requests page. But since the group does not exist at all, I'm getting a 404 page because of a wrong url. Nevertheless, the former notification has been marked as viewed correctly and does not appear in the box any longer.

Alternatively, you may use the 'mark all as read' function to make that fake notification disappear.
enter image description here


In any case the database row is still in place, just the 'viewed' value is different
enter image description here

us Michieal ~ Coder ~ Replied 2 years ago

Wow, I missed one! :D There might be more - I hope not, but I am glad that you found it. (It's added and will be live in the next upload.)

As far as broken notifications, that is a rare - but not impossible - situation. The Notifications code (OssnNotifications) has a built in "failsafe" that when a user clicks on it, it tries to delete the notification. It doesn't always work. My broken notification was 1222. And it gave me fits, but it was on the list, and I used the Delete All Reactions to remove it. I'd have to double check, but I think that the action (in ossnnotifications) checks to see if the url passed is valid and if not I think? it exits. Like I said, I would have to double check the code.
Being that I am not replacing the notifications component, I really have no control over the fundamental notifications code. I copied the one page (site/Notifications/all) and added the button code to the very top of it. Other than that one file, it's completely separate from OssnNotifications.

Also, @Hugo - can you send me your translation files so that I can add them in?

German Michael Zülsdorff Replied 2 years ago

Re photos:
I can only suggest to provide a list of all currently ignored notification types in you db table so Michieal can add them to his list.

German Michael Zülsdorff Replied 2 years ago

Ah, your db screenshot is enlighting things:
a notification of type like:annotation:comments:entity is simply not part of Michieal's delete list. :)

As for the poll: Actually there will be only 1 db like entry in the notification table. Thus, as long as the main poll is still there, this entry will be kept. If you delete the poll completely, that entry should disappear. If not, file a report to Openteknik.

Component

Developer: Michieal
License GPL v2
Type: Tools
Requires Ossn Version : 6.1
Latest Version: 6.1.2.0
Last Updated 2 years ago
Repository Url View Repository

Versions