-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
TASK: Create a new package for the Media Browser #159
Conversation
Next step should be to remove the templates and controller from the Media package to have everything in this package. |
Basically the Media Package is working correctly. The only problem come from the ImageEditor when selecting an image when we try to open the media browser from the inspector Neos throw an exception regarding permissions (The security context contained no tokens which could be authenticated.), no clue why currently, but it's too late for today ... let's see tomorrow |
Before anyone merges this we should consider creating a new branch for bigger tasks like this. The prioritizers discussed creating branches for each project/larger change. This will allow us to much better have simultaneous development and only allow finished features into master and not half finished ones. Still need to write a proposal for it though. |
@aertmann I agree with creating branch for those kind of changes, and don't merge this one ;) it's a WIP currently, playground status currently |
Now this PR depends on the Flow PR: Now the access to the media browser from the inspector work (policy wise), some CSS/JS loading issue, that need to be solved but at least the security parts work ;) |
06adef2
to
d46a1d0
Compare
Rebase on top of master, and now depend on neos/flow-development-collection#130 |
d46a1d0
to
3ce7692
Compare
@dfeyer ping if you want someone to have a look and go further with it. |
I'll try to continue this now at the sprint. |
3ce7692
to
6d8f519
Compare
c4beffd
to
e76abe2
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.
Tested locally - looks good. Didn't checked all the code
After installing I have to adapt ContainerViewHelper to not use the Context::getPartyByType but the PartyService. But I think it's not related to this change I think the Thumbnail controller should also move the the new Neos.Media.Browser package, basically the Neos.Media package should only contains logic and no controller, not routes I continue testing tomorror |
This change extract the MediaBrowser from the Neos core package and create an new package name Neos.Media.Browser. Resolves: NEOS-1683
e76abe2
to
c807d0d
Compare
@dfeyer @johannessteu I rebased and that should fix the issue. |
Tested it again, still working! |
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.
When I try to replace a file I get: #1216919280: You are not allowed to perform this action.
There is a problem when replacing some images in the demo site but this is also in master. @gerhard-boden please check if it works if you logout and login. |
@Sebobo So OK merge this one it work basically and we can discuss the other small point after the namespace hell ;) and have a safe namespace change party |
</trans-unit> | ||
<trans-unit id="media.replace.previewFile" xml:space="preserve"> | ||
<source>Preview current file</source> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
</xliff> |
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.
we should move these labels to the media browser package
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.
I agree
{documentNode.label} | ||
</f:for> | ||
</neos:backend.documentBreadcrumbPath> |
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.
this adds undesired whitespace between the labels, which is why it was formatted without new lines
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.
Correct, didn't want to commit that.
maximumHeight: 250 | ||
'TYPO3.Neos:Preview': | ||
maximumWidth: 1000 | ||
maximumHeight: 1000 |
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.
changing these presets is wrong, they belong to Neos and not the media package as they're used throughout the neos backend and not just for the media browser..
also changing them is a breaking change, which is better to avoid
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.
Would love a discussion about this, because it's currently confusing how and where this is used.
pattern: 'ControllerObjectName' | ||
patternOptions: | ||
controllerObjectNamePattern: 'TYPO3\Media\Controller\.*' | ||
controllerObjectNamePattern: 'TYPO3\Neos\Controller\.*|TYPO3\Neos\Service\.*|TYPO3\Media\Controller\.*' |
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.
this is a really bad regression reverting the newly formatted requestPatterns into the old format
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.
Ah this was a mistake when rebasing I guess :/
'NeosMediaBrowserSubroutes': | ||
package: 'Neos.Media.Browser' | ||
variables: | ||
'defaultUriSuffix': '.html' |
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.
instead we should use the routes by settings feature and put these in the media browser package
'Neos.Media.Browser': 'resource://Neos.Media.Browser/Private/Partials' | ||
|
||
templateRootPathPattern: 'resource://Neos.Media.Browser/Private/Templates' | ||
templatePathAndFilenamePattern: '@templateRoot/@subpackage/Module/Management/Asset/@action.@format' |
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.
the idea was to get rid of this entirely, we don't want any media templates nor labels in Neos
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.
Needs to be cleaned up, when we achieve that we only have one layout and template.
- 'resource://TYPO3.Neos/Public/Library/bootstrap-components.js' | ||
- 'resource://Neos.Media.Browser/Public/JavaScript/Modules/media-browser.js' | ||
styles: | ||
- 'resource://TYPO3.Neos/Public/Styles/Neos.css' |
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.
we should probably get rid of this as we don't need it to be extensible anymore
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.
Still needed for the iframe version when opening the browser via the inspector. But as I said in my comment to this PR, this needs an improvement.
|
||
- | ||
privilegeTarget: 'Neos.Media.Browser:Backend.Module.Media.ManageAssetCollections' | ||
permission: GRANT |
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.
why not combine these two privileges?
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.
I think this was intentional that not everybody can change the collections.
} | ||
|
||
// FIXME: Resources are not deleted, because we cannot be sure that the resource isn't used anywhere else. | ||
$this->assetRepository->remove($asset); | ||
$this->addFlashMessage(sprintf('Asset "%s" has been deleted.', $asset->getLabel()), null, null, array(), 1412375050); | ||
$this->redirect('index'); | ||
} | ||
|
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.
we don't need this class do we? everything should fit in one controller now right?
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.
I didn't understand why the controllers are like they are, so a discussion with the involved people would be great.
{ | ||
"name": "neos/media-browser", | ||
"type": "typo3-flow-package", | ||
"description": "Add description here", |
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.
This module allows managing of media assets including pictures, videos, audio and documents.
Hey @Sebobo, @dfeyer, @johannessteu and @gerhard-boden thanks a lot for pushing this one! Unfortunately found some regressions and some things that should be done as well. Anyone up for a round two? |
Hi @aertmann, I would join in again as I now know the code very well after this monster-rebase and adaption ;) There are big two things which in my opinion have to be cleaned up. |
@Sebobo: awesome! I'd suggest to start with fixing the policy configuration regression as that's pretty critical. Regarding thumbnail generation, that belongs in the media package. Configuration for Neos belongs in Neos IMO and the media browser depends on Neos so it's fine using configuration from Neos in it. Regarding the layouts, that's true however I don't see a way around it. It's just how we re-use it as a standalone module and inside an iframe. |
Topic continues in #1305 |
This change create a new package Neos.MediaBrowser to distribute the Neos Media Browser module, so this module is not part of the core.
Resolves: #1130, NEOS-1683