dspace-angular
dspace-angular copied to clipboard
Handle Null Users Gracefully in Process Overview Page
References
- Requires DSpace/DSpace#9401
Description
This pull request addresses the issue of null users causing crashes in the process overview page. It includes changes to handle null users gracefully by returning an i18n message for unknown users and switching from getFirstSucceededRemoteDataPayload to getFirstCompletedRemoteData to ensure proper emissions.
Instructions for Reviewers
List of changes in this PR:
- Wrapping the method in an if/else to check for non-empty IDs and return an i18n message for unknown users if necessary.
- Changing
getFirstSucceededRemoteDataPayloadtogetFirstCompletedRemoteDataand usingswitchMapto handle emissions based on whether the remote data has succeeded. - Writing unit tests to cover all possible cases (valid ID, invalid ID, null ID).
Please ensure to test the following:
- Ensure the process overview page no longer crashes when encountering null users.
- Verify that the i18n message for unknown users is displayed correctly.
- Confirm that the method emits properly based on the success status of remote data.
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!
- [x] My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
- [x] My PR passes ESLint validation using
yarn lint - [x] My PR doesn't introduce circular dependencies (verified via
yarn check-circ-deps) - [x] My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
- [x] My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
- [x] If my PR includes new libraries/dependencies (in
package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation. - [x] If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
- [x] If my PR fixes an issue ticket, I've linked them together.
@kunovercammen : Do you know if this bug in the Process Overview page also exists in 7.6.x? If so, would you be able to also create a 7.6.x version of this PR? I'm just trying to determine if these fixes need to be backported, especially since I know the Processes page is quite different in 8.0 than it was in 7.6.x.
@tdonohue it does exist since the user is shown there as well, but yes that would require a separate fix, since the component works differently. It can't simply be ported.
I'll see what we can do
@artlowel : Yes, that's what I expected. Since the backend PR DSpace/DSpace#9401 was ported to 7.x, it would be nice if we could port this fix as well... or minimally port a "basic fix" which simply ensures the 7.x Processes page will no longer throw errors if a null EPerson is encountered. Thanks.
I'm sorry @tdonohue. Looks like the branch we started from already contained the changes to the create process page described here. They were created, and work, on 7.6, but clearly something went wrong with the port to 8. We'll create a new version of this PR without those changes.