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

TASK: Create a new package for the Media Browser #159

Merged
merged 3 commits into from
Nov 24, 2016

Conversation

dfeyer
Copy link
Contributor

@dfeyer dfeyer commented Oct 26, 2015

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

@dfeyer
Copy link
Contributor Author

dfeyer commented Oct 26, 2015

Next step should be to remove the templates and controller from the Media package to have everything in this package.

@dfeyer
Copy link
Contributor Author

dfeyer commented Oct 26, 2015

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

@aertmann
Copy link
Contributor

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.

@dfeyer
Copy link
Contributor Author

dfeyer commented Oct 27, 2015

@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

@dfeyer
Copy link
Contributor Author

dfeyer commented Oct 29, 2015

Now this PR depends on the Flow PR:
neos/flow-development-collection#114

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 ;)

@dfeyer dfeyer force-pushed the task-mediabrowser-module branch from 06adef2 to d46a1d0 Compare November 17, 2015 10:41
@dfeyer
Copy link
Contributor Author

dfeyer commented Nov 17, 2015

Rebase on top of master, and now depend on neos/flow-development-collection#130

@dfeyer dfeyer force-pushed the task-mediabrowser-module branch from d46a1d0 to 3ce7692 Compare November 17, 2015 17:36
@kitsunet
Copy link
Member

@dfeyer ping if you want someone to have a look and go further with it.

@Sebobo
Copy link
Member

Sebobo commented Nov 21, 2016

I'll try to continue this now at the sprint.

@Sebobo Sebobo force-pushed the task-mediabrowser-module branch from 3ce7692 to 6d8f519 Compare November 23, 2016 15:50
@Sebobo Sebobo removed the I: WIP label Nov 23, 2016
@Sebobo Sebobo unassigned dfeyer and Sebobo Nov 23, 2016
@Sebobo
Copy link
Member

Sebobo commented Nov 23, 2016

@dfeyer @kitsunet @nezaniel @aertmann the PR is now rebased onto master. All additional adaptions to master from @nezaniel and me are in the second commit.

@Sebobo Sebobo force-pushed the task-mediabrowser-module branch 4 times, most recently from c4beffd to e76abe2 Compare November 23, 2016 18:32
Copy link
Contributor

@johannessteu johannessteu left a 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

@johannessteu johannessteu changed the title [TASK] Create a new package for the Media Browser TASK: Create a new package for the Media Browser Nov 23, 2016
@dfeyer
Copy link
Contributor Author

dfeyer commented Nov 23, 2016

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

dfeyer and others added 2 commits November 24, 2016 10:00
This change extract the MediaBrowser from the Neos core package and create
an new package name Neos.Media.Browser.

Resolves: NEOS-1683
@Sebobo Sebobo force-pushed the task-mediabrowser-module branch from e76abe2 to c807d0d Compare November 24, 2016 09:07
@Sebobo
Copy link
Member

Sebobo commented Nov 24, 2016

@dfeyer @johannessteu I rebased and that should fix the issue.
We had a discussion at the sprint regarding the thumbnail controller where it should be as it's not only media browser related. I would prefer to do that after the name change because we have to hurry here a bit.
If this change now works without issues we should really merge it and then do the rest afterwards and think about where to put the thumbnail stuff.

@johannessteu
Copy link
Contributor

Tested it again, still working!

Copy link
Contributor

@gerhard-boden gerhard-boden left a comment

Choose a reason for hiding this comment

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

@gerhard-boden gerhard-boden self-assigned this Nov 24, 2016
@Sebobo
Copy link
Member

Sebobo commented Nov 24, 2016

There is a problem when replacing some images in the demo site but this is also in master.
It then breaks when trying to delete a resource.

@gerhard-boden please check if it works if you logout and login.

@dfeyer
Copy link
Contributor Author

dfeyer commented Nov 24, 2016

@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

@Sebobo Sebobo merged commit 6d08ff9 into neos:master Nov 24, 2016
@gerhard-boden gerhard-boden removed their assignment Nov 24, 2016
</trans-unit>
<trans-unit id="media.replace.previewFile" xml:space="preserve">
<source>Preview current file</source>
</trans-unit>
</body>
</file>
</xliff>
Copy link
Contributor

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

Copy link
Member

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>
Copy link
Contributor

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

Copy link
Member

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
Copy link
Contributor

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

Copy link
Member

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\.*'
Copy link
Contributor

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

Copy link
Member

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'
Copy link
Contributor

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'
Copy link
Contributor

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

Copy link
Member

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'
Copy link
Contributor

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

Copy link
Member

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
Copy link
Contributor

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?

Copy link
Member

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');
}

Copy link
Contributor

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?

Copy link
Member

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",
Copy link
Contributor

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.

@aertmann
Copy link
Contributor

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?

@Sebobo
Copy link
Member

Sebobo commented Nov 29, 2016

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.
One is that we currently need different layouts when opening the media browser via the backend module and when opening it via the inspector. This is really smelly.
The other thing is the whole thing about thumbnail generation. Where to do it, where to put the configuration, etc...

@aertmann
Copy link
Contributor

@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.

Sebobo added a commit to Sebobo/neos-development-collection that referenced this pull request Dec 10, 2016
Sebobo added a commit to Sebobo/neos-development-collection that referenced this pull request Dec 10, 2016
Sebobo added a commit to Sebobo/neos-development-collection that referenced this pull request Dec 10, 2016
Sebobo added a commit to Sebobo/neos-development-collection that referenced this pull request Dec 10, 2016
@Sebobo
Copy link
Member

Sebobo commented Dec 11, 2016

Topic continues in #1305

skurfuerst added a commit that referenced this pull request May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants