TSK-465 Add classification tree filtering
This commit is contained in:
parent
0062d89aae
commit
12ac45036c
|
|
@ -4,8 +4,8 @@
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
&> .panel-body {
|
&> .panel-body {
|
||||||
height: 87vh;
|
height: 85vh;
|
||||||
max-height: 87vh;
|
max-height: 85vh;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<taskana-spinner [isRunning]="requestInProgress" ></taskana-spinner>
|
<div class="col-xs-12">
|
||||||
<taskana-tree *ngIf="classifications" [treeNodes]="classifications" [selectNodeId] ="selectedId" (selectNodeIdChanged) ="selectClassification($event)"></taskana-tree>
|
<input class="filter-input" [ngModel]="inputValue" (ngModelChange)="inputValue = $event" placeholder="Filter classifications">
|
||||||
|
</div>
|
||||||
|
<taskana-spinner class="col-xs-12" [isRunning]="requestInProgress"></taskana-spinner>
|
||||||
|
<taskana-tree class="col-xs-12" *ngIf="classifications" [treeNodes]="classifications" [selectNodeId]="selectedId" [filterText]="inputValue"
|
||||||
|
(selectNodeIdChanged)="selectClassification($event)"></taskana-tree>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
.classification-list-full-height {
|
.classification-list-full-height {
|
||||||
height: calc(100vh - 57px);
|
height: calc(100vh - 55px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-group-item {
|
.list-group-item {
|
||||||
|
|
@ -14,3 +14,9 @@
|
||||||
margin: 6px 0px;
|
margin: 6px 0px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input.filter-input {
|
||||||
|
margin: 10px 0px;
|
||||||
|
height: 32px;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
@ -29,6 +30,7 @@ import { RequestInProgressService } from 'app/services/requestInProgress/request
|
||||||
class TaskanaTreeComponent {
|
class TaskanaTreeComponent {
|
||||||
@Input() treeNodes;
|
@Input() treeNodes;
|
||||||
@Input() selectNodeId;
|
@Input() selectNodeId;
|
||||||
|
@Input() filterText;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
@ -56,7 +58,7 @@ describe('ClassificationListComponent', () => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
declarations: [ClassificationListComponent, ImportExportComponent, SpinnerComponent, ClassificationTypesSelectorComponent,
|
declarations: [ClassificationListComponent, ImportExportComponent, SpinnerComponent, ClassificationTypesSelectorComponent,
|
||||||
TaskanaTreeComponent, DummyDetailComponent],
|
TaskanaTreeComponent, DummyDetailComponent],
|
||||||
imports: [HttpClientModule, RouterTestingModule.withRoutes(routes)],
|
imports: [HttpClientModule, RouterTestingModule.withRoutes(routes), FormsModule],
|
||||||
providers: [
|
providers: [
|
||||||
HttpClient, WorkbasketDefinitionService, AlertService, ClassificationsService, DomainService, ClassificationDefinitionService,
|
HttpClient, WorkbasketDefinitionService, AlertService, ClassificationsService, DomainService, ClassificationDefinitionService,
|
||||||
ErrorModalService, ClassificationTypesService, RequestInProgressService
|
ErrorModalService, ClassificationTypesService, RequestInProgressService
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
|
||||||
selectionToImport = ImportType.CLASSIFICATIONS;
|
selectionToImport = ImportType.CLASSIFICATIONS;
|
||||||
requestInProgress = false;
|
requestInProgress = false;
|
||||||
initialized = false;
|
initialized = false;
|
||||||
|
inputValue: string;
|
||||||
|
|
||||||
classifications: Array<Classification> = [];
|
classifications: Array<Classification> = [];
|
||||||
classificationsTypes: Array<string> = [];
|
classificationsTypes: Array<string> = [];
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
.workbasket-list-full-height{
|
.workbasket-list-full-height{
|
||||||
height: calc(100vh - 57px);
|
height: calc(100vh - 55px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.row.list-group {
|
.row.list-group {
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,6 @@ svg-icon.logo {
|
||||||
padding:2px;
|
padding:2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo-container {
|
|
||||||
padding-left: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.navbar-brand >a{
|
p.navbar-brand >a{
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,9 @@ export class TaskanaTreeComponent implements OnInit, AfterViewChecked {
|
||||||
@Output() treeNodesChange = new EventEmitter<Array<TreeNodeModel>>();
|
@Output() treeNodesChange = new EventEmitter<Array<TreeNodeModel>>();
|
||||||
@Input() selectNodeId: string;
|
@Input() selectNodeId: string;
|
||||||
@Output() selectNodeIdChanged = new EventEmitter<string>();
|
@Output() selectNodeIdChanged = new EventEmitter<string>();
|
||||||
|
@Input() filterText: string;
|
||||||
|
|
||||||
|
private filterTextOld: string
|
||||||
|
|
||||||
options: ITreeOptions = {
|
options: ITreeOptions = {
|
||||||
displayField: 'name',
|
displayField: 'name',
|
||||||
|
|
@ -54,6 +57,10 @@ export class TaskanaTreeComponent implements OnInit, AfterViewChecked {
|
||||||
} else if (!this.selectNodeId && this.tree.treeModel.getActiveNode()) {
|
} else if (!this.selectNodeId && this.tree.treeModel.getActiveNode()) {
|
||||||
this.unSelectActiveNode();
|
this.unSelectActiveNode();
|
||||||
}
|
}
|
||||||
|
if (this.filterTextOld !== this.filterText) {
|
||||||
|
this.filterTextOld = this.filterText;
|
||||||
|
this.filterNodes(this.filterText)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onActivate(treeNode: any) {
|
onActivate(treeNode: any) {
|
||||||
|
|
@ -92,6 +99,13 @@ export class TaskanaTreeComponent implements OnInit, AfterViewChecked {
|
||||||
this.expandParent(node.parent);
|
this.expandParent(node.parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private filterNodes(text) {
|
||||||
|
this.tree.treeModel.filterNodes((node) => {
|
||||||
|
return (node.data.name.toUpperCase().includes(text.toUpperCase())
|
||||||
|
|| node.data.key.toUpperCase().includes(text.toUpperCase()));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,18 +21,18 @@
|
||||||
/*
|
/*
|
||||||
* Base structure
|
* Base structure
|
||||||
*/
|
*/
|
||||||
/* Move down content because we have a fixed navbar that is 57px tall */
|
/* Move down content because we have a fixed navbar that is 55px tall */
|
||||||
|
|
||||||
.container-main {
|
.container-main {
|
||||||
margin-top: 57px;
|
margin-top: 55px;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
/*Min mobile view size*/
|
/*Min mobile view size*/
|
||||||
min-width: 420px;
|
min-width: 420px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container-scrollable {
|
.container-scrollable {
|
||||||
max-height: calc(100vh - 57px);
|
max-height: calc(100vh - 55px);
|
||||||
height: calc(100vh - 57px);
|
height: calc(100vh - 55px);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -268,5 +268,5 @@ taskana-workbasket-information, taskana-workbasket-access-items, taskana-workbas
|
||||||
}
|
}
|
||||||
|
|
||||||
tree-viewport {
|
tree-viewport {
|
||||||
height: calc(100vh - 110px);
|
height: calc(100vh - 165px);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,6 @@ tree-node-expander .toggle-children-wrapper-expanded {
|
||||||
transform: none;
|
transform: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tree-node-collection > div > tree-node > .tree-node {
|
|
||||||
padding-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.node-content-wrapper {
|
.node-content-wrapper {
|
||||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue