Skip to content
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

[Feat]: Notification setting logic updates #2752

Open
wants to merge 186 commits into
base: feat/1055_notifications-final
Choose a base branch
from

Conversation

Ayush8923
Copy link
Contributor

@Ayush8923 Ayush8923 commented Dec 26, 2024

closes: #2723

Visible/Frontend Changes

  • Implement the logic to save the notification rules in CouchDB
  • Implement the logic that when the user enables or disables push notifications from the Where you receive notifications section in the notification settings page, the value is updated accordingly in the CouchDB.
  • Retrieve the existing notification rules from the CouchDB and then show all the notification rules.

Ayush8923 and others added 30 commits November 27, 2024 10:32
@sleidig sleidig added this to the Notifications milestone Jan 3, 2025
Base automatically changed from feat/notification-setting-page to feat/1055_notifications-final January 3, 2025 16:06
@Ayush8923 Ayush8923 marked this pull request as ready for review January 6, 2025 05:23
@Ayush8923 Ayush8923 requested a review from sleidig January 6, 2025 05:23
@@ -45,79 +48,271 @@ import { ConfirmationDialogService } from "app/core/common-components/confirmati
templateUrl: "./notification-settings.component.html",
styleUrl: "./notification-settings.component.scss",
})
export class NotificationSettingsComponent {
hasPushNotificationEnabled: boolean = false;
export class NotificationSettingsComponent implements OnInit {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the many fields and arrays, the template and logic is starting to become quite complicated. I would suggest to extract a component the represents the config of a single notificationRule:

class NotificationRuleComponent {
  @Input() notificationRule: NotificationRule;

  /**
   * Emits whenever a detail about the notification rule was changed by the user.
   */
  @Output() notificationRuleChange: EventEmitter<NotificationRule>();

  ...
}

Within this all the different UI and property updates can be handled and to the outside (the NotifciationSettingsComponent), things are communicated through a single input and output. Test notifications etc. can be handled within that component also

// TODO: If the user to not allow the permission then don't need to update the value.
const NotificationToken = this.getNotificationToken();
const notificationConfig = await this.loadNotificationConfig();
this.isPushNotificationEnabled = event.checked;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is requesting notification permissions handled in a different PR / issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance Notification Settings Logic for User Entity Updates in CouchDB
2 participants