-
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
[Feat]: Notification setting logic updates #2752
base: feat/1055_notifications-final
Are you sure you want to change the base?
[Feat]: Notification setting logic updates #2752
Conversation
…tification entity in system
…/github.com/Aam-Digital/ndb-core into feat/push-notification-firebase-integration
…am-Digital/ndb-core into feat/notification-setting-logic-updates
…am-Digital/ndb-core into feat/notification-setting-logic-updates
…setting-logic-updates
…m-Digital/ndb-core into feat/notification-setting-logic-updates
…m-Digital/ndb-core into feat/notification-setting-logic-updates
@@ -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 { |
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.
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; |
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.
Is requesting notification permissions handled in a different PR / issue?
closes: #2723
Visible/Frontend Changes
Where you receive notifications
section in the notification settings page, the value is updated accordingly in the CouchDB.