fas-admin 0.0.75 → 0.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/views/notifications/api/notification-to-all-active-users-im.model.mjs +2 -0
- package/esm2022/lib/components/views/notifications/api/notifications-to-all-active-users.service.mjs +34 -0
- package/esm2022/lib/components/views/notifications/components/user-notifications/user-notifications.component.mjs +3 -3
- package/esm2022/lib/components/views/notifications/components/users-notifications/users-notifications.component.mjs +62 -4
- package/esm2022/lib/fas-admin.component.mjs +17 -1
- package/esm2022/lib/shared/models/fas-admin-models.mjs +1 -1
- package/fesm2022/fas-admin.mjs +96 -4
- package/fesm2022/fas-admin.mjs.map +1 -1
- package/lib/components/views/notifications/api/notification-to-all-active-users-im.model.d.ts +8 -0
- package/lib/components/views/notifications/api/notifications-to-all-active-users.service.d.ts +15 -0
- package/lib/components/views/notifications/components/users-notifications/users-notifications.component.d.ts +10 -0
- package/lib/fas-admin.component.d.ts +2 -0
- package/lib/shared/models/fas-admin-models.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFzLWFkbWluLW1vZGVscy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Zhcy1hZG1pbi9zcmMvbGliL3NoYXJlZC9tb2RlbHMvZmFzLWFkbWluLW1vZGVscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgUm91dGUgfSBmcm9tICdAYW5ndWxhci9yb3V0ZXInO1xuaW1wb3J0IHsgVHlwZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5leHBvcnQgaW50ZXJmYWNlIElGQVNCdXR0b25MaXN0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uICBhY2Nlc3M6IEFycmF5PElGQVNEZWZhdWx0Um91dGVQYXRoIHwgc3RyaW5nPiBcbn1cblxuZXhwb3J0IGludGVyZmFjZSBJRkFTUmVkaXJlY3RDb25maWcge1xuICByb2xlOiBJRkFTVXNlclJvbGU7XG4gIHJlZGlyZWN0UGF0aDogSUZBU0RlZmF1bHRSb3V0ZVBhdGggfCBzdHJpbmc7XG59XG4iXX0=
|
package/fesm2022/fas-admin.mjs
CHANGED
|
@@ -2725,7 +2725,7 @@ class UserNotificationsComponent {
|
|
|
2725
2725
|
this._dialogRef.close();
|
|
2726
2726
|
}
|
|
2727
2727
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: UserNotificationsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2728
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.2", type: UserNotificationsComponent, isStandalone: true, selector: "lib-user-notifications", ngImport: i0, template: "<div\n class=\"flex align-items-center justify-content-between decorator-strong py-3 mt-2\"\n>\n <div class=\"font-semibold text-xl\">Dodaj notyfikacj\u0119</div>\n <i\n class=\"pi pi-times cursor-pointer\"\n size=\"small\"\n (click)=\"closeDialog()\"\n ></i>\n</div>\n<form [formGroup]=\"addNewNotificationForm\" class=\"flex flex-column gap-2 mt-2\">\n <div class=\"flex flex-column gap-2\">\n <div class=\"flex flex-column gap-2\">\n <div>Tytu\u0142</div>\n <input\n formControlName=\"title\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex flex-column gap-2\">\n <div>Wiadomo\u015B\u0107</div>\n <input\n formControlName=\"message\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex flex-column gap-2\">\n <div>Link</div>\n <input\n formControlName=\"link\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n </div>\n <div class=\"mt-2 flex flex-column gap-2\">\n <div>Tre\u015B\u0107 email</div>\n <input\n formControlName=\"emailBody\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\" flex flex-column gap-2\">\n <div>Email u\u017Cytkownika</div>\n <input\n formControlName=\"email\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\" flex flex-column gap-2\">\n <div>Guid u\u017Cytkownika</div>\n <input\n formControlName=\"userAccountGuid\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex gap-3 justify-content-end mt-3\">\n <p-button (onClick)=\"closeDialog()\" [disabled]=\"submitLoading\" [link]=\"true\" label=\"Anuluj\"></p-button>\n <p-button (onClick)=\"submit()\" [loading]=\"submitLoading\" label=\"Dodaj nowe
|
|
2728
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.2", type: UserNotificationsComponent, isStandalone: true, selector: "lib-user-notifications", ngImport: i0, template: "<div\n class=\"flex align-items-center justify-content-between decorator-strong py-3 mt-2\"\n>\n <div class=\"font-semibold text-xl\">Dodaj notyfikacj\u0119 wybranym u\u017Cytkownikom</div>\n <i\n class=\"pi pi-times cursor-pointer\"\n size=\"small\"\n (click)=\"closeDialog()\"\n ></i>\n</div>\n<form [formGroup]=\"addNewNotificationForm\" class=\"flex flex-column gap-2 mt-2\">\n <div class=\"flex flex-column gap-2\">\n <div class=\"flex flex-column gap-2\">\n <div>Tytu\u0142</div>\n <input\n formControlName=\"title\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex flex-column gap-2\">\n <div>Wiadomo\u015B\u0107</div>\n <input\n formControlName=\"message\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex flex-column gap-2\">\n <div>Link</div>\n <input\n formControlName=\"link\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n </div>\n <div class=\"mt-2 flex flex-column gap-2\">\n <div>Tre\u015B\u0107 email</div>\n <input\n formControlName=\"emailBody\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\" flex flex-column gap-2\">\n <div>Email u\u017Cytkownika</div>\n <input\n formControlName=\"email\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\" flex flex-column gap-2\">\n <div>Guid u\u017Cytkownika</div>\n <input\n formControlName=\"userAccountGuid\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex gap-3 justify-content-end mt-3\">\n <p-button (onClick)=\"closeDialog()\" [disabled]=\"submitLoading\" [link]=\"true\" label=\"Anuluj\"></p-button>\n <p-button (onClick)=\"submit()\" [loading]=\"submitLoading\" label=\"Dodaj nowe notyfikacje\"></p-button>\n </div>\n</form>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "ngmodule", type: CalendarModule }, { kind: "ngmodule", type: InputNumberModule }, { kind: "ngmodule", type: FormsModule }] }); }
|
|
2729
2729
|
}
|
|
2730
2730
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: UserNotificationsComponent, decorators: [{
|
|
2731
2731
|
type: Component,
|
|
@@ -2737,16 +2737,93 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImpor
|
|
|
2737
2737
|
CalendarModule,
|
|
2738
2738
|
InputNumberModule,
|
|
2739
2739
|
FormsModule
|
|
2740
|
-
], template: "<div\n class=\"flex align-items-center justify-content-between decorator-strong py-3 mt-2\"\n>\n <div class=\"font-semibold text-xl\">Dodaj notyfikacj\u0119</div>\n <i\n class=\"pi pi-times cursor-pointer\"\n size=\"small\"\n (click)=\"closeDialog()\"\n ></i>\n</div>\n<form [formGroup]=\"addNewNotificationForm\" class=\"flex flex-column gap-2 mt-2\">\n <div class=\"flex flex-column gap-2\">\n <div class=\"flex flex-column gap-2\">\n <div>Tytu\u0142</div>\n <input\n formControlName=\"title\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex flex-column gap-2\">\n <div>Wiadomo\u015B\u0107</div>\n <input\n formControlName=\"message\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex flex-column gap-2\">\n <div>Link</div>\n <input\n formControlName=\"link\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n </div>\n <div class=\"mt-2 flex flex-column gap-2\">\n <div>Tre\u015B\u0107 email</div>\n <input\n formControlName=\"emailBody\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\" flex flex-column gap-2\">\n <div>Email u\u017Cytkownika</div>\n <input\n formControlName=\"email\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\" flex flex-column gap-2\">\n <div>Guid u\u017Cytkownika</div>\n <input\n formControlName=\"userAccountGuid\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex gap-3 justify-content-end mt-3\">\n <p-button (onClick)=\"closeDialog()\" [disabled]=\"submitLoading\" [link]=\"true\" label=\"Anuluj\"></p-button>\n <p-button (onClick)=\"submit()\" [loading]=\"submitLoading\" label=\"Dodaj nowe
|
|
2740
|
+
], template: "<div\n class=\"flex align-items-center justify-content-between decorator-strong py-3 mt-2\"\n>\n <div class=\"font-semibold text-xl\">Dodaj notyfikacj\u0119 wybranym u\u017Cytkownikom</div>\n <i\n class=\"pi pi-times cursor-pointer\"\n size=\"small\"\n (click)=\"closeDialog()\"\n ></i>\n</div>\n<form [formGroup]=\"addNewNotificationForm\" class=\"flex flex-column gap-2 mt-2\">\n <div class=\"flex flex-column gap-2\">\n <div class=\"flex flex-column gap-2\">\n <div>Tytu\u0142</div>\n <input\n formControlName=\"title\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex flex-column gap-2\">\n <div>Wiadomo\u015B\u0107</div>\n <input\n formControlName=\"message\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex flex-column gap-2\">\n <div>Link</div>\n <input\n formControlName=\"link\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n </div>\n <div class=\"mt-2 flex flex-column gap-2\">\n <div>Tre\u015B\u0107 email</div>\n <input\n formControlName=\"emailBody\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\" flex flex-column gap-2\">\n <div>Email u\u017Cytkownika</div>\n <input\n formControlName=\"email\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\" flex flex-column gap-2\">\n <div>Guid u\u017Cytkownika</div>\n <input\n formControlName=\"userAccountGuid\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex gap-3 justify-content-end mt-3\">\n <p-button (onClick)=\"closeDialog()\" [disabled]=\"submitLoading\" [link]=\"true\" label=\"Anuluj\"></p-button>\n <p-button (onClick)=\"submit()\" [loading]=\"submitLoading\" label=\"Dodaj nowe notyfikacje\"></p-button>\n </div>\n</form>\n" }]
|
|
2741
2741
|
}] });
|
|
2742
2742
|
|
|
2743
|
+
class NotificationsToAllActiveUsersService {
|
|
2744
|
+
constructor(http, apiUrl) {
|
|
2745
|
+
this.http = http;
|
|
2746
|
+
this.apiUrl = apiUrl;
|
|
2747
|
+
this.baseUrl = `${this.apiUrl}/NotificationsToAllActiveUsers`;
|
|
2748
|
+
}
|
|
2749
|
+
post(notification) {
|
|
2750
|
+
const headers = this.createHeaders();
|
|
2751
|
+
return this.http.post(this.baseUrl, notification, { headers });
|
|
2752
|
+
}
|
|
2753
|
+
createHeaders() {
|
|
2754
|
+
let headers = new HttpHeaders();
|
|
2755
|
+
const token = localStorage.getItem('authToken');
|
|
2756
|
+
if (token) {
|
|
2757
|
+
headers = headers.set('Authorization', `Bearer ${token}`);
|
|
2758
|
+
}
|
|
2759
|
+
return headers;
|
|
2760
|
+
}
|
|
2761
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: NotificationsToAllActiveUsersService, deps: [{ token: i1.HttpClient }, { token: API_URL }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2762
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: NotificationsToAllActiveUsersService, providedIn: 'root' }); }
|
|
2763
|
+
}
|
|
2764
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: NotificationsToAllActiveUsersService, decorators: [{
|
|
2765
|
+
type: Injectable,
|
|
2766
|
+
args: [{ providedIn: 'root' }]
|
|
2767
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
2768
|
+
type: Inject,
|
|
2769
|
+
args: [API_URL]
|
|
2770
|
+
}] }] });
|
|
2771
|
+
|
|
2743
2772
|
class UsersNotificationsComponent {
|
|
2773
|
+
constructor() {
|
|
2774
|
+
this._notificationsToAllActiveUsersService = inject(NotificationsToAllActiveUsersService);
|
|
2775
|
+
this._dialogRef = inject(DynamicDialogRef);
|
|
2776
|
+
this._fb = inject(FormBuilder);
|
|
2777
|
+
this.submitLoading = false;
|
|
2778
|
+
}
|
|
2779
|
+
ngOnInit() {
|
|
2780
|
+
this.setFormStructure();
|
|
2781
|
+
}
|
|
2782
|
+
setFormStructure() {
|
|
2783
|
+
this.addNewNotificationForm = this._fb.group({
|
|
2784
|
+
link: ['', [Validators.required]],
|
|
2785
|
+
message: ['', [Validators.required]],
|
|
2786
|
+
title: ['', [Validators.required]],
|
|
2787
|
+
emailBody: ['', [Validators.required]],
|
|
2788
|
+
});
|
|
2789
|
+
}
|
|
2790
|
+
submit() {
|
|
2791
|
+
this.submitLoading = true;
|
|
2792
|
+
const dataToPost = {
|
|
2793
|
+
link: this.addNewNotificationForm.get('link')?.value,
|
|
2794
|
+
message: this.addNewNotificationForm.get('message')?.value,
|
|
2795
|
+
title: this.addNewNotificationForm.get('title')?.value,
|
|
2796
|
+
emailBody: this.addNewNotificationForm.get('emailBody')?.value,
|
|
2797
|
+
sendAlsoEmail: true,
|
|
2798
|
+
linkOpenInNewWindow: true,
|
|
2799
|
+
};
|
|
2800
|
+
this._notificationsToAllActiveUsersService.post(dataToPost).subscribe({
|
|
2801
|
+
next: (res) => {
|
|
2802
|
+
this.submitLoading = false;
|
|
2803
|
+
},
|
|
2804
|
+
error: (err) => {
|
|
2805
|
+
console.error(err);
|
|
2806
|
+
this.submitLoading = false;
|
|
2807
|
+
},
|
|
2808
|
+
});
|
|
2809
|
+
}
|
|
2810
|
+
closeDialog() {
|
|
2811
|
+
this._dialogRef.close();
|
|
2812
|
+
}
|
|
2744
2813
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: UsersNotificationsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2745
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.2", type: UsersNotificationsComponent, isStandalone: true, selector: "lib-users-notifications", ngImport: i0, template: "<
|
|
2814
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.2", type: UsersNotificationsComponent, isStandalone: true, selector: "lib-users-notifications", ngImport: i0, template: "<div\n class=\"flex align-items-center justify-content-between decorator-strong py-3 mt-2\"\n>\n <div class=\"font-semibold text-xl\">Dodaj notyfikacj\u0119 wszystkim u\u017Cytkownikom</div>\n <i\n class=\"pi pi-times cursor-pointer\"\n size=\"small\"\n (click)=\"closeDialog()\"\n ></i>\n</div>\n<form [formGroup]=\"addNewNotificationForm\" class=\"flex flex-column gap-2 mt-2\">\n <div class=\"flex flex-column gap-2\">\n <div class=\"flex flex-column gap-2\">\n <div>Tytu\u0142</div>\n <input\n formControlName=\"title\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex flex-column gap-2\">\n <div>Wiadomo\u015B\u0107</div>\n <input\n formControlName=\"message\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex flex-column gap-2\">\n <div>Link</div>\n <input\n formControlName=\"link\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n </div>\n <div class=\"mt-2 flex flex-column gap-2\">\n <div>Tre\u015B\u0107 email</div>\n <input\n formControlName=\"emailBody\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex gap-3 justify-content-end mt-3\">\n <p-button (onClick)=\"closeDialog()\" [disabled]=\"submitLoading\" [link]=\"true\" label=\"Anuluj\"></p-button>\n <p-button (onClick)=\"submit()\" [loading]=\"submitLoading\" label=\"Dodaj nowe notyfikacje\"></p-button>\n </div>\n</form>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: InputNumberModule }, { kind: "ngmodule", type: DropdownModule }, { kind: "ngmodule", type: CalendarModule }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: FormsModule }] }); }
|
|
2746
2815
|
}
|
|
2747
2816
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: UsersNotificationsComponent, decorators: [{
|
|
2748
2817
|
type: Component,
|
|
2749
|
-
args: [{ selector: 'lib-users-notifications', standalone: true, imports: [
|
|
2818
|
+
args: [{ selector: 'lib-users-notifications', standalone: true, imports: [
|
|
2819
|
+
ReactiveFormsModule,
|
|
2820
|
+
InputNumberModule,
|
|
2821
|
+
DropdownModule,
|
|
2822
|
+
CalendarModule,
|
|
2823
|
+
CommonModule,
|
|
2824
|
+
ButtonModule,
|
|
2825
|
+
FormsModule,
|
|
2826
|
+
], template: "<div\n class=\"flex align-items-center justify-content-between decorator-strong py-3 mt-2\"\n>\n <div class=\"font-semibold text-xl\">Dodaj notyfikacj\u0119 wszystkim u\u017Cytkownikom</div>\n <i\n class=\"pi pi-times cursor-pointer\"\n size=\"small\"\n (click)=\"closeDialog()\"\n ></i>\n</div>\n<form [formGroup]=\"addNewNotificationForm\" class=\"flex flex-column gap-2 mt-2\">\n <div class=\"flex flex-column gap-2\">\n <div class=\"flex flex-column gap-2\">\n <div>Tytu\u0142</div>\n <input\n formControlName=\"title\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex flex-column gap-2\">\n <div>Wiadomo\u015B\u0107</div>\n <input\n formControlName=\"message\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex flex-column gap-2\">\n <div>Link</div>\n <input\n formControlName=\"link\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n </div>\n <div class=\"mt-2 flex flex-column gap-2\">\n <div>Tre\u015B\u0107 email</div>\n <input\n formControlName=\"emailBody\"\n class=\"input-on\"\n type=\"text\"\n />\n </div>\n <div class=\"flex gap-3 justify-content-end mt-3\">\n <p-button (onClick)=\"closeDialog()\" [disabled]=\"submitLoading\" [link]=\"true\" label=\"Anuluj\"></p-button>\n <p-button (onClick)=\"submit()\" [loading]=\"submitLoading\" label=\"Dodaj nowe notyfikacje\"></p-button>\n </div>\n</form>\n" }]
|
|
2750
2827
|
}] });
|
|
2751
2828
|
|
|
2752
2829
|
const centerDynamicModalConfig = {
|
|
@@ -3294,6 +3371,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImpor
|
|
|
3294
3371
|
class FASAdminComponent {
|
|
3295
3372
|
constructor() {
|
|
3296
3373
|
this.fasAdminService = inject(FASAdminService);
|
|
3374
|
+
this.router = inject(Router);
|
|
3297
3375
|
this.visableDefaultButtonList = [];
|
|
3298
3376
|
this.specButtonList = [];
|
|
3299
3377
|
}
|
|
@@ -3302,6 +3380,20 @@ class FASAdminComponent {
|
|
|
3302
3380
|
this.visableDefaultButtonList = this.setSidebarButtons(this.inputData, FAS_DEFAULT_BUTTON_LIST, true);
|
|
3303
3381
|
if (this.inputData.specButtonList)
|
|
3304
3382
|
this.specButtonList = this.setSidebarButtons(this.inputData, this.inputData.specButtonList, false);
|
|
3383
|
+
this.redirectUserBasedOnRole();
|
|
3384
|
+
}
|
|
3385
|
+
redirectUserBasedOnRole() {
|
|
3386
|
+
const token = localStorage.getItem('authToken');
|
|
3387
|
+
if (!token) {
|
|
3388
|
+
console.error('FASAdminComponent: No token found.');
|
|
3389
|
+
return;
|
|
3390
|
+
}
|
|
3391
|
+
const decodedToken = jwtDecode(token);
|
|
3392
|
+
const currentUserRole = decodedToken.Roles;
|
|
3393
|
+
const redirectConfig = this.inputData?.redirectConfig?.find((config) => config.role.toLowerCase() === currentUserRole.toLowerCase());
|
|
3394
|
+
if (redirectConfig && this.router.url === '/') {
|
|
3395
|
+
this.router.navigate([redirectConfig.redirectPath]);
|
|
3396
|
+
}
|
|
3305
3397
|
}
|
|
3306
3398
|
setSidebarButtons(configData, buttonList, isDefaultList) {
|
|
3307
3399
|
const token = localStorage.getItem('authToken');
|