+
diff --git a/src/app/shared/truncatable/truncatable.component.spec.ts b/src/app/shared/truncatable/truncatable.component.spec.ts
index b539ab0d56..29100e50d2 100644
--- a/src/app/shared/truncatable/truncatable.component.spec.ts
+++ b/src/app/shared/truncatable/truncatable.component.spec.ts
@@ -70,15 +70,4 @@ describe('TruncatableComponent', () => {
});
});
- describe('When toggle is called', () => {
- beforeEach(() => {
- spyOn(truncatableService, 'toggle');
- comp.toggle();
- });
-
- it('should call toggle on the TruncatableService', () => {
- expect(truncatableService.toggle).toHaveBeenCalledWith(identifier);
- });
- });
-
});
diff --git a/src/app/shared/truncatable/truncatable.component.ts b/src/app/shared/truncatable/truncatable.component.ts
index e22ce4441e..8fca300cd4 100644
--- a/src/app/shared/truncatable/truncatable.component.ts
+++ b/src/app/shared/truncatable/truncatable.component.ts
@@ -1,6 +1,4 @@
-import {
- Component, Input
-} from '@angular/core';
+import { AfterViewChecked, Component, ElementRef, Input, OnInit } from '@angular/core';
import { TruncatableService } from './truncatable.service';
@Component({
@@ -13,7 +11,7 @@ import { TruncatableService } from './truncatable.service';
/**
* Component that represents a section with one or more truncatable parts that all listen to this state
*/
-export class TruncatableComponent {
+export class TruncatableComponent implements OnInit, AfterViewChecked {
/**
* Is true when all truncatable parts in this truncatable should be expanded on loading
*/
@@ -29,7 +27,13 @@ export class TruncatableComponent {
*/
@Input() onHover = false;
- public constructor(private service: TruncatableService) {
+ /**
+ * A boolean representing if to show or not the show/collapse toggle
+ * This value must have the same value as the children TruncatablePartComponent
+ */
+ @Input() showToggle = true;
+
+ public constructor(private service: TruncatableService, private el: ElementRef,) {
}
/**
@@ -61,11 +65,18 @@ export class TruncatableComponent {
}
}
- /**
- * Expands the truncatable when it's collapsed, collapses it when it's expanded
- */
- public toggle() {
- this.service.toggle(this.id);
+ ngAfterViewChecked() {
+ if (this.showToggle) {
+ const truncatedElements = this.el.nativeElement.querySelectorAll('.truncated');
+ if (truncatedElements?.length > 0) {
+ const truncateElements = this.el.nativeElement.querySelectorAll('.dont-break-out');
+ for (let i = 0; i < (truncateElements.length - 1); i++) {
+ truncateElements[i].classList.remove('truncated');
+ truncateElements[i].classList.add('notruncatable');
+ }
+ truncateElements[truncateElements.length - 1].classList.add('truncated');
+ }
+ }
}
}
diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5
index 7fac77cbc6..b19357ecea 100644
--- a/src/assets/i18n/en.json5
+++ b/src/assets/i18n/en.json5
@@ -862,6 +862,12 @@
"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 bitstream policies for bundle",
+
"collection.edit.tabs.metadata.head": "Edit Metadata",
"collection.edit.tabs.metadata.title": "Collection Edit - Metadata",
@@ -2139,6 +2145,10 @@
"item.search.title": "Item Search",
+ "item.truncatable-part.show-more": "Show more",
+
+ "item.truncatable-part.show-less": "Collapse",
+
"item.page.abstract": "Abstract",
diff --git a/src/assets/i18n/fi.json5 b/src/assets/i18n/fi.json5
index 02f020a45d..860062fa67 100644
--- a/src/assets/i18n/fi.json5
+++ b/src/assets/i18n/fi.json5
@@ -107,7 +107,7 @@
"admin.registries.bitstream-formats.edit.head": "Tiedostoformaatti: {{ format }}",
// "admin.registries.bitstream-formats.edit.internal.hint": "Formats marked as internal are hidden from the user, and used for administrative purposes.",
- "admin.registries.bitstream-formats.edit.internal.hint": "Sisäisiksi merkittyjä formaatteja käytetään hallinnollisiin tarkoituksiin, ja ne on piilotettu käyttäjiltä.",
+ "admin.registries.bitstream-formats.edit.internal.hint": "Sisäisiksi merkittyjä formaatteja käytetään ylläpitotarkoituksiin, ja ne on piilotettu käyttäjiltä.",
// "admin.registries.bitstream-formats.edit.internal.label": "Internal",
"admin.registries.bitstream-formats.edit.internal.label": "Sisäinen",
@@ -662,7 +662,7 @@
// "admin.search.breadcrumbs": "Administrative Search",
- "admin.search.breadcrumbs": "Hallinnollinen haku",
+ "admin.search.breadcrumbs": "Ylläpitäjän haku",
// "admin.search.collection.edit": "Edit",
"admin.search.collection.edit": "Muokkaa",
@@ -692,19 +692,19 @@
"admin.search.item.withdraw": "Poista käytöstä",
// "admin.search.title": "Administrative Search",
- "admin.search.title": "Hallinnollinen haku",
+ "admin.search.title": "Ylläpitäjän haku",
// "administrativeView.search.results.head": "Administrative Search",
- "administrativeView.search.results.head": "Hallinnollinen haku",
+ "administrativeView.search.results.head": "Ylläpitäjän haku",
// "admin.workflow.breadcrumbs": "Administer Workflow",
- "admin.workflow.breadcrumbs": "Hallinnointityönkulku",
+ "admin.workflow.breadcrumbs": "Hallinnoi työnkulkua",
// "admin.workflow.title": "Administer Workflow",
- "admin.workflow.title": "Hallinnointityönkulku",
+ "admin.workflow.title": "Hallinnoi työnkulkua",
// "admin.workflow.item.workflow": "Workflow",
"admin.workflow.item.workflow": "Työnkulku",
@@ -2954,7 +2954,7 @@
// "menu.section.admin_search": "Admin Search",
- "menu.section.admin_search": "Admin-haku",
+ "menu.section.admin_search": "Ylläpitäjän haku",
@@ -3033,7 +3033,7 @@
"menu.section.icon.access_control": "Pääsyoikeudet",
// "menu.section.icon.admin_search": "Admin search menu section",
- "menu.section.icon.admin_search": "Admin-haku",
+ "menu.section.icon.admin_search": "Ylläpitäjän haku",
// "menu.section.icon.control_panel": "Control Panel menu section",
"menu.section.icon.control_panel": "Hallintapaneeli",
@@ -3168,7 +3168,7 @@
// "menu.section.workflow": "Administer Workflow",
- "menu.section.workflow": "Hallinnointityönkulku",
+ "menu.section.workflow": "Hallinnoi työnkulkua",
// "mydspace.description": "",
@@ -5079,7 +5079,7 @@
// "workflowAdmin.search.results.head": "Administer Workflow",
- "workflowAdmin.search.results.head": "Hallinnointityönkulku",
+ "workflowAdmin.search.results.head": "Hallinnoi työnkulkua",