[CST-5677] Added translation

This commit is contained in:
Alisa Ismailati
2022-05-09 11:55:58 +02:00
parent d15277849b
commit e79c045ac0
4 changed files with 13 additions and 16 deletions

View File

@@ -3,7 +3,7 @@
<ds-resource-policies [resourceType]="'item'" [resourceName]="(getItemName() | async)" <ds-resource-policies [resourceType]="'item'" [resourceName]="(getItemName() | async)"
[resourceUUID]="(getItemUUID() | async)"> [resourceUUID]="(getItemUUID() | async)">
</ds-resource-policies> </ds-resource-policies>
<ng-container *ngFor="let bundle of (bundlesToShow$ | async); trackById"> <ng-container *ngFor="let bundle of (bundles$ | async); trackById">
<ds-resource-policies [resourceType]="'bundle'" [resourceUUID]="bundle.id" [resourceName]="bundle.name"> <ds-resource-policies [resourceType]="'bundle'" [resourceUUID]="bundle.id" [resourceName]="bundle.name">
</ds-resource-policies> </ds-resource-policies>
<ng-container *ngIf="(bundleBitstreamsMap.get(bundle.id)?.bitstreams | async)?.length > 0"> <ng-container *ngIf="(bundleBitstreamsMap.get(bundle.id)?.bitstreams | async)?.length > 0">
@@ -11,7 +11,7 @@
<div class="card-header"> <div class="card-header">
<button type="button" class="btn btn-outline-primary" (click)="collapseArea(bundle.id)" <button type="button" class="btn btn-outline-primary" (click)="collapseArea(bundle.id)"
[attr.aria-expanded]="false" [attr.aria-controls]="bundle.id"> [attr.aria-expanded]="false" [attr.aria-controls]="bundle.id">
Show all Bitstreams' Policies for Bundle {{bundle.name}} {{ 'collection.edit.item.authorizations.show-bitstreams-button' | translate }} {{bundle.name}}
</button> </button>
</div> </div>
<div class="card-body" [id]="bundle.id" [ngbCollapse]="bundleBitstreamsMap.get(bundle.id).isCollapsed"> <div class="card-body" [id]="bundle.id" [ngbCollapse]="bundleBitstreamsMap.get(bundle.id).isCollapsed">
@@ -21,13 +21,13 @@
[resourceName]="bitstream.name"></ds-resource-policies> [resourceName]="bitstream.name"></ds-resource-policies>
</ng-container> </ng-container>
<div class="row justify-content-center" *ngIf="!bundleBitstreamsMap.get(bundle.id).allBitstreamsLoaded"> <div class="row justify-content-center" *ngIf="!bundleBitstreamsMap.get(bundle.id).allBitstreamsLoaded">
<button type="button" class="btn btn-link" (click)="onBitstreamsLoad(bundle)">Load more</button> <button type="button" class="btn btn-link" (click)="onBitstreamsLoad(bundle)">{{ 'collection.edit.item.authorizations.load-more-button' | translate }}</button>
</div> </div>
</div> </div>
</div> </div>
</ng-container> </ng-container>
</ng-container> </ng-container>
<div class="row justify-content-center" *ngIf="!allBundlesLoaded"> <div class="row justify-content-center" *ngIf="!allBundlesLoaded">
<button type="button" class="btn btn-link" (click)="onBunbleLoad()">Load more bundles</button> <button type="button" class="btn btn-link" (click)="onBunbleLoad()">{{ 'collection.edit.item.authorizations.load-bundle-button' | translate }}</button>
</div> </div>
</div> </div>

View File

@@ -45,13 +45,7 @@ export class ItemAuthorizationsComponent implements OnInit, OnDestroy {
* The list of all bundles for the item * The list of all bundles for the item
* @type {Observable<PaginatedList<Bundle>>} * @type {Observable<PaginatedList<Bundle>>}
*/ */
private bundles$: BehaviorSubject<Bundle[]> = new BehaviorSubject<Bundle[]>([]); bundles$: BehaviorSubject<Bundle[]> = new BehaviorSubject<Bundle[]>([]);
/**
* The list of bundles to be displayed in the template
* @type {BehaviorSubject<Bundle[]>}
*/
bundlesToShow$: BehaviorSubject<Bundle[]> = new BehaviorSubject<Bundle[]>([]);
/** /**
* The target editing item * The target editing item
@@ -69,13 +63,13 @@ export class ItemAuthorizationsComponent implements OnInit, OnDestroy {
* The size of the bundles to be loaded on demand * The size of the bundles to be loaded on demand
* @type {number} * @type {number}
*/ */
bunblesPerPage = 6; bunblesPerPage = 1;
/** /**
* The number of current page * The number of current page
* @type {number} * @type {number}
*/ */
bunblesPageSize = 1; bunblesPageSize = 6;
/** /**
* The flag to show or not the 'Load more' button * The flag to show or not the 'Load more' button
@@ -179,9 +173,7 @@ export class ItemAuthorizationsComponent implements OnInit, OnDestroy {
} }
if (isEqual(page, 1)) { if (isEqual(page, 1)) {
this.bundles$.next(bundles); this.bundles$.next(bundles);
this.bundlesToShow$.next(bundles);
} else { } else {
this.bundlesToShow$.next(this.bundles$.getValue().concat(bundles));
this.bundles$.next(this.bundles$.getValue().concat(bundles)); this.bundles$.next(this.bundles$.getValue().concat(bundles));
} }
}), }),

View File

@@ -6,7 +6,6 @@
<div class="d-flex justify-content-between align-items-center m-0"> <div class="d-flex justify-content-between align-items-center m-0">
<span> <span>
{{ 'resource-policies.table.headers.title.for.' + resourceType | translate }} {{ 'resource-policies.table.headers.title.for.' + resourceType | translate }}
<!-- {{(getResourcePolicies() | async)?.length}} -->
<span class="text-info"> {{resourceName}} </span> <span class="text-info"> {{resourceName}} </span>
<ng-container *ngIf="resourceType != 'item'"> <ng-container *ngIf="resourceType != 'item'">
({{resourceUUID}}) ({{resourceUUID}})

View File

@@ -848,6 +848,12 @@
"collection.edit.tabs.authorizations.title": "Collection Edit - Authorizations", "collection.edit.tabs.authorizations.title": "Collection Edit - Authorizations",
"collection.edit.item.authorizations.load-bundle-button": "Load more bundles",
"collection.edit.item.authorizations.load-more-button": "Load more",
"collection.edit.item.authorizations.show-bitstreams-button": "Show all Bitstreams' Policies for Bundle",
"collection.edit.tabs.metadata.head": "Edit Metadata", "collection.edit.tabs.metadata.head": "Edit Metadata",
"collection.edit.tabs.metadata.title": "Collection Edit - Metadata", "collection.edit.tabs.metadata.title": "Collection Edit - Metadata",