mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
taskid 85843 Add a tree to browse hierarchical facets on the search page - feedback
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { VocabularyTreeviewComponent } from '../../../../../app/shared/vocabulary-treeview/vocabulary-treeview.component';
|
import { VocabularyTreeviewComponent } from '../../../../../app/shared/vocabulary-treeview/vocabulary-treeview.component';
|
||||||
import { filter, startWith } from 'rxjs/operators';
|
import { filter, map, startWith } from 'rxjs/operators';
|
||||||
import { PageInfo } from '../../../../../app/core/shared/page-info.model';
|
import { PageInfo } from '../../../../../app/core/shared/page-info.model';
|
||||||
|
import { lowerCase } from 'lodash';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that show a hierarchical vocabulary in a tree view.
|
* Component that show a hierarchical vocabulary in a tree view.
|
||||||
@@ -27,10 +28,10 @@ export class OkrVocabularyTreeviewComponent extends VocabularyTreeviewComponent
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
const descriptionLabel = 'vocabulary-treeview.tree.description.' + this.vocabularyOptions.name;
|
this.translate.get(`search.filters.filter.${this.vocabularyOptions.name}.head`).pipe(
|
||||||
this.description = this.translate.get(descriptionLabel).pipe(
|
map((type) => lowerCase(type)),
|
||||||
filter((msg) => msg !== descriptionLabel),
|
).subscribe(
|
||||||
startWith('')
|
(type) => this.description = this.translate.get('okr-vocabulary-treeview.info', { type })
|
||||||
);
|
);
|
||||||
|
|
||||||
this.loading = this.vocabularyTreeviewService.isLoading();
|
this.loading = this.vocabularyTreeviewService.isLoading();
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
<ds-search-hierarchy-filter></ds-search-hierarchy-filter>
|
<ds-search-hierarchy-filter></ds-search-hierarchy-filter>
|
||||||
|
|
||||||
<div *ngIf="vocabularyExists$ | async"
|
<a *ngIf="vocabularyExists$ | async"
|
||||||
|
href="javascript:void(0);"
|
||||||
id="show-{{filterConfig.name}}-tree"
|
id="show-{{filterConfig.name}}-tree"
|
||||||
class="text-lowercase"
|
|
||||||
(click)="showVocabularyTree()">
|
(click)="showVocabularyTree()">
|
||||||
{{'search.filters.filter.show-tree' | translate: {name: ('search.filters.filter.' + filterConfig.name + '.head' | translate)} }}
|
{{'search.filters.filter.show-tree' | translate: {name: ('search.filters.filter.' + filterConfig.name + '.head' | translate | lowercase )} }}
|
||||||
</div>
|
</a>
|
||||||
|
@@ -82,7 +82,7 @@ describe('OkrSearchHierarchyFilterComponent', () => {
|
|||||||
function init() {
|
function init() {
|
||||||
fixture = TestBed.createComponent(OkrSearchHierarchyFilterComponent);
|
fixture = TestBed.createComponent(OkrSearchHierarchyFilterComponent);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
showVocabularyTreeLink = fixture.debugElement.query(By.css('div#show-test-search-filter-tree'));
|
showVocabularyTreeLink = fixture.debugElement.query(By.css('a#show-test-search-filter-tree'));
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('if the vocabulary doesn\'t exist', () => {
|
describe('if the vocabulary doesn\'t exist', () => {
|
||||||
|
Reference in New Issue
Block a user