Skip to content

Commit

Permalink
Merge pull request DSpace#2361 from nona-luypaert/issue-2337_fix-voca…
Browse files Browse the repository at this point in the history
…bulary-treeview-not-updating

Fix tree not updating when switching between "Browse by Vocabulary" pages
  • Loading branch information
tdonohue authored Sep 5, 2023
2 parents 65a215e + 64e9f77 commit ba70a96
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FlatTreeControl } from '@angular/cdk/tree';
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, OnChanges, SimpleChanges } from '@angular/core';

import { map } from 'rxjs/operators';
import { Observable, Subscription } from 'rxjs';
Expand Down Expand Up @@ -28,7 +28,7 @@ import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operato
templateUrl: './vocabulary-treeview.component.html',
styleUrls: ['./vocabulary-treeview.component.scss']
})
export class VocabularyTreeviewComponent implements OnDestroy, OnInit {
export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges {

/**
* The {@link VocabularyOptions} object
Expand Down Expand Up @@ -322,4 +322,9 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit {
private getEntryId(entry: VocabularyEntry): string {
return entry.authority || entry.otherInformation.id || undefined;
}

ngOnChanges(changes: SimpleChanges): void {
this.reset();
this.vocabularyTreeviewService.initialize(this.vocabularyOptions, new PageInfo(), this.selectedItems, null);
}
}
6 changes: 6 additions & 0 deletions src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,8 @@

"browse.comcol.by.srsc": "By Subject Category",

"browse.comcol.by.nsi": "By Norwegian Science Index",

"browse.comcol.by.title": "By Title",

"browse.comcol.head": "Browse",
Expand All @@ -804,6 +806,8 @@

"browse.metadata.srsc.breadcrumbs": "Browse by Subject Category",

"browse.metadata.nsi.breadcrumbs": "Browse by Norwegian Science Index",

"browse.metadata.title.breadcrumbs": "Browse by Title",

"pagination.next.button": "Next",
Expand Down Expand Up @@ -2826,6 +2830,8 @@

"menu.section.browse_global_by_srsc": "By Subject Category",

"menu.section.browse_global_by_nsi": "By Norwegian Science Index",

"menu.section.browse_global_by_title": "By Title",

"menu.section.browse_global_communities_and_collections": "Communities & Collections",
Expand Down

0 comments on commit ba70a96

Please sign in to comment.