Skip to content

Commit

Permalink
[DURACOM-190] Fix i18n labels in vocabulary-treeview
Browse files Browse the repository at this point in the history
  • Loading branch information
davide-negretti committed Oct 11, 2023
1 parent a57bcf0 commit b321d6f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ds-alert *ngIf="description | async" [content]="description | async" [type]="'alert-info'"></ds-alert>
<ds-alert [content]="'vocabulary-treeview.info' | translate" [type]="'alert-info'"></ds-alert>
<div class="treeview-header row">
<div class="col-12">
<div class="input-group">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { FlatTreeControl } from '@angular/cdk/tree';
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, OnChanges, SimpleChanges } from '@angular/core';

import { map } from 'rxjs/operators';
import { Observable, Subscription } from 'rxjs';
import { Store } from '@ngrx/store';
import { TranslateService } from '@ngx-translate/core';
Expand All @@ -16,7 +15,6 @@ import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vo
import { VocabularyTreeFlattener } from './vocabulary-tree-flattener';
import { VocabularyTreeFlatDataSource } from './vocabulary-tree-flat-data-source';
import { CoreState } from '../../../core/core-state.model';
import { lowerCase } from 'lodash/string';
import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service';
import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators';

Expand Down Expand Up @@ -50,11 +48,6 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
*/
@Input() multiSelect = false;

/**
* Contain a descriptive message for this vocabulary retrieved from i18n files
*/
description: Observable<string>;

/**
* A map containing the current node showed by the tree
*/
Expand Down Expand Up @@ -216,12 +209,6 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
})
);

this.translate.get(`search.filters.filter.${this.vocabularyOptions.name}.head`).pipe(
map((type) => lowerCase(type)),
).subscribe(
(type) => this.description = this.translate.get('vocabulary-treeview.info', { type })
);

this.loading = this.vocabularyTreeviewService.isLoading();

this.vocabularyTreeviewService.initialize(this.vocabularyOptions, new PageInfo(), this.selectedItems, null);
Expand Down

0 comments on commit b321d6f

Please sign in to comment.