-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add filter to show unused media files #2048
Conversation
Code Climate has analyzed commit d5237e2 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 76.4% (50% is the threshold). This pull request will bring the total coverage in the repository to 75.6% (0.0% change). View more on Code Climate. |
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.
Thank you a lot!
In general I think this feature works well. When I use media inside a page, the filter acts correctly and doesn't show the media anymore - this goes both for the regional and the global library. But I still made a few observations:
- Maybe I'm doing something wrong, but I wasn't able to uncheck the filter and think it would be good, if it would also be possible to reset the filter after using it once. So far it is only possible when I remove the filter-unused-media-files from the URL
- This is probably unrelated to this PR, but when I try to access the media library from the editor the loading time was very long (three times it took forever until I restarted the server).
- I have one suggestion for a different translation
I think this is it for now :)
5eff34a
to
bb50c26
Compare
bb50c26
to
cfe890f
Compare
I've introduced an navigation titling "Home > Unused media files" like when a search funcion is being used. so users can go back to the home directory where all the files are shown just in the same way with after key word search.
I think, as you meant, this is not because of PR, for I've seen this problem before this PR sometimes. If you think this cannot be ignored anymore, we can have a closer look at it 😃
Applied! |
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.
Thanks a lot! 👍
Apart from my comments below, I'd also suggest to disable the "Upload" and "Create directory" buttons when the filter is applied, since it might not be clear to which directories the new files are uploaded.
integreat_cms/static/src/js/media-management/component/breadcrumbs.tsx
Outdated
Show resolved
Hide resolved
integreat_cms/static/src/js/media-management/component/breadcrumbs.tsx
Outdated
Show resolved
Hide resolved
integreat_cms/static/src/js/media-management/unused-filter-library.tsx
Outdated
Show resolved
Hide resolved
integreat_cms/static/src/js/media-management/unused-filter-library.tsx
Outdated
Show resolved
Hide resolved
5a6aeaa
to
e6388e7
Compare
integreat_cms/static/src/js/media-management/component/breadcrumbs.tsx
Outdated
Show resolved
Hide resolved
e6388e7
to
a6795e3
Compare
1c54cb2
to
a032623
Compare
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.
Thanks a lot! 👍
I refactored the structure "a bit", mostly to improve performance and to somehow implement my suggestion of showing the usages in the sidebar (even though I did not manage to find a query that is fast enough to include it on every request, so I added an additional ajax step).
So from my side this is good to go, but could you have a detailed look again at my changes and check whether I made some other mistakes somewhere? Thanks!
a032623
to
28d4053
Compare
28d4053
to
f34c5e8
Compare
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.
Thank you very much for all the changes. It looks a lot better now 😄
Co-authored-by: Timo Ludwig <timo.ludwig@tuerantuer.org>
Co-authored-by: Mizuki Temma <temma@integreat-app.de>
f34c5e8
to
d5237e2
Compare
I really appreciate your suggestions and detailed explanation 🥺 🙏 it's full of improvements and I find nothing bad 😃 |
Short description
This PR adds a filter function to show unused media files in the media library and a description in side bar of media files where the file is used.
Proposed changes
Side effects
None (i hope)
In region media library currently, only files that belong to the region will be checked and filtered, becuase region users cannot change or delete global files. Should global files too be filtered shown in region media library?
Resolved issues
Fixes: #1005
Pull Request Review Guidelines