dspace-angular
dspace-angular copied to clipboard
Metadata representation components compare `BrowseByDataType` values to `ResourceType`
Describe the bug
This discrepancy was highlighted by the @typescript-eslint/no-unsafe-enum-comparison rule in #2865
There is no overlap between the BrowseByDataType enum and the string value of VALUE_LIST_BROWSE_DEFINITION. Appears in
- https://github.com/DSpace/dspace-angular/blob/0a1764c65ad8cfd0a8e74776cee36073723681c4/src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts#L25
- https://github.com/DSpace/dspace-angular/blob/0a1764c65ad8cfd0a8e74776cee36073723681c4/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.ts#L25
- https://github.com/DSpace/dspace-angular/blob/0a1764c65ad8cfd0a8e74776cee36073723681c4/src/app/item-page/field-components/metadata-values/metadata-values.component.ts#L120-L120
Expected behavior
The comparison should be consistent with the types on either side, possibly by using this.mdRepresentation.browseDefinition.type.
Related work
- @alexandrevryghem changed the return type of
getRenderTypesfromstringtoBrowseByDataTypein #2339 (line) - @wwelling discovered a possibly related bug in #2949 (before the type change)