From 9c67c92b8235a350c42fdebf724e199896a2c7cf Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Thu, 6 Jun 2024 14:33:24 -0400 Subject: [PATCH] [ACS-6124] Mark tree view component for deprecation (#9781) --- docs/release-notes/RelNote-6.10.0.md | 20 +++++++++++++++++++ .../components/tree-view.component.spec.ts | 2 +- .../components/tree-view.component.ts | 7 +++++++ .../tree-view/services/tree-view.service.ts | 20 ++++++++----------- .../src/lib/tree-view/tree-view.module.ts | 20 ++++--------------- 5 files changed, 40 insertions(+), 29 deletions(-) create mode 100644 docs/release-notes/RelNote-6.10.0.md diff --git a/docs/release-notes/RelNote-6.10.0.md b/docs/release-notes/RelNote-6.10.0.md new file mode 100644 index 00000000000..e98b70c636b --- /dev/null +++ b/docs/release-notes/RelNote-6.10.0.md @@ -0,0 +1,20 @@ +# Release Notes v6.10.0 + +## Deprecated Content + +The following components have been deprecated and will be removed in the next major release: + +- Content Services: `TreeViewComponent` + +## Removed Content + +The following components have been removed: + +- ACS-5571: Content Services: `WebScriptComponent` +- ACS-5572: Content Services: `RatingComponent` +- ACS-5572: Content Services: `LikeComponent` +- ACS-7577: Content Services: `adf-create-folder`, `adf-edit-folder` directives + +## Changelog + +TBD diff --git a/lib/content-services/src/lib/tree-view/components/tree-view.component.spec.ts b/lib/content-services/src/lib/tree-view/components/tree-view.component.spec.ts index f50bb7d6e70..db3bfe0c540 100644 --- a/lib/content-services/src/lib/tree-view/components/tree-view.component.spec.ts +++ b/lib/content-services/src/lib/tree-view/components/tree-view.component.spec.ts @@ -74,7 +74,7 @@ describe('TreeViewComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ContentTestingModule] + imports: [ContentTestingModule, TreeViewComponent] }); }); diff --git a/lib/content-services/src/lib/tree-view/components/tree-view.component.ts b/lib/content-services/src/lib/tree-view/components/tree-view.component.ts index 3e49c72f4ad..7214b91745f 100644 --- a/lib/content-services/src/lib/tree-view/components/tree-view.component.ts +++ b/lib/content-services/src/lib/tree-view/components/tree-view.component.ts @@ -21,9 +21,16 @@ import { TreeBaseNode } from '../models/tree-view.model'; import { TreeViewDataSource } from '../data/tree-view-datasource'; import { TreeViewService } from '../services/tree-view.service'; import { NodeEntry } from '@alfresco/js-api'; +import { CommonModule } from '@angular/common'; +import { MatTreeModule } from '@angular/material/tree'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'adf-tree-view-list', + standalone: true, + imports: [CommonModule, MatTreeModule, MatButtonModule, MatIconModule, TranslateModule], templateUrl: './tree-view.component.html', styleUrls: ['./tree-view.component.scss'] }) diff --git a/lib/content-services/src/lib/tree-view/services/tree-view.service.ts b/lib/content-services/src/lib/tree-view/services/tree-view.service.ts index c3525a31131..c5bfd56d1be 100644 --- a/lib/content-services/src/lib/tree-view/services/tree-view.service.ts +++ b/lib/content-services/src/lib/tree-view/services/tree-view.service.ts @@ -15,8 +15,8 @@ * limitations under the License. */ -import { NodesApiService } from '../../common/services/nodes-api.service'; -import { Injectable } from '@angular/core'; +import { NodesApiService } from '../../common/services/nodes-api.service'; +import { inject, Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { TreeBaseNode } from '../models/tree-view.model'; import { NodePaging, NodeEntry } from '@alfresco/js-api'; @@ -26,16 +26,12 @@ import { map } from 'rxjs/operators'; providedIn: 'root' }) export class TreeViewService { + private nodeApi = inject(NodesApiService); - constructor(private nodeApi: NodesApiService) { + getTreeNodes(nodeId: string): Observable { + return this.nodeApi.getNodeChildren(nodeId).pipe( + map((nodePage: NodePaging) => nodePage.list.entries.filter((node) => (node.entry.isFolder ? node : null))), + map((nodes: NodeEntry[]) => nodes.map((node) => new TreeBaseNode(node))) + ); } - - getTreeNodes(nodeId): Observable { - return this.nodeApi.getNodeChildren(nodeId) - .pipe( - map((nodePage: NodePaging) => nodePage.list.entries.filter((node) => node.entry.isFolder ? node : null)), - map((nodes: NodeEntry[]) => nodes.map((node) => new TreeBaseNode(node))) - ); - } - } diff --git a/lib/content-services/src/lib/tree-view/tree-view.module.ts b/lib/content-services/src/lib/tree-view/tree-view.module.ts index b4ccad059b8..308b958d43c 100644 --- a/lib/content-services/src/lib/tree-view/tree-view.module.ts +++ b/lib/content-services/src/lib/tree-view/tree-view.module.ts @@ -15,24 +15,12 @@ * limitations under the License. */ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; -import { MaterialModule } from '../material.module'; import { TreeViewComponent } from './components/tree-view.component'; +/** @deprecated this module is deprecated and will be removed in future versions */ @NgModule({ - imports: [ - CommonModule, - MaterialModule, - TranslateModule - ], - declarations: [ - TreeViewComponent - ], - exports: [ - TreeViewComponent - ] + imports: [TreeViewComponent], + exports: [TreeViewComponent] }) -export class TreeViewModule { -} +export class TreeViewModule {}