-
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 option to hide files in global media library #2035
Conversation
Code Climate has analyzed commit 7300c9f and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 75.1% (0.0% change). View more on Code Climate. |
6002932
to
7780fd3
Compare
integreat_cms/static/src/js/media-management/component/edit-directory-sidebar.tsx
Outdated
Show resolved
Hide resolved
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 for the PR 👍
To save the value is_hidden
I suggest to set id and name for the checkbox.
If I've understood the context correctlly, hiding folders matters only for folders of the global media library and we don't have to show this choice for folders of region media library (and let it stay always false).
integreat_cms/static/src/js/media-management/component/edit-directory-sidebar.tsx
Outdated
Show resolved
Hide resolved
9fd8154
to
1bff28d
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 for PR!
I think it's working now to save whether the media file/folder shall be hidden in the media library 👍
There is one bug though: in region media library, when you click a file, another one is shown in the side bar (see the screen shots below).
I guess the cause is that the file index is not correctly set.
integreat_cms/static/src/js/media-management/component/edit-sidebar.tsx
Outdated
Show resolved
Hide resolved
integreat_cms/static/src/js/media-management/component/directory-content.tsx
Outdated
Show resolved
Hide resolved
67fe1ca
to
7b1e6b7
Compare
@MizukiTemma Thank you for your suggestions. I wasn't able to reproduce your issue, but if your suggestion works, it should be fixed now. Can you please check? |
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!
It looks good: the checkbox is only in global media library available (hidden in region media library) and the correct data is rendered in the side bar 👍 The choice of hide/show is preserved also after replacing the file.
I have one small suggestion to make the description of the checkbox more self-explaining.
8ea731a
to
d24e1ef
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.
🎉
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! 👍
It is going in the right direction, but a few things need to be improved in my opinion.
integreat_cms/static/src/js/media-management/component/edit-sidebar.tsx
Outdated
Show resolved
Hide resolved
integreat_cms/static/src/js/media-management/component/edit-sidebar.tsx
Outdated
Show resolved
Hide resolved
integreat_cms/static/src/js/media-management/component/edit-directory-sidebar.tsx
Outdated
Show resolved
Hide resolved
integreat_cms/static/src/js/media-management/component/edit-directory-sidebar.tsx
Outdated
Show resolved
Hide resolved
integreat_cms/static/src/js/media-management/component/directory-content.tsx
Outdated
Show resolved
Hide resolved
889acbc
to
fcd472a
Compare
Thank you a lot for your suggestions. I tried to work them all in. Please feel free to test it again :) |
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 for your changes! 👍
I still have questions regarding the hiding mechanism, what do you think about filtering the directory content already on the server side?
integreat_cms/static/src/js/media-management/component/edit-directory-sidebar.tsx
Show resolved
Hide resolved
integreat_cms/static/src/js/media-management/component/directory-content.tsx
Outdated
Show resolved
Hide resolved
a6d8268
to
7342c6e
Compare
99a02ac
to
4e29fe4
Compare
4e29fe4
to
f2fd13a
Compare
integreat_cms/static/src/js/media-management/component/edit-directory-sidebar.tsx
Outdated
Show resolved
Hide resolved
integreat_cms/static/src/js/media-management/component/directory-content.tsx
Outdated
Show resolved
Hide resolved
integreat_cms/static/src/js/media-management/component/directory-content.tsx
Outdated
Show resolved
Hide resolved
de1dcb2
to
6910ad6
Compare
Thank you a lot for your suggestions. They are worked in now and you can check again :) |
6910ad6
to
7300c9f
Compare
Short description
This PR was made in collaboration with @bob606 . This PR is supposed to add the option to hide files or directories in the global media library for regional media libraries.
Proposed changes
Side effects
This PR is still a work in progress. So far the functionality that the directories and files actually get hidden is still missing and we have worked so far only on the prerequisites for it.
Resolved issues
Fixes: #1578
Pull Request Review Guidelines