mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Merge pull request #2581 from DSpace/backport-2542-to-dspace-7_x
[Port dspace-7_x] Fix i18n labels and alignment in vocabulary-treeview
This commit is contained in:
@@ -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="treeview-header row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<!-- Leaf node -->
|
<!-- Leaf node -->
|
||||||
<cdk-tree-node *cdkTreeNodeDef="let node" cdkTreeNodePadding class="d-flex">
|
<cdk-tree-node *cdkTreeNodeDef="let node" cdkTreeNodePadding class="d-flex">
|
||||||
<button type="button" class="btn btn-default" cdkTreeNodeToggle>
|
<button type="button" class="btn btn-default" cdkTreeNodeToggle>
|
||||||
<span class="fas fa-angle-right invisible" aria-hidden="true"></span>
|
<span class="fas fa-fw fa-angle-right invisible" aria-hidden="true"></span>
|
||||||
</button>
|
</button>
|
||||||
<label *ngIf="multiSelect" class="d-flex align-items-center m-0 p-0 form-check"
|
<label *ngIf="multiSelect" class="d-flex align-items-center m-0 p-0 form-check"
|
||||||
[class.text-success]="node.isSelected"
|
[class.text-success]="node.isSelected"
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
<button type="button" class="btn btn-default" cdkTreeNodeToggle
|
<button type="button" class="btn btn-default" cdkTreeNodeToggle
|
||||||
[attr.aria-label]="'toggle ' + node.name"
|
[attr.aria-label]="'toggle ' + node.name"
|
||||||
(click)="loadChildren(node)">
|
(click)="loadChildren(node)">
|
||||||
<span class="fas {{treeControl.isExpanded(node) ? 'fa-angle-down' : 'fa-angle-right'}}"
|
<span class="fas fa-fw {{treeControl.isExpanded(node) ? 'fa-angle-down' : 'fa-angle-right'}}"
|
||||||
aria-hidden="true"></span>
|
aria-hidden="true"></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
import { FlatTreeControl } from '@angular/cdk/tree';
|
import { FlatTreeControl } from '@angular/cdk/tree';
|
||||||
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, OnChanges, SimpleChanges } 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';
|
import { Observable, Subscription } from 'rxjs';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
@@ -16,7 +15,6 @@ import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vo
|
|||||||
import { VocabularyTreeFlattener } from './vocabulary-tree-flattener';
|
import { VocabularyTreeFlattener } from './vocabulary-tree-flattener';
|
||||||
import { VocabularyTreeFlatDataSource } from './vocabulary-tree-flat-data-source';
|
import { VocabularyTreeFlatDataSource } from './vocabulary-tree-flat-data-source';
|
||||||
import { CoreState } from '../../../core/core-state.model';
|
import { CoreState } from '../../../core/core-state.model';
|
||||||
import { lowerCase } from 'lodash/string';
|
|
||||||
import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service';
|
import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service';
|
||||||
import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators';
|
import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators';
|
||||||
|
|
||||||
@@ -50,11 +48,6 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
|
|||||||
*/
|
*/
|
||||||
@Input() multiSelect = false;
|
@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
|
* A map containing the current node showed by the tree
|
||||||
*/
|
*/
|
||||||
@@ -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.loading = this.vocabularyTreeviewService.isLoading();
|
||||||
|
|
||||||
this.vocabularyTreeviewService.initialize(this.vocabularyOptions, new PageInfo(), this.selectedItems, null);
|
this.vocabularyTreeviewService.initialize(this.vocabularyOptions, new PageInfo(), this.selectedItems, null);
|
||||||
|
Reference in New Issue
Block a user