diff --git a/lib/content-services/src/lib/common/services/nodes-api.service.ts b/lib/content-services/src/lib/common/services/nodes-api.service.ts index fe9446882d..ea4deca9b5 100644 --- a/lib/content-services/src/lib/common/services/nodes-api.service.ts +++ b/lib/content-services/src/lib/common/services/nodes-api.service.ts @@ -15,10 +15,10 @@ * limitations under the License. */ -import { Injectable } from '@angular/core'; -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 { ContentPagingQuery, Node, NodeAssignedHold, NodeEntry, NodePaging, NodesApi, NodesIncludeQuery, TrashcanApi } from '@alfresco/js-api'; +import { Injectable } from '@angular/core'; +import { from, Observable, Subject, throwError } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; import { NodeMetadata } from '../models/node-metadata.model'; @@ -182,18 +182,15 @@ export class NodesApiService { includeSource?: boolean; } & NodesIncludeQuery & ContentPagingQuery - ): Observable { + ): Observable { const queryOptions = Object.assign({ where: `(assocType='rma:frozenContent')` }, options); return from(this.nodesApi.listParents(nodeId, queryOptions)).pipe( map(({ list }) => - list.entries?.map( - ({ entry }) => - ({ - id: entry.id, - name: entry.name - } as Hold) - ) + list.entries?.map(({ entry }) => ({ + id: entry.id, + name: entry.name + })) ) ); } diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/Hold.md b/lib/js-api/src/api/gs-core-rest-api/docs/Hold.md index 7d3fbb435c..0b85e0c01d 100644 --- a/lib/js-api/src/api/gs-core-rest-api/docs/Hold.md +++ b/lib/js-api/src/api/gs-core-rest-api/docs/Hold.md @@ -1,22 +1,10 @@ # Hold -## Basic usage - -```ts -export interface Hold { - id: string; - name: string; - reason: string; - description?: string; - selected?: string; -} -``` - ## Properties -| Name | Type | Default value | Description | -|-----------------|------------|---------------|-----------------------------------| -| **id** | **string** | | Hold id | -| **name** | **string** | | Hold name | -| **reason** | **string** | | Hold reason | -| **description** | **string** | | Additional information for a hold | +| Name | Type | Default value | Description | +|-----------------|------------|---------------|----------------------------------------------| +| **id** | **string** | | Hold id | +| **name** | **string** | | Hold name | +| **reason** | **string** | | Hold reason | +| **description** | **string** | | (Optional) Additional information for a hold | diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/HoldBody.md b/lib/js-api/src/api/gs-core-rest-api/docs/HoldBody.md index 72c81765f7..d543dc2211 100644 --- a/lib/js-api/src/api/gs-core-rest-api/docs/HoldBody.md +++ b/lib/js-api/src/api/gs-core-rest-api/docs/HoldBody.md @@ -1,15 +1,5 @@ # HoldBody -## Basic usage - -```ts -export interface HoldBody { - name: string; - reason: string; - description?: string; -} -``` - ## Properties | Name | Type | Default value | Description | diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/NodeAssignedHold.md b/lib/js-api/src/api/gs-core-rest-api/docs/NodeAssignedHold.md new file mode 100644 index 0000000000..081a7a1534 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/NodeAssignedHold.md @@ -0,0 +1,8 @@ +# NodeAssignedHold + +## Properties + +| Name | Type | Default value | Description | +|----------|------------|---------------|-------------| +| **id** | **string** | | Hold id | +| **name** | **string** | | Hold name | diff --git a/lib/js-api/src/api/gs-core-rest-api/model/hold.ts b/lib/js-api/src/api/gs-core-rest-api/model/hold.ts index 266bf8a14f..8bde0291af 100644 --- a/lib/js-api/src/api/gs-core-rest-api/model/hold.ts +++ b/lib/js-api/src/api/gs-core-rest-api/model/hold.ts @@ -15,10 +15,8 @@ * limitations under the License. */ -export interface Hold { +import { HoldBody } from './holdBody'; + +export interface Hold extends HoldBody { id: string; - name: string; - reason: string; - description?: string; - selected?: boolean; } diff --git a/lib/js-api/src/api/gs-core-rest-api/model/index.ts b/lib/js-api/src/api/gs-core-rest-api/model/index.ts index bd8c7fff0c..78cb3dbf03 100644 --- a/lib/js-api/src/api/gs-core-rest-api/model/index.ts +++ b/lib/js-api/src/api/gs-core-rest-api/model/index.ts @@ -79,4 +79,5 @@ export * from './holdBody'; export * from './holdEntry'; export * from './holdPaging'; export * from './holdPagingList'; +export * from './nodeAssignedHold'; export * from './bulkAssignHoldResponse'; diff --git a/lib/js-api/src/api/gs-core-rest-api/model/nodeAssignedHold.ts b/lib/js-api/src/api/gs-core-rest-api/model/nodeAssignedHold.ts new file mode 100644 index 0000000000..069ad27e84 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/nodeAssignedHold.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface NodeAssignedHold { + id: string; + name: string; +}