-
Notifications
You must be signed in to change notification settings - Fork 21
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
Enhance Notification Settings Logic for User Entity Updates in CouchDB #2723
Comments
Just one remark here, @Ayush8923 : The configuration should be stored as its own EntityType (maybe "NotificationConfig:<user_uuid>" or whatever name you suggest as more fitting). |
Thanks for this remark @sleidig. I have updated the draft database schema in the issue description. Please take a look once and let me know if there are any changes needed. |
as per group discussion: {
"_id": "NotificationConfig:<userId (Keycloak ID)>",
"_rev": ...,
"created": ...,
"updated": ...,
"channels": { "push": true, "email": false },
"notificationTypes": [
{
"notificationType": "entity-update", // in the future also e.g. "new_app_release"
"enabled": true,
"channels": { "push": true, "email": false },
"entityType": "User",
"conditions" // as <DataFilter/MongoQuery>, see https://www.mongodb.com/docs/manual/reference/operator/query/
},
{
"entityType": "Task",
"conditions": {
"authors": { "$in": "<userId>" },
}
}
]
} |
@sleidig @tomwwinter @george-neha, In the notification setting page, I have created an initial UI(attached screenshot below) for the notification condition field. In this UI, the user first selects an entity type and then the user adds the corresponding fields (e.g., subject, name, etc.) with which the user wants to perform the comparison. Then the user selects an operator (e.g., Equals, Greater than, etc.) and specifies a value for the comparison in the notification condition. Please check this initial UI and share your inputs or suggestions. Also, please let me know if I have missed anything. |
We should support multiple conditions (so probably similar to the "add new notification rule" button, we can have a "add condition" button to add another block of this). Accordingly, I would move the condition fields to a second row in the box and maybe make that expandable/collapsible for easier overview of all rules. A general thought coming to my mind: These conditions are actually similar (or probably the same?) as the filters to filter entries in the EntityList views. Can we reuse those UI components to filter data for the notification conditions instead of introducing a new model? |
Yes, I agree with the idea of supporting multiple conditions. Implementing an Yes, Instead of creating a new component, we can use the existing EntityList filter components for notification conditions. I’ll check the current filter implementation to evaluate how it can be adapted or extended for this use case. |
Objective
This issue involves refining the notification settings logic and ensuring seamless synchronization with CouchDB. The following tasks are outlined:
Proposed Solutions & Alternatives
User
entity in CouchDB.Below is an example of the expected schema for a
NotificationConfig
entity after notification settings are applied:Push Notification Toggle Logic:
User
entity is updated accordingly.Add/Delete Notification Rules:
User
entity in CouchDB.The Save button should be enabled only if any changes are made to the notification settings.
Retrieve and Update UI:
Update the Notification rule condition UI(maybe need to add the operator field) and based on that user can set the condition accordingly. Configure rules/filters for "entity update notifications" as an admin #2775
The text was updated successfully, but these errors were encountered: