-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix simple item view author link #2949
Conversation
@@ -31,6 +31,6 @@ export class ValueListBrowseDefinition extends NonHierarchicalBrowseDefinition { | |||
}; | |||
|
|||
getRenderType(): string { | |||
return this.dataType; | |||
return this.type.value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I encountered a few similar issues today while resolving merge conflicts on #2865 (WIP), which included upgrading TSESLint and introducing a new default rule for enum consistency
- There were a few cases where the return value of
getRenderTypes
was being compared with a ResourceType, and I was considering replacing them withtype
instead - If we change this browse definition we should probably do the same for the other ones
- If we use
this.type
here, do we still need the method at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
abstract getRenderType(): string; |
The abstract inheritance requires it of implementations. I don't think I would make that many changes to resolve a bug in a past release. The component and class structure might require revisiting and that would be a scope creep within this patch. Additionally, as the unit test required breaking apart and it went under the coverage of e2e tests, I would think additional e2e tests (failing in this regard) are required to safely resolve. Then again, I have seen larger changes to fix a bug before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps an additional e2e test could be in the forward port to the next release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point about the scope creep, should probably be it's own issue/PR 👍
We could turn these rules off, but it seems that they indicate some important inconsistencies. A few cases have been ignored inline because they should be investigated in more detail, which is out of scope for this PR: - Metadata representation components compare `BrowseByDataType` to a `ResourceType`. Could be related to DSpace#2949. - We assume that dynamic form dates are always represented by strings, but they can also be `Date` or `object` according to the library (see https://github.com/udos86/ng-dynamic-forms/blob/da1742ce051af5cebdcf905b189ab6b55fe365d7/projects/ng-dynamic-forms/core/src/lib/model/dynamic-date-control.model.ts#L5)
@tdonohue does |
@wwelling : This is simply waiting on a reviewer. Because the PR is not built on If you'd like to speed up the review process for any of your PRs, we have a PR Trading option where you can volunteer to review others PRs in exchange for this one being reviewed more quickly. https://wiki.lyrasis.org/display/DSPACE/Trading+reviews+on+Pull+Requests Otherwise, this PR will be reviewed as soon as we find a volunteer who has time to review it. Or, as soon as someone else finds this useful and just tests it and reports back on this PR. |
@wwelling : I found time to look more closely at this today. Because of the changes in this area of the code between 7.x and 8.x, this PR is not able to be applied to pre-8.0 ( If you find time to create a secondary PR for 8.0 (against |
@tdonohue this resolves 7x and the PR for 8x as you discovered will be significantly different. How is this 7x patch being blocked with that discovery and patching 8x? Does the bug still manifest itself in 8x? |
@wwelling : When a bug is discovered in DSpace, we obviously want to ensure it is patched in both 7.x and 8.x if it affects both. I've not had time to verify yet whether this affects both, but my assumption was that this bug likely does (unless I've overlooked us patching it in a different manner in 8.x). In general, we refrain from fixing bugs only in 7.x unless they are verified to no longer impact 8.x. The reason is that we simply don't want a bug to be fixed in an older release while it still appears in a newer release....that can causes institutions upgrading to be frustrated as bugs that were previously fixed will reappear. I haven't had time to get back to this PR myself to do a more thorough analysis (as I'm busy getting 8.0 finished up). I'm hoping another developer can test whether this bug is truly 7.x specific and no longer exists on 8.x. Perhaps one easier way to do so is to look at the differences in behavior on demo.dspace.org (running 7.x) versus sandbox.dspace.org (running 8.x), if it's possible to reproduce the behaviors there. |
Is still kind of a bug in 8. This is where the author link on the simple item view is from https://sandbox.dspace.org/entities/publication/e1ffc1c5-284d-492c-9742-b18f0c4f8a43 https://sandbox.dspace.org/browse/author?startsWith=Gillen,%20Martie https://sandbox.dspace.org/browse/author?value=Gillen,%20Martie This finally gets to the expected results of publications by the author. |
It sounds like this fix needs to also have a I'd hesitate to only merge this into 7.x because of that behavior change. Ideally, we should have this feature working the same way in both 7.x and 8.x. (And, as noted, the implementation in this PR won't work for 8.x. The modified UPDATE: I meant to add, I'm currently seeing identical behavior on demo (running 7.x) and sandbox (running 8.x). So, this bug looks the same on both. Here's an example item that has two plain text authors...it exists on both demo and sandbox:
In both scenarios the author link works. But, it goes to the |
An alternative fix has been added in #3159 (to potentially replace this PR). This alternative PR seems more compatible with 8.x, so we may want to verify whether it is a complete replacement for this PR or not. |
References
Add references/links to any related issues or PRs. These may include:
Description
Fixes the simple item view author links.
Instructions for Reviewers
See issue above.
List of changes in this PR:
this.value.type
, which is hardcoded "valueList", instead of data type that could never evaluate to the desired query parameter for the URL link to the browse by author.this.value.type
.Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
yarn lint
yarn check-circ-deps
)package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.