Skip to content

Commit

Permalink
[ACS-6124] Mark tree view component for deprecation (#9781)
Browse files Browse the repository at this point in the history
  • Loading branch information
DenysVuika authored Jun 6, 2024
1 parent 6586bec commit 9c67c92
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 29 deletions.
20 changes: 20 additions & 0 deletions docs/release-notes/RelNote-6.10.0.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('TreeViewComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [ContentTestingModule]
imports: [ContentTestingModule, TreeViewComponent]
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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)))
);
}

}
20 changes: 4 additions & 16 deletions lib/content-services/src/lib/tree-view/tree-view.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

0 comments on commit 9c67c92

Please sign in to comment.