From 07d489b6f9f3e84a457f25733cf3d5069447fc68 Mon Sep 17 00:00:00 2001 From: DanGastardelli <55243638+DanGastardelli@users.noreply.github.com> Date: Fri, 4 Oct 2024 12:06:28 -0300 Subject: [PATCH 01/10] Allow input of alternative text for collection and community logos/thumbnails --- .../collection-form/collection-form.models.ts | 5 ++++ .../collection-page.component.html | 11 ++++++--- .../community-form.component.ts | 5 ++++ .../community-page.component.html | 7 ++++-- src/app/core/shared/collection.model.ts | 8 +++++++ src/app/core/shared/community.model.ts | 8 +++++++ src/app/thumbnail/thumbnail.component.html | 4 +++- src/app/thumbnail/thumbnail.component.ts | 24 ++++++++++++++++++- src/assets/i18n/en.json5 | 4 ++++ src/assets/i18n/es.json5 | 5 ++++ src/assets/i18n/pt-BR.json5 | 6 +++++ src/assets/i18n/pt-PT.json5 | 6 +++++ 12 files changed, 86 insertions(+), 7 deletions(-) diff --git a/src/app/collection-page/collection-form/collection-form.models.ts b/src/app/collection-page/collection-form/collection-form.models.ts index 22998af674e..20d829b3f8c 100644 --- a/src/app/collection-page/collection-form/collection-form.models.ts +++ b/src/app/collection-page/collection-form/collection-form.models.ts @@ -54,4 +54,9 @@ export const collectionFormModels: DynamicFormControlModel[] = [ name: 'dc.rights.license', spellCheck: environment.form.spellCheck, }), + new DynamicTextAreaModel({ + id: 'thumbnail', + name: 'dspace.thumbnail.description', + spellCheck: environment.form.spellCheck, + }), ]; diff --git a/src/app/collection-page/collection-page.component.html b/src/app/collection-page/collection-page.component.html index 4a3e28c6aad..da6d8165118 100644 --- a/src/app/collection-page/collection-page.component.html +++ b/src/app/collection-page/collection-page.component.html @@ -10,10 +10,15 @@ - - + + [alternateText]="collection.descriptionThumbnail"> + + + diff --git a/src/app/community-page/community-form/community-form.component.ts b/src/app/community-page/community-form/community-form.component.ts index d32d9e408f2..4b6a22aa873 100644 --- a/src/app/community-page/community-form/community-form.component.ts +++ b/src/app/community-page/community-form/community-form.component.ts @@ -101,6 +101,11 @@ export class CommunityFormComponent extends ComColFormComponent imple name: 'dc.description.tableofcontents', spellCheck: environment.form.spellCheck, }), + new DynamicTextAreaModel({ + id: 'thumbnail', + name: 'dspace.thumbnail.description', + spellCheck: environment.form.spellCheck, + }), ]; public constructor(protected formService: DynamicFormService, diff --git a/src/app/community-page/community-page.component.html b/src/app/community-page/community-page.component.html index a695e2019a3..2262e6ae5e3 100644 --- a/src/app/community-page/community-page.component.html +++ b/src/app/community-page/community-page.component.html @@ -6,8 +6,11 @@
- - + + + + + diff --git a/src/app/core/shared/collection.model.ts b/src/app/core/shared/collection.model.ts index b929e54ccb4..cf61b724ebc 100644 --- a/src/app/core/shared/collection.model.ts +++ b/src/app/core/shared/collection.model.ts @@ -130,6 +130,14 @@ export class Collection extends DSpaceObject implements ChildHALResource, Handle return this.firstMetadataValue('dc.description.tableofcontents'); } + /** + * The thumbail description of this Collection + * Corresponds to the metadata field dspace.thumbnail.description + */ + get descriptionThumbnail(): string { + return this.firstMetadataValue('dspace.thumbnail.description'); + } + getParentLinkKey(): keyof this['_links'] { return 'parentCommunity'; } diff --git a/src/app/core/shared/community.model.ts b/src/app/core/shared/community.model.ts index 31b00398ffb..8e384cc063e 100644 --- a/src/app/core/shared/community.model.ts +++ b/src/app/core/shared/community.model.ts @@ -111,6 +111,14 @@ export class Community extends DSpaceObject implements ChildHALResource, HandleO return this.firstMetadataValue('dc.description.tableofcontents'); } + /** + * The thumbail description of this Community + * Corresponds to the metadata field dspace.thumbnail.description + */ + get descriptionThumbnail(): string { + return this.firstMetadataValue('dspace.thumbnail.description'); + } + getParentLinkKey(): keyof this['_links'] { return 'parentCommunity'; } diff --git a/src/app/thumbnail/thumbnail.component.html b/src/app/thumbnail/thumbnail.component.html index c32a44da3f1..4ac0c5cf120 100644 --- a/src/app/thumbnail/thumbnail.component.html +++ b/src/app/thumbnail/thumbnail.component.html @@ -8,7 +8,9 @@ - +
diff --git a/src/app/thumbnail/thumbnail.component.ts b/src/app/thumbnail/thumbnail.component.ts index efcbfb1a81d..1a8eaf71b70 100644 --- a/src/app/thumbnail/thumbnail.component.ts +++ b/src/app/thumbnail/thumbnail.component.ts @@ -3,6 +3,7 @@ import { Component, Input, OnChanges, + OnInit, SimpleChanges, } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; @@ -38,12 +39,17 @@ import { VarDirective } from '../shared/utils/var.directive'; standalone: true, imports: [VarDirective, CommonModule, ThemedLoadingComponent, TranslateModule, SafeUrlPipe], }) -export class ThumbnailComponent implements OnChanges { +export class ThumbnailComponent implements OnInit, OnChanges { /** * The thumbnail Bitstream */ @Input() thumbnail: Bitstream | RemoteData; + /** + * Variable that listens to the thumbnail value + */ + listenThumbnail: RemoteData; + /** * The default image, used if the thumbnail isn't set or can't be downloaded. * If defaultImage is null, a HTML placeholder is used instead. @@ -62,6 +68,11 @@ export class ThumbnailComponent implements OnChanges { */ @Input() alt? = 'thumbnail.default.alt'; + /** + * Custom thumbnail description for alt text + */ + customDescription: string; + /** * i18n key of HTML placeholder text */ @@ -85,6 +96,17 @@ export class ThumbnailComponent implements OnChanges { ) { } + /** + * Getting the description from the thumbnail file + * when rendering the screen. + */ + ngOnInit(): void{ + if ('payload' in this.thumbnail) { + this.listenThumbnail = this.thumbnail; + this.customDescription = this.listenThumbnail.payload.metadata['dc.description'][0].value; + } + } + /** * Resolve the thumbnail. * Use a default image if no actual image is available. diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 31e45d46246..2cce730f8df 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -6741,4 +6741,8 @@ "item.page.cc.license.disclaimer": "Except where otherwised noted, this item's license is described as", "browse.search-form.placeholder": "Search the repository", + + "community.form.thumbnail": "Thumbnail Description", + + "collection.form.thumbnail": "Thumbnail Description", } diff --git a/src/assets/i18n/es.json5 b/src/assets/i18n/es.json5 index 55962d25b5f..3a9dba0f00d 100644 --- a/src/assets/i18n/es.json5 +++ b/src/assets/i18n/es.json5 @@ -8152,5 +8152,10 @@ //"browse.search-form.placeholder": "Search the repository", "browse.search-form.placeholder": "Buscar en el repositorio", + // "community.form.thumbnail": "Thumbnail Description", + "community.form.thumbnail": "Descripción del logotipo de la comunidad", + + // "collection.form.thumbnail": "Thumbnail Description", + "collection.form.thumbnail": "Descripción del logo de la colección", } diff --git a/src/assets/i18n/pt-BR.json5 b/src/assets/i18n/pt-BR.json5 index c3b26a09d28..5880b6100bb 100644 --- a/src/assets/i18n/pt-BR.json5 +++ b/src/assets/i18n/pt-BR.json5 @@ -10249,4 +10249,10 @@ //"browse.search-form.placeholder": "Search the repository", "browse.search-form.placeholder": "Buscar no repositório", + + // "community.form.thumbnail": "Thumbnail Description", + "community.form.thumbnail": "Descrição do logotipo da comunidade", + + // "collection.form.thumbnail": "Thumbnail Description", + "collection.form.thumbnail": "Descrição do logotipo da coleção", } diff --git a/src/assets/i18n/pt-PT.json5 b/src/assets/i18n/pt-PT.json5 index 414b70448d1..a7c85407744 100644 --- a/src/assets/i18n/pt-PT.json5 +++ b/src/assets/i18n/pt-PT.json5 @@ -8478,4 +8478,10 @@ // "item.preview.dc.identifier.eisbn": "EISBN", "item.preview.dc.identifier.eisbn": "EISBN", + // "community.form.thumbnail": "Thumbnail Description", + "community.form.thumbnail": "Descrição do logotipo da comunidade", + + // "collection.form.thumbnail": "Thumbnail Description", + "collection.form.thumbnail": "Descrição do logotipo da coleção", + } From cc7473932b61bb04d957c59a7ec28baaaae044a7 Mon Sep 17 00:00:00 2001 From: DanGastardelli <55243638+DanGastardelli@users.noreply.github.com> Date: Fri, 4 Oct 2024 14:11:50 -0300 Subject: [PATCH 02/10] Checking for thumbnail with valid value --- src/app/thumbnail/thumbnail.component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/thumbnail/thumbnail.component.ts b/src/app/thumbnail/thumbnail.component.ts index 1a8eaf71b70..0be5addd00e 100644 --- a/src/app/thumbnail/thumbnail.component.ts +++ b/src/app/thumbnail/thumbnail.component.ts @@ -101,9 +101,11 @@ export class ThumbnailComponent implements OnInit, OnChanges { * when rendering the screen. */ ngOnInit(): void{ - if ('payload' in this.thumbnail) { - this.listenThumbnail = this.thumbnail; - this.customDescription = this.listenThumbnail.payload.metadata['dc.description'][0].value; + if (this.thumbnail){ + if ('payload' in this.thumbnail) { + this.listenThumbnail = this.thumbnail; + this.customDescription = this.listenThumbnail.payload.metadata['dc.description'][0].value; + } } } From 0ab24be9068b630f77a089c748ca1deaa32b0734 Mon Sep 17 00:00:00 2001 From: DanGastardelli <55243638+DanGastardelli@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:56:39 -0300 Subject: [PATCH 03/10] Fixed merge done in git --- src/app/thumbnail/thumbnail.component.html | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/app/thumbnail/thumbnail.component.html b/src/app/thumbnail/thumbnail.component.html index 7ddff5538c0..eed6b1994c8 100644 --- a/src/app/thumbnail/thumbnail.component.html +++ b/src/app/thumbnail/thumbnail.component.html @@ -6,17 +6,15 @@
- - - - -
-
-
- {{ placeholder | translate }} -
+ + + +
+
+
+ {{ placeholder | translate }}
From 909aa999df1f7ccd0533860c5b486df29168664a Mon Sep 17 00:00:00 2001 From: Daniel Pais <55243638+DanGastardelli@users.noreply.github.com> Date: Tue, 5 Nov 2024 20:25:28 +0000 Subject: [PATCH 04/10] Space correction --- src/assets/i18n/en.json5 | 1 + src/assets/i18n/pt-BR.json5 | 1 + 2 files changed, 2 insertions(+) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index aa7b0d11960..69a8db1a332 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -6751,4 +6751,5 @@ "community.form.thumbnail": "Thumbnail Description", "collection.form.thumbnail": "Thumbnail Description", + } diff --git a/src/assets/i18n/pt-BR.json5 b/src/assets/i18n/pt-BR.json5 index 114d0cd0dea..a9566d09be8 100644 --- a/src/assets/i18n/pt-BR.json5 +++ b/src/assets/i18n/pt-BR.json5 @@ -10261,4 +10261,5 @@ // "forgot-email.form.aria.label": "Enter your e-mail address", "forgot-email.form.aria.label": "Digite seu e-mail", + } From cb752760a01bbf63226bc5e03b9a6d94cce26b1e Mon Sep 17 00:00:00 2001 From: Daniel Pais <55243638+DanGastardelli@users.noreply.github.com> Date: Tue, 5 Nov 2024 21:22:14 +0000 Subject: [PATCH 05/10] Space correction --- src/assets/i18n/en.json5 | 5 ++--- src/assets/i18n/pt-BR.json5 | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 69a8db1a332..6e0e11894c4 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -6747,9 +6747,8 @@ "register-page.registration.aria.label": "Enter your e-mail address", "forgot-email.form.aria.label": "Enter your e-mail address", - + "community.form.thumbnail": "Thumbnail Description", "collection.form.thumbnail": "Thumbnail Description", - -} +} \ No newline at end of file diff --git a/src/assets/i18n/pt-BR.json5 b/src/assets/i18n/pt-BR.json5 index a9566d09be8..000bf422594 100644 --- a/src/assets/i18n/pt-BR.json5 +++ b/src/assets/i18n/pt-BR.json5 @@ -10261,5 +10261,4 @@ // "forgot-email.form.aria.label": "Enter your e-mail address", "forgot-email.form.aria.label": "Digite seu e-mail", - -} +} \ No newline at end of file From c78b7756db9438483b0a0d197509e97d637b751b Mon Sep 17 00:00:00 2001 From: DanGastardelli <55243638+DanGastardelli@users.noreply.github.com> Date: Fri, 8 Nov 2024 10:36:31 -0300 Subject: [PATCH 06/10] Space correction --- src/assets/i18n/pt-BR.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/i18n/pt-BR.json5 b/src/assets/i18n/pt-BR.json5 index 5880b6100bb..c62dca9da44 100644 --- a/src/assets/i18n/pt-BR.json5 +++ b/src/assets/i18n/pt-BR.json5 @@ -10247,7 +10247,7 @@ // "item.page.cc.license.disclaimer": "Except where otherwised noted, this item's license is described as", "item.page.cc.license.disclaimer": "Exceto quando indicado de outra forma, a licença deste item é descrita como", - //"browse.search-form.placeholder": "Search the repository", + // "browse.search-form.placeholder": "Search the repository", "browse.search-form.placeholder": "Buscar no repositório", // "community.form.thumbnail": "Thumbnail Description", From a90c02cffb212752bd28eaf5e673657d90d2a340 Mon Sep 17 00:00:00 2001 From: DanGastardelli <55243638+DanGastardelli@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:06:49 -0300 Subject: [PATCH 07/10] Space correction --- src/assets/i18n/pt-BR.json5 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/assets/i18n/pt-BR.json5 b/src/assets/i18n/pt-BR.json5 index c2216a41e4d..f20c0d2886b 100644 --- a/src/assets/i18n/pt-BR.json5 +++ b/src/assets/i18n/pt-BR.json5 @@ -10249,16 +10249,16 @@ // "browse.search-form.placeholder": "Search the repository", "browse.search-form.placeholder": "Buscar no repositório", - + // "community.form.thumbnail": "Thumbnail Description", "community.form.thumbnail": "Descrição do logotipo da comunidade", // "collection.form.thumbnail": "Thumbnail Description", "collection.form.thumbnail": "Descrição do logotipo da coleção", - + // "register-page.registration.aria.label": "Enter your e-mail address", "register-page.registration.aria.label": "Digite seu e-mail", // "forgot-email.form.aria.label": "Enter your e-mail address", "forgot-email.form.aria.label": "Digite seu e-mail", -} \ No newline at end of file +} From cc0bbc8d7ad70bdeaf9c84000da164287eeeb971 Mon Sep 17 00:00:00 2001 From: Daniel Pais <55243638+DanGastardelli@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:34:45 -0300 Subject: [PATCH 08/10] Update es.json5 --- src/assets/i18n/es.json5 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/assets/i18n/es.json5 b/src/assets/i18n/es.json5 index 282301ecfe9..b3e3505be6c 100644 --- a/src/assets/i18n/es.json5 +++ b/src/assets/i18n/es.json5 @@ -10203,5 +10203,4 @@ // "search.sidebar.advanced-search.add": "Add", "search.sidebar.advanced-search.add": "Añadir", - -} \ No newline at end of file +} From daa04cac33fdf5978e00dc7a9095974df522a15d Mon Sep 17 00:00:00 2001 From: Daniel Pais <55243638+DanGastardelli@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:37:17 -0300 Subject: [PATCH 09/10] Update es.json5 From 2e586748f3487803226d416c63775c38d4468add Mon Sep 17 00:00:00 2001 From: Daniel Pais <55243638+DanGastardelli@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:45:28 -0300 Subject: [PATCH 10/10] Update es.json5 --- src/assets/i18n/es.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/i18n/es.json5 b/src/assets/i18n/es.json5 index b3e3505be6c..65baf242038 100644 --- a/src/assets/i18n/es.json5 +++ b/src/assets/i18n/es.json5 @@ -9172,7 +9172,7 @@ // "file-download-link.download": "Download ", "file-download-link.download": "Descargar ", - + // "admin.notifications.publicationclaim.breadcrumbs": "Publication Claim", "admin.notifications.publicationclaim.breadcrumbs": "Reclamo de publicación",