mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
[DURACOM-208] add showAdd flag in vocabulary-treeview-modal.component
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
[preloadLevel]="preloadLevel"
|
||||
[selectedItems]="selectedItems"
|
||||
[multiSelect]="multiSelect"
|
||||
[showAdd]="showAdd"
|
||||
(select)="onSelect($event)">
|
||||
</ds-vocabulary-treeview>
|
||||
</div>
|
||||
|
@@ -36,6 +36,11 @@ export class VocabularyTreeviewModalComponent implements OnInit {
|
||||
*/
|
||||
@Input() multiSelect = false;
|
||||
|
||||
/**
|
||||
* A boolean representing if to show the add button or not
|
||||
*/
|
||||
@Input() showAdd = true;
|
||||
|
||||
/**
|
||||
* Contain a descriptive message for this vocabulary retrieved from i18n files
|
||||
*/
|
||||
|
@@ -2,7 +2,6 @@ import { FlatTreeControl } from '@angular/cdk/tree';
|
||||
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||
|
||||
import { Observable, Subscription } from 'rxjs';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||
import { hasValue, isEmpty, isNotEmpty } from '../../empty.util';
|
||||
@@ -13,7 +12,6 @@ import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model';
|
||||
import { VocabularyTreeFlattener } from './vocabulary-tree-flattener';
|
||||
import { VocabularyTreeFlatDataSource } from './vocabulary-tree-flat-data-source';
|
||||
import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service';
|
||||
import { AlertType } from '../../alert/alert-type';
|
||||
import { FormFieldMetadataValueObject } from '../builder/models/form-field-metadata-value.model';
|
||||
|
||||
@@ -50,7 +48,7 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
|
||||
@Input() multiSelect = false;
|
||||
|
||||
/**
|
||||
* The vocabulary entries already selected, if any
|
||||
* A boolean representing if to show the add button or not
|
||||
*/
|
||||
@Input() showAdd = true;
|
||||
|
||||
@@ -117,13 +115,9 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
|
||||
* Initialize instance variables
|
||||
*
|
||||
* @param {VocabularyTreeviewService} vocabularyTreeviewService
|
||||
* @param {vocabularyService} vocabularyService
|
||||
* @param {TranslateService} translate
|
||||
*/
|
||||
constructor(
|
||||
private vocabularyTreeviewService: VocabularyTreeviewService,
|
||||
private vocabularyService: VocabularyService,
|
||||
private translate: TranslateService
|
||||
private vocabularyTreeviewService: VocabularyTreeviewService
|
||||
) {
|
||||
this.treeFlattener = new VocabularyTreeFlattener(this.transformer, this.getLevel,
|
||||
this.isExpandable, this.getChildren);
|
||||
|
@@ -10,7 +10,8 @@ import { SearchService } from '../../../../../core/shared/search/search.service'
|
||||
import {
|
||||
FILTER_CONFIG,
|
||||
IN_PLACE_SEARCH,
|
||||
SearchFilterService, REFRESH_FILTER
|
||||
REFRESH_FILTER,
|
||||
SearchFilterService
|
||||
} from '../../../../../core/shared/search/search-filter.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service';
|
||||
@@ -18,14 +19,15 @@ import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-p
|
||||
import { SearchConfigurationService } from '../../../../../core/shared/search/search-configuration.service';
|
||||
import { SearchFilterConfig } from '../../../models/search-filter-config.model';
|
||||
import { FacetValue } from '../../../models/facet-value.model';
|
||||
import { getFacetValueForType } from '../../../search.utils';
|
||||
import { addOperatorToFilterValue, getFacetValueForType } from '../../../search.utils';
|
||||
import { filter, map, take } from 'rxjs/operators';
|
||||
import { VocabularyService } from '../../../../../core/submission/vocabularies/vocabulary.service';
|
||||
import { Observable, BehaviorSubject } from 'rxjs';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { PageInfo } from '../../../../../core/shared/page-info.model';
|
||||
import { environment } from '../../../../../../environments/environment';
|
||||
import { addOperatorToFilterValue } from '../../../search.utils';
|
||||
import { VocabularyTreeviewModalComponent } from '../../../../form/vocabulary-treeview-modal/vocabulary-treeview-modal.component';
|
||||
import {
|
||||
VocabularyTreeviewModalComponent
|
||||
} from '../../../../form/vocabulary-treeview-modal/vocabulary-treeview-modal.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-search-hierarchy-filter',
|
||||
@@ -91,6 +93,7 @@ export class SearchHierarchyFilterComponent extends SearchFacetFilterComponent i
|
||||
name: this.getVocabularyEntry(),
|
||||
closed: true
|
||||
};
|
||||
modalRef.componentInstance.showAdd = false;
|
||||
modalRef.result.then((detail: VocabularyEntryDetail) => {
|
||||
this.selectedValues$
|
||||
.pipe(take(1))
|
||||
|
Reference in New Issue
Block a user