cat-documents-ng 0.2.58 → 0.2.61

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.
@@ -1,6 +1,7 @@
1
1
  import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { SHARED } from '../../../../Shared/constant/SHARED';
3
3
  import { DocumentActionsService, DocumentAction } from '../../services/document-actions.service';
4
+ import { ConfirmationDialogComponent } from '../../../../Shared/components/confirmation-dialog/confirmation-dialog.component';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class DocumentActionsComponent implements OnChanges {
6
7
  private documentActionsService;
@@ -22,6 +23,7 @@ export declare class DocumentActionsComponent implements OnChanges {
22
23
  rejectButtonClass: string;
23
24
  acceptButtonClass: string;
24
25
  isRejectNoteEmpty: boolean;
26
+ confirmationDialog: ConfirmationDialogComponent;
25
27
  constructor(documentActionsService: DocumentActionsService);
26
28
  get rejectNote(): string;
27
29
  set rejectNote(value: string);
@@ -89,6 +89,7 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
89
89
  * Completion counts for each category
90
90
  */
91
91
  categoryCompletionCounts: string[];
92
+ deleteMessage: Message[];
92
93
  /**
93
94
  * Getter to format category labels with proper suffix
94
95
  */
@@ -107,14 +108,6 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
107
108
  * Initializes the component by setting up document list subscription.
108
109
  */
109
110
  ngOnInit(): void;
110
- /**
111
- * Handles the save click event to update the document's file name.
112
- * This method creates a payload with the updated file name and calls the
113
- * updateDocumentName() method from the documentHttpService. On a successful update,
114
- * it logs a message with the document's ID.
115
- * @returns {void}
116
- */
117
- handleSaveClick(): void;
118
111
  /**
119
112
  * Handles the visibility of the sidebar.
120
113
  * @param {boolean} isVisible - Indicates whether the sidebar should be visible or not.
@@ -138,10 +131,15 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
138
131
  * @param {any} rowData - The row data containing the document to delete
139
132
  */
140
133
  handleDeleteAction(rowData: any): void;
134
+ /**
135
+ * Closes the document viewer dialog and resets the selected document
136
+ */
137
+ handleCloseModal(): void;
141
138
  /**
142
139
  * Refreshes the document list after a status update
140
+ * @param {boolean} isDeleteAction - Optional flag indicating if this refresh is due to a delete action
143
141
  */
144
- refreshDocumentList(): void;
142
+ refreshDocumentList(isDeleteAction?: boolean): void;
145
143
  /**
146
144
  * Cleanup subscriptions on component destroy
147
145
  */
@@ -65,6 +65,8 @@ export declare class DocumentUploadComponent implements OnDestroy {
65
65
  isSaving: boolean;
66
66
  /** Current form validation state */
67
67
  isFormValid: boolean;
68
+ /** File size property for testing */
69
+ fileSize: string;
68
70
  /** Subject for managing component lifecycle and unsubscribing from observables */
69
71
  private destroy$;
70
72
  /**
@@ -266,6 +268,11 @@ export declare class DocumentUploadComponent implements OnDestroy {
266
268
  * Emits form validation change event.
267
269
  */
268
270
  emitFormValidationChange(): void;
271
+ /**
272
+ * Formats file size for testing purposes.
273
+ * @param size - The file size in bytes
274
+ */
275
+ formatSize(size: number): void;
269
276
  /**
270
277
  * Lifecycle hook that is called when component is destroyed.
271
278
  * Cleans up subscriptions and destroys services.
@@ -36,7 +36,9 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
36
36
  * Event emitted when document status is updated to refresh the document list
37
37
  * @type {EventEmitter<void>}
38
38
  */
39
- documentStatusUpdated: EventEmitter<void>;
39
+ documentStatusUpdated: EventEmitter<{
40
+ actionType?: string;
41
+ }>;
40
42
  /**
41
43
  * Indicates whether a checkbox is selected.
42
44
  * @type {boolean}
@@ -1,4 +1,4 @@
1
- import { EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core';
1
+ import { EventEmitter, OnInit, OnChanges, SimpleChanges, ChangeDetectorRef } from '@angular/core';
2
2
  import { DocumentStore } from '../../state/document.store';
3
3
  import { DocumentQuery } from '../../state/document.query';
4
4
  import { UserListModel } from '../../models/user-list.model';
@@ -11,6 +11,7 @@ export declare class UserListComponent implements OnInit, OnChanges {
11
11
  private documentStore;
12
12
  private documentQuery;
13
13
  private userListService;
14
+ private cdr;
14
15
  userList: UserListModel[];
15
16
  categories: DocumentCategory[];
16
17
  userSelected: EventEmitter<string>;
@@ -18,12 +19,15 @@ export declare class UserListComponent implements OnInit, OnChanges {
18
19
  filteredUserData: UserListModel[];
19
20
  selectedUser: string | undefined;
20
21
  shouldShowContainer: boolean;
21
- constructor(documentService: DocumentHelperService, documentStore: DocumentStore, documentQuery: DocumentQuery, userListService: UserListService);
22
+ private userListSubscription;
23
+ private categoriesSubscription;
24
+ constructor(documentService: DocumentHelperService, documentStore: DocumentStore, documentQuery: DocumentQuery, userListService: UserListService, cdr: ChangeDetectorRef);
22
25
  ngOnChanges(changes: SimpleChanges): void;
23
- private initializeUserData;
24
- private updateFilteredUserData;
26
+ initializeUserData(): void;
27
+ updateFilteredUserData(): void;
25
28
  ngOnInit(): void;
26
29
  onUserSelect(username: string, id: string): void;
30
+ ngOnDestroy(): void;
27
31
  static ɵfac: i0.ɵɵFactoryDeclaration<UserListComponent, never>;
28
32
  static ɵcmp: i0.ɵɵComponentDeclaration<UserListComponent, "lib-user-list", never, { "userList": { "alias": "userList"; "required": false; }; "categories": { "alias": "categories"; "required": false; }; }, { "userSelected": "userSelected"; }, never, never, false, never>;
29
33
  }
@@ -38,6 +38,8 @@ import * as i36 from "primeng/panelmenu";
38
38
  import * as i37 from "primeng/card";
39
39
  import * as i38 from "primeng/table";
40
40
  import * as i39 from "../../Shared/shared.module";
41
+ import * as i40 from "primeng/toast";
42
+ import * as i41 from "primeng/confirmdialog";
41
43
  /**
42
44
  * @module DocumentModule
43
45
  *
@@ -47,6 +49,6 @@ import * as i39 from "../../Shared/shared.module";
47
49
  */
48
50
  export declare class DocumentModule {
49
51
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentModule, never>;
50
- static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent, typeof i8.DocumentHistoryComponent, typeof i9.DocumentDirective, typeof i10.LinkedDocumentComponent, typeof i11.DocumentsMenuComponent, typeof i12.UserListComponent, typeof i13.DocumentStatusComponent, typeof i14.DocumentActionsComponent, typeof i15.DocumentSearchComponent, typeof i16.SidebarComponent], [typeof i17.CommonModule, typeof i18.AccordionModule, typeof i19.HttpClientModule, typeof i20.ButtonModule, typeof i21.SidebarModule, typeof i22.FileUploadModule, typeof i23.ProgressBarModule, typeof i24.BadgeModule, typeof i25.ListboxModule, typeof i26.CheckboxModule, typeof i27.RadioButtonModule, typeof i28.TimelineModule, typeof i29.InputTextareaModule, typeof i30.FormsModule, typeof i31.PdfViewerModule, typeof i32.DialogModule, typeof i33.DropdownModule, typeof i34.InputTextModule, typeof i35.MenuModule, typeof i36.PanelMenuModule, typeof i37.CardModule, typeof i38.TableModule, typeof i39.SharedModule, typeof i29.InputTextareaModule], [typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i14.DocumentActionsComponent, typeof i4.DocumentListComponent, typeof i9.DocumentDirective, typeof i15.DocumentSearchComponent, typeof i16.SidebarComponent]>;
52
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent, typeof i8.DocumentHistoryComponent, typeof i9.DocumentDirective, typeof i10.LinkedDocumentComponent, typeof i11.DocumentsMenuComponent, typeof i12.UserListComponent, typeof i13.DocumentStatusComponent, typeof i14.DocumentActionsComponent, typeof i15.DocumentSearchComponent, typeof i16.SidebarComponent], [typeof i17.CommonModule, typeof i18.AccordionModule, typeof i19.HttpClientModule, typeof i20.ButtonModule, typeof i21.SidebarModule, typeof i22.FileUploadModule, typeof i23.ProgressBarModule, typeof i24.BadgeModule, typeof i25.ListboxModule, typeof i26.CheckboxModule, typeof i27.RadioButtonModule, typeof i28.TimelineModule, typeof i29.InputTextareaModule, typeof i30.FormsModule, typeof i31.PdfViewerModule, typeof i32.DialogModule, typeof i33.DropdownModule, typeof i34.InputTextModule, typeof i35.MenuModule, typeof i36.PanelMenuModule, typeof i37.CardModule, typeof i38.TableModule, typeof i39.SharedModule, typeof i29.InputTextareaModule, typeof i40.ToastModule, typeof i41.ConfirmDialogModule], [typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i14.DocumentActionsComponent, typeof i4.DocumentListComponent, typeof i9.DocumentDirective, typeof i15.DocumentSearchComponent, typeof i16.SidebarComponent]>;
51
53
  static ɵinj: i0.ɵɵInjectorDeclaration<DocumentModule>;
52
54
  }
@@ -10,6 +10,8 @@ export interface UploadedFile {
10
10
  formattedSize: string;
11
11
  progress: number;
12
12
  uploadResponse?: any;
13
+ url?: string;
14
+ contentType?: string;
13
15
  }
14
16
  export interface DocumentUploadPayload {
15
17
  source: 'Applicant' | 'Application';
@@ -20,9 +22,9 @@ export interface DocumentUploadPayload {
20
22
  documents: {
21
23
  fileName: string;
22
24
  fileSize: number;
23
- fileType: string;
24
- file: File;
25
25
  uploadedFileId?: string;
26
+ url?: string;
27
+ contentType?: string;
26
28
  }[];
27
29
  }
28
30
  export declare class DocumentUploadBusinessService {
@@ -46,6 +48,10 @@ export declare class DocumentUploadBusinessService {
46
48
  * Filters applicants based on assignment type
47
49
  */
48
50
  filterApplicants(applicantList: UserListModel[], assignmentType: 'Applicant' | 'Application'): UserListModel[];
51
+ /**
52
+ * Helper method to validate form data and return validation result
53
+ */
54
+ private validateFormData;
49
55
  /**
50
56
  * Validates form data
51
57
  */
@@ -16,10 +16,18 @@ export declare class DocumentUploadFormService {
16
16
  * Shows success message
17
17
  */
18
18
  showSuccessMessage(summary: string, detail: string): void;
19
+ /**
20
+ * Helper method to validate required fields and show appropriate messages
21
+ */
22
+ private validateRequiredFieldsWithMessages;
19
23
  /**
20
24
  * Validates required fields for upload
21
25
  */
22
26
  validateRequiredFields(assignmentType: 'Applicant' | 'Application' | null, selectedApplicant: string, selectedCategory: string, selectedDocumentType: string, uploadedFiles: UploadedFile[]): boolean;
27
+ /**
28
+ * Shows appropriate validation message based on the field that failed
29
+ */
30
+ private showValidationMessage;
23
31
  /**
24
32
  * Validates form completeness
25
33
  */
@@ -46,6 +46,11 @@ export declare class DocumentQuery extends QueryEntity<DocumentState> {
46
46
  * @returns {Observable<DocumentCategory[]>} Observable that emits the document categories.
47
47
  */
48
48
  selectDocumentCategories(): Observable<DocumentCategory[]>;
49
+ /**
50
+ * Gets the current document categories value (synchronous).
51
+ * @returns {DocumentCategory[]} The current document categories.
52
+ */
53
+ getDocumentCategories(): DocumentCategory[];
49
54
  /**
50
55
  * Selects the currently selected menu item.
51
56
  * @returns {Observable<string | null>} Observable that emits the currently selected menu item _id (not the label).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.2.58",
3
+ "version": "0.2.61",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"
package/public-api.d.ts CHANGED
@@ -10,3 +10,8 @@ export * from './lib/document/models/document-history.model';
10
10
  export * from './lib/document/services/document-table-builder.service';
11
11
  export * from './lib/document/directives/document.directive';
12
12
  export * from './lib/document/directives/permission.directive';
13
+ export * from './Shared/components/confirmation-dialog/confirmation-dialog.component';
14
+ export * from './Shared/components/table-primary/table-primary.component';
15
+ export * from './Shared/components/table-primary/table-primary.model';
16
+ export * from './Shared/constant/SHARED';
17
+ export * from './Shared/shared.module';
@@ -0,0 +1,20 @@
1
+ {
2
+ "catQwUrl": "https://qa-qw-api.dynamatix.com/api/",
3
+ "apiUrl": "https://gatehouse-qa.dynamatix.com/api/",
4
+ "swaggerUrl": "https://qa-qw-api.dynamatix.com/api-docs/",
5
+ "adminEmail": "neeraj.kumar@catura.co.uk",
6
+ "interactBaseApi": "https://qa-interact-api.dynamatix.com/api/",
7
+ "actionBaseApi": "https://qa-qw-api.dynamatix.com/api/",
8
+ "documentApiUrl": "https://gatehouse-documents-qa-bgavezbwe9b6e9h6.uksouth-01.azurewebsites.net/api/",
9
+ "adminPhoneNumber": "+447380300545",
10
+ "visibilityOption": {
11
+ "isRationalVisible": false,
12
+ "isChecklistVisible": false,
13
+ "isAudit": false,
14
+ "isConversation": true,
15
+ "isOverview": true,
16
+ "isDocuments": true
17
+ },
18
+ "env": "qa"
19
+
20
+ }