Skip to content

Name variants on item pages#496

Merged
tdonohue merged 5 commits intoDSpace:masterfrom
atmire:Name-variants-on-item-pages
Nov 5, 2019
Merged

Name variants on item pages#496
tdonohue merged 5 commits intoDSpace:masterfrom
atmire:Name-variants-on-item-pages

Conversation

@Atmire-Kristof
Copy link
Copy Markdown
Contributor

@Atmire-Kristof Atmire-Kristof commented Oct 15, 2019

This PR adds support for name variants on related items by always using the virtual metadata’s value.

This is achieved by modifying ItemMetadataRepresentation to accept a MetadataValue in the constructor and return its value in the getValue() method of the representation.
This getValue() method is then called on the entity-metadata-list-element components to display the name variant.

A sample item is https://dspace7-entities.atmire.com/items/72635f7f-37b5-4875-b4f2-5ff45d97a09b

@paulo-graca
Copy link
Copy Markdown
Contributor

I'm experiencing the same as in #475, where the ds-metadata-representation-list component doesn't behave as expected using my local backend.

@paulo-graca
Copy link
Copy Markdown
Contributor

But, as in #475 , this is working as expected using the Atmire backend. As an example, the Person with the UUID: 0ffbee3f-e7ea-42bc-92fe-2fbef1a52c0f has this metadata:

"person.familyName": [
      {
        "value": "Eens",
        "language": "",
        "authority": null,
        "confidence": -1,
        "place": 0
      }
    ],
    "person.givenName": [
      {
        "value": "Marcel",
        "language": "",
        "authority": null,
        "confidence": -1,
        "place": 0
      }
    ],

but the author name presented in the Publication with the UUID 72635f7f-37b5-4875-b4f2-5ff45d97a09b is "Eens, M." when, based on the default behavior ([person.familyName], [person.givenName] ) it should be: "Eens, Marcel".

import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator';
import { MetadataRepresentationType } from '../../../../core/shared/metadata-representation/metadata-representation.model';
import { TypedItemSearchResultListElementComponent } from '../../../../shared/object-list/item-list-element/item-types/typed-item-search-result-list-element.component';
import {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the line break?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Atmire-Kristof removed it

Copy link
Copy Markdown
Contributor

@paulo-graca paulo-graca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Atmire's backend. This PR works as expected but I can't test it with my own backend. As I referred in #475 I think this might be related with some backend dependency I don't have in my local environment.

@benbosman
Copy link
Copy Markdown
Member

I have quickly tested this with the latest master REST and this branch in Angular, and I noticed dc.contributor.author contained the name variant and the authors section on the simple item page contained the name variant as well, without any errors

Copy link
Copy Markdown
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine to me. I haven't tested it, but trust the testing of others.

@tdonohue tdonohue merged commit 959134f into DSpace:master Nov 5, 2019
@tdonohue tdonohue added this to the 7.0beta1 milestone Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants