This week is focussed on another front end improvement. By the end of this week, OGV should have a clean, simplified, and stable notifications. This includes improving style of notifications and removing redundant notifications if any. Also two new features are to be added in this week. One is push notifications and a notification panel, that shows notifications when someone loves or comments on your model. Another is to add share functionality to the models.
After solving permission error, today I finalized the backend of notifications in second trial.
First I gave permission to client for inserting and updating in Notifications collection. This seemed a bit insecure. Also I had to redo some stuff like getting the model id whose activity triggered notification, getting user id of currently logged in user. So it seemed a wrong approach.
I read the code, and came to know that there exists a Meteor method for each social element, that are, love, comment and share. I needed to insert noficiations for these three social elements, so adding insert statement in the existing method seeemed a better and secure approach.
Also added schema to notifications panel.
Fixed the permission error. Came to know that we can only insert data in collection from server by default.So there are two methods to tackle this. First is creating functions that insert data on server, and calling them from client using
Meteor.call. Another way is to use
CollectionName.allow to allow the insert statements from client. In this, we set permission for each database operations separately. This includes insert, update, delete, and so on.
This solved the ongoing error for both sharedModels collection, and notification collection. Now the only thing to decide was how to show the shared values in OGV
After finishing up with notification UI, I started working on share functionality of model. First I tried to do the stuff by adding fields in Meteor.users collection, but that created problem in showing the shared models in newsfeed.
Another way around was to create a different collection, with fields like owner, model, sharedBy.
I did all the required things it take to create a collection and insert data in it. But when I try to insert data in it, I get error that I haven't given permission to insert data in collection. Searched about this. Spend the rest of my day with this error. Hopefully it would be completed by tommorrow, as today's day is almost finished
Finished up with notifications design today. Removed rendundant notifications. Came to know that OGV has two types of notifications in it's system. A custom built notification mechanism that has a client side collection, and can be used to show notification by function
throwNotification. This may have been bulit before porting the notification to sAlert. However I haven't deleted it, as it may come handy when working on notification panel, and a notificaiton for each love, comment a user does.
A few code cleanups were done, in order to get a stable notification system
Started working on my notifications, Made the sAlert design, instead of full width notification, that blocks the whole top bar, the notifications are displayed on left hand side, with a genie effect.
Created a single sAlert file, where I can configure sAlert for all the notifications. Doing this meant changing all the sAlert messages, in the OGV
Tried to do as many as possible. By the end of day, I was almost done, a few left which I will do the next day.
Today I mostly gave final touches to previous week's work, checked the OGV completely, if there's any bug, or unexpected behaviour that started showing as a result of schema I added
I forgot to attach a schema to lovers and comments collection, finished with it.
Also started working on the design of notifications, went through number of effects of sAlert shown in their demo website. Most probably I would be using the genie effect.