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

Update to Sulu 2.0 #32

Merged
merged 35 commits into from
Jul 30, 2019

Conversation

kleinkoerkamp
Copy link
Contributor

@kleinkoerkamp kleinkoerkamp commented Jul 3, 2019

Q A
Bug fix? no
New feature? no
BC breaks? yes
Deprecations? no
License MIT

What's in this PR?

Update to work with Sulu 2.0

To Do

Copy link
Member

@alexander-schranz alexander-schranz left a comment

Choose a reason for hiding this comment

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

@kleinkoerkamp first a big thank you for doing this ugprade 👍 ! Some things we need to discuss with the other core team members but most of the things I commented should be easily fixable.

Controller/RedirectRouteController.php Outdated Show resolved Hide resolved
Manager/RedirectRouteManager.php Outdated Show resolved Hide resolved
Manager/RedirectRouteManager.php Outdated Show resolved Hide resolved
Resources/config/forms/redirect_route_details.xml Outdated Show resolved Hide resolved
Resources/config/services.xml Outdated Show resolved Hide resolved
Resources/config/forms/redirect_route_details.xml Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
DependencyInjection/SuluRedirectExtension.php Outdated Show resolved Hide resolved
Manager/Exception/RedirectRouteNotUniqueException.php Outdated Show resolved Hide resolved
@alexander-schranz
Copy link
Member

/cc @chirimoya and @danrot the toolbarAction on the list for Import I would see to be inside sulu/sulu where you can drop a file into it and call a specific action on the current resource.

Resources/translations/admin.de.json Outdated Show resolved Hide resolved
Resources/config/services.xml Outdated Show resolved Hide resolved
Resources/translations/admin.en.json Outdated Show resolved Hide resolved
Tests/Application/config/config.yml Outdated Show resolved Hide resolved
@kleinkoerkamp
Copy link
Contributor Author

@alexander-schranz thanks for the feedback, will dive into that. Regarding the import functionality in the UI i'm very curious if you guys have some quicktips how to implement it.

@alexander-schranz
Copy link
Member

alexander-schranz commented Jul 4, 2019

@danrot maybe you can give some tips here and maybe we have some design for an import drop in? /cc @chirimoya
@kleinkoerkamp The js implementation will be in sulu/sulu repository here: https://github.com/sulu/sulu/tree/develop/src/Sulu/Bundle/AdminBundle/Resources/js/views/List/toolbarActions the toolbarAction need to be registered here and then can be used in the RedirectAdmin.php by the registered name.

@kleinkoerkamp
Copy link
Contributor Author

@alexander-schranz changed most of it, except from the BC breaks where you asked @wachterjohannes his opinion.

Also do not yet really get the import drop in, should this be part of the Sulu core? /cc @danrot

Copy link
Member

@alexander-schranz alexander-schranz left a comment

Choose a reason for hiding this comment

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

@kleinkoerkamp Can we change the Manager so it avoids currently the BC Break.

Resources/doc/installation.md Show resolved Hide resolved
Manager/RedirectRouteManagerInterface.php Outdated Show resolved Hide resolved
Resources/doc/installation.md Show resolved Hide resolved
@alexander-schranz
Copy link
Member

alexander-schranz commented Jul 8, 2019

The import can currently be seen as out of scope as it need first be implemented in the sulu/sulu repository: sulu/sulu#4621 / #33

@alexander-schranz
Copy link
Member

alexander-schranz commented Jul 22, 2019

We need to add the following SQL's to the UPGRADE.md to support utfmb4 which is default in sulu 2.0:

ALTER TABLE `re_redirect_routes` CHANGE `id` `id` VARCHAR(36) NOT NULL;
ALTER TABLE `re_redirect_routes` CHANGE `source` `source` VARCHAR(191) NOT NULL;

EDIT: Did add it in the last commit

@@ -5,23 +5,16 @@
<services>
<!-- sulu-admin -->
<service id="sulu_redirect.admin" class="Sulu\Bundle\RedirectBundle\Admin\RedirectAdmin" public="false">
<argument type="service" id="sulu_admin.route_factory"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

@alexander-schranz Still not sure if this is a good idea. If the route builder factory is overridden by just changing the alias (which I would consider a valid thing to do) this class would still use the core service, instead of the overridden one.

Are there any real reasons for not doing this, besides the pure fact that we should not use FQCN?

Copy link
Member

Choose a reason for hiding this comment

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

We should definitly following best practices and if somebody want to overwrite it for all bundles it should overwrite it by using the service id and not the FQCN.

Copy link
Contributor

Choose a reason for hiding this comment

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

Where is written that this is best practice? I only know about the part of the symfony documentation saying that bundles should not rely on autowiring (which we don't do here), and it says nothing about how services should be named.

Copy link
Member

@alexander-schranz alexander-schranz Jul 31, 2019

Choose a reason for hiding this comment

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

If the bundle defines services, they must be prefixed with the bundle alias. For example, AcmeBlogBundle services must be prefixed with acme_blog.

https://symfony.com/doc/current/bundles/best_practices.html#services

@danrot
Copy link
Contributor

danrot commented Jul 23, 2019

@kleinkoerkamp Since we also have an export button for lists in the core already, I think it would also make sense to have the inverse operation. So yes, I think an import button being in Sulu core calling a certain Symfony action similar to what the import button does would make sense.

However, I also don't have any design for that. We were also discussing if clicking the button should simply open the operating systems file upload dialog. It probably would not make a lot of sense to upload multiple files at once, because it would just complicate things, for a probably not existent use case.

@alexander-schranz
Copy link
Member

alexander-schranz commented Jul 30, 2019

I'm merging this and ignoring the phpstan errors currently in the CI as they should be fixed with: sulu/sulu#4655.

There are currently 2 things out of scope of this PR. Both are toolbarActions:

  1. The Import Toolbar Action Add import toolbar action #33
  2. The Enabled/Disable Toolbar Action Add enable/disable toolbarAction #37

Both should be implemented in the js of sulu/core so other bundles can also use them.

/cc @chirimoya @danrot

@alexander-schranz alexander-schranz merged commit b380087 into sulu:develop Jul 30, 2019
@alexander-schranz
Copy link
Member

@kleinkoerkamp thank you for your PR!

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.

3 participants