mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +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 { 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 { lowerCase } from 'lodash';
|
||||
|
||||
/**
|
||||
* 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.description = this.translate.get(descriptionLabel).pipe(
|
||||
filter((msg) => msg !== descriptionLabel),
|
||||
startWith('')
|
||||
this.translate.get(`search.filters.filter.${this.vocabularyOptions.name}.head`).pipe(
|
||||
map((type) => lowerCase(type)),
|
||||
).subscribe(
|
||||
(type) => this.description = this.translate.get('okr-vocabulary-treeview.info', { type })
|
||||
);
|
||||
|
||||
this.loading = this.vocabularyTreeviewService.isLoading();
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<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"
|
||||
class="text-lowercase"
|
||||
(click)="showVocabularyTree()">
|
||||
{{'search.filters.filter.show-tree' | translate: {name: ('search.filters.filter.' + filterConfig.name + '.head' | translate)} }}
|
||||
</div>
|
||||
{{'search.filters.filter.show-tree' | translate: {name: ('search.filters.filter.' + filterConfig.name + '.head' | translate | lowercase )} }}
|
||||
</a>
|
||||
|
@@ -82,7 +82,7 @@ describe('OkrSearchHierarchyFilterComponent', () => {
|
||||
function init() {
|
||||
fixture = TestBed.createComponent(OkrSearchHierarchyFilterComponent);
|
||||
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', () => {
|
||||
|
Reference in New Issue
Block a user