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

Fix : Media Library List View navigation #17565

Merged
merged 1 commit into from
Aug 7, 2023
Merged

Conversation

noobCode-69
Copy link
Contributor

@noobCode-69 noobCode-69 commented Aug 3, 2023

What does it do?

The PR fix the issue of Folder links not working in the Media Library page , in the List view
The issue is related to issue number #17564

Why is it needed?

It is needed since we want to navigate to folders in List View also.

How to test it?

To test the issue do the following things

  1. Go to Media Library
  2. Create a new Folder
  3. Switch to List View
  4. Click on any of the folder links

We are not be navigated to the target folder.

Fixes #17564

@noobCode-69
Copy link
Contributor Author

noobCode-69 commented Aug 3, 2023

I would like to discuss the solution here.
Right now in your codebase you are using this approach to generate a link for the folder (In List View only)

onChangeFolder={(folderID) => push(getFolderURL(pathname, query, folderID))}

But here getFolderURL will never generate the correct URL , to generate correct URL you have to use it like this

onChangeFolder={(folderID, folderPath) =>
    push(getFolderURL(pathname, query, { folder: folderID, folderPath }))
}

This will generate the correct link.
After these changes the navigation is working fine.

@noobCode-69
Copy link
Contributor Author

Can someone please review this up?

@noobCode-69
Copy link
Contributor Author

hey @gu-stav can you review and merge this!

@gu-stav gu-stav self-assigned this Aug 7, 2023
@gu-stav gu-stav self-requested a review August 7, 2023 09:22
@gu-stav gu-stav added source: core:upload Source is core/upload package pr: fix This PR is fixing a bug labels Aug 7, 2023
Copy link
Contributor

@gu-stav gu-stav left a comment

Choose a reason for hiding this comment

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

Thank you - well done! 🌻

@gu-stav gu-stav added this to the 4.12.2 milestone Aug 7, 2023
@gu-stav gu-stav changed the title fixed : Media Library List View Broken Fix : Media Library List View navigation Aug 7, 2023
@gu-stav gu-stav merged commit 234b3cc into strapi:main Aug 7, 2023
24 checks passed
@noobCode-69 noobCode-69 deleted the folder branch September 12, 2023 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: fix This PR is fixing a bug source: core:upload Source is core/upload package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Folder Links Not Clickable In List View
2 participants