-
Notifications
You must be signed in to change notification settings - Fork 19
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
Align Context Menus #127
Comments
Do I understand you correctly: you want to extend the cfiles context menu with additional options from stream menu, i.e. we should add options:
right? |
@yurabakhtin Yes. It would be good if it is somehow the same (extended) menu. So if e.g. a module (e.g. Bookmarks) adds an entry option, this should also be available in the CFiles module automatically. |
@luke- What I could implement in PR #131 and also small changes are required from core PR humhub/humhub#5261: But there are still errors on click on some of the menu entries because really all they are implemented firstly to work from wall entry under widget The main difference between stream wall entry menu and cfiles context menu is that wall entry menu is intialized per each entry as separate html tag So current version still has errors because after each click on the menu entry we should reload a file row completely as it is done on wall stream entry side, because we need the reloading in order to update state of the menu entries, e.g. "Save as bookmark" vs "Remove from bookmarks". Currently I just blocked the reloading here https://github.com/humhub/humhub/pull/5261/files#diff-9b40039e0bb6ca8e0806ba5ea1c0dda8dde291b8fcebb7010a0c7cc104555833R91 that not good of course, but otherwise JS error. Should I continue to implement this or do you think this is so complex and no need this feature? |
@yurabakhtin I think you are already on a good way here. But I think we need to refactor a bit more/deeper to get a nice solution that also works in other modules. What do you think about introduce new class Do you also see a change to then extend So that we end up with the following inheritances:
We can then move the entries from |
@luke- I don't see a reason to refactor PHP part, we need to change only JS core code as I started here https://github.com/humhub/humhub/pull/5261/files#diff-9b40039e0bb6ca8e0806ba5ea1c0dda8dde291b8fcebb7010a0c7cc104555833R91. I.e. we just need to modify the reload function to do this not only with wall entry but with others like rows from the cfiles browse table, I think it is easier way than we will redo each wall entry control in each module. Do you agree? |
@yurabakhtin Somehow it doesn't look clean to me. It is somehow a mix of a NonMenu widget with a Menu widget. We can leave out the separation between Is there a reason why the Another example would be this here in the Tasks Module: - How would the code look like if I also wanted to use the |
I cannot know what reason was to implement this but yes I could agree with you that we can try to extend the Probably it was done as optimization to keep less html code on a page. As I wrote above the difference between stream wall and cfiles browse pages is:
<div data-ui-widget="stream.StreamEntry"> // 1st wall Entry
<ul><li>...</li>...</ul> // WallEntryControls
// Wall entry content
<div>
<div data-ui-widget="stream.StreamEntry"> // Nth wall Entry
...
<div>
<table>
<tr> // 1st cfile
<td>
File title
<ul><li>...</li>...</ul> // PLACE A: WallEntryControls (I added this recently because they should be initialized per object then on show context menu action this menu is appended to the FileListContextMenu below)
</td>
<td></td>
<tr>
<tr> // Nth cfile
</tr>
</table>
// PLACE B: FileListContextMenu:
<div data-ui-widget="stream.StreamEntry"> // <-- please note this is a dirty code, I just added this recently in order to hide many errors on click from WallEntryControls because they require a parent stream.StreamEntry
<ul class="contextMenuFolder"><li>...</li>...</ul>
<ul class="contextMenuFile"><li>...</li>...</ul>
<ul class="contextMenuImage"><li>...</li>...</ul>
<ul class="contextMenuAllPostedFiles"><li>...</li>...</ul>
</div> So as you can see the Should I start to modify the
I have reviewed the |
@yurabakhtin Thanks for the info. Yes, please migrate the I think this is the best way for the the long run, if such menus clearly depend on the I am still considering whether we should not also introduce |
@luke- The migration |
@yurabakhtin ok, thanks for the update |
@luke- In today's commits of these 2 PRs https://github.com/humhub/cfiles/pull/131/commits and https://github.com/humhub/humhub/pull/5261/commits I have fixed all Js errors, so currently all context menu entries works well. They may be merged.
To remove the "Pin" entry I just call a code Please note the 2 PRs have broken checks because of error:
I have missed the |
@yurabakhtin Thanks looks good. Can you please see my review? Regarding the test errors, can you try to update the develop branch in this PR? |
@yurabakhtin Here another small UI improvement |
Sorry, not sure what you mean here, probably it was already implemented here #84, if yes, then as I got I just need to implement the same for folders.
Why is it not supported, I see it works well as from wall stream side as from cfiles browser page: Only one issue we can see here is that the dividers are hidden when the content is archived, it is because in core code the ->disableControlsEntry(DropdownDivider::class); I think it should be fixed somehow, either from core side or from CFiles module side. I have detected one issue and fixed in the commit 593d525 of the same PR: |
@yurabakhtin Regarding "Move": It is not clear where the difference between "Move" and "Move content" is. So we should remove "Move content" and add a link here: |
@yurabakhtin Regarding "Archive": Even if the "Archive" link is working, it has no effect on the view except for the status message. In the Stream view also the Wall Entry disappears. So the best solution would be at the moment: CFiles View - Context Menu: Don't show Archive Link This can probably easily done by a flag, or? |
@luke- Thank you for the details with screenshot, I have done all in commit dbec8e7, it works like this:
Ok, I have hidden that.
I think it would be good if we will mark the archived files with some grey background on the files browser page, so in such case user will knows the files is not visible on the wall stream side. |
@yurabakhtin Thanks, looks good! Regarding "Archive" I've added a seperate issue #135 - we may optimize this in the future. |
It would be good if we could somehow use the context menu from the Stream Entry with the options in the Cfiles module as well.
Stream Menu
File Menu
Probably there is a similar need in other places (e.g. Task module).
So probably it would be good if we create the possibility here in the core repo.
The text was updated successfully, but these errors were encountered: