Skip to content
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

EDSC-4031: Always route to saved Projects when selected. #1745

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Bccorb
Copy link
Contributor

@Bccorb Bccorb commented May 7, 2024

Overview

What is the feature?

Created a SavedProjects page and route to avoid the accidental appending of route params to the project page.

What is the Solution?

  • New Component
  • New Route
  • Updated the link for saved projects to the new route

What areas of the application does this impact?

  • Saved Projects
  • Projects when missing all params

Testing

Reproduction steps

This is confirmable by:

  1. Logging in to EDSC
  2. Selecting the save project icon in the right hand tool bar
  3. Entering a project name
  4. Adding a collection to the project via the plus button on a collection
  5. Clicking the user icon in the right hand tool bar and selecting "saved projects"
  6. You should observe that you are routed to '/savedProjects' and it is in face your saved projects.

Attachments

Please include relevant screenshots or files that would be helpful in reviewing and verifying this change.

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@codecov-commenter
Copy link

codecov-commenter commented May 8, 2024

Codecov Report

Attention: Patch coverage is 38.75969% with 158 lines in your changes are missing coverage. Please review.

Project coverage is 66.81%. Comparing base (b796613) to head (a6d3bc4).

❗ Current head a6d3bc4 differs from pull request most recent head b8f8c39. Consider uploading reports for the commit b8f8c39 to get more accurate results

Files Patch % Lines
...tic/src/js/components/AccessMethod/AccessMethod.js 38.24% 147 Missing and 8 partials ⚠️
...tatic/src/js/routes/SavedProjects/SavedProjects.js 33.33% 2 Missing ⚠️
static/src/js/components/EDSCIcon/EDSCIcon.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1745       +/-   ##
===========================================
- Coverage   91.93%   66.81%   -25.12%     
===========================================
  Files         730      731        +1     
  Lines       19568    19528       -40     
  Branches     4647     4640        -7     
===========================================
- Hits        17989    13048     -4941     
- Misses       1441     5709     +4268     
- Partials      138      771      +633     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@macrouch
Copy link
Contributor

macrouch commented May 8, 2024

/savedProjects is not a valid URL, it should be /saved-projects to match every other URL in App.js.

Instead of fixing the bug in the ticket you added a new feature and left the original buggy code abandoned in the codebase. The Project.js route already has code with comments that explain how the behavior should work. This is occurring because ?projectId=... is still in the URL when it switches to the /projects endpoint. Either track down the bug and fix it, or remove the buggy code.

See CONTRIBUTING.md, all commits have to start with the ticket number.

@Bccorb
Copy link
Contributor Author

Bccorb commented May 8, 2024

/savedProjects is not a valid URL, it should be /saved-projects to match every other URL in App.js.

Instead of fixing the bug in the ticket you added a new feature and left the original buggy code abandoned in the codebase. The Project.js route already has code with comments that explain how the behavior should work. This is occurring because ?projectId=... is still in the URL when it switches to the /projects endpoint. Either track down the bug and fix it, or remove the buggy code.

See CONTRIBUTING.md, all commits have to start with the ticket number.

All feedback incorporated.

  • Removed saved project logic from the project url
  • Added logic to correct an issue where a project url with no params could still be navigated to
  • Added the back to search to the saved-projects url
  • renamed the url endpoint

@@ -66,24 +65,10 @@ export class Project extends Component {
const { search } = location
const { edscHost } = this

// If there are no params in the URL, show the saved projects page
// If there are no project params in the URL, re-route to the saved Projects page
if (search === '') {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit confused I'll pull this down and test it myself but, if the conditional here if (search === '') is failing to properly work i.e. its false when it should be true, which is why we are getting routed to the other component wouldn't this still have the same issue even if it is on a difference page?

Copy link
Contributor

Choose a reason for hiding this comment

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

So the issue I seem to be seeing is that something like http://localhost:8080/saved-projects?projectId=3519105921is always going to strip out the projectId but, also that http://localhost:8080/projects?projectId=3519105921 is redirecting me (fill in any projectId) back into the saved-projects page so I can't go back to my previous projects

@Bccorb Bccorb marked this pull request as draft May 9, 2024 16:50
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.

None yet

5 participants