cat-documents-ng 0.3.51 → 0.3.52
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.
|
@@ -1413,7 +1413,7 @@ class DocumentHttpService {
|
|
|
1413
1413
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1414
1414
|
*/
|
|
1415
1415
|
getDocumentCatagories(contextId) {
|
|
1416
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1416
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1417
1417
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENTS_CATAGORIES}/${contextId}`, { headers })
|
|
1418
1418
|
.pipe(tap((response) => {
|
|
1419
1419
|
if (response && response.categories) {
|
|
@@ -1457,7 +1457,7 @@ class DocumentHttpService {
|
|
|
1457
1457
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1458
1458
|
*/
|
|
1459
1459
|
getDocumentByFolderID(folderId, contextId) {
|
|
1460
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1460
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1461
1461
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${URLS.PARENT_DOCUMENT_TYPE_ID}${folderId}${URLS.CONTEXT_ID}${contextId}`, { headers }).pipe(tap((records) => {
|
|
1462
1462
|
this.documentStore.set(records);
|
|
1463
1463
|
}), catchError((error) => {
|
|
@@ -1473,7 +1473,7 @@ class DocumentHttpService {
|
|
|
1473
1473
|
* @returns {Observable<DocumentModel>} An observable that emits the updated DocumentModel.
|
|
1474
1474
|
*/
|
|
1475
1475
|
updateDocumentName(documentId, payload) {
|
|
1476
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1476
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1477
1477
|
return this.http.put(`${this.apiUrl}${URLS.ALIAS_NAME}${documentId}`, payload, { headers }).pipe(catchError((error) => {
|
|
1478
1478
|
return throwError(() => new Error(error));
|
|
1479
1479
|
}));
|
|
@@ -1486,7 +1486,7 @@ class DocumentHttpService {
|
|
|
1486
1486
|
getUserListByContextId(contextId) {
|
|
1487
1487
|
if (!contextId)
|
|
1488
1488
|
return EMPTY;
|
|
1489
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1489
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1490
1490
|
return this.http.get(`${this.apiUrl}${URLS.USERLIST}${contextId}`, { headers }).pipe(tap((userList) => {
|
|
1491
1491
|
this.documentStore.setUserList(userList);
|
|
1492
1492
|
}), catchError((error) => {
|
|
@@ -1512,7 +1512,7 @@ class DocumentHttpService {
|
|
|
1512
1512
|
if (categoryId) {
|
|
1513
1513
|
params = params.set(SHARED.CATEGORY, categoryId);
|
|
1514
1514
|
}
|
|
1515
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1515
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1516
1516
|
return this.http.get(url, { params, headers }).pipe(tap((statusData) => {
|
|
1517
1517
|
this.documentStore.setStatusData(statusData);
|
|
1518
1518
|
}), catchError((error) => {
|
|
@@ -1541,7 +1541,7 @@ class DocumentHttpService {
|
|
|
1541
1541
|
if (searchKey) {
|
|
1542
1542
|
params = params.set(SHARED.SEARCH_KEY, searchKey);
|
|
1543
1543
|
}
|
|
1544
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1544
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1545
1545
|
return this.http.get(`${this.apiUrl}${URLS.GETALL}/${contextId}`, { params, headers }).pipe(tap((response) => {
|
|
1546
1546
|
if (response.documents) {
|
|
1547
1547
|
this.documentStore.setDocumentList(response.documents);
|
|
@@ -1554,7 +1554,7 @@ class DocumentHttpService {
|
|
|
1554
1554
|
if (!documentId) {
|
|
1555
1555
|
return of([]);
|
|
1556
1556
|
}
|
|
1557
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1557
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1558
1558
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_HISTORY}${documentId}`, { headers }).pipe(catchError((error) => {
|
|
1559
1559
|
return throwError(() => new Error(error));
|
|
1560
1560
|
}));
|
|
@@ -1567,7 +1567,7 @@ class DocumentHttpService {
|
|
|
1567
1567
|
getCategoriesBySource(source) {
|
|
1568
1568
|
if (!source)
|
|
1569
1569
|
return EMPTY;
|
|
1570
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1570
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1571
1571
|
return this.http.get(`${this.apiUrl}${URLS.GET_CATEGORIES_BY_SOURCE}${source}`, { headers }).pipe(catchError((error) => {
|
|
1572
1572
|
return throwError(() => new Error(error));
|
|
1573
1573
|
}));
|
|
@@ -1580,7 +1580,7 @@ class DocumentHttpService {
|
|
|
1580
1580
|
getDocumentTypesByCategory(categoryId) {
|
|
1581
1581
|
if (!categoryId)
|
|
1582
1582
|
return EMPTY;
|
|
1583
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1583
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1584
1584
|
return this.http.get(`${this.apiUrl}${URLS.GET_DOCUMENT_TYPES_BY_CATEGORY}${categoryId}`, { headers }).pipe(catchError((error) => {
|
|
1585
1585
|
return throwError(() => new Error(error));
|
|
1586
1586
|
}));
|
|
@@ -1591,7 +1591,7 @@ class DocumentHttpService {
|
|
|
1591
1591
|
* @returns {Observable<any>} Observable that emits the upload response.
|
|
1592
1592
|
*/
|
|
1593
1593
|
uploadFile(formData) {
|
|
1594
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1594
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1595
1595
|
return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD_FILE}`, formData, { headers }).pipe(catchError((error) => {
|
|
1596
1596
|
return throwError(() => new Error(error));
|
|
1597
1597
|
}));
|
|
@@ -1602,7 +1602,7 @@ class DocumentHttpService {
|
|
|
1602
1602
|
* @returns {Observable<any>} Observable that emits the save response.
|
|
1603
1603
|
*/
|
|
1604
1604
|
saveDocumentUpload(payload) {
|
|
1605
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1605
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1606
1606
|
return this.http.post(`${this.apiUrl}${URLS.SAVE_DOCUMENT_UPLOAD}`, payload, { headers }).pipe(catchError((error) => {
|
|
1607
1607
|
return throwError(() => new Error(error));
|
|
1608
1608
|
}));
|
|
@@ -1618,7 +1618,7 @@ class DocumentHttpService {
|
|
|
1618
1618
|
const payload = {
|
|
1619
1619
|
statusUpdateDescription: statusUpdateDescription
|
|
1620
1620
|
};
|
|
1621
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1621
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1622
1622
|
return this.http.put(`${this.apiUrl}${URLS.UPDATE_DOCUMENT_STATUS}${documentId}/${status}`, payload, { headers }).pipe(tap((response) => {
|
|
1623
1623
|
if (response && response.status) {
|
|
1624
1624
|
const normalizedStatus = this.normalizeStatus(response.status);
|
|
@@ -1652,7 +1652,7 @@ class DocumentHttpService {
|
|
|
1652
1652
|
* @returns {Observable<any>} Observable that emits the delete response
|
|
1653
1653
|
*/
|
|
1654
1654
|
deleteDocument(documentId, contextId) {
|
|
1655
|
-
let headers = new HttpHeaders({ 'Authorization': `Bearer
|
|
1655
|
+
let headers = new HttpHeaders({ 'Authorization': `Bearer 4f84cc39-5446-45cc-9f4d-6fec8fdf45c9` });
|
|
1656
1656
|
return this.http.delete(`${this.apiUrl}${URLS.DELETE_DOCUMENT}${documentId}`, { headers }).pipe(tap(() => {
|
|
1657
1657
|
this.getDocumentCatagories(contextId).subscribe();
|
|
1658
1658
|
this.getUserListByContextId(contextId).subscribe();
|
|
@@ -7970,7 +7970,6 @@ class DocumentViewerComponent {
|
|
|
7970
7970
|
*/
|
|
7971
7971
|
onDocumentSelected(document) {
|
|
7972
7972
|
if (document && document.documentUrl && document.docName) {
|
|
7973
|
-
// Create a temporary document object for the viewer
|
|
7974
7973
|
const tempDocument = {
|
|
7975
7974
|
_id: document._id,
|
|
7976
7975
|
docName: document.docName,
|
|
@@ -7979,11 +7978,13 @@ class DocumentViewerComponent {
|
|
|
7979
7978
|
contentType: document.contentType,
|
|
7980
7979
|
status: document.status,
|
|
7981
7980
|
isUploaded: true,
|
|
7981
|
+
isAliasEditable: document.isAliasEditable,
|
|
7982
|
+
parentDocumentId: document.parentDocumentId,
|
|
7983
|
+
aliasName: document.aliasName,
|
|
7982
7984
|
fileSize: '0',
|
|
7983
|
-
uploadedOn: new Date().toISOString(),
|
|
7984
|
-
ownerName: 'History Document'
|
|
7985
|
+
uploadedOn: new Date().toISOString(),
|
|
7986
|
+
ownerName: 'History Document'
|
|
7985
7987
|
};
|
|
7986
|
-
// Update the selected document to show in the viewer
|
|
7987
7988
|
this.selectedDocument = tempDocument;
|
|
7988
7989
|
}
|
|
7989
7990
|
}
|
|
@@ -8260,15 +8261,12 @@ class DocumentListComponent {
|
|
|
8260
8261
|
this.documentListService.handleDeleteAction(rowData, this.contextId)
|
|
8261
8262
|
.subscribe({
|
|
8262
8263
|
next: (response) => {
|
|
8263
|
-
console.log('response', response);
|
|
8264
8264
|
if (this.selectedDocument && this.selectedDocument._id === rowData._id) {
|
|
8265
8265
|
this.handleCloseModal();
|
|
8266
8266
|
}
|
|
8267
8267
|
this.documentListService.refreshAllDataWithCurrentFilters(this.contextId);
|
|
8268
8268
|
},
|
|
8269
8269
|
error: (error) => {
|
|
8270
|
-
console.error(ERRORS.ERROR_FETCHING_DOCUMENTS, error);
|
|
8271
|
-
// Show error message without closing dialog
|
|
8272
8270
|
this.showDeleteErrorMessage(error);
|
|
8273
8271
|
}
|
|
8274
8272
|
});
|
|
@@ -8349,7 +8347,6 @@ class DocumentListComponent {
|
|
|
8349
8347
|
* Triggers a refresh of the document data
|
|
8350
8348
|
*/
|
|
8351
8349
|
handleViewerDestroyed() {
|
|
8352
|
-
// Refresh document data when viewer is closed
|
|
8353
8350
|
this.documentListService.refreshDocumentList(this.contextId);
|
|
8354
8351
|
}
|
|
8355
8352
|
/**
|