cat-documents-ng 0.3.3 → 0.3.5
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/Shared/components/confirmation-dialog/confirmation-dialog.component.d.ts +15 -8
- package/Shared/constant/SHARED.d.ts +1 -0
- package/Shared/shared.module.d.ts +2 -1
- package/fesm2022/cat-documents-ng.mjs +225 -236
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-actions/document-actions.component.d.ts +3 -3
- package/lib/document/components/sidebar/sidebar.component.d.ts +29 -31
- package/package.json +1 -1
|
@@ -8,6 +8,8 @@ import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http'
|
|
|
8
8
|
import { __decorate } from 'tslib';
|
|
9
9
|
import { EntityStore, StoreConfig, QueryEntity } from '@datorama/akita';
|
|
10
10
|
import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
|
|
11
|
+
import * as i6$2 from 'primeng/confirmdialog';
|
|
12
|
+
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
|
11
13
|
import { trigger, state, transition, style, animate } from '@angular/animations';
|
|
12
14
|
import * as i3 from 'primeng/api';
|
|
13
15
|
import { ConfirmationService, MessageService } from 'primeng/api';
|
|
@@ -313,6 +315,7 @@ class SHARED {
|
|
|
313
315
|
static TEAM_LEADER = 'TeamLeader';
|
|
314
316
|
static UNDERWRITER_USER = 'Underwriter User';
|
|
315
317
|
static INITIAL_REQUEST = 'Initial Request';
|
|
318
|
+
static REFRESH_TRIGGER = 'refreshTrigger';
|
|
316
319
|
static Menu = [
|
|
317
320
|
{
|
|
318
321
|
label: 'Applicant',
|
|
@@ -1338,7 +1341,7 @@ class DocumentHttpService {
|
|
|
1338
1341
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1339
1342
|
*/
|
|
1340
1343
|
getDocumentCatagories(contextId) {
|
|
1341
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1344
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1342
1345
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENTS_CATAGORIES}/${contextId}`, { headers }).pipe(tap((response) => {
|
|
1343
1346
|
// Store only the categories array, not the entire response
|
|
1344
1347
|
if (response && response.categories) {
|
|
@@ -1397,7 +1400,7 @@ class DocumentHttpService {
|
|
|
1397
1400
|
* @returns {Observable<DocumentModel>} An observable that emits the updated DocumentModel.
|
|
1398
1401
|
*/
|
|
1399
1402
|
updateDocumentName(documentId, payload) {
|
|
1400
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1403
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1401
1404
|
return this.http.put(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${documentId}`, payload, { headers }).pipe(catchError((error) => {
|
|
1402
1405
|
return throwError(() => new Error(error));
|
|
1403
1406
|
}));
|
|
@@ -1408,7 +1411,7 @@ class DocumentHttpService {
|
|
|
1408
1411
|
* @returns {Observable<UserListModel[]>} Observable that emits the user list data.
|
|
1409
1412
|
*/
|
|
1410
1413
|
getUserListByContextId(contextId) {
|
|
1411
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1414
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1412
1415
|
if (!contextId)
|
|
1413
1416
|
return EMPTY;
|
|
1414
1417
|
return this.http.get(`${this.apiUrl}${URLS.USERLIST}${contextId}`, { headers }).pipe(tap((userList) => {
|
|
@@ -1427,7 +1430,7 @@ class DocumentHttpService {
|
|
|
1427
1430
|
getStatusDocumentCount(applicationId, contextId = null, categoryId = null) {
|
|
1428
1431
|
if (!applicationId)
|
|
1429
1432
|
return EMPTY;
|
|
1430
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1433
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1431
1434
|
let url = `${this.apiUrl}${URLS.STATUS_DOCUMENT_COUNT}${applicationId}`;
|
|
1432
1435
|
let params = new HttpParams();
|
|
1433
1436
|
const contextParam = contextId || null;
|
|
@@ -1456,7 +1459,7 @@ class DocumentHttpService {
|
|
|
1456
1459
|
*/
|
|
1457
1460
|
getDocumentsBySelection(contextId, menuItem, userId, status, searchKey = null) {
|
|
1458
1461
|
let params = new HttpParams();
|
|
1459
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1462
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1460
1463
|
if (userId) {
|
|
1461
1464
|
params = params.set(SHARED.CONTEXT_ID, userId);
|
|
1462
1465
|
}
|
|
@@ -1478,7 +1481,7 @@ class DocumentHttpService {
|
|
|
1478
1481
|
if (!documentId) {
|
|
1479
1482
|
return of([]);
|
|
1480
1483
|
}
|
|
1481
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1484
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1482
1485
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_HISTORY}${documentId}`, { headers }).pipe(catchError((error) => {
|
|
1483
1486
|
return throwError(() => new Error(error));
|
|
1484
1487
|
}));
|
|
@@ -1491,7 +1494,7 @@ class DocumentHttpService {
|
|
|
1491
1494
|
getCategoriesBySource(source) {
|
|
1492
1495
|
if (!source)
|
|
1493
1496
|
return EMPTY;
|
|
1494
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1497
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1495
1498
|
return this.http.get(`${this.apiUrl}${URLS.GET_CATEGORIES_BY_SOURCE}${source}`, { headers }).pipe(catchError((error) => {
|
|
1496
1499
|
return throwError(() => new Error(error));
|
|
1497
1500
|
}));
|
|
@@ -1504,7 +1507,7 @@ class DocumentHttpService {
|
|
|
1504
1507
|
getDocumentTypesByCategory(categoryId) {
|
|
1505
1508
|
if (!categoryId)
|
|
1506
1509
|
return EMPTY;
|
|
1507
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1510
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1508
1511
|
return this.http.get(`${this.apiUrl}${URLS.GET_DOCUMENT_TYPES_BY_CATEGORY}${categoryId}`, { headers }).pipe(catchError((error) => {
|
|
1509
1512
|
return throwError(() => new Error(error));
|
|
1510
1513
|
}));
|
|
@@ -1515,7 +1518,7 @@ class DocumentHttpService {
|
|
|
1515
1518
|
* @returns {Observable<any>} Observable that emits the upload response.
|
|
1516
1519
|
*/
|
|
1517
1520
|
uploadFile(formData) {
|
|
1518
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1521
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1519
1522
|
return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD_FILE}`, formData, { headers }).pipe(catchError((error) => {
|
|
1520
1523
|
return throwError(() => new Error(error));
|
|
1521
1524
|
}));
|
|
@@ -1526,7 +1529,7 @@ class DocumentHttpService {
|
|
|
1526
1529
|
* @returns {Observable<any>} Observable that emits the save response.
|
|
1527
1530
|
*/
|
|
1528
1531
|
saveDocumentUpload(payload) {
|
|
1529
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1532
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1530
1533
|
return this.http.post(`${this.apiUrl}${URLS.SAVE_DOCUMENT_UPLOAD}`, payload, { headers }).pipe(catchError((error) => {
|
|
1531
1534
|
return throwError(() => new Error(error));
|
|
1532
1535
|
}));
|
|
@@ -1542,7 +1545,7 @@ class DocumentHttpService {
|
|
|
1542
1545
|
const payload = {
|
|
1543
1546
|
statusUpdateDescription: statusUpdateDescription
|
|
1544
1547
|
};
|
|
1545
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1548
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1546
1549
|
return this.http.put(`${this.apiUrl}${URLS.UPDATE_DOCUMENT_STATUS}${documentId}/${status}`, payload, { headers }).pipe(tap((response) => {
|
|
1547
1550
|
if (response && response.status) {
|
|
1548
1551
|
const normalizedStatus = this.normalizeStatus(response.status);
|
|
@@ -1576,7 +1579,7 @@ class DocumentHttpService {
|
|
|
1576
1579
|
* @returns {Observable<any>} Observable that emits the delete response
|
|
1577
1580
|
*/
|
|
1578
1581
|
deleteDocument(documentId, contextId) {
|
|
1579
|
-
let headers = new HttpHeaders().set('Authorization', `Bearer
|
|
1582
|
+
let headers = new HttpHeaders().set('Authorization', `Bearer db15d0f4-46e9-4968-8e37-4371acb093c1`);
|
|
1580
1583
|
return this.http.delete(`${this.apiUrl}${URLS.DELETE_DOCUMENT}${documentId}`, { headers }).pipe(tap(() => {
|
|
1581
1584
|
this.getDocumentCatagories(contextId).subscribe();
|
|
1582
1585
|
this.getUserListByContextId(contextId).subscribe();
|
|
@@ -2378,7 +2381,7 @@ class DocumentService {
|
|
|
2378
2381
|
* @returns {Observable<any>} Observable that emits the newly created document.
|
|
2379
2382
|
*/
|
|
2380
2383
|
create(entity) {
|
|
2381
|
-
const headers = { 'Authorization': 'Bearer
|
|
2384
|
+
const headers = { 'Authorization': 'Bearer db15d0f4-46e9-4968-8e37-4371acb093c1' };
|
|
2382
2385
|
return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD_FILE}`, entity, { headers }).pipe(tap((newEntity) => this.documentStore.add(newEntity)));
|
|
2383
2386
|
}
|
|
2384
2387
|
/**
|
|
@@ -3535,6 +3538,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3535
3538
|
}] } });
|
|
3536
3539
|
|
|
3537
3540
|
class ConfirmationDialogComponent {
|
|
3541
|
+
confirmationService;
|
|
3538
3542
|
confirmationOptions = {
|
|
3539
3543
|
message: 'Are you sure that you want to proceed?',
|
|
3540
3544
|
header: 'Confirmation',
|
|
@@ -3543,13 +3547,12 @@ class ConfirmationDialogComponent {
|
|
|
3543
3547
|
rejectLabel: 'No',
|
|
3544
3548
|
acceptIcon: 'pi pi-check',
|
|
3545
3549
|
rejectIcon: 'pi pi-times',
|
|
3546
|
-
acceptButtonClass: 'btn-
|
|
3550
|
+
acceptButtonClass: 'btn-danger',
|
|
3547
3551
|
rejectButtonClass: 'btn-secondary'
|
|
3548
3552
|
};
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
rejectCallback;
|
|
3553
|
+
constructor(confirmationService) {
|
|
3554
|
+
this.confirmationService = confirmationService;
|
|
3555
|
+
}
|
|
3553
3556
|
/**
|
|
3554
3557
|
* Shows the confirmation dialog with the specified options
|
|
3555
3558
|
* @param options - Configuration options for the confirmation dialog
|
|
@@ -3557,19 +3560,60 @@ class ConfirmationDialogComponent {
|
|
|
3557
3560
|
* @param rejectCallback - Function to execute when user rejects
|
|
3558
3561
|
*/
|
|
3559
3562
|
confirm(options, acceptCallback, rejectCallback) {
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3563
|
+
const confirmation = {
|
|
3564
|
+
message: options.message || this.confirmationOptions.message,
|
|
3565
|
+
header: options.header || this.confirmationOptions.header,
|
|
3566
|
+
icon: options.icon || this.confirmationOptions.icon,
|
|
3567
|
+
acceptLabel: options.acceptLabel || this.confirmationOptions.acceptLabel,
|
|
3568
|
+
rejectLabel: options.rejectLabel || this.confirmationOptions.rejectLabel,
|
|
3569
|
+
acceptIcon: options.acceptIcon || this.confirmationOptions.acceptIcon,
|
|
3570
|
+
rejectIcon: options.rejectIcon || this.confirmationOptions.rejectIcon,
|
|
3571
|
+
accept: acceptCallback,
|
|
3572
|
+
reject: rejectCallback
|
|
3573
|
+
};
|
|
3574
|
+
this.confirmationService.confirm(confirmation);
|
|
3575
|
+
}
|
|
3576
|
+
/**
|
|
3577
|
+
* Static method to show a confirmation dialog (for components that don't want to inject this component)
|
|
3578
|
+
* @param confirmationService - The ConfirmationService instance
|
|
3579
|
+
* @param options - Configuration options for the confirmation dialog
|
|
3580
|
+
* @param acceptCallback - Function to execute when user accepts
|
|
3581
|
+
* @param rejectCallback - Function to execute when user rejects
|
|
3582
|
+
*/
|
|
3583
|
+
static confirm(confirmationService, options, acceptCallback, rejectCallback) {
|
|
3584
|
+
const defaultOptions = {
|
|
3585
|
+
message: 'Are you sure that you want to proceed?',
|
|
3586
|
+
header: 'Confirmation',
|
|
3587
|
+
icon: 'pi pi-exclamation-triangle',
|
|
3588
|
+
acceptLabel: 'Yes',
|
|
3589
|
+
rejectLabel: 'No',
|
|
3590
|
+
acceptIcon: 'pi pi-check',
|
|
3591
|
+
rejectIcon: 'pi pi-times',
|
|
3592
|
+
acceptButtonClass: 'btn-success',
|
|
3593
|
+
rejectButtonClass: 'btn-secondary'
|
|
3594
|
+
};
|
|
3595
|
+
const confirmation = {
|
|
3596
|
+
message: options.message || defaultOptions.message,
|
|
3597
|
+
header: options.header || defaultOptions.header,
|
|
3598
|
+
icon: options.icon || defaultOptions.icon,
|
|
3599
|
+
acceptLabel: options.acceptLabel || defaultOptions.acceptLabel,
|
|
3600
|
+
rejectLabel: options.rejectLabel || defaultOptions.rejectLabel,
|
|
3601
|
+
acceptIcon: options.acceptIcon || defaultOptions.acceptIcon,
|
|
3602
|
+
rejectIcon: options.rejectIcon || defaultOptions.rejectIcon,
|
|
3603
|
+
accept: acceptCallback,
|
|
3604
|
+
reject: rejectCallback
|
|
3605
|
+
};
|
|
3606
|
+
confirmationService.confirm(confirmation);
|
|
3564
3607
|
}
|
|
3565
3608
|
/**
|
|
3566
|
-
*
|
|
3609
|
+
* Static method to show a delete confirmation dialog
|
|
3610
|
+
* @param confirmationService - The ConfirmationService instance
|
|
3567
3611
|
* @param itemName - Name of the item to be deleted
|
|
3568
3612
|
* @param acceptCallback - Function to execute when user accepts deletion
|
|
3569
3613
|
* @param rejectCallback - Function to execute when user rejects deletion
|
|
3570
3614
|
*/
|
|
3571
|
-
confirmDelete(itemName, acceptCallback, rejectCallback) {
|
|
3572
|
-
|
|
3615
|
+
static confirmDelete(confirmationService, itemName, acceptCallback, rejectCallback) {
|
|
3616
|
+
ConfirmationDialogComponent.confirm(confirmationService, {
|
|
3573
3617
|
message: `Are you sure you want to delete "${itemName}"?`,
|
|
3574
3618
|
header: 'Delete Confirmation',
|
|
3575
3619
|
acceptLabel: 'Delete',
|
|
@@ -3577,31 +3621,26 @@ class ConfirmationDialogComponent {
|
|
|
3577
3621
|
acceptButtonClass: 'btn-danger'
|
|
3578
3622
|
}, acceptCallback, rejectCallback);
|
|
3579
3623
|
}
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
this.acceptCallback();
|
|
3584
|
-
}
|
|
3585
|
-
}
|
|
3586
|
-
onReject() {
|
|
3587
|
-
this.isVisible = false;
|
|
3588
|
-
if (this.rejectCallback) {
|
|
3589
|
-
this.rejectCallback();
|
|
3590
|
-
}
|
|
3591
|
-
}
|
|
3592
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfirmationDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3593
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ConfirmationDialogComponent, isStandalone: false, selector: "app-confirmation-dialog", inputs: { confirmationOptions: "confirmationOptions" }, ngImport: i0, template: "<div *ngIf=\"isVisible\" class=\"custom-confirmation-overlay\">\r\n <div class=\"custom-confirmation-dialog\">\r\n <div class=\"dialog-header\">\r\n <i *ngIf=\"currentOptions.icon\" [class]=\"currentOptions.icon\"></i>\r\n <h3>{{ currentOptions.header }}</h3>\r\n </div>\r\n <div class=\"dialog-content\">\r\n <p>{{ currentOptions.message }}</p>\r\n </div>\r\n <div class=\"dialog-actions\">\r\n <button \r\n type=\"button\" \r\n pButton\r\n class=\"btn btn-secondary\"\r\n (click)=\"onReject()\">\r\n <i *ngIf=\"currentOptions.rejectIcon\" [class]=\"currentOptions.rejectIcon\"></i>\r\n {{ currentOptions.rejectLabel }}\r\n </button>\r\n <button \r\n type=\"button\" \r\n pButton\r\n [class]=\"'btn ' + currentOptions.acceptButtonClass\"\r\n (click)=\"onAccept()\">\r\n <i *ngIf=\"currentOptions.acceptIcon\" [class]=\"currentOptions.acceptIcon\"></i>\r\n {{ currentOptions.acceptLabel }}\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".custom-confirmation-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#00000080;display:flex;align-items:center;justify-content:center;z-index:10001}.custom-confirmation-dialog{background:#fff;border-radius:8px;padding:1.5rem;max-width:400px;width:90%;box-shadow:0 4px 20px #00000026}.dialog-header{display:flex;align-items:center;gap:.5rem;margin-bottom:1rem;padding-bottom:1rem;border-bottom:1px solid #e9ecef}.dialog-header h3{margin:0;font-size:1.25rem;font-weight:600}.dialog-content{margin-bottom:1.5rem}.dialog-content p{margin:0;color:#495057;line-height:1.5}.dialog-actions{display:flex;gap:.75rem;justify-content:flex-end}.btn{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.875rem;font-weight:500;display:flex;align-items:center;gap:.5rem;transition:all .2s ease}.btn:hover{transform:translateY(-1px);box-shadow:0 2px 8px #00000026}.btn-secondary{background-color:#6c757d;color:#fff}.btn-secondary:hover{background-color:#5a6268}.btn-success{background-color:#28a745;color:#fff}.btn-success:hover{background-color:#218838}.btn-danger{background-color:#dc3545;color:#fff}.btn-danger:hover{background-color:#c82333}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }] });
|
|
3624
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfirmationDialogComponent, deps: [{ token: i3.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3625
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ConfirmationDialogComponent, isStandalone: false, selector: "app-confirmation-dialog", inputs: { confirmationOptions: "confirmationOptions" }, ngImport: i0, template: "<!-- This component no longer renders a p-confirmDialog element -->\n<!-- The p-confirmDialog should be placed only once in the main app component -->\n<!-- This component now only provides methods to trigger confirmations via ConfirmationService -->\n", styles: [".btn-danger{background-color:#ef4444;color:#fff;border-color:#e53e3e;max-width:100px}.btn-secondary{background-color:#f3f4f6;color:#000;max-width:100px}\n"] });
|
|
3626
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfirmationDialogComponent, providedIn: 'root' });
|
|
3594
3627
|
}
|
|
3595
3628
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfirmationDialogComponent, decorators: [{
|
|
3629
|
+
type: Injectable,
|
|
3630
|
+
args: [{
|
|
3631
|
+
providedIn: 'root'
|
|
3632
|
+
}]
|
|
3633
|
+
}, {
|
|
3596
3634
|
type: Component,
|
|
3597
|
-
args: [{ selector: 'app-confirmation-dialog', standalone: false, template: "
|
|
3598
|
-
}], propDecorators: { confirmationOptions: [{
|
|
3635
|
+
args: [{ selector: 'app-confirmation-dialog', standalone: false, template: "<!-- This component no longer renders a p-confirmDialog element -->\n<!-- The p-confirmDialog should be placed only once in the main app component -->\n<!-- This component now only provides methods to trigger confirmations via ConfirmationService -->\n", styles: [".btn-danger{background-color:#ef4444;color:#fff;border-color:#e53e3e;max-width:100px}.btn-secondary{background-color:#f3f4f6;color:#000;max-width:100px}\n"] }]
|
|
3636
|
+
}], ctorParameters: () => [{ type: i3.ConfirmationService }], propDecorators: { confirmationOptions: [{
|
|
3599
3637
|
type: Input
|
|
3600
3638
|
}] } });
|
|
3601
3639
|
|
|
3602
3640
|
class SidebarComponent {
|
|
3603
|
-
|
|
3604
|
-
//
|
|
3641
|
+
confirmationService;
|
|
3642
|
+
// Flag to prevent multiple confirmations
|
|
3643
|
+
isShowingConfirmation = false;
|
|
3605
3644
|
set visible(value) {
|
|
3606
3645
|
this._visible = value;
|
|
3607
3646
|
}
|
|
@@ -3609,17 +3648,12 @@ class SidebarComponent {
|
|
|
3609
3648
|
return this._visible;
|
|
3610
3649
|
}
|
|
3611
3650
|
_visible = false;
|
|
3612
|
-
// Flag to prevent double event emission
|
|
3613
|
-
isProgrammaticallyClosing = false;
|
|
3614
3651
|
position = 'right';
|
|
3615
3652
|
width = SHARED.WIDTH;
|
|
3616
3653
|
title = SHARED.EMPTY;
|
|
3617
3654
|
showCloseButton = true;
|
|
3618
3655
|
modal = true;
|
|
3619
3656
|
dismissible = true;
|
|
3620
|
-
closeOnEscape = true;
|
|
3621
|
-
baseZIndex = 10000;
|
|
3622
|
-
autoZIndex = false;
|
|
3623
3657
|
styleClass = SHARED.EMPTY;
|
|
3624
3658
|
appendTo = 'body';
|
|
3625
3659
|
blockScroll = true;
|
|
@@ -3634,7 +3668,7 @@ class SidebarComponent {
|
|
|
3634
3668
|
onShow = new EventEmitter();
|
|
3635
3669
|
onHide = new EventEmitter();
|
|
3636
3670
|
onSave = new EventEmitter();
|
|
3637
|
-
|
|
3671
|
+
onClose = new EventEmitter();
|
|
3638
3672
|
showSuccessMessage = false;
|
|
3639
3673
|
showErrorMessage = false;
|
|
3640
3674
|
destroy$ = new Subject();
|
|
@@ -3650,23 +3684,32 @@ class SidebarComponent {
|
|
|
3650
3684
|
acceptButtonClass: SHARED.ACCEPT_BUTTON_STYLE_CLASS,
|
|
3651
3685
|
rejectButtonClass: SHARED.REJECT_BUTTON_STYLE_CLASS
|
|
3652
3686
|
};
|
|
3653
|
-
constructor() {
|
|
3687
|
+
constructor(confirmationService) {
|
|
3688
|
+
this.confirmationService = confirmationService;
|
|
3654
3689
|
}
|
|
3655
3690
|
/**
|
|
3656
3691
|
* Handles the onHide event from PrimeNG sidebar
|
|
3692
|
+
* Only emits when actually closing, not when showing confirmation
|
|
3657
3693
|
*/
|
|
3658
3694
|
onSidebarHide() {
|
|
3659
|
-
if
|
|
3695
|
+
// Only emit onHide if we're not showing confirmation
|
|
3696
|
+
if (!this.isShowingConfirmation) {
|
|
3660
3697
|
this.onHide.emit();
|
|
3661
3698
|
}
|
|
3662
3699
|
}
|
|
3663
3700
|
/**
|
|
3664
3701
|
* Handles the visibleChange event from PrimeNG sidebar
|
|
3702
|
+
* Intercepts automatic closing to show confirmation if needed
|
|
3665
3703
|
*/
|
|
3666
3704
|
onVisibleChange(value) {
|
|
3667
|
-
|
|
3668
|
-
|
|
3705
|
+
// If PrimeNG is trying to close the sidebar and we have unsaved changes
|
|
3706
|
+
if (!value && this.hasUnsavedChanges && !this.isShowingConfirmation) {
|
|
3707
|
+
// Prevent the close and show confirmation
|
|
3708
|
+
this._visible = true;
|
|
3709
|
+
this.showUnsavedChangesConfirmation();
|
|
3710
|
+
return;
|
|
3669
3711
|
}
|
|
3712
|
+
this.visibleChange.emit(value);
|
|
3670
3713
|
}
|
|
3671
3714
|
/**
|
|
3672
3715
|
* Opens the sidebar
|
|
@@ -3681,94 +3724,36 @@ class SidebarComponent {
|
|
|
3681
3724
|
* Closes the sidebar
|
|
3682
3725
|
*/
|
|
3683
3726
|
close() {
|
|
3684
|
-
this.isProgrammaticallyClosing = true;
|
|
3685
|
-
this._visible = false;
|
|
3686
|
-
this.clearMessages();
|
|
3687
|
-
this.visibleChange.emit(this._visible);
|
|
3688
|
-
this.onHide.emit();
|
|
3689
|
-
this.isProgrammaticallyClosing = false;
|
|
3690
|
-
}
|
|
3691
|
-
/**
|
|
3692
|
-
* Closes the sidebar and discards all changes
|
|
3693
|
-
*/
|
|
3694
|
-
closeAndDiscardChanges() {
|
|
3695
|
-
this.isProgrammaticallyClosing = true;
|
|
3696
3727
|
this._visible = false;
|
|
3697
3728
|
this.clearMessages();
|
|
3698
3729
|
this.visibleChange.emit(this._visible);
|
|
3699
|
-
this.onDiscardChanges.emit();
|
|
3700
3730
|
this.onHide.emit();
|
|
3701
|
-
this.isProgrammaticallyClosing = false;
|
|
3702
3731
|
}
|
|
3703
3732
|
/**
|
|
3704
|
-
*
|
|
3733
|
+
* Handles escape key press
|
|
3734
|
+
* Shows confirmation if there are unsaved changes
|
|
3705
3735
|
*/
|
|
3706
|
-
|
|
3707
|
-
this.
|
|
3708
|
-
|
|
3709
|
-
this.
|
|
3710
|
-
this.onShow.emit();
|
|
3736
|
+
handleEscapeKey(event) {
|
|
3737
|
+
if (this.visible) {
|
|
3738
|
+
event.preventDefault();
|
|
3739
|
+
this.handleClose();
|
|
3711
3740
|
}
|
|
3712
|
-
else {
|
|
3713
|
-
this.clearMessages();
|
|
3714
|
-
this.onHide.emit();
|
|
3715
|
-
}
|
|
3716
|
-
this.visibleChange.emit(this._visible);
|
|
3717
3741
|
}
|
|
3718
3742
|
/**
|
|
3719
|
-
* Handles
|
|
3743
|
+
* Handles backdrop click events
|
|
3744
|
+
* Prevents default PrimeNG behavior and shows confirmation if needed
|
|
3720
3745
|
*/
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
else {
|
|
3726
|
-
this.close();
|
|
3727
|
-
}
|
|
3746
|
+
handleBackdropClick(event) {
|
|
3747
|
+
event.preventDefault();
|
|
3748
|
+
event.stopPropagation();
|
|
3749
|
+
this.handleClose();
|
|
3728
3750
|
}
|
|
3729
3751
|
/**
|
|
3730
|
-
* Handles
|
|
3752
|
+
* Handles all closing scenarios (backdrop click, escape key, close button, etc.)
|
|
3753
|
+
* This is the single entry point for all closing logic
|
|
3731
3754
|
*/
|
|
3732
|
-
|
|
3733
|
-
if (this.
|
|
3734
|
-
if (this.hasUnsavedChanges) {
|
|
3735
|
-
this.showUnsavedChangesConfirmation();
|
|
3736
|
-
}
|
|
3737
|
-
else {
|
|
3738
|
-
this.close();
|
|
3739
|
-
}
|
|
3740
|
-
}
|
|
3741
|
-
}
|
|
3742
|
-
/**
|
|
3743
|
-
* Handles the escape key press with unsaved changes check
|
|
3744
|
-
*/
|
|
3745
|
-
onEscapeKey(event) {
|
|
3746
|
-
if (this._visible && this.closeOnEscape) {
|
|
3747
|
-
if (this.hasUnsavedChanges) {
|
|
3748
|
-
event.preventDefault();
|
|
3749
|
-
this.showUnsavedChangesConfirmation();
|
|
3750
|
-
}
|
|
3751
|
-
else {
|
|
3752
|
-
this.close();
|
|
3753
|
-
}
|
|
3754
|
-
}
|
|
3755
|
-
}
|
|
3756
|
-
/**
|
|
3757
|
-
* Handles backdrop click with unsaved changes check
|
|
3758
|
-
*/
|
|
3759
|
-
onBackdropClick(event) {
|
|
3760
|
-
if (this.hasUnsavedChanges) {
|
|
3761
|
-
this.showUnsavedChangesConfirmation();
|
|
3762
|
-
}
|
|
3763
|
-
else {
|
|
3764
|
-
this.close();
|
|
3765
|
-
}
|
|
3766
|
-
}
|
|
3767
|
-
/**
|
|
3768
|
-
* Handles close button click with unsaved changes check
|
|
3769
|
-
*/
|
|
3770
|
-
onCloseButtonClick() {
|
|
3771
|
-
if (this.hasUnsavedChanges) {
|
|
3755
|
+
handleClose() {
|
|
3756
|
+
if (this.hasUnsavedChanges && !this.isShowingConfirmation) {
|
|
3772
3757
|
this.showUnsavedChangesConfirmation();
|
|
3773
3758
|
}
|
|
3774
3759
|
else {
|
|
@@ -3779,9 +3764,17 @@ class SidebarComponent {
|
|
|
3779
3764
|
* Shows confirmation dialog for unsaved changes
|
|
3780
3765
|
*/
|
|
3781
3766
|
showUnsavedChangesConfirmation() {
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
}
|
|
3767
|
+
if (this.isShowingConfirmation) {
|
|
3768
|
+
return; // Prevent multiple confirmations
|
|
3769
|
+
}
|
|
3770
|
+
this.isShowingConfirmation = true;
|
|
3771
|
+
ConfirmationDialogComponent.confirm(this.confirmationService, this.unsavedChangesConfirmationOptions, () => {
|
|
3772
|
+
this.isShowingConfirmation = false;
|
|
3773
|
+
this.close();
|
|
3774
|
+
this.onClose.emit(); // Emit close event when user confirms
|
|
3775
|
+
}, () => {
|
|
3776
|
+
this.isShowingConfirmation = false;
|
|
3777
|
+
});
|
|
3785
3778
|
}
|
|
3786
3779
|
/**
|
|
3787
3780
|
* Shows success message and closes sidebar after delay
|
|
@@ -3823,16 +3816,13 @@ class SidebarComponent {
|
|
|
3823
3816
|
this.destroy$.next();
|
|
3824
3817
|
this.destroy$.complete();
|
|
3825
3818
|
}
|
|
3826
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3827
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: SidebarComponent, isStandalone: false, selector: "lib-sidebar", inputs: { visible: "visible", position: "position", width: "width", title: "title", showCloseButton: "showCloseButton", modal: "modal", dismissible: "dismissible",
|
|
3819
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SidebarComponent, deps: [{ token: i3.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3820
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: SidebarComponent, isStandalone: false, selector: "lib-sidebar", inputs: { visible: "visible", position: "position", width: "width", title: "title", showCloseButton: "showCloseButton", modal: "modal", dismissible: "dismissible", styleClass: "styleClass", appendTo: "appendTo", blockScroll: "blockScroll", closeIcon: "closeIcon", showSaveButton: "showSaveButton", saveButtonText: "saveButtonText", saveButtonDisabled: "saveButtonDisabled", successMessage: "successMessage", errorMessage: "errorMessage", hasUnsavedChanges: "hasUnsavedChanges" }, outputs: { visibleChange: "visibleChange", onShow: "onShow", onHide: "onHide", onSave: "onSave", onClose: "onClose" }, host: { listeners: { "document:keydown.escape": "handleEscapeKey($event)" } }, ngImport: i0, template: "<!-- PrimeNG Sidebar with proper backdrop handling -->\n<p-sidebar \n [(visible)]=\"visible\"\n [position]=\"position\"\n [style]=\"{width: width}\"\n [modal]=\"true\"\n [dismissible]=\"true\"\n [showCloseIcon]=\"false\"\n [styleClass]=\"styleClass\"\n [appendTo]=\"'body'\"\n [blockScroll]=\"blockScroll\"\n (visibleChange)=\"onVisibleChange($event)\"\n (onShow)=\"onShow.emit()\"\n (onHide)=\"onSidebarHide()\"\n (onMaskClick)=\"handleBackdropClick($event)\"\n>\n <ng-template pTemplate=\"header\" *ngIf=\"title || showCloseButton || showSaveButton\">\n <div class=\"sidebar-header\">\n <h3 *ngIf=\"title\" class=\"sidebar-title\">{{ title }}</h3>\n <div class=\"header-content\">\n <ng-content select=\"[header]\"></ng-content>\n \n <p-messages \n *ngIf=\"showSuccessMessage\"\n severity=\"success\"\n [closable]=\"false\"\n [style]=\"{'margin-bottom': '0.5rem'}\"\n class=\"ml-3\"\n >\n <ng-template pTemplate=\"message\">\n <span>{{ successMessage }}</span>\n </ng-template>\n </p-messages>\n <p-messages \n *ngIf=\"showErrorMessage\"\n severity=\"error\"\n [closable]=\"false\"\n [style]=\"{'margin-bottom': '0.5rem'}\"\n class=\"ml-3\"\n >\n <ng-template pTemplate=\"message\">\n <span>{{ errorMessage }}</span>\n </ng-template>\n </p-messages>\n\n <div class=\"header-actions mr-3\">\n <button \n *ngIf=\"showSaveButton\"\n pButton \n type=\"button\" \n [label]=\"saveButtonText\"\n [disabled]=\"saveButtonDisabled\"\n class=\"p-button-primary\"\n (click)=\"onSave.emit()\"\n ></button>\n\n <button \n *ngIf=\"showCloseButton\"\n pButton \n type=\"button\" \n icon=\"pi pi-times\"\n class=\"p-button-text p-button-rounded\"\n (click)=\"handleClose()\"\n ></button>\n \n </div>\n </div>\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"content\">\n <div class=\"sidebar-content\">\n <ng-content></ng-content>\n </div>\n </ng-template>\n</p-sidebar>\n", styles: [":host{display:block}.sidebar-header{display:flex;justify-content:space-between;align-items:center;padding:0;width:100%}.sidebar-title{margin:0;font-size:1.25rem;font-weight:600;color:#212529;flex:1}.header-content{display:flex;align-items:center;gap:.5rem;justify-content:space-between;width:100%}.header-actions{display:flex;align-items:center;gap:.5rem;margin-left:auto;margin-right:0}.close-button{background:none;border:none;color:#6c757d;cursor:pointer;padding:.5rem;border-radius:.375rem;transition:all .2s ease;display:flex;align-items:center;justify-content:center;min-width:2rem;min-height:2rem;margin-right:.5rem}.close-button:hover{background-color:#e9ecef;color:#495057}.close-button:focus{outline:none;box-shadow:0 0 0 3px #0f8bfd4d}.close-button i{font-size:1rem}.sidebar-content{height:100%;overflow-y:auto;padding:0}.header-actions .p-button-text.p-button-rounded{width:2rem;height:2rem;border-radius:50%}.header-actions .p-button-text.p-button-rounded:hover{background-color:#0000001a}::ng-deep .p-sidebar .p-sidebar-header{border-bottom:1px solid #e9ecef;margin-bottom:1rem;background-color:#f8f9fa}::ng-deep .p-sidebar .p-sidebar-content{padding:0 1.5rem 1.5rem;height:calc(100% - 80px);overflow-y:auto}::ng-deep .p-sidebar.p-sidebar-right .p-sidebar-content{padding-left:1.5rem;padding-right:1.5rem}::ng-deep .p-sidebar.p-sidebar-left .p-sidebar-content{padding-left:1.5rem;padding-right:1.5rem}@media (max-width: 768px){::ng-deep .p-sidebar{width:100%!important;max-width:100%!important}::ng-deep .p-sidebar .p-sidebar-header{padding:1rem 1rem 0}::ng-deep .p-sidebar .p-sidebar-content{padding:0 1rem 1rem}}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i9.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i4.Sidebar, selector: "p-sidebar", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "component", type: i5.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }] });
|
|
3828
3821
|
}
|
|
3829
3822
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SidebarComponent, decorators: [{
|
|
3830
3823
|
type: Component,
|
|
3831
|
-
args: [{ selector: 'lib-sidebar', standalone: false, template: "<!--
|
|
3832
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
3833
|
-
type: ViewChild,
|
|
3834
|
-
args: ['confirmationDialog']
|
|
3835
|
-
}], visible: [{
|
|
3824
|
+
args: [{ selector: 'lib-sidebar', standalone: false, template: "<!-- PrimeNG Sidebar with proper backdrop handling -->\n<p-sidebar \n [(visible)]=\"visible\"\n [position]=\"position\"\n [style]=\"{width: width}\"\n [modal]=\"true\"\n [dismissible]=\"true\"\n [showCloseIcon]=\"false\"\n [styleClass]=\"styleClass\"\n [appendTo]=\"'body'\"\n [blockScroll]=\"blockScroll\"\n (visibleChange)=\"onVisibleChange($event)\"\n (onShow)=\"onShow.emit()\"\n (onHide)=\"onSidebarHide()\"\n (onMaskClick)=\"handleBackdropClick($event)\"\n>\n <ng-template pTemplate=\"header\" *ngIf=\"title || showCloseButton || showSaveButton\">\n <div class=\"sidebar-header\">\n <h3 *ngIf=\"title\" class=\"sidebar-title\">{{ title }}</h3>\n <div class=\"header-content\">\n <ng-content select=\"[header]\"></ng-content>\n \n <p-messages \n *ngIf=\"showSuccessMessage\"\n severity=\"success\"\n [closable]=\"false\"\n [style]=\"{'margin-bottom': '0.5rem'}\"\n class=\"ml-3\"\n >\n <ng-template pTemplate=\"message\">\n <span>{{ successMessage }}</span>\n </ng-template>\n </p-messages>\n <p-messages \n *ngIf=\"showErrorMessage\"\n severity=\"error\"\n [closable]=\"false\"\n [style]=\"{'margin-bottom': '0.5rem'}\"\n class=\"ml-3\"\n >\n <ng-template pTemplate=\"message\">\n <span>{{ errorMessage }}</span>\n </ng-template>\n </p-messages>\n\n <div class=\"header-actions mr-3\">\n <button \n *ngIf=\"showSaveButton\"\n pButton \n type=\"button\" \n [label]=\"saveButtonText\"\n [disabled]=\"saveButtonDisabled\"\n class=\"p-button-primary\"\n (click)=\"onSave.emit()\"\n ></button>\n\n <button \n *ngIf=\"showCloseButton\"\n pButton \n type=\"button\" \n icon=\"pi pi-times\"\n class=\"p-button-text p-button-rounded\"\n (click)=\"handleClose()\"\n ></button>\n \n </div>\n </div>\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"content\">\n <div class=\"sidebar-content\">\n <ng-content></ng-content>\n </div>\n </ng-template>\n</p-sidebar>\n", styles: [":host{display:block}.sidebar-header{display:flex;justify-content:space-between;align-items:center;padding:0;width:100%}.sidebar-title{margin:0;font-size:1.25rem;font-weight:600;color:#212529;flex:1}.header-content{display:flex;align-items:center;gap:.5rem;justify-content:space-between;width:100%}.header-actions{display:flex;align-items:center;gap:.5rem;margin-left:auto;margin-right:0}.close-button{background:none;border:none;color:#6c757d;cursor:pointer;padding:.5rem;border-radius:.375rem;transition:all .2s ease;display:flex;align-items:center;justify-content:center;min-width:2rem;min-height:2rem;margin-right:.5rem}.close-button:hover{background-color:#e9ecef;color:#495057}.close-button:focus{outline:none;box-shadow:0 0 0 3px #0f8bfd4d}.close-button i{font-size:1rem}.sidebar-content{height:100%;overflow-y:auto;padding:0}.header-actions .p-button-text.p-button-rounded{width:2rem;height:2rem;border-radius:50%}.header-actions .p-button-text.p-button-rounded:hover{background-color:#0000001a}::ng-deep .p-sidebar .p-sidebar-header{border-bottom:1px solid #e9ecef;margin-bottom:1rem;background-color:#f8f9fa}::ng-deep .p-sidebar .p-sidebar-content{padding:0 1.5rem 1.5rem;height:calc(100% - 80px);overflow-y:auto}::ng-deep .p-sidebar.p-sidebar-right .p-sidebar-content{padding-left:1.5rem;padding-right:1.5rem}::ng-deep .p-sidebar.p-sidebar-left .p-sidebar-content{padding-left:1.5rem;padding-right:1.5rem}@media (max-width: 768px){::ng-deep .p-sidebar{width:100%!important;max-width:100%!important}::ng-deep .p-sidebar .p-sidebar-header{padding:1rem 1rem 0}::ng-deep .p-sidebar .p-sidebar-content{padding:0 1rem 1rem}}\n"] }]
|
|
3825
|
+
}], ctorParameters: () => [{ type: i3.ConfirmationService }], propDecorators: { visible: [{
|
|
3836
3826
|
type: Input
|
|
3837
3827
|
}], position: [{
|
|
3838
3828
|
type: Input
|
|
@@ -3846,12 +3836,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3846
3836
|
type: Input
|
|
3847
3837
|
}], dismissible: [{
|
|
3848
3838
|
type: Input
|
|
3849
|
-
}], closeOnEscape: [{
|
|
3850
|
-
type: Input
|
|
3851
|
-
}], baseZIndex: [{
|
|
3852
|
-
type: Input
|
|
3853
|
-
}], autoZIndex: [{
|
|
3854
|
-
type: Input
|
|
3855
3839
|
}], styleClass: [{
|
|
3856
3840
|
type: Input
|
|
3857
3841
|
}], appendTo: [{
|
|
@@ -3880,9 +3864,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3880
3864
|
type: Output
|
|
3881
3865
|
}], onSave: [{
|
|
3882
3866
|
type: Output
|
|
3883
|
-
}],
|
|
3867
|
+
}], onClose: [{
|
|
3884
3868
|
type: Output
|
|
3885
|
-
}],
|
|
3869
|
+
}], handleEscapeKey: [{
|
|
3886
3870
|
type: HostListener,
|
|
3887
3871
|
args: ['document:keydown.escape', ['$event']]
|
|
3888
3872
|
}] } });
|
|
@@ -4476,7 +4460,7 @@ class FolderContainerComponent {
|
|
|
4476
4460
|
}
|
|
4477
4461
|
}
|
|
4478
4462
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FolderContainerComponent, deps: [{ token: DocumentQuery }, { token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4479
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FolderContainerComponent, isStandalone: false, selector: "lib-folder-container", inputs: { documentList: "documentList", folderList: "folderList", contextId: "contextId", userList: "userList", statusData: "statusData", categories: "categories" }, viewQueries: [{ propertyName: "documentUploadComponent", first: true, predicate: DocumentUploadComponent, descendants: true }, { propertyName: "sidebarComponent", first: true, predicate: SidebarComponent, descendants: true }], ngImport: i0, template: "\
|
|
4463
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FolderContainerComponent, isStandalone: false, selector: "lib-folder-container", inputs: { documentList: "documentList", folderList: "folderList", contextId: "contextId", userList: "userList", statusData: "statusData", categories: "categories" }, viewQueries: [{ propertyName: "documentUploadComponent", first: true, predicate: DocumentUploadComponent, descendants: true }, { propertyName: "sidebarComponent", first: true, predicate: SidebarComponent, descendants: true }], ngImport: i0, template: "\n<document-search [contextId]=\"contextId\" (onActionClick)=\"openDocumentUploadSidebar()\"></document-search>\n<div class=\"user-list-wrapper\" [@slideInOut]=\"userListAnimationState\">\n <lib-user-list [userList]=\"userList\" [categories]=\"categories\"></lib-user-list>\n</div>\n<lib-document-status [contextId]=\"contextId\" [statusData]=\"statusData\"></lib-document-status>\n\n<!-- Document Upload Sidebar -->\n<lib-sidebar\n [(visible)]=\"isDocumentUploadSidebarOpen\"\n position=\"right\"\n width=\"600px\"\n title=\"Upload Documents\"\n [showCloseButton]=\"true\"\n [showSaveButton]=\"true\"\n [saveButtonText]=\"'Save'\"\n [saveButtonDisabled]=\"isSaveButtonDisabled\"\n [successMessage]=\"'Document Saved Successfully'\"\n [hasUnsavedChanges]=\"hasUnsavedChanges\"\n (onHide)=\"onDocumentUploadSidebarHide()\"\n (onSave)=\"onDocumentUploadSave()\"\n (onClose)=\"onDocumentUploadSidebarCloseWithUnsavedChanges()\"\n>\n <lib-document-upload \n [contextId]=\"contextId\" \n (onFormValidationChange)=\"onFormValidationChange()\" \n (onUploadSuccess)=\"onDocumentUploadSuccess()\"\n (onUploadError)=\"onDocumentUploadError($event)\"\n ></lib-document-upload>\n</lib-sidebar>", styles: [".user-list-wrapper{overflow:hidden;margin-bottom:1rem}.user-list-wrapper ::ng-deep *{transition:opacity .2s ease-in-out}.user-list-wrapper.ng-animating{pointer-events:none}::ng-deep lib-user-list{display:block;width:100%}\n"], dependencies: [{ kind: "component", type: DocumentUploadComponent, selector: "lib-document-upload", inputs: ["contextId"], outputs: ["onFormValidationChange", "onUploadSuccess"] }, { kind: "component", type: UserListComponent, selector: "lib-user-list", inputs: ["userList", "categories"], outputs: ["userSelected"] }, { kind: "component", type: DocumentStatusComponent, selector: "lib-document-status", inputs: ["contextId", "statusData"] }, { kind: "component", type: DocumentSearchComponent, selector: "document-search", inputs: ["contextId"], outputs: ["onActionClick"] }, { kind: "component", type: SidebarComponent, selector: "lib-sidebar", inputs: ["visible", "position", "width", "title", "showCloseButton", "modal", "dismissible", "styleClass", "appendTo", "blockScroll", "closeIcon", "showSaveButton", "saveButtonText", "saveButtonDisabled", "successMessage", "errorMessage", "hasUnsavedChanges"], outputs: ["visibleChange", "onShow", "onHide", "onSave", "onClose"] }], animations: [
|
|
4480
4464
|
trigger('slideInOut', [
|
|
4481
4465
|
state('visible', style({
|
|
4482
4466
|
height: '*',
|
|
@@ -4530,7 +4514,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4530
4514
|
animate('300ms cubic-bezier(0.0, 0.0, 0.2, 1)')
|
|
4531
4515
|
])
|
|
4532
4516
|
])
|
|
4533
|
-
], template: "\
|
|
4517
|
+
], template: "\n<document-search [contextId]=\"contextId\" (onActionClick)=\"openDocumentUploadSidebar()\"></document-search>\n<div class=\"user-list-wrapper\" [@slideInOut]=\"userListAnimationState\">\n <lib-user-list [userList]=\"userList\" [categories]=\"categories\"></lib-user-list>\n</div>\n<lib-document-status [contextId]=\"contextId\" [statusData]=\"statusData\"></lib-document-status>\n\n<!-- Document Upload Sidebar -->\n<lib-sidebar\n [(visible)]=\"isDocumentUploadSidebarOpen\"\n position=\"right\"\n width=\"600px\"\n title=\"Upload Documents\"\n [showCloseButton]=\"true\"\n [showSaveButton]=\"true\"\n [saveButtonText]=\"'Save'\"\n [saveButtonDisabled]=\"isSaveButtonDisabled\"\n [successMessage]=\"'Document Saved Successfully'\"\n [hasUnsavedChanges]=\"hasUnsavedChanges\"\n (onHide)=\"onDocumentUploadSidebarHide()\"\n (onSave)=\"onDocumentUploadSave()\"\n (onClose)=\"onDocumentUploadSidebarCloseWithUnsavedChanges()\"\n>\n <lib-document-upload \n [contextId]=\"contextId\" \n (onFormValidationChange)=\"onFormValidationChange()\" \n (onUploadSuccess)=\"onDocumentUploadSuccess()\"\n (onUploadError)=\"onDocumentUploadError($event)\"\n ></lib-document-upload>\n</lib-sidebar>", styles: [".user-list-wrapper{overflow:hidden;margin-bottom:1rem}.user-list-wrapper ::ng-deep *{transition:opacity .2s ease-in-out}.user-list-wrapper.ng-animating{pointer-events:none}::ng-deep lib-user-list{display:block;width:100%}\n"] }]
|
|
4534
4518
|
}], ctorParameters: () => [{ type: DocumentQuery }, { type: DocumentHelperService }], propDecorators: { documentList: [{
|
|
4535
4519
|
type: Input
|
|
4536
4520
|
}], folderList: [{
|
|
@@ -5623,80 +5607,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
5623
5607
|
}]
|
|
5624
5608
|
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
5625
5609
|
|
|
5626
|
-
/**
|
|
5627
|
-
* Directive to conditionally show or hide elements based on user permissions.
|
|
5628
|
-
* @class HasPermissionDirective
|
|
5629
|
-
* @typedef {HasPermissionDirective}
|
|
5630
|
-
*/
|
|
5631
|
-
class HasPermissionDirective {
|
|
5632
|
-
el;
|
|
5633
|
-
renderer;
|
|
5634
|
-
sessionService;
|
|
5635
|
-
/**
|
|
5636
|
-
* The required permission(s) to display the element.
|
|
5637
|
-
* Accepts a single string or an array of strings.
|
|
5638
|
-
* @type {string | string[]}
|
|
5639
|
-
*/
|
|
5640
|
-
permission;
|
|
5641
|
-
/**
|
|
5642
|
-
* Creates an instance of HasPermissionDirective.
|
|
5643
|
-
* @param {ElementRef} el - Reference to the host element.
|
|
5644
|
-
* @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
|
|
5645
|
-
* @param {SessionService} sessionService - Service to retrieve user permissions.
|
|
5646
|
-
*/
|
|
5647
|
-
constructor(el, renderer, sessionService) {
|
|
5648
|
-
this.el = el;
|
|
5649
|
-
this.renderer = renderer;
|
|
5650
|
-
this.sessionService = sessionService;
|
|
5651
|
-
}
|
|
5652
|
-
/**
|
|
5653
|
-
* Lifecycle hook that is called when input properties change.
|
|
5654
|
-
* @param {SimpleChanges} changes - The changes in input properties.
|
|
5655
|
-
*/
|
|
5656
|
-
ngOnChanges(changes) {
|
|
5657
|
-
if (changes['permission']) {
|
|
5658
|
-
this.checkPermission();
|
|
5659
|
-
}
|
|
5660
|
-
}
|
|
5661
|
-
/**
|
|
5662
|
-
* Checks if the user has the required permission(s).
|
|
5663
|
-
* Hides the element if the permission is not found.
|
|
5664
|
-
*/
|
|
5665
|
-
checkPermission() {
|
|
5666
|
-
// If no permission is required (empty string, null, or undefined), show the element
|
|
5667
|
-
if (!this.permission || this.permission === '' || (Array.isArray(this.permission) && this.permission.length === 0)) {
|
|
5668
|
-
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
5669
|
-
return;
|
|
5670
|
-
}
|
|
5671
|
-
const userPermissionsObjects = this.sessionService.getUserPermissions();
|
|
5672
|
-
const userPermissionNames = userPermissionsObjects?.map((perm) => perm.name) || [];
|
|
5673
|
-
const requiredPermissions = Array.isArray(this.permission)
|
|
5674
|
-
? this.permission
|
|
5675
|
-
: [this.permission];
|
|
5676
|
-
const hasPermission = requiredPermissions.some(permission => userPermissionNames.includes(permission));
|
|
5677
|
-
if (!hasPermission) {
|
|
5678
|
-
this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
|
|
5679
|
-
}
|
|
5680
|
-
else {
|
|
5681
|
-
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
5682
|
-
}
|
|
5683
|
-
}
|
|
5684
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5685
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: HasPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission" }, usesOnChanges: true, ngImport: i0 });
|
|
5686
|
-
}
|
|
5687
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
5688
|
-
type: Directive,
|
|
5689
|
-
args: [{
|
|
5690
|
-
selector: '[permission]',
|
|
5691
|
-
standalone: false
|
|
5692
|
-
}]
|
|
5693
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SessionService }], propDecorators: { permission: [{
|
|
5694
|
-
type: Input
|
|
5695
|
-
}] } });
|
|
5696
|
-
|
|
5697
5610
|
class DocumentActionsComponent {
|
|
5698
5611
|
documentActionsService;
|
|
5699
5612
|
sessionService;
|
|
5613
|
+
confirmationService;
|
|
5700
5614
|
SHARED = SHARED;
|
|
5701
5615
|
document;
|
|
5702
5616
|
documentId;
|
|
@@ -5722,10 +5636,10 @@ class DocumentActionsComponent {
|
|
|
5722
5636
|
showApproveRejectActions = false;
|
|
5723
5637
|
showDeleteAction = false;
|
|
5724
5638
|
showNoActions = false;
|
|
5725
|
-
|
|
5726
|
-
constructor(documentActionsService, sessionService) {
|
|
5639
|
+
constructor(documentActionsService, sessionService, confirmationService) {
|
|
5727
5640
|
this.documentActionsService = documentActionsService;
|
|
5728
5641
|
this.sessionService = sessionService;
|
|
5642
|
+
this.confirmationService = confirmationService;
|
|
5729
5643
|
}
|
|
5730
5644
|
get rejectNote() {
|
|
5731
5645
|
return this._rejectNote;
|
|
@@ -5785,8 +5699,8 @@ class DocumentActionsComponent {
|
|
|
5785
5699
|
this.showRejectDialog = true;
|
|
5786
5700
|
}
|
|
5787
5701
|
onDeleteClick() {
|
|
5788
|
-
const documentName = this.document?.
|
|
5789
|
-
|
|
5702
|
+
const documentName = this.document?.docName || 'this document';
|
|
5703
|
+
ConfirmationDialogComponent.confirmDelete(this.confirmationService, documentName, () => {
|
|
5790
5704
|
this.actionPerformed.emit(this.documentActionsService.createDeleteAction());
|
|
5791
5705
|
}, () => { });
|
|
5792
5706
|
}
|
|
@@ -5808,13 +5722,13 @@ class DocumentActionsComponent {
|
|
|
5808
5722
|
this.acceptNote = SHARED.EMPTY;
|
|
5809
5723
|
this.rejectNote = SHARED.EMPTY;
|
|
5810
5724
|
}
|
|
5811
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentActionsComponent, deps: [{ token: DocumentActionsService }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5812
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentActionsComponent, isStandalone: false, selector: "document-actions", inputs: { document: "document", documentId: "documentId", currentStatus: "currentStatus", isLoading: "isLoading", isUploaded: "isUploaded", statusId: "statusId" }, outputs: { actionPerformed: "actionPerformed" }, viewQueries: [{ propertyName: "confirmationDialog", first: true, predicate: ConfirmationDialogComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"document-actions-container\" *ngIf=\"document?.status !=='Pending' && !document?.isUploaded && document?.status === 'Reviewing'\">\r\n <div class=\"actions-card\" [ngClass]=\"cardClass\">\r\n <div class=\"actions-buttons\">\r\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn reject-btn\" [ngClass]=\"rejectButtonClass\"\r\n (click)=\"onRejectClick()\" [disabled]=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE || isRejecting\">\r\n <i class=\"pi pi-times\" *ngIf=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE\"></i>\r\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isRejecting\"></i>\r\n <span>{{ currentStatus === SHARED.STATUS_REJECTED_LOWERCASE ? SHARED.BUTTON_LABEL_REJECTED :\r\n SHARED.BUTTON_LABEL_REJECT }}</span>\r\n </button>\r\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn accept-btn\" [ngClass]=\"acceptButtonClass\"\r\n (click)=\"onAcceptClick()\" [disabled]=\"currentStatus === SHARED.STATUS_ACCEPTED || isAccepting\">\r\n <i class=\"pi pi-check\" *ngIf=\"currentStatus === SHARED.STATUS_ACCEPTED\"></i>\r\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isAccepting\"></i>\r\n <span>{{ currentStatus === SHARED.STATUS_ACCEPTED ? SHARED.BUTTON_LABEL_ACCEPTED : SHARED.BUTTON_LABEL_ACCEPT\r\n }}</span>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n@if(document?.isUploaded){\r\n<div class=\"actions-card\">\r\n <div class=\"actions-buttons\">\r\n <button class=\"action-btn delete-btn\" (click)=\"onDeleteClick()\" [disabled]=\"isLoading\"\r\n [permission]=\"'documents-deleteDocumentByDocumentId'\" pTooltip=\"Delete Document\" tooltipPosition=\"top\">\r\n <i class=\"pi pi-trash\"></i>\r\n </button>\r\n </div>\r\n</div>\r\n}\r\n<app-confirmation-dialog></app-confirmation-dialog>\r\n\r\n<p-dialog [(visible)]=\"showAcceptDialog\" [header]=\"SHARED.ACCEPT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\r\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\r\n <div class=\"dialog-content\">\r\n <label for=\"acceptNote\" class=\"note-label\">{{ SHARED.ACCEPT_NOTE_LABEL }}</label>\r\n <textarea id=\"acceptNote\" pInputTextarea [(ngModel)]=\"acceptNote\" [placeholder]=\"SHARED.ACCEPT_NOTE_PLACEHOLDER\"\r\n rows=\"6\" class=\"note-textarea\">\r\n </textarea>\r\n </div>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"dialog-footer\">\r\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\r\n </button>\r\n <button pButton [label]=\"SHARED.ACCEPT_BUTTON_LABEL\" class=\"p-button-success\" (click)=\"onAcceptConfirm()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n</p-dialog>\r\n\r\n<p-dialog [(visible)]=\"showRejectDialog\" [header]=\"SHARED.REJECT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\r\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\r\n <div class=\"dialog-content\">\r\n <label for=\"rejectNote\" class=\"note-label\">{{ SHARED.REJECT_NOTE_LABEL }}</label>\r\n <textarea id=\"rejectNote\" pInputTextarea [(ngModel)]=\"rejectNote\" [placeholder]=\"SHARED.REJECT_NOTE_PLACEHOLDER\"\r\n rows=\"6\" class=\"note-textarea\">\r\n </textarea>\r\n </div>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"dialog-footer\">\r\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\r\n </button>\r\n <button pButton [label]=\"SHARED.REJECT_BUTTON_LABEL\" class=\"p-button-danger\" [disabled]=\"isRejectNoteEmpty\"\r\n (click)=\"onRejectConfirm()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n</p-dialog>", styles: [".document-actions-container{margin:0}.actions-card{border-radius:8px;padding:.75rem;box-shadow:0 2px 4px #0000001a;transition:all .3s ease;width:92%;margin-left:3%}.actions-card.pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card.accepted-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card.rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-approved-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card[class*=status-].status-rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card:has(.delete-btn){width:auto;margin-left:0;background-color:#fff;border:1px solid #e2e8f0;padding:.5rem}.actions-buttons{display:flex;gap:.5rem;align-items:center}.action-btn{padding:.5rem 1rem;border-radius:6px;border:1px solid;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:.5rem;min-width:80px;justify-content:center}.action-btn:disabled{opacity:.6;cursor:not-allowed}.action-btn i{font-size:.875rem}.reject-btn.default-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn.default-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn.secondary-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn.secondary-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn.primary-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn.primary-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-approved-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn[class*=status-].status-approved-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn[class*=status-].status-rejected-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn[class*=status-].status-rejected-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-pending-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn[class*=status-].status-pending-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.accept-btn.default-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn.default-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.accept-btn.secondary-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn.secondary-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn.primary-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn.primary-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-approved-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn[class*=status-].status-approved-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-rejected-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn[class*=status-].status-rejected-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn[class*=status-].status-pending-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn[class*=status-].status-pending-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.delete-btn{background-color:#f5f5f5;border-color:#e57373;color:#e57373;padding:.5rem;min-width:auto;width:40px;height:40px;border-radius:6px}.delete-btn:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181;color:#c53030}.delete-btn i{font-size:1rem}:host ::ng-deep .confirmation-dialog .p-dialog{border-radius:8px;box-shadow:0 4px 12px #00000026;border:none;overflow:hidden}:host ::ng-deep .confirmation-dialog .p-dialog-header{padding:1.25rem 1.5rem;background-color:#fff;border-bottom:none;border-top-right-radius:10px;border-top-left-radius:10px}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-header-icon{display:none}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-title{font-size:1.125rem;font-weight:600;color:#2d3748;margin:0}:host ::ng-deep .confirmation-dialog .p-dialog-content{padding:1.5rem;background-color:#fff}:host ::ng-deep .confirmation-dialog .p-dialog-footer{padding:1rem 1.5rem;background-color:#f7fafc;border-top:1px solid #e2e8f0;display:flex;gap:.75rem;justify-content:flex-end;border-bottom-right-radius:10px;border-bottom-left-radius:10px}.dialog-content .note-label{display:block;margin-bottom:.75rem;font-weight:500;font-size:.875rem;color:#2d3748}.dialog-content .note-textarea{width:100%;min-height:100px;padding:.75rem;border:1px solid #e2e8f0;border-radius:6px;font-family:inherit;font-size:.875rem;line-height:1.5;resize:vertical;background-color:#fff;color:#2d3748}.dialog-content .note-textarea::placeholder{color:#a0aec0}.dialog-content .note-textarea:focus{outline:none;border-color:#3182ce;box-shadow:0 0 0 3px #3182ce1a}.dialog-footer{display:flex;gap:.75rem;justify-content:flex-end}.dialog-footer button{min-width:80px;padding:.5rem 1rem;border-radius:6px;font-weight:500;font-size:.875rem;border:1px solid;cursor:pointer;transition:all .2s ease}.dialog-footer button.p-button-secondary{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.dialog-footer button.p-button-secondary:hover{background-color:#edf2f7;border-color:#cbd5e0}.dialog-footer button.p-button-success{background-color:#38a169;border-color:#38a169;color:#fff}.dialog-footer button.p-button-success:hover{background-color:#2f855a;border-color:#2f855a}.dialog-footer button.p-button-danger{background-color:#e53e3e;border-color:#e53e3e;color:#fff}.dialog-footer button.p-button-danger:hover{background-color:#c53030;border-color:#c53030}.no-actions-message{display:flex;align-items:center;justify-content:center;padding:.5rem;min-height:40px}.no-actions-message .no-actions-text{color:#6b7280;font-size:.875rem;font-style:italic;text-align:center}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i9.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "directive", type: i6.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { kind: "directive", type: i7.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: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i9$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: HasPermissionDirective, selector: "[permission]", inputs: ["permission"] }, { kind: "component", type: ConfirmationDialogComponent, selector: "app-confirmation-dialog", inputs: ["confirmationOptions"] }] });
|
|
5725
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentActionsComponent, deps: [{ token: DocumentActionsService }, { token: SessionService }, { token: i3.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5726
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentActionsComponent, isStandalone: false, selector: "document-actions", inputs: { document: "document", documentId: "documentId", currentStatus: "currentStatus", isLoading: "isLoading", isUploaded: "isUploaded", statusId: "statusId" }, outputs: { actionPerformed: "actionPerformed" }, usesOnChanges: true, ngImport: i0, template: "<!-- <div class=\"document-actions-container\" *ngIf=\"document?.status !=='Pending' && !document?.isUploaded && document?.status === 'Reviewing'\"> -->\n <div class=\"actions-card\" [ngClass]=\"cardClass\">\n <div class=\"actions-buttons\">\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn reject-btn\" [ngClass]=\"rejectButtonClass\"\n (click)=\"onRejectClick()\" [disabled]=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE || isRejecting\">\n <i class=\"pi pi-times\" *ngIf=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE\"></i>\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isRejecting\"></i>\n <span>{{ currentStatus === SHARED.STATUS_REJECTED_LOWERCASE ? SHARED.BUTTON_LABEL_REJECTED :\n SHARED.BUTTON_LABEL_REJECT }}</span>\n </button>\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn accept-btn\" [ngClass]=\"acceptButtonClass\"\n (click)=\"onAcceptClick()\" [disabled]=\"currentStatus === SHARED.STATUS_ACCEPTED || isAccepting\">\n <i class=\"pi pi-check\" *ngIf=\"currentStatus === SHARED.STATUS_ACCEPTED\"></i>\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isAccepting\"></i>\n <span>{{ currentStatus === SHARED.STATUS_ACCEPTED ? SHARED.BUTTON_LABEL_ACCEPTED : SHARED.BUTTON_LABEL_ACCEPT\n }}</span>\n </button>\n </div>\n </div>\n<!-- </div> -->\n\n<!-- @if(document?.isUploaded){ -->\n<div class=\"actions-card\">\n <div class=\"actions-buttons\">\n <button class=\"action-btn delete-btn\" (click)=\"onDeleteClick()\" [disabled]=\"isLoading\"\n pTooltip=\"Delete Document\" tooltipPosition=\"top\">\n <i class=\"pi pi-trash\"></i>\n </button>\n </div>\n</div>\n<!-- } -->\n\n<p-dialog [(visible)]=\"showAcceptDialog\" [header]=\"SHARED.ACCEPT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\n <div class=\"dialog-content\">\n <label for=\"acceptNote\" class=\"note-label\">{{ SHARED.ACCEPT_NOTE_LABEL }}</label>\n <textarea id=\"acceptNote\" pInputTextarea [(ngModel)]=\"acceptNote\" [placeholder]=\"SHARED.ACCEPT_NOTE_PLACEHOLDER\"\n rows=\"6\" class=\"note-textarea\">\n </textarea>\n </div>\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\n </button>\n <button pButton [label]=\"SHARED.ACCEPT_BUTTON_LABEL\" class=\"p-button-success\" (click)=\"onAcceptConfirm()\">\n </button>\n </div>\n </ng-template>\n</p-dialog>\n\n<p-dialog [(visible)]=\"showRejectDialog\" [header]=\"SHARED.REJECT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\n <div class=\"dialog-content\">\n <label for=\"rejectNote\" class=\"note-label\">{{ SHARED.REJECT_NOTE_LABEL }}</label>\n <textarea id=\"rejectNote\" pInputTextarea [(ngModel)]=\"rejectNote\" [placeholder]=\"SHARED.REJECT_NOTE_PLACEHOLDER\"\n rows=\"6\" class=\"note-textarea\">\n </textarea>\n </div>\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\n </button>\n <button pButton [label]=\"SHARED.REJECT_BUTTON_LABEL\" class=\"p-button-danger\" [disabled]=\"isRejectNoteEmpty\"\n (click)=\"onRejectConfirm()\">\n </button>\n </div>\n </ng-template>\n</p-dialog>", styles: [".document-actions-container{margin:0}.actions-card{border-radius:8px;padding:.75rem;box-shadow:0 2px 4px #0000001a;transition:all .3s ease;width:92%;margin-left:3%}.actions-card.pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card.accepted-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card.rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-approved-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card[class*=status-].status-rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card:has(.delete-btn){width:auto;margin-left:0;background-color:#fff;border:1px solid #e2e8f0;padding:.5rem}.actions-buttons{display:flex;gap:.5rem;align-items:center}.action-btn{padding:.5rem 1rem;border-radius:6px;border:1px solid;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:.5rem;min-width:80px;justify-content:center}.action-btn:disabled{opacity:.6;cursor:not-allowed}.action-btn i{font-size:.875rem}.reject-btn.default-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn.default-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn.secondary-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn.secondary-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn.primary-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn.primary-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-approved-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn[class*=status-].status-approved-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn[class*=status-].status-rejected-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn[class*=status-].status-rejected-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-pending-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn[class*=status-].status-pending-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.accept-btn.default-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn.default-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.accept-btn.secondary-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn.secondary-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn.primary-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn.primary-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-approved-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn[class*=status-].status-approved-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-rejected-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn[class*=status-].status-rejected-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn[class*=status-].status-pending-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn[class*=status-].status-pending-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.delete-btn{background-color:#f5f5f5;border-color:#e57373;color:#e57373;padding:.5rem;min-width:auto;width:40px;height:40px;border-radius:6px}.delete-btn:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181;color:#c53030}.delete-btn i{font-size:1rem}:host ::ng-deep .confirmation-dialog .p-dialog{border-radius:8px;box-shadow:0 4px 12px #00000026;border:none;overflow:hidden}:host ::ng-deep .confirmation-dialog .p-dialog-header{padding:1.25rem 1.5rem;background-color:#fff;border-bottom:none;border-top-right-radius:10px;border-top-left-radius:10px}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-header-icon{display:none}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-title{font-size:1.125rem;font-weight:600;color:#2d3748;margin:0}:host ::ng-deep .confirmation-dialog .p-dialog-content{padding:1.5rem;background-color:#fff}:host ::ng-deep .confirmation-dialog .p-dialog-footer{padding:1rem 1.5rem;background-color:#f7fafc;border-top:1px solid #e2e8f0;display:flex;gap:.75rem;justify-content:flex-end;border-bottom-right-radius:10px;border-bottom-left-radius:10px}.dialog-content .note-label{display:block;margin-bottom:.75rem;font-weight:500;font-size:.875rem;color:#2d3748}.dialog-content .note-textarea{width:100%;min-height:100px;padding:.75rem;border:1px solid #e2e8f0;border-radius:6px;font-family:inherit;font-size:.875rem;line-height:1.5;resize:vertical;background-color:#fff;color:#2d3748}.dialog-content .note-textarea::placeholder{color:#a0aec0}.dialog-content .note-textarea:focus{outline:none;border-color:#3182ce;box-shadow:0 0 0 3px #3182ce1a}.dialog-footer{display:flex;gap:.75rem;justify-content:flex-end}.dialog-footer button{min-width:80px;padding:.5rem 1rem;border-radius:6px;font-weight:500;font-size:.875rem;border:1px solid;cursor:pointer;transition:all .2s ease}.dialog-footer button.p-button-secondary{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.dialog-footer button.p-button-secondary:hover{background-color:#edf2f7;border-color:#cbd5e0}.dialog-footer button.p-button-success{background-color:#38a169;border-color:#38a169;color:#fff}.dialog-footer button.p-button-success:hover{background-color:#2f855a;border-color:#2f855a}.dialog-footer button.p-button-danger{background-color:#e53e3e;border-color:#e53e3e;color:#fff}.dialog-footer button.p-button-danger:hover{background-color:#c53030;border-color:#c53030}.no-actions-message{display:flex;align-items:center;justify-content:center;padding:.5rem;min-height:40px}.no-actions-message .no-actions-text{color:#6b7280;font-size:.875rem;font-style:italic;text-align:center}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i9.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "directive", type: i6.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { kind: "directive", type: i7.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: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i9$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }] });
|
|
5813
5727
|
}
|
|
5814
5728
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentActionsComponent, decorators: [{
|
|
5815
5729
|
type: Component,
|
|
5816
|
-
args: [{ selector: 'document-actions', standalone: false, template: "<div class=\"document-actions-container\" *ngIf=\"document?.status !=='Pending' && !document?.isUploaded && document?.status === 'Reviewing'\">\r\n <div class=\"actions-card\" [ngClass]=\"cardClass\">\r\n <div class=\"actions-buttons\">\r\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn reject-btn\" [ngClass]=\"rejectButtonClass\"\r\n (click)=\"onRejectClick()\" [disabled]=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE || isRejecting\">\r\n <i class=\"pi pi-times\" *ngIf=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE\"></i>\r\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isRejecting\"></i>\r\n <span>{{ currentStatus === SHARED.STATUS_REJECTED_LOWERCASE ? SHARED.BUTTON_LABEL_REJECTED :\r\n SHARED.BUTTON_LABEL_REJECT }}</span>\r\n </button>\r\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn accept-btn\" [ngClass]=\"acceptButtonClass\"\r\n (click)=\"onAcceptClick()\" [disabled]=\"currentStatus === SHARED.STATUS_ACCEPTED || isAccepting\">\r\n <i class=\"pi pi-check\" *ngIf=\"currentStatus === SHARED.STATUS_ACCEPTED\"></i>\r\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isAccepting\"></i>\r\n <span>{{ currentStatus === SHARED.STATUS_ACCEPTED ? SHARED.BUTTON_LABEL_ACCEPTED : SHARED.BUTTON_LABEL_ACCEPT\r\n }}</span>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n@if(document?.isUploaded){\r\n<div class=\"actions-card\">\r\n <div class=\"actions-buttons\">\r\n <button class=\"action-btn delete-btn\" (click)=\"onDeleteClick()\" [disabled]=\"isLoading\"\r\n [permission]=\"'documents-deleteDocumentByDocumentId'\" pTooltip=\"Delete Document\" tooltipPosition=\"top\">\r\n <i class=\"pi pi-trash\"></i>\r\n </button>\r\n </div>\r\n</div>\r\n}\r\n<app-confirmation-dialog></app-confirmation-dialog>\r\n\r\n<p-dialog [(visible)]=\"showAcceptDialog\" [header]=\"SHARED.ACCEPT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\r\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\r\n <div class=\"dialog-content\">\r\n <label for=\"acceptNote\" class=\"note-label\">{{ SHARED.ACCEPT_NOTE_LABEL }}</label>\r\n <textarea id=\"acceptNote\" pInputTextarea [(ngModel)]=\"acceptNote\" [placeholder]=\"SHARED.ACCEPT_NOTE_PLACEHOLDER\"\r\n rows=\"6\" class=\"note-textarea\">\r\n </textarea>\r\n </div>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"dialog-footer\">\r\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\r\n </button>\r\n <button pButton [label]=\"SHARED.ACCEPT_BUTTON_LABEL\" class=\"p-button-success\" (click)=\"onAcceptConfirm()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n</p-dialog>\r\n\r\n<p-dialog [(visible)]=\"showRejectDialog\" [header]=\"SHARED.REJECT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\r\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\r\n <div class=\"dialog-content\">\r\n <label for=\"rejectNote\" class=\"note-label\">{{ SHARED.REJECT_NOTE_LABEL }}</label>\r\n <textarea id=\"rejectNote\" pInputTextarea [(ngModel)]=\"rejectNote\" [placeholder]=\"SHARED.REJECT_NOTE_PLACEHOLDER\"\r\n rows=\"6\" class=\"note-textarea\">\r\n </textarea>\r\n </div>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"dialog-footer\">\r\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\r\n </button>\r\n <button pButton [label]=\"SHARED.REJECT_BUTTON_LABEL\" class=\"p-button-danger\" [disabled]=\"isRejectNoteEmpty\"\r\n (click)=\"onRejectConfirm()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n</p-dialog>", styles: [".document-actions-container{margin:0}.actions-card{border-radius:8px;padding:.75rem;box-shadow:0 2px 4px #0000001a;transition:all .3s ease;width:92%;margin-left:3%}.actions-card.pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card.accepted-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card.rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-approved-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card[class*=status-].status-rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card:has(.delete-btn){width:auto;margin-left:0;background-color:#fff;border:1px solid #e2e8f0;padding:.5rem}.actions-buttons{display:flex;gap:.5rem;align-items:center}.action-btn{padding:.5rem 1rem;border-radius:6px;border:1px solid;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:.5rem;min-width:80px;justify-content:center}.action-btn:disabled{opacity:.6;cursor:not-allowed}.action-btn i{font-size:.875rem}.reject-btn.default-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn.default-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn.secondary-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn.secondary-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn.primary-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn.primary-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-approved-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn[class*=status-].status-approved-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn[class*=status-].status-rejected-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn[class*=status-].status-rejected-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-pending-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn[class*=status-].status-pending-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.accept-btn.default-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn.default-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.accept-btn.secondary-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn.secondary-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn.primary-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn.primary-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-approved-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn[class*=status-].status-approved-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-rejected-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn[class*=status-].status-rejected-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn[class*=status-].status-pending-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn[class*=status-].status-pending-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.delete-btn{background-color:#f5f5f5;border-color:#e57373;color:#e57373;padding:.5rem;min-width:auto;width:40px;height:40px;border-radius:6px}.delete-btn:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181;color:#c53030}.delete-btn i{font-size:1rem}:host ::ng-deep .confirmation-dialog .p-dialog{border-radius:8px;box-shadow:0 4px 12px #00000026;border:none;overflow:hidden}:host ::ng-deep .confirmation-dialog .p-dialog-header{padding:1.25rem 1.5rem;background-color:#fff;border-bottom:none;border-top-right-radius:10px;border-top-left-radius:10px}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-header-icon{display:none}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-title{font-size:1.125rem;font-weight:600;color:#2d3748;margin:0}:host ::ng-deep .confirmation-dialog .p-dialog-content{padding:1.5rem;background-color:#fff}:host ::ng-deep .confirmation-dialog .p-dialog-footer{padding:1rem 1.5rem;background-color:#f7fafc;border-top:1px solid #e2e8f0;display:flex;gap:.75rem;justify-content:flex-end;border-bottom-right-radius:10px;border-bottom-left-radius:10px}.dialog-content .note-label{display:block;margin-bottom:.75rem;font-weight:500;font-size:.875rem;color:#2d3748}.dialog-content .note-textarea{width:100%;min-height:100px;padding:.75rem;border:1px solid #e2e8f0;border-radius:6px;font-family:inherit;font-size:.875rem;line-height:1.5;resize:vertical;background-color:#fff;color:#2d3748}.dialog-content .note-textarea::placeholder{color:#a0aec0}.dialog-content .note-textarea:focus{outline:none;border-color:#3182ce;box-shadow:0 0 0 3px #3182ce1a}.dialog-footer{display:flex;gap:.75rem;justify-content:flex-end}.dialog-footer button{min-width:80px;padding:.5rem 1rem;border-radius:6px;font-weight:500;font-size:.875rem;border:1px solid;cursor:pointer;transition:all .2s ease}.dialog-footer button.p-button-secondary{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.dialog-footer button.p-button-secondary:hover{background-color:#edf2f7;border-color:#cbd5e0}.dialog-footer button.p-button-success{background-color:#38a169;border-color:#38a169;color:#fff}.dialog-footer button.p-button-success:hover{background-color:#2f855a;border-color:#2f855a}.dialog-footer button.p-button-danger{background-color:#e53e3e;border-color:#e53e3e;color:#fff}.dialog-footer button.p-button-danger:hover{background-color:#c53030;border-color:#c53030}.no-actions-message{display:flex;align-items:center;justify-content:center;padding:.5rem;min-height:40px}.no-actions-message .no-actions-text{color:#6b7280;font-size:.875rem;font-style:italic;text-align:center}\n"] }]
|
|
5817
|
-
}], ctorParameters: () => [{ type: DocumentActionsService }, { type: SessionService }], propDecorators: { document: [{
|
|
5730
|
+
args: [{ selector: 'document-actions', standalone: false, template: "<!-- <div class=\"document-actions-container\" *ngIf=\"document?.status !=='Pending' && !document?.isUploaded && document?.status === 'Reviewing'\"> -->\n <div class=\"actions-card\" [ngClass]=\"cardClass\">\n <div class=\"actions-buttons\">\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn reject-btn\" [ngClass]=\"rejectButtonClass\"\n (click)=\"onRejectClick()\" [disabled]=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE || isRejecting\">\n <i class=\"pi pi-times\" *ngIf=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE\"></i>\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isRejecting\"></i>\n <span>{{ currentStatus === SHARED.STATUS_REJECTED_LOWERCASE ? SHARED.BUTTON_LABEL_REJECTED :\n SHARED.BUTTON_LABEL_REJECT }}</span>\n </button>\n <button *ngIf=\"!document?.isUploaded\" class=\"action-btn accept-btn\" [ngClass]=\"acceptButtonClass\"\n (click)=\"onAcceptClick()\" [disabled]=\"currentStatus === SHARED.STATUS_ACCEPTED || isAccepting\">\n <i class=\"pi pi-check\" *ngIf=\"currentStatus === SHARED.STATUS_ACCEPTED\"></i>\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isAccepting\"></i>\n <span>{{ currentStatus === SHARED.STATUS_ACCEPTED ? SHARED.BUTTON_LABEL_ACCEPTED : SHARED.BUTTON_LABEL_ACCEPT\n }}</span>\n </button>\n </div>\n </div>\n<!-- </div> -->\n\n<!-- @if(document?.isUploaded){ -->\n<div class=\"actions-card\">\n <div class=\"actions-buttons\">\n <button class=\"action-btn delete-btn\" (click)=\"onDeleteClick()\" [disabled]=\"isLoading\"\n pTooltip=\"Delete Document\" tooltipPosition=\"top\">\n <i class=\"pi pi-trash\"></i>\n </button>\n </div>\n</div>\n<!-- } -->\n\n<p-dialog [(visible)]=\"showAcceptDialog\" [header]=\"SHARED.ACCEPT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\n <div class=\"dialog-content\">\n <label for=\"acceptNote\" class=\"note-label\">{{ SHARED.ACCEPT_NOTE_LABEL }}</label>\n <textarea id=\"acceptNote\" pInputTextarea [(ngModel)]=\"acceptNote\" [placeholder]=\"SHARED.ACCEPT_NOTE_PLACEHOLDER\"\n rows=\"6\" class=\"note-textarea\">\n </textarea>\n </div>\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\n </button>\n <button pButton [label]=\"SHARED.ACCEPT_BUTTON_LABEL\" class=\"p-button-success\" (click)=\"onAcceptConfirm()\">\n </button>\n </div>\n </ng-template>\n</p-dialog>\n\n<p-dialog [(visible)]=\"showRejectDialog\" [header]=\"SHARED.REJECT_CONFIRM_HEADER\" [modal]=\"true\" [draggable]=\"false\"\n [closable]=\"true\" [style]=\"{ width: '25rem', height: '25rem' }\" styleClass=\"confirmation-dialog\">\n <div class=\"dialog-content\">\n <label for=\"rejectNote\" class=\"note-label\">{{ SHARED.REJECT_NOTE_LABEL }}</label>\n <textarea id=\"rejectNote\" pInputTextarea [(ngModel)]=\"rejectNote\" [placeholder]=\"SHARED.REJECT_NOTE_PLACEHOLDER\"\n rows=\"6\" class=\"note-textarea\">\n </textarea>\n </div>\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button pButton [label]=\"SHARED.CANCEL_BUTTON_LABEL\" class=\"p-button-secondary\" (click)=\"onCancel()\">\n </button>\n <button pButton [label]=\"SHARED.REJECT_BUTTON_LABEL\" class=\"p-button-danger\" [disabled]=\"isRejectNoteEmpty\"\n (click)=\"onRejectConfirm()\">\n </button>\n </div>\n </ng-template>\n</p-dialog>", styles: [".document-actions-container{margin:0}.actions-card{border-radius:8px;padding:.75rem;box-shadow:0 2px 4px #0000001a;transition:all .3s ease;width:92%;margin-left:3%}.actions-card.pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card.accepted-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card.rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-approved-card{background-color:#e8f5e9;border:1px solid #66bb6a}.actions-card[class*=status-].status-rejected-card{background-color:#feeaea;border:1px solid #e57373}.actions-card[class*=status-].status-pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card:has(.delete-btn){width:auto;margin-left:0;background-color:#fff;border:1px solid #e2e8f0;padding:.5rem}.actions-buttons{display:flex;gap:.5rem;align-items:center}.action-btn{padding:.5rem 1rem;border-radius:6px;border:1px solid;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:.5rem;min-width:80px;justify-content:center}.action-btn:disabled{opacity:.6;cursor:not-allowed}.action-btn i{font-size:.875rem}.reject-btn.default-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn.default-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn.secondary-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn.secondary-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn.primary-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn.primary-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-approved-reject{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.reject-btn[class*=status-].status-approved-reject:hover:not(:disabled){background-color:#edf2f7}.reject-btn[class*=status-].status-rejected-reject{background-color:#feeaea;border-color:#e57373;color:#e57373}.reject-btn[class*=status-].status-rejected-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn[class*=status-].status-pending-reject{background-color:#feeaea;border-color:#e57373;color:#4a4a4a}.reject-btn[class*=status-].status-pending-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.accept-btn.default-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn.default-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.accept-btn.secondary-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn.secondary-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn.primary-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn.primary-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-approved-accept{background-color:#4caf50;border-color:#4caf50;color:#fff}.accept-btn[class*=status-].status-approved-accept:hover:not(:disabled){background-color:#45a049;border-color:#45a049}.accept-btn[class*=status-].status-rejected-accept{background-color:#f5f5f5;border-color:transparent;color:#4a4a4a}.accept-btn[class*=status-].status-rejected-accept:hover:not(:disabled){background-color:#edf2f7}.accept-btn[class*=status-].status-pending-accept{background-color:#e8f5e9;border-color:#66bb6a;color:#4a4a4a}.accept-btn[class*=status-].status-pending-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.delete-btn{background-color:#f5f5f5;border-color:#e57373;color:#e57373;padding:.5rem;min-width:auto;width:40px;height:40px;border-radius:6px}.delete-btn:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181;color:#c53030}.delete-btn i{font-size:1rem}:host ::ng-deep .confirmation-dialog .p-dialog{border-radius:8px;box-shadow:0 4px 12px #00000026;border:none;overflow:hidden}:host ::ng-deep .confirmation-dialog .p-dialog-header{padding:1.25rem 1.5rem;background-color:#fff;border-bottom:none;border-top-right-radius:10px;border-top-left-radius:10px}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-header-icon{display:none}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-title{font-size:1.125rem;font-weight:600;color:#2d3748;margin:0}:host ::ng-deep .confirmation-dialog .p-dialog-content{padding:1.5rem;background-color:#fff}:host ::ng-deep .confirmation-dialog .p-dialog-footer{padding:1rem 1.5rem;background-color:#f7fafc;border-top:1px solid #e2e8f0;display:flex;gap:.75rem;justify-content:flex-end;border-bottom-right-radius:10px;border-bottom-left-radius:10px}.dialog-content .note-label{display:block;margin-bottom:.75rem;font-weight:500;font-size:.875rem;color:#2d3748}.dialog-content .note-textarea{width:100%;min-height:100px;padding:.75rem;border:1px solid #e2e8f0;border-radius:6px;font-family:inherit;font-size:.875rem;line-height:1.5;resize:vertical;background-color:#fff;color:#2d3748}.dialog-content .note-textarea::placeholder{color:#a0aec0}.dialog-content .note-textarea:focus{outline:none;border-color:#3182ce;box-shadow:0 0 0 3px #3182ce1a}.dialog-footer{display:flex;gap:.75rem;justify-content:flex-end}.dialog-footer button{min-width:80px;padding:.5rem 1rem;border-radius:6px;font-weight:500;font-size:.875rem;border:1px solid;cursor:pointer;transition:all .2s ease}.dialog-footer button.p-button-secondary{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.dialog-footer button.p-button-secondary:hover{background-color:#edf2f7;border-color:#cbd5e0}.dialog-footer button.p-button-success{background-color:#38a169;border-color:#38a169;color:#fff}.dialog-footer button.p-button-success:hover{background-color:#2f855a;border-color:#2f855a}.dialog-footer button.p-button-danger{background-color:#e53e3e;border-color:#e53e3e;color:#fff}.dialog-footer button.p-button-danger:hover{background-color:#c53030;border-color:#c53030}.no-actions-message{display:flex;align-items:center;justify-content:center;padding:.5rem;min-height:40px}.no-actions-message .no-actions-text{color:#6b7280;font-size:.875rem;font-style:italic;text-align:center}\n"] }]
|
|
5731
|
+
}], ctorParameters: () => [{ type: DocumentActionsService }, { type: SessionService }, { type: i3.ConfirmationService }], propDecorators: { document: [{
|
|
5818
5732
|
type: Input
|
|
5819
5733
|
}], documentId: [{
|
|
5820
5734
|
type: Input
|
|
@@ -5828,9 +5742,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
5828
5742
|
type: Input
|
|
5829
5743
|
}], actionPerformed: [{
|
|
5830
5744
|
type: Output
|
|
5831
|
-
}], confirmationDialog: [{
|
|
5832
|
-
type: ViewChild,
|
|
5833
|
-
args: [ConfirmationDialogComponent]
|
|
5834
5745
|
}] } });
|
|
5835
5746
|
|
|
5836
5747
|
/**
|
|
@@ -6833,7 +6744,7 @@ class DocumentContainerComponent {
|
|
|
6833
6744
|
documentQuery;
|
|
6834
6745
|
documentStore;
|
|
6835
6746
|
documentMenuService;
|
|
6836
|
-
refreshTrigger;
|
|
6747
|
+
refreshTrigger = SHARED.INITIAL_VALUE;
|
|
6837
6748
|
/**
|
|
6838
6749
|
* The document list response data
|
|
6839
6750
|
* @type {DocumentListResponse[] | null}
|
|
@@ -6905,6 +6816,10 @@ class DocumentContainerComponent {
|
|
|
6905
6816
|
if (changes[SHARED.CONTEXT_ID] && !changes[SHARED.CONTEXT_ID].firstChange) {
|
|
6906
6817
|
this.handleContextIdChange();
|
|
6907
6818
|
}
|
|
6819
|
+
if (changes[SHARED.REFRESH_TRIGGER] && changes[SHARED.REFRESH_TRIGGER].currentValue !== SHARED.INITIAL_VALUE && !changes[SHARED.REFRESH_TRIGGER].firstChange) {
|
|
6820
|
+
this.clearAllState();
|
|
6821
|
+
this.initializeData();
|
|
6822
|
+
}
|
|
6908
6823
|
}
|
|
6909
6824
|
/**
|
|
6910
6825
|
* Initializes the component
|
|
@@ -7119,11 +7034,11 @@ class DocumentContainerComponent {
|
|
|
7119
7034
|
this.clearAllState();
|
|
7120
7035
|
}
|
|
7121
7036
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentContainerComponent, deps: [{ token: DocumentHttpService }, { token: DocumentHelperService }, { token: DocumentQuery }, { token: DocumentStore }, { token: DocumentMenuService }], target: i0.ɵɵFactoryTarget.Component });
|
|
7122
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { refreshTrigger: "refreshTrigger", contextId: "contextId" }, outputs: { selectedDocument: "selectedDocument" }, viewQueries: [{ propertyName: "contentScrollContainer", first: true, predicate: ["contentScrollContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"grid m-0 flex document-container-layout\">\n <!-- Fixed Left Menu -->\n <div class=\"menu-panel col-12 md:col-2\">\n <lib-documents-menu \n [catagories]=\"catagories\" \n [applicationNumber]=\"applicationNumber\" \n [contextId]=\"contextId\"\n (menuItemSelected)=\"onMenuItemSelected($event)\">\n </lib-documents-menu>\n </div>\n \n <!-- Scrollable Right Content -->\n <div class=\"content-panel col-12 md:col-10\" #contentScrollContainer>\n <div class=\"card content-card\">\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\n </div>\n <div>\n <lib-document-list \n [contextId]=\"contextId\" \n [documentListResponse]=\"documentListResponse\"\n [selectedMenuItemId]=\"selectedMenuItemId\"\n [navigationInfo]=\"navigationInfo\"\n [sortedMenuItems]=\"sortedMenuItems\"\n (handleSelectedDocument)=\"onDocumentSelected($event)\"\n >\n <ng-content></ng-content>\n </lib-document-list>\n </div>\n </div>\n</div>", styles: [".document-container-layout{display:grid;grid-template-columns:1fr;height:98vh;overflow:auto;position:relative}@media (min-width: 768px){.document-container-layout{grid-template-columns:16.6667% 1fr}}.menu-panel{background-color:#fff;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.menu-panel{position:fixed;left:0;top:0;bottom:0;width:16.6667%}}.menu-panel::-webkit-scrollbar{display:none}.content-panel{display:flex;flex-direction:column;height:98vh;overflow-y:auto;overflow-x:hidden;padding:0;position:relative;z-index:10;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.content-panel{margin-left:16.6667%}}.content-panel::-webkit-scrollbar{display:none}@media (max-width: 1024px){.menu-panel{width:240px}.content-panel{margin-left:240px}}@media (max-width: 768px){.document-container-layout{grid-template-columns:1fr}.menu-panel{position:relative;width:100%;height:200px;border-right:none;border-bottom:1px solid #e5e7eb;z-index:auto}.content-panel{margin-left:0;flex:1}}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}*{scrollbar-width:thin}body,html{height:100%}::ng-deep .p-card{overflow:visible!important}::ng-deep .p-card-body{overflow:visible!important}::ng-deep .p-dialog{z-index:9999!important}::ng-deep .p-dialog-mask{z-index:9998!important}::ng-deep .content-panel .p-card{overflow:visible!important}\n"], dependencies: [{ kind: "component", type: FolderContainerComponent, selector: "lib-folder-container", inputs: ["documentList", "folderList", "contextId", "userList", "statusData", "categories"] }, { kind: "component", type: DocumentListComponent, selector: "lib-document-list", inputs: ["contextId", "documentListResponse", "selectedMenuItemId", "navigationInfo", "sortedMenuItems", "documentList"], outputs: ["handleSelectedDocument"] }, { kind: "component", type: DocumentsMenuComponent, selector: "lib-documents-menu", inputs: ["catagories", "applicationNumber", "contextId"], outputs: ["menuItemSelected"] }] });
|
|
7037
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { refreshTrigger: "refreshTrigger", contextId: "contextId" }, outputs: { selectedDocument: "selectedDocument" }, viewQueries: [{ propertyName: "contentScrollContainer", first: true, predicate: ["contentScrollContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"grid m-0 flex document-container-layout\">\n <!-- Fixed Left Menu -->\n <div class=\"menu-panel col-12 md:col-2\">\n <lib-documents-menu \n [catagories]=\"catagories\" \n [applicationNumber]=\"applicationNumber\" \n [contextId]=\"contextId\"\n (menuItemSelected)=\"onMenuItemSelected($event)\">\n </lib-documents-menu>\n </div>\n \n <!-- Scrollable Right Content -->\n <div class=\"content-panel col-12 md:col-10\" #contentScrollContainer>\n <div class=\"card content-card\">\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\n </div>\n <div>\n <lib-document-list \n [contextId]=\"contextId\" \n [documentListResponse]=\"documentListResponse\"\n [selectedMenuItemId]=\"selectedMenuItemId\"\n [navigationInfo]=\"navigationInfo\"\n [sortedMenuItems]=\"sortedMenuItems\"\n (handleSelectedDocument)=\"onDocumentSelected($event)\"\n >\n <ng-content></ng-content>\n </lib-document-list>\n </div>\n </div>\n</div>\n\n<!-- Centralized confirmation dialog for all components -->\n<p-confirmDialog \n [style]=\"{width: '25vw'}\" \n acceptLabel=\"Yes\"\n rejectLabel=\"No\"\n appendTo=\"body\"\n acceptIcon=\"pi pi-check\"\n rejectIcon=\"pi pi-times\">\n</p-confirmDialog>", styles: [".document-container-layout{display:grid;grid-template-columns:1fr;height:98vh;overflow:auto;position:relative}@media (min-width: 768px){.document-container-layout{grid-template-columns:16.6667% 1fr}}.menu-panel{background-color:#fff;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.menu-panel{position:fixed;left:0;top:0;bottom:0;width:16.6667%}}.menu-panel::-webkit-scrollbar{display:none}.content-panel{display:flex;flex-direction:column;height:98vh;overflow-y:auto;overflow-x:hidden;padding:0;position:relative;z-index:10;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.content-panel{margin-left:16.6667%}}.content-panel::-webkit-scrollbar{display:none}@media (max-width: 1024px){.menu-panel{width:240px}.content-panel{margin-left:240px}}@media (max-width: 768px){.document-container-layout{grid-template-columns:1fr}.menu-panel{position:relative;width:100%;height:200px;border-right:none;border-bottom:1px solid #e5e7eb;z-index:auto}.content-panel{margin-left:0;flex:1}}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}*{scrollbar-width:thin}body,html{height:100%}::ng-deep .p-card{overflow:visible!important}::ng-deep .p-card-body{overflow:visible!important}::ng-deep .p-dialog{z-index:9999!important}::ng-deep .p-dialog-mask{z-index:9998!important}::ng-deep .content-panel .p-card{overflow:visible!important}\n"], dependencies: [{ kind: "component", type: i6$2.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "component", type: FolderContainerComponent, selector: "lib-folder-container", inputs: ["documentList", "folderList", "contextId", "userList", "statusData", "categories"] }, { kind: "component", type: DocumentListComponent, selector: "lib-document-list", inputs: ["contextId", "documentListResponse", "selectedMenuItemId", "navigationInfo", "sortedMenuItems", "documentList"], outputs: ["handleSelectedDocument"] }, { kind: "component", type: DocumentsMenuComponent, selector: "lib-documents-menu", inputs: ["catagories", "applicationNumber", "contextId"], outputs: ["menuItemSelected"] }] });
|
|
7123
7038
|
}
|
|
7124
7039
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentContainerComponent, decorators: [{
|
|
7125
7040
|
type: Component,
|
|
7126
|
-
args: [{ selector: 'lib-document-container', standalone: false, template: "<div class=\"grid m-0 flex document-container-layout\">\n <!-- Fixed Left Menu -->\n <div class=\"menu-panel col-12 md:col-2\">\n <lib-documents-menu \n [catagories]=\"catagories\" \n [applicationNumber]=\"applicationNumber\" \n [contextId]=\"contextId\"\n (menuItemSelected)=\"onMenuItemSelected($event)\">\n </lib-documents-menu>\n </div>\n \n <!-- Scrollable Right Content -->\n <div class=\"content-panel col-12 md:col-10\" #contentScrollContainer>\n <div class=\"card content-card\">\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\n </div>\n <div>\n <lib-document-list \n [contextId]=\"contextId\" \n [documentListResponse]=\"documentListResponse\"\n [selectedMenuItemId]=\"selectedMenuItemId\"\n [navigationInfo]=\"navigationInfo\"\n [sortedMenuItems]=\"sortedMenuItems\"\n (handleSelectedDocument)=\"onDocumentSelected($event)\"\n >\n <ng-content></ng-content>\n </lib-document-list>\n </div>\n </div>\n</div>", styles: [".document-container-layout{display:grid;grid-template-columns:1fr;height:98vh;overflow:auto;position:relative}@media (min-width: 768px){.document-container-layout{grid-template-columns:16.6667% 1fr}}.menu-panel{background-color:#fff;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.menu-panel{position:fixed;left:0;top:0;bottom:0;width:16.6667%}}.menu-panel::-webkit-scrollbar{display:none}.content-panel{display:flex;flex-direction:column;height:98vh;overflow-y:auto;overflow-x:hidden;padding:0;position:relative;z-index:10;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.content-panel{margin-left:16.6667%}}.content-panel::-webkit-scrollbar{display:none}@media (max-width: 1024px){.menu-panel{width:240px}.content-panel{margin-left:240px}}@media (max-width: 768px){.document-container-layout{grid-template-columns:1fr}.menu-panel{position:relative;width:100%;height:200px;border-right:none;border-bottom:1px solid #e5e7eb;z-index:auto}.content-panel{margin-left:0;flex:1}}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}*{scrollbar-width:thin}body,html{height:100%}::ng-deep .p-card{overflow:visible!important}::ng-deep .p-card-body{overflow:visible!important}::ng-deep .p-dialog{z-index:9999!important}::ng-deep .p-dialog-mask{z-index:9998!important}::ng-deep .content-panel .p-card{overflow:visible!important}\n"] }]
|
|
7041
|
+
args: [{ selector: 'lib-document-container', standalone: false, template: "<div class=\"grid m-0 flex document-container-layout\">\n <!-- Fixed Left Menu -->\n <div class=\"menu-panel col-12 md:col-2\">\n <lib-documents-menu \n [catagories]=\"catagories\" \n [applicationNumber]=\"applicationNumber\" \n [contextId]=\"contextId\"\n (menuItemSelected)=\"onMenuItemSelected($event)\">\n </lib-documents-menu>\n </div>\n \n <!-- Scrollable Right Content -->\n <div class=\"content-panel col-12 md:col-10\" #contentScrollContainer>\n <div class=\"card content-card\">\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\n </div>\n <div>\n <lib-document-list \n [contextId]=\"contextId\" \n [documentListResponse]=\"documentListResponse\"\n [selectedMenuItemId]=\"selectedMenuItemId\"\n [navigationInfo]=\"navigationInfo\"\n [sortedMenuItems]=\"sortedMenuItems\"\n (handleSelectedDocument)=\"onDocumentSelected($event)\"\n >\n <ng-content></ng-content>\n </lib-document-list>\n </div>\n </div>\n</div>\n\n<!-- Centralized confirmation dialog for all components -->\n<p-confirmDialog \n [style]=\"{width: '25vw'}\" \n acceptLabel=\"Yes\"\n rejectLabel=\"No\"\n appendTo=\"body\"\n acceptIcon=\"pi pi-check\"\n rejectIcon=\"pi pi-times\">\n</p-confirmDialog>", styles: [".document-container-layout{display:grid;grid-template-columns:1fr;height:98vh;overflow:auto;position:relative}@media (min-width: 768px){.document-container-layout{grid-template-columns:16.6667% 1fr}}.menu-panel{background-color:#fff;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.menu-panel{position:fixed;left:0;top:0;bottom:0;width:16.6667%}}.menu-panel::-webkit-scrollbar{display:none}.content-panel{display:flex;flex-direction:column;height:98vh;overflow-y:auto;overflow-x:hidden;padding:0;position:relative;z-index:10;scrollbar-width:none;-ms-overflow-style:none}@media (min-width: 768px){.content-panel{margin-left:16.6667%}}.content-panel::-webkit-scrollbar{display:none}@media (max-width: 1024px){.menu-panel{width:240px}.content-panel{margin-left:240px}}@media (max-width: 768px){.document-container-layout{grid-template-columns:1fr}.menu-panel{position:relative;width:100%;height:200px;border-right:none;border-bottom:1px solid #e5e7eb;z-index:auto}.content-panel{margin-left:0;flex:1}}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}*{scrollbar-width:thin}body,html{height:100%}::ng-deep .p-card{overflow:visible!important}::ng-deep .p-card-body{overflow:visible!important}::ng-deep .p-dialog{z-index:9999!important}::ng-deep .p-dialog-mask{z-index:9998!important}::ng-deep .content-panel .p-card{overflow:visible!important}\n"] }]
|
|
7127
7042
|
}], ctorParameters: () => [{ type: DocumentHttpService }, { type: DocumentHelperService }, { type: DocumentQuery }, { type: DocumentStore }, { type: DocumentMenuService }], propDecorators: { refreshTrigger: [{
|
|
7128
7043
|
type: Input
|
|
7129
7044
|
}], contentScrollContainer: [{
|
|
@@ -7341,16 +7256,89 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7341
7256
|
type: Output
|
|
7342
7257
|
}] } });
|
|
7343
7258
|
|
|
7259
|
+
/**
|
|
7260
|
+
* Directive to conditionally show or hide elements based on user permissions.
|
|
7261
|
+
* @class HasPermissionDirective
|
|
7262
|
+
* @typedef {HasPermissionDirective}
|
|
7263
|
+
*/
|
|
7264
|
+
class HasPermissionDirective {
|
|
7265
|
+
el;
|
|
7266
|
+
renderer;
|
|
7267
|
+
sessionService;
|
|
7268
|
+
/**
|
|
7269
|
+
* The required permission(s) to display the element.
|
|
7270
|
+
* Accepts a single string or an array of strings.
|
|
7271
|
+
* @type {string | string[]}
|
|
7272
|
+
*/
|
|
7273
|
+
permission;
|
|
7274
|
+
/**
|
|
7275
|
+
* Creates an instance of HasPermissionDirective.
|
|
7276
|
+
* @param {ElementRef} el - Reference to the host element.
|
|
7277
|
+
* @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
|
|
7278
|
+
* @param {SessionService} sessionService - Service to retrieve user permissions.
|
|
7279
|
+
*/
|
|
7280
|
+
constructor(el, renderer, sessionService) {
|
|
7281
|
+
this.el = el;
|
|
7282
|
+
this.renderer = renderer;
|
|
7283
|
+
this.sessionService = sessionService;
|
|
7284
|
+
}
|
|
7285
|
+
/**
|
|
7286
|
+
* Lifecycle hook that is called when input properties change.
|
|
7287
|
+
* @param {SimpleChanges} changes - The changes in input properties.
|
|
7288
|
+
*/
|
|
7289
|
+
ngOnChanges(changes) {
|
|
7290
|
+
if (changes['permission']) {
|
|
7291
|
+
this.checkPermission();
|
|
7292
|
+
}
|
|
7293
|
+
}
|
|
7294
|
+
/**
|
|
7295
|
+
* Checks if the user has the required permission(s).
|
|
7296
|
+
* Hides the element if the permission is not found.
|
|
7297
|
+
*/
|
|
7298
|
+
checkPermission() {
|
|
7299
|
+
// If no permission is required (empty string, null, or undefined), show the element
|
|
7300
|
+
if (!this.permission || this.permission === '' || (Array.isArray(this.permission) && this.permission.length === 0)) {
|
|
7301
|
+
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
7302
|
+
return;
|
|
7303
|
+
}
|
|
7304
|
+
const userPermissionsObjects = this.sessionService.getUserPermissions();
|
|
7305
|
+
const userPermissionNames = userPermissionsObjects?.map((perm) => perm.name) || [];
|
|
7306
|
+
const requiredPermissions = Array.isArray(this.permission)
|
|
7307
|
+
? this.permission
|
|
7308
|
+
: [this.permission];
|
|
7309
|
+
const hasPermission = requiredPermissions.some(permission => userPermissionNames.includes(permission));
|
|
7310
|
+
if (!hasPermission) {
|
|
7311
|
+
this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
|
|
7312
|
+
}
|
|
7313
|
+
else {
|
|
7314
|
+
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
7315
|
+
}
|
|
7316
|
+
}
|
|
7317
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
7318
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: HasPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission" }, usesOnChanges: true, ngImport: i0 });
|
|
7319
|
+
}
|
|
7320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
7321
|
+
type: Directive,
|
|
7322
|
+
args: [{
|
|
7323
|
+
selector: '[permission]',
|
|
7324
|
+
standalone: false
|
|
7325
|
+
}]
|
|
7326
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SessionService }], propDecorators: { permission: [{
|
|
7327
|
+
type: Input
|
|
7328
|
+
}] } });
|
|
7329
|
+
|
|
7344
7330
|
class SharedModule {
|
|
7345
7331
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
7346
7332
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, declarations: [TablePrimaryComponent, HasPermissionDirective, ConfirmationDialogComponent], imports: [CommonModule,
|
|
7347
7333
|
TableModule,
|
|
7348
7334
|
ButtonModule,
|
|
7349
|
-
RippleModule
|
|
7335
|
+
RippleModule,
|
|
7336
|
+
ConfirmDialogModule], exports: [TablePrimaryComponent, HasPermissionDirective, ConfirmationDialogComponent, ConfirmDialogModule] });
|
|
7350
7337
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, providers: [ConfirmationService], imports: [CommonModule,
|
|
7351
7338
|
TableModule,
|
|
7352
7339
|
ButtonModule,
|
|
7353
|
-
RippleModule
|
|
7340
|
+
RippleModule,
|
|
7341
|
+
ConfirmDialogModule, ConfirmDialogModule] });
|
|
7354
7342
|
}
|
|
7355
7343
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, decorators: [{
|
|
7356
7344
|
type: NgModule,
|
|
@@ -7360,10 +7348,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7360
7348
|
CommonModule,
|
|
7361
7349
|
TableModule,
|
|
7362
7350
|
ButtonModule,
|
|
7363
|
-
RippleModule
|
|
7351
|
+
RippleModule,
|
|
7352
|
+
ConfirmDialogModule
|
|
7364
7353
|
],
|
|
7365
7354
|
providers: [ConfirmationService],
|
|
7366
|
-
exports: [TablePrimaryComponent, HasPermissionDirective, ConfirmationDialogComponent]
|
|
7355
|
+
exports: [TablePrimaryComponent, HasPermissionDirective, ConfirmationDialogComponent, ConfirmDialogModule]
|
|
7367
7356
|
}]
|
|
7368
7357
|
}] });
|
|
7369
7358
|
|