cleared unused code

This commit is contained in:
Maria Teresa Paratore 2023-12-06 19:23:10 +01:00
parent 50e575e238
commit 664699e25a
7 changed files with 0 additions and 186 deletions

View File

@ -1,29 +0,0 @@
<div class="col-md-9">
<h1 class="display-4"><span>This is a Tree!</span></h1>
<mat-tree [dataSource]="nestedDataSource" [treeControl]="nestedTreeControl" class="example-tree">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle>
{{node.name}}
</mat-tree-node>
<mat-nested-tree-node *matTreeNodeDef="let node; when hasNestedChild">
<div class="mat-tree-node">
<button mat-icon-button matTreeNodeToggle>
<mat-icon class="mat-icon-rtl-mirror">
{{nestedTreeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
{{node.name}}
</div>
<div [class.example-tree-invisible]="!nestedTreeControl.isExpanded(node)" role="group">
<ng-container matTreeNodeOutlet></ng-container>
</div>
</mat-nested-tree-node>
</mat-tree>
</div>

View File

@ -1,29 +0,0 @@
@import url( 'https://fonts.googleapis.com/css?family=Roboto:400,700|Material+Icons');
@import '~@angular/material/theming';
.example-tree-invisible {
display: none;
}
.example-tree ul,
.example-tree li {
margin-top: 0;
margin-bottom: 0;
list-style-type: none;
}
/*
* This padding sets alignment of the nested nodes.
*/
.example-tree .mat-nested-tree-node div[role=group] {
padding-left: 40px;
}
/*
* Padding for leaf nodes.
* Leaf nodes need to have padding so as to align with other non-leaf nodes
* under the same parent.
*/
.example-tree div[role=group] > .mat-tree-node {
padding-left: 40px;
}

View File

@ -1,23 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ContextTreeComponent } from './context-tree.component';
describe('ContextTreeComponent', () => {
let component: ContextTreeComponent;
let fixture: ComponentFixture<ContextTreeComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ContextTreeComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(ContextTreeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -1,58 +0,0 @@
import { Component/*, OnInit*/ } from '@angular/core';
import {MatTreeNestedDataSource} from '@angular/material/tree'
import { NestedTreeControl } from '@angular/cdk/tree';
interface IContextNode {
name: string;
children?: IContextNode[];
}
const TREE_DATA: IContextNode[] = [
{
name: 'Fruit',
children: [{name: 'Apple'}, {name: 'Grapefruit'}, {name: 'Fruit loops'}],
},
{
name: 'Vegetables',
children: [
{
name: 'Green',
children: [{name: 'Spinach'}, {name: 'Brussels sprouts'}],
},
{
name: 'Orange',
children: [{name: 'Pumpkins'}, {name: 'Carrots'}],
},
],
},
];
@Component({
selector: 'jhi-context-tree',
templateUrl: './context-tree.component.html',
styleUrls: ['./context-tree.component.scss'],
})
export class ContextTreeComponent /*implements OnInit*/ {
nestedTreeControl = new NestedTreeControl<IContextNode>(node => node.children);
nestedDataSource = new MatTreeNestedDataSource<IContextNode>();
constructor() {
this.nestedDataSource.data = TREE_DATA;
}
hasNestedChild(_:number, node:IContextNode):boolean{
if (node.children==null){
return false;
}
else{
return node.children.length>0;
}
}
}

View File

@ -1,20 +0,0 @@
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { ContextTreeComponent } from './context-tree.component';
import { CONTEXTTREE_ROUTE } from './context-tree.route';
import { SharedModule } from 'app/shared/shared.module';
import { MatIconModule } from '@angular/material/icon';
@NgModule({
imports: [
SharedModule,
RouterModule.forChild(CONTEXTTREE_ROUTE),
MatIconModule
],
declarations: [ContextTreeComponent],
entryComponents: [ContextTreeComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class ContextTreeModule { }

View File

@ -1,11 +0,0 @@
import { Routes } from '@angular/router';
import { ContextTreeComponent } from './context-tree.component';
export const CONTEXTTREE_ROUTE: Routes = [{
path: '',
component: ContextTreeComponent,
data: {
pageTitle: 'This is a Tree',
},
}];

View File

@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { ContextsLoaderService } from './contexts-loader.service';
describe('ContextsLoaderService', () => {
let service: ContextsLoaderService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ContextsLoaderService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});