[ACS-6124] Mark tree view component for deprecation (#9781)

This commit is contained in:
Denys Vuika 2024-06-06 14:33:24 -04:00 committed by GitHub
parent 6586becdbd
commit 9c67c92b82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 40 additions and 29 deletions

View File

@ -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

View File

@ -74,7 +74,7 @@ describe('TreeViewComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ContentTestingModule]
imports: [ContentTestingModule, TreeViewComponent]
});
});

View File

@ -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']
})

View File

@ -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<TreeBaseNode[]> {
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<TreeBaseNode[]> {
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)))
);
}
}

View File

@ -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 {}