From a08af0bb9d9de719eaf4028d028cfca72f137010 Mon Sep 17 00:00:00 2001 From: tamaragruszka <156320606+tamaragruszka@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:27:10 +0200 Subject: [PATCH] [ACS-7600] Legal hold - Hold interface and documentation fixes (#10074) * [ACS-8055] Integrate endpoint for getting Legal Holds (#9771) * ACS-8055 add listAssignedHolds API * ACS-8055 create legal-hold service * ACS-8055 add documentation * ACS-8055 fix imports * ACS-8055 clean up code * ACS-8055 fix interface typo * ACS-8055 add optional options and uodate nodes-api.service.md * ACS-8055 update interface * ACS-8055 add HoldPaging class and documentation * ACS-8055 add interface and fix test * ACS-8055 add documentation for legal hold service * ACS-8055 update legal-hold.service.md * ACS-8055 update legal-hold.service.md * ACS-8055 update readme file * ACS-8055 add translation --------- Co-authored-by: DaryaBalvanovich * ACS-7689 Save and delete to existing hold (#9841) * [ACS-7690] Saving adding o a new hold (#9862) * ACS-7689 Save and delete to existing hold * ACS-7689 Save and delete to existing hold, cleanup * ACS-7689 Save and delete to existing hold, revert to separate methods * ACS-7689 Save and delete to existing hold, fix specs * ACS-7689 Save and delete to existing hold, fix specs * ACS-7689 Save and delete to existing hold * ACS-8055 add listAssignedHolds API * ACS-8055 create legal-hold service * ACS-8055 add documentation * ACS-8055 fix imports * ACS-8055 add HoldPaging class and documentation * ACS-8055 add interface and fix test * ACS-7689 Save and delete to existing hold, fix specs * ACS-7689 Save and delete to existing hold, fix specs * ACS-7690 integrate create and assign holds endpoints * ACS-7690 fix imports * ACS-7690 add bulk method * ACS-7690 update readme file * ACS-7690 add tests * ACS-7690 update docs file * ACS-7690 remove interface * ACS-7690 update geHolds description and md file with createHold * ACS-7690 add createHolds to md file * ACS-7690 fix typo in spec, and description in legal-hold service * ACS-7690 refactor create hold parameter and documentation * ACS-7690 fixed test * ACS-7690 fix test for getHolds * ACS-7690 fix md for create hold action * ACS-7690 fix rebase conflicts --------- Co-authored-by: Tomasz Nastaly Co-authored-by: DaryaBalvanovich * ACS-7689 Update payload with hold id (#9877) * ACS-7600 fix documentation and method name * ACS-7600 create separate type for hold creation * [ACS-8036] [FE] Legal Hold in ADW. Part 2 (Bulk) (#10062) * ACS-8329 Manage bulks endpoint (#9972) * ACS-8325 extend ContentActionRef with tooltip (#9998) * [ACS-8425] Add functionality to select folder and assign it to a hold (#10011) * ACS-8425 add bulkFolderHold method * ACS-8425 refactor names and add more specific query to folder * ACS-8425 refactor names * ACS-8425 fix description in md file * ACS-8425 update interfaces and add constant * ACS-8425 fix readme file and refactor tests * ACS-8425 fix readme * ACS-8425 fix readme * ACS-8036 fix import path --------- Co-authored-by: Tomasz Nastaly * [ACS-7600] fix imports in dropdown widget * [ACS-7600] fix Hold interface and documentation * [ACS-7600] fix hold interfaces and documentation * [ACS-7600] fix hold interfaces and documentation * [ACS-7600] fix hold interfaces and documentation * [ACS-7600] fix hold interfaces and documentation * [ACS-7600] fix hold interfaces and documentation * [ACS-7600] fix hold interfaces and documentation --------- Co-authored-by: Darya Blavanovich <166367848+DaryaBalvanovich@users.noreply.github.com> Co-authored-by: DaryaBalvanovich Co-authored-by: tomson Co-authored-by: g-jaskowski --- .../lib/common/services/nodes-api.service.ts | 19 +++++++-------- .../src/api/gs-core-rest-api/docs/Hold.md | 24 +++++-------------- .../src/api/gs-core-rest-api/docs/HoldBody.md | 10 -------- .../gs-core-rest-api/docs/NodeAssignedHold.md | 8 +++++++ .../src/api/gs-core-rest-api/model/hold.ts | 8 +++---- .../src/api/gs-core-rest-api/model/index.ts | 1 + .../model/nodeAssignedHold.ts | 21 ++++++++++++++++ 7 files changed, 47 insertions(+), 44 deletions(-) create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/NodeAssignedHold.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/nodeAssignedHold.ts 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; +}