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 Page #2712

Merged
merged 168 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from 160 commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
832f23a
feat(*): firebase integration for push notification
Ayush8923 Nov 27, 2024
04b6672
feat(*): create the wrapper function for the firebase messaging
Ayush8923 Nov 29, 2024
c29861f
feat(*): create the push notification UI
Ayush8923 Nov 29, 2024
6e7ed4b
fix(*): update the notification UI alignment
Ayush8923 Nov 29, 2024
5293440
fix(*): update the notification UI styling
Ayush8923 Nov 29, 2024
afac897
fix(*): update the notification list UI
Ayush8923 Dec 2, 2024
4f60d7c
fix
Ayush8923 Dec 2, 2024
4199026
fix(*): update the aam digital firebase credintals
Ayush8923 Dec 2, 2024
91b6a2e
fix(*): refactore the push notification service and create the new No…
Ayush8923 Dec 3, 2024
30132b1
feat(*): integrate the firebase send api to send the notification to …
Ayush8923 Dec 3, 2024
3e3562c
fix(*): remove the hardcoded project ID
Ayush8923 Dec 3, 2024
0dae24c
fix(*): update the notification entity fields
Ayush8923 Dec 3, 2024
c13bfe6
fix(*): implement the get the notification list and cleanups
Ayush8923 Dec 4, 2024
c277454
fix(*): linting checks
Ayush8923 Dec 10, 2024
6e30e7a
fix(*): added the padding in the notification item class
Ayush8923 Dec 10, 2024
3896fcf
Merge branch 'master' into feat/push-notification-firebase-integration
Ayush8923 Dec 10, 2024
9d20b82
fix(*): update the firebaseConfig import
Ayush8923 Dec 10, 2024
c384ebd
Merge branch 'feat/push-notification-firebase-integration' of https:/…
Ayush8923 Dec 10, 2024
7af4344
fix(*): added the firebase config in the environment prod and spec file
Ayush8923 Dec 10, 2024
71ed3b4
fix(*): linting checks fixes
Ayush8923 Dec 10, 2024
7da91d3
feat(*): update the notification list UI
Ayush8923 Dec 11, 2024
e0961ee
fix*(*): fix the indentation
Ayush8923 Dec 11, 2024
da0a887
fix(*): update the notification list UI
Ayush8923 Dec 11, 2024
d3eaa1a
fix(*): cleanups and refactoring
Ayush8923 Dec 11, 2024
457e7d6
fix(*): update the code description
Ayush8923 Dec 11, 2024
ef93d0d
fix(*): added the logging
Ayush8923 Dec 11, 2024
5c37352
fix(*): cleanups
Ayush8923 Dec 11, 2024
1d05768
fix(*): remove the unwanted styles
Ayush8923 Dec 11, 2024
c7f38e0
fix(*): minor updates on the markAsRead Logic and cleanups
Ayush8923 Dec 11, 2024
73329b0
fix(*): update the notification setting item
Ayush8923 Dec 11, 2024
66e074a
fix(*): added the inline css
Ayush8923 Dec 11, 2024
cb769b4
fix(*): fix the prettier checks
Ayush8923 Dec 12, 2024
5c3ca42
feat(*): initiate the notification setting page
Ayush8923 Dec 12, 2024
fc34c93
feat(*): create the own component for the user notification setting
Ayush8923 Dec 12, 2024
d389271
fix(*): UI updates
Ayush8923 Dec 12, 2024
4e4f600
fix(*): added the enable and disable the notification type and cleanups
Ayush8923 Dec 12, 2024
ada0d4f
fix(*): redirect the user to notification setting page via notificati…
Ayush8923 Dec 12, 2024
09f19c9
fix(*): added the comment in the event types
Ayush8923 Dec 12, 2024
c309525
fix(*): implement for the add new notification rule functionality and…
Ayush8923 Dec 13, 2024
7ae4240
fix(*): code cleanups and unwanted code
Ayush8923 Dec 13, 2024
94fc5ef
Merge branch 'feat/notification-final-integration' into feat/notifica…
Ayush8923 Dec 13, 2024
5383470
fix(*): create the own component for the entity type selector
Ayush8923 Dec 13, 2024
1c7daa9
Merge branch 'feat/notification-setting-page' of https://github.com/A…
Ayush8923 Dec 13, 2024
783c4b6
fix(*): add the place holder
Ayush8923 Dec 13, 2024
e16be28
fix(gst)
Ayush8923 Dec 13, 2024
8547364
fix(*): remove the comments
Ayush8923 Dec 13, 2024
1c917a3
fix(*): create the entity type dropdown component
Ayush8923 Dec 13, 2024
f657512
fix(*): fix the linting checks
Ayush8923 Dec 13, 2024
d4ddae3
fix(*): remove the unused imports
Ayush8923 Dec 13, 2024
3548a97
fix(*): update the test cases and indentation
Ayush8923 Dec 13, 2024
f03a8d6
fix(*): update the changes in the notification setting page
Ayush8923 Dec 13, 2024
7ad1167
fix(*): add the placeholder in the entity type selector
Ayush8923 Dec 13, 2024
943f4a9
fix(i18n): add and improve translations
sleidig Dec 13, 2024
ec72442
fix(*): remove the duplicate code and refactor the edit entity type d…
Ayush8923 Dec 13, 2024
07deddd
fix(*): update the spec file describe name
Ayush8923 Dec 13, 2024
59c6b87
Merge branch 'master' into feat/entity-type-dropdown-component
Ayush8923 Dec 13, 2024
49bbeaa
fix(*): revert the languages files
Ayush8923 Dec 13, 2024
f1c6af5
Merge branch 'master' into feat/entity-type-dropdown-component
Ayush8923 Dec 13, 2024
5d31b5a
Update src/app/core/entity/entity-type-selector/entity-type-selector.…
sleidig Dec 13, 2024
75e4b23
fix(*): code cleanups and change the file name of entity dropdown
Ayush8923 Dec 16, 2024
af475c7
fix(*): update the entity type select component name
Ayush8923 Dec 16, 2024
fda4326
Merge branch 'master' into feat/entity-type-dropdown-component
Ayush8923 Dec 16, 2024
8a305a4
Merge branch 'feat/1055_notifications-final' into feat/notification-f…
Ayush8923 Dec 16, 2024
610241f
fix(*): revert the firebase implementation changes
Ayush8923 Dec 16, 2024
99174b4
fix(*): add the app component html file
Ayush8923 Dec 16, 2024
05a0fa7
fix(*): suggestion implemented
Ayush8923 Dec 16, 2024
057b73f
fix(*): update the indentation in the notification component
Ayush8923 Dec 16, 2024
14c8d0d
fix(*): add the notfication list UI mocked data
Ayush8923 Dec 16, 2024
2ee5dc2
fix(*): remove the mocked notification data fcm token
Ayush8923 Dec 16, 2024
64b9fc0
fix(*): few condition updates
Ayush8923 Dec 16, 2024
862d9c4
fix(*): revert the firebase implementation changes in the notfication…
Ayush8923 Dec 16, 2024
fe2db79
fix(*): remove the unused code
Ayush8923 Dec 16, 2024
513e0d2
Merge branch 'feat/notification-final-integration' into feat/notifica…
Ayush8923 Dec 16, 2024
603c9db
fix(*): codecleans & remove unwanted imports
Ayush8923 Dec 16, 2024
b8b2d95
Merge branch 'feat/notification-setting-page' of https://github.com/A…
Ayush8923 Dec 16, 2024
a0af2ab
fix(*): import the public form module
Ayush8923 Dec 16, 2024
b613fd1
Merge branch 'feat/entity-type-dropdown-component' of https://github.…
Ayush8923 Dec 16, 2024
d31ebe0
fix(*): update the naming convention and few cleanups
Ayush8923 Dec 16, 2024
8478abf
fix(*): remove the unused styling
Ayush8923 Dec 16, 2024
ff1f2ec
fix(*): cleanups and update the styling
Ayush8923 Dec 16, 2024
33a64e4
fix(*): fix the indentation of user notification spec file
Ayush8923 Dec 16, 2024
d02d46e
fix(*): add the i18n for translation
Ayush8923 Dec 16, 2024
797ddc7
fix(*): remove the unused imports
Ayush8923 Dec 16, 2024
4624539
fix(*): add the i18n for translation
Ayush8923 Dec 16, 2024
ddaf431
Merge branch 'feat/notification-final-integration' into feat/notifica…
Ayush8923 Dec 16, 2024
1442987
fix(*): implement if the only one notification rule then not show the…
Ayush8923 Dec 16, 2024
7960fe7
fix(*): added the i18n-label
Ayush8923 Dec 16, 2024
9145c85
fix(*): cleanups in the entity type select component
Ayush8923 Dec 16, 2024
2988840
fix(*): add the i18n
Ayush8923 Dec 16, 2024
71153a3
fix(*): update the notification event file name
Ayush8923 Dec 16, 2024
23313d8
fix(*): update the indentation and add the comment
Ayush8923 Dec 17, 2024
3acb0e7
Merge branch 'feat/notification-final-integration' into feat/notifica…
Ayush8923 Dec 17, 2024
63d49be
fix(*): cleanups
Ayush8923 Dec 17, 2024
24e4156
Merge branch 'feat/notification-final-integration' into feat/notifica…
Ayush8923 Dec 17, 2024
96dc68e
fix(*): updaet the test cases for the notification setting page
Ayush8923 Dec 17, 2024
fbe2907
fix(*): update the code and ui as per the suggestion
Ayush8923 Dec 17, 2024
7201c20
fix(*): added the date and time in the tooltip
Ayush8923 Dec 17, 2024
6475489
fix(*): use the new syntax for if and for
Ayush8923 Dec 17, 2024
07d2c7c
fix(*): add the comment in the notification time pipe file
Ayush8923 Dec 17, 2024
ebc9f39
fix(*): remove the unused imports
Ayush8923 Dec 17, 2024
ed517f6
Merge branch 'feat/notification-final-integration' of https://github.…
Ayush8923 Dec 17, 2024
2c009db
fix(*): update the test cases of entity type select component
Ayush8923 Dec 17, 2024
5c3160b
fix(*): update the notification file name
Ayush8923 Dec 18, 2024
fc0332b
fix(*): update the notfication html file name
Ayush8923 Dec 18, 2024
cab30c7
fix(*): update the file notification file name
Ayush8923 Dec 18, 2024
b6da287
Merge branch 'feat/notification-final-integration' of https://github.…
Ayush8923 Dec 18, 2024
f94ab94
fix(*): update the notification component spec name
Ayush8923 Dec 18, 2024
46afdc4
Merge branch 'feat/notification-final-integration' into feat/notifica…
Ayush8923 Dec 18, 2024
656630a
feat(*): update in the notification list ui
Ayush8923 Dec 19, 2024
c71f389
fix(*): update the notification time pipe and date on the tooltip
Ayush8923 Dec 19, 2024
a842f5b
fix(*): create the own function for the stop propogation
Ayush8923 Dec 19, 2024
f6ea242
fix(*): update the name of the enabled notification
Ayush8923 Dec 19, 2024
25b4b31
fix(*gst)
Ayush8923 Dec 19, 2024
7249bb4
fix(*): update the jsDoc in the notification component
Ayush8923 Dec 19, 2024
fdd50cc
Merge branch 'feat/notification-final-integration' into feat/notifica…
Ayush8923 Dec 19, 2024
1244000
fix(*): update the few changes in the notifcation list ui
Ayush8923 Dec 19, 2024
7adaadc
prevent submenu actions to close notifications panel
sleidig Dec 19, 2024
8807f1c
fix(*): update the notification setting UI
Ayush8923 Dec 20, 2024
82263ac
Merge branch 'feat/notification-final-integration' of https://github.…
Ayush8923 Dec 20, 2024
92247dc
fix(*): update the time of mock notification
Ayush8923 Dec 20, 2024
4a0766c
feat(*): update the notification setting UI
Ayush8923 Dec 23, 2024
81b59e9
Merge branch 'feat/notification-final-integration' into feat/notifica…
Ayush8923 Dec 23, 2024
6755afc
fix
Ayush8923 Dec 23, 2024
60e519d
fix(*): update the jsDoc in notification setting page
Ayush8923 Dec 23, 2024
c9e9b12
translated time periods + more mock events
sleidig Dec 23, 2024
d2e25f4
UI tuning
sleidig Dec 23, 2024
03ddd6e
fix outputs
sleidig Dec 23, 2024
0566b50
fix outputs and tests
sleidig Dec 23, 2024
6534650
fix(*): added the position sticky
Ayush8923 Dec 23, 2024
01d7f97
fix(*): update the notification list header styling
Ayush8923 Dec 23, 2024
64e2d0f
fix(*): update the notification setting page UI
Ayush8923 Dec 24, 2024
fd6a6c7
fix(*): update the style class name
Ayush8923 Dec 24, 2024
82b7d9b
fix(*): update the notification setting page test cases
Ayush8923 Dec 24, 2024
82194ca
fix(*): update the test cases and cleanups
Ayush8923 Dec 24, 2024
a5d827b
fix(*): add the comment and remove unused imports
Ayush8923 Dec 24, 2024
3b07b28
fix(*): refactore the code of notification setting page
Ayush8923 Dec 24, 2024
81b1c1b
fix(*): revert the notification event file changes + added the jsDoc
Ayush8923 Dec 24, 2024
d28d8a6
fix(*): remove the unwanted imports
Ayush8923 Dec 24, 2024
fc9c183
fix(*): added ngonit in the entity type select component
Ayush8923 Dec 24, 2024
1d6ff42
i18n label clarifications
sleidig Dec 27, 2024
604e218
tuning texts
sleidig Dec 27, 2024
8f72c07
fix(*): Merge branch 'feat/1055_notifications-final' of https://githu…
Ayush8923 Jan 2, 2025
47371cd
Merge branch 'feat/notification-setting-page' of https://github.com/A…
Ayush8923 Jan 2, 2025
0cb9c22
fix(*): cleanups
Ayush8923 Jan 2, 2025
bc7dc53
fix(*): cleanups and update the code according the suggestion
Ayush8923 Jan 2, 2025
5e3fcd7
fix(*): added the warning icon in the where you receive notification …
Ayush8923 Jan 2, 2025
c2ca65f
fix(*): added the badge text if the notification is enabled and disabled
Ayush8923 Jan 2, 2025
4e68945
fix(*): update the ordering and tooltip text
Ayush8923 Jan 2, 2025
a3bef65
fix(*): cleanups and refactoring
Ayush8923 Jan 2, 2025
4a11ca0
fix(*): update the file name for the notification method
Ayush8923 Jan 2, 2025
228df71
fix(*): update the css for the notification method select
Ayush8923 Jan 2, 2025
023cf5e
fix(*): remove the unused code
Ayush8923 Jan 2, 2025
95196d7
fix(*): the notification setting pop up auto close after redirect
Ayush8923 Jan 2, 2025
54e06fc
fix(*): update the notification setting component
Ayush8923 Jan 3, 2025
0a62d5d
fix(*): update the notification method select component
Ayush8923 Jan 3, 2025
91d64d6
Merge branch 'feat/1055_notifications-final' into feat/notification-s…
sleidig Jan 3, 2025
4cc3643
rename setting - settings
sleidig Jan 3, 2025
959443f
refine notification method select
sleidig Jan 3, 2025
aa0f95f
fix(Admin UI): field group titles are saved again (#2765)
Abhinegi2 Jan 3, 2025
ba89478
fix(Admin UI): correctly save changes to fields from Public Forms Edi…
Abhinegi2 Jan 3, 2025
70519f3
fix(*): update the code as per the suggestions
Ayush8923 Jan 3, 2025
6cc76e8
fix(*): update the notification pannel wrapper styling
Ayush8923 Jan 3, 2025
92e1146
refactor: turn entity-type-select into a form-control
sleidig Jan 3, 2025
16e3f21
change to new entity-type-select
sleidig Jan 3, 2025
c504723
refactor(core): add option to entities-table to open full details vie…
sleidig Jan 3, 2025
8537d86
fix(Admin UI): manage related public forms directly from Admin Entity…
Abhinegi2 Jan 3, 2025
c8f9351
refactor: turn entity-type-select into a form-control
sleidig Jan 3, 2025
661e7b2
Merge branch 'refactor/entity-type-select2' into feat/notification-se…
sleidig Jan 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
import { Component, OnInit, Input } from "@angular/core";
import {
Component,
EventEmitter,
Input,
OnInit,
Output,
forwardRef,
} from "@angular/core";
import { BasicAutocompleteComponent } from "../../common-components/basic-autocomplete/basic-autocomplete.component";
import { FormControl, ReactiveFormsModule } from "@angular/forms";
import {
NG_VALUE_ACCESSOR,
FormControl,
ReactiveFormsModule,
} from "@angular/forms";
import { EntityConstructor } from "../model/entity";
import { EntityRegistry } from "../database-entity.decorator";
import { MatFormField, MatLabel } from "@angular/material/form-field";

/**
* Component for selecting an entity type from a dropdown.
*/
@Component({
selector: "app-entity-type-select",
templateUrl: "./entity-type-select.component.html",
Expand All @@ -14,22 +28,51 @@ import { MatFormField, MatLabel } from "@angular/material/form-field";
MatFormField,
MatLabel,
],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => EntityTypeSelectComponent),
multi: true,
},
],
standalone: true,
})

