mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
ACS-8055 add interface and fix test
This commit is contained in:
@@ -84,10 +84,10 @@ Accesses and manipulates ACS document nodes using their node IDs.
|
||||
- _nodeBody:_ `any` - New data for the node
|
||||
- _options:_ `any` - Optional parameters supported by JS-API
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNode`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeMinimalEntry.md)`>` - Updated node information<br/>
|
||||
- **getNodeAssignHolds**(nodeId: `string`, options: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`Hold[]`](../../../lib/js-api/src/api/gs-core-rest-api/docs/Hold.md)`>`<br/>
|
||||
- **getNodeAssignHolds**(nodeId: `string`, options: `{ includeSource?: boolean; } & NodesIncludeQuery & ContentPagingQuery`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`Hold[]`](../../../lib/js-api/src/api/gs-core-rest-api/docs/Hold.md)`>`<br/>
|
||||
Getting legal holds assigned to a node.
|
||||
- _nodeId:_ `string` - ID of the target node
|
||||
- _options:_ `any` - Optional parameters supported by JS-API
|
||||
- _options:_ `{ includeSource?: boolean; } & NodesIncludeQuery & ContentPagingQuery` - Optional parameters supported by JS-API
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`Hold[]`](../../../lib/js-api/src/api/gs-core-rest-api/docs/Hold.md)`>` - Updated node information
|
||||
|
||||
## Details
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { NodeEntry, NodePaging, NodesApi, TrashcanApi, Node, Hold } from '@alfresco/js-api';
|
||||
import { NodeEntry, NodePaging, NodesApi, TrashcanApi, Node, Hold, ContentPagingQuery, NodesIncludeQuery } from '@alfresco/js-api';
|
||||
import { Subject, from, Observable, throwError } from 'rxjs';
|
||||
import { AlfrescoApiService, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
@@ -245,9 +245,16 @@ export class NodesApiService {
|
||||
*
|
||||
* @param nodeId ID of the target node
|
||||
* @param options Optional parameters supported by JS-API
|
||||
* @param options.includeSource Also include **source** (in addition to **entries**) with folder information on **nodeId**
|
||||
* @returns List of assigned holds Observable<Hold[]>
|
||||
*/
|
||||
getNodeAssignHolds(nodeId: string, options?: any): Observable<Hold[]> {
|
||||
getNodeAssignHolds(
|
||||
nodeId: string,
|
||||
options?: {
|
||||
includeSource?: boolean;
|
||||
} & NodesIncludeQuery &
|
||||
ContentPagingQuery
|
||||
): Observable<Hold[]> {
|
||||
const queryOptions = Object.assign({ where: `(assocType='rma:frozenContent')` }, options);
|
||||
|
||||
return from(this.nodesApi.listParents(nodeId, queryOptions)).pipe(
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { LegalHoldService } from './legal-hold.service';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { Hold, NodeChildAssociationPaging } from '@alfresco/js-api';
|
||||
import { Hold, HoldPaging } from '@alfresco/js-api';
|
||||
|
||||
describe('LegalHoldsService', () => {
|
||||
let service: LegalHoldService;
|
||||
let legalHolds: NodeChildAssociationPaging;
|
||||
let legalHolds: HoldPaging;
|
||||
let returnedHolds: Hold[];
|
||||
const mockId = 'mockId';
|
||||
|
||||
@@ -44,7 +44,7 @@ describe('LegalHoldsService', () => {
|
||||
}
|
||||
]
|
||||
}
|
||||
} as NodeChildAssociationPaging;
|
||||
} as HoldPaging;
|
||||
|
||||
returnedHolds = [
|
||||
{
|
||||
|
||||
@@ -64,7 +64,6 @@ Class | Method | HTTP request | Description
|
||||
- [FilePlanComponentBodyUpdate](docs/FilePlanComponentBodyUpdate.md)
|
||||
- [FilePlanEntry](docs/FilePlanEntry.md)
|
||||
- [ModelError](docs/ModelError.md)
|
||||
- [NodeChildAssociationPaging](../content-rest-api/docs/NodesApi.md#NodeChildAssociationPaging)
|
||||
- [Pagination](docs/Pagination.md)
|
||||
- [PathElement](docs/PathElement.md)
|
||||
- [PathInfo](docs/PathInfo.md)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Hold } from '..';
|
||||
import { Hold } from './hold';
|
||||
|
||||
export class HoldEntry {
|
||||
entry: Hold;
|
||||
|
||||
Reference in New Issue
Block a user