// TODO: Need to use the CustomFormControlDirective abstract class instead of ControlValueAccessor.
export class EntityTypeSelectComponent implements OnInit {
sleidig marked this conversation as resolved.
Show resolved Hide resolved
@Input() formControl: FormControl;
@Input() allowMultiSelect = false;
@Input() label: string;
@Output() selectedEntity = new EventEmitter();

entityTypes: EntityConstructor[];
optionToLabel = (option: EntityConstructor) => option.label;
optionToId = (option: EntityConstructor) => option.ENTITY_TYPE;
value: any;
onChange = (_: string) => {};
onTouched = () => {};

constructor(private entityRegistry: EntityRegistry) {}

ngOnInit() {
this.entityTypes = this.entityRegistry
.getEntityTypes(true)
.map(({ value }) => value);

this.formControl.valueChanges.subscribe((value) => {
this.selectedEntity.emit(value);
});
}

writeValue(value: string) {
this.value = value;
}

registerOnChange(fn: () => void) {
this.onChange = fn;
}

registerOnTouched(fn: () => void) {
this.onTouched = fn;
}
}
6 changes: 5 additions & 1 deletion src/app/core/user/user-account/user-account.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<mat-tab-group appTabStateMemo>
<mat-tab i18n-label="User-Account label" label="User Account">
<mat-tab i18n-label="User Profile - tab title" label="User Account">
<div
class="min-width-1-3 margin-top-large flex-column gap-regular"
[matTooltip]="tooltipText"
Expand Down Expand Up @@ -43,4 +43,8 @@ <h2 i18n>Your profile:</h2>
<div i18n>Your user account is not linked to any record.</div>
}
</mat-tab>

<mat-tab i18n-label="User Profile - tab title" label="Notification Settings">
<app-notification-settings></app-notification-settings>
</mat-tab>
</mat-tab-group>
5 changes: 3 additions & 2 deletions src/app/core/user/user-account/user-account.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ import { MatTooltipModule } from "@angular/material/tooltip";
import { MatInputModule } from "@angular/material/input";
import { AccountPageComponent } from "../../session/auth/keycloak/account-page/account-page.component";
import { CurrentUserSubject } from "../../session/current-user-subject";
import { AsyncPipe, NgIf } from "@angular/common";
import { AsyncPipe } from "@angular/common";
import { EntityBlockComponent } from "../../basic-datatypes/entity/entity-block/entity-block.component";
import { SessionSubject } from "../../session/auth/session-info";
import { NotificationSettingsComponent } from "../../../features/notification/notification-settings/notification-settings.component";

/**
* User account form to allow the user to view and edit information.
Expand All @@ -45,7 +46,7 @@ import { SessionSubject } from "../../session/auth/session-info";
AccountPageComponent,
AsyncPipe,
EntityBlockComponent,
NgIf,
NotificationSettingsComponent,
],
standalone: true,
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ComponentFixture, TestBed } from "@angular/core/testing";

import { NotificationItemComponent } from "./notification-item.component";
import { NotificationEvent } from "../model/notification-event";
import { FontAwesomeTestingModule } from "@fortawesome/angular-fontawesome/testing";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<mat-form-field>
<mat-label>{{ label }}</mat-label>
<mat-select
(selectionChange)="onSelectionChange($event)"
placeholder="Choose notification channels"
i18n-placeholder="Notification Method Select placeholder"
[disabled]="disabled"
multiple
[value]="selectedNotificationMethod"
>
@for (notificationMethod of notificationMethods; track notificationMethod) {
<mat-option [value]="notificationMethod.key">
{{ notificationMethod.label }}
</mat-option>
}
</mat-select>
</mat-form-field>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from "@angular/core/testing";
import { NotificationMethodSelectComponent } from "./notification-method-select.component";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";

describe("NotificationCenterSelectComponent", () => {
let component: NotificationMethodSelectComponent;
let fixture: ComponentFixture<NotificationMethodSelectComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [NotificationMethodSelectComponent, BrowserAnimationsModule],
}).compileComponents();

fixture = TestBed.createComponent(NotificationMethodSelectComponent);
component = fixture.componentInstance;

fixture.detectChanges();
});

it("should create", () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { CommonModule } from "@angular/common";
import { Component, EventEmitter, Input, Output } from "@angular/core";
import { FormsModule } from "@angular/forms";
import { MatSelectChange, MatSelectModule } from "@angular/material/select";
import { NotificationChannel } from "../model/notification-config";

@Component({
standalone: true,
imports: [MatSelectModule, FormsModule, CommonModule],
selector: "app-notification-method-select",
templateUrl: "./notification-method-select.component.html",
})
export class NotificationMethodSelectComponent {
notificationMethods: { key: NotificationChannel; label: string }[] = [
{ key: "push", label: $localize`:notification method option:Push` },
];

@Input() label: string =
$localize`:notification method select label:Notification method`;
@Input() selectedNotificationMethod: string[] = [];
@Input() disabled: boolean = false;
@Output() selectionChange = new EventEmitter<NotificationChannel[]>();

onSelectionChange(event: MatSelectChange) {
this.selectionChange.emit(event.value);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
<div class="notifications-container">
<h1 class="notification-setting-title" i18n>Notifications Settings</h1>
<div i18n>
Notifications can remind you of events in the system that are important to
you. For example, you can set up custom notifications to see when certain
records are added or changed (e.g. when a new participant has registered
through a public form; or when a colleague assigned a task to you). These
notifications are visible in the toolbar and can be sent to you via email or
push notifications.
</div>

<div class="notification-types-container">
<h3 class="no-margin" i18n>
<strong>What notifications you receive</strong>
</h3>
<div i18n>
Define rules for events that you want to get notifications for. You can
add as many rules as you want. Disable a rule temporarily to pause these
notifications without deleting the conditions completely.
</div>

@for (
notificationRule of notificationRules.controls;
track notificationRule;
let index = $index
) {
<div
class="flex-column justify-space-between align-center notifications-options-container"
>
<div
class="flex-column justify-space-between align-center notification-options-wrapper"
>
<div
class="flex-row justify-content-center align-center notification-rule-option"
>
<app-entity-type-select
[allowMultiSelect]="false"
label="Select an entity type"
[formControl]="getFormField(index, 'entityType')"
></app-entity-type-select>
<app-help-button
text="A notification type is based on the selected entity. For instance, choosing 'task' will enable notifications for newly created tasks in the system."
i18n-text
></app-help-button>
</div>

<div class="flex-row align-center full-width">
<mat-form-field class="notification-rule-option">
<mat-label i18n>Notification condition</mat-label>
<input
matInput
placeholder="TO BE IMPLEMENTED LATER"
disabled="true"
i18n-placeholder="Notification condition placeholder"
/>
</mat-form-field>
<app-help-button
text="You can choose a notification based on the selected entity. For example, if you select 'task', you can create a notification for when a task is assigned to a user."
i18n-text
></app-help-button>
</div>

<div
class="flex-row justify-content-center align-center notification-rule-option"
>
<app-notification-method-select></app-notification-method-select>
<app-help-button
text="Define a notification method to receive notifications"
i18n-text
></app-help-button>
</div>
</div>

<div class="flex-row notification-rule-actions">
<div class="flex-row align-center">
<mat-slide-toggle
[formControl]="getFormField(index, 'enabled')"
class="notification-toggle"
matTooltip="You can enable or disable notifications. If you do not want to delete this notification rule, you can disable it to 'pause' these notifications."
i18n-matTooltip
></mat-slide-toggle>
</div>

<button
mat-icon-button
(click)="confirmRemoveNotificationRule(index)"
matTooltip="Remove notification rule"
i18n-matTooltip
>
<fa-icon icon="trash"></fa-icon>
</button>

<button
mat-icon-button
(click)="testNotification()"
matTooltip="Test notification"
i18n-matTooltip
>
<fa-icon icon="paper-plane"></fa-icon>
</button>
</div>
</div>
}
<div class="add-new-notification-rule">
<button
mat-stroked-button
class="add-new-rule-button"
color="accent"
(click)="addNewNotificationRule()"
matTooltip="Define another type of notifications for your user account"
i18n-matTooltip
>
<fa-icon aria-label="add element" icon="plus-circle"></fa-icon>
<span i18n class="new-notification-rule"
>Add new notification rule</span
>
</button>
</div>
</div>

<div class="browser-notifications-container">
<div class="browser-notifications-title">
<h3 i18n class="no-margin flex-row align-center">
<strong>Where you receive notifications</strong>
@if (hasPushNotificationEnabled) {
<div
class="enabled-text"
matTooltip="Push notifications are enabled. You’ll receive real-time updates for important activities."
i18n-matTooltip
>
Enabled
</div>
} @else {
<div
class="disabled-text"
matTooltip="Push notifications are disabled. Turn them on in settings to stay informed about updates."
i18n-matTooltip
>
Disabled
</div>
}
</h3>
<div i18n>
Notifications are always visible through the bell icon in the toolbar at
the top of the application. You can enable other ways to get
notifications sent to you below.
</div>
</div>
<div class="receive-notifications-container">
<div>
<div class="flex-row">
<fa-icon icon="window-maximize"></fa-icon>
<p class="notification-toggle" i18n>Browser</p>
</div>
<div
class="flex-row align-center justify-space-between browser-notification-list"
>
<div class="flex-row align-center">
<span i18n>Notification Center (in app)</span>
<app-help-button
text="View notifications in the app's interface. Click the icon in the top toolbar to see all notifications, including those you already read. The notification center is always available and cannot be disabled."
i18n-text
></app-help-button>
</div>
</div>
<div
class="flex-row align-center justify-space-between browser-notification-list"
>
<div class="flex-row align-center">
<span i18n>Push notifications</span>
<app-help-button
text="A notification on your system (e.g. a normal Android smartphone notification). You see these alerts without needing to open the app."
i18n-text
></app-help-button>
</div>
<mat-slide-toggle (change)="onEnableNotification()" />
</div>
</div>

<div>
<div class="flex-row">
<fa-icon icon="envelope"></fa-icon>
<p class="notification-toggle" i18n>Email</p>
</div>
<div
class="flex-row align-center justify-space-between browser-notification-list"
>
<div class="flex-row align-center">
<span i18n>Email</span>
<span class="coming-soon-label" i18n>Coming Soon</span>
</div>
<mat-slide-toggle disabled></mat-slide-toggle>
</div>
</div>
</div>
</div>
</div>
Loading
Loading