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

Add RouteBuilders #4276

Merged
merged 16 commits into from Dec 21, 2018
Merged

Add RouteBuilders #4276

merged 16 commits into from Dec 21, 2018

Conversation

danrot
Copy link
Contributor

@danrot danrot commented Nov 15, 2018

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets ---
Documentation PR ---

What's in this PR?

This PR adds the Builder pattern to create routes.

Why?

Because it is more comfortable to work with.

To Do

  • Redirect ResourceTabs to first tab, if nothing is selected
  • How to handle inheritance? Remove and therefore duplicate a few configurations? Keep it and mix logic between different RouteBuilder?

@danrot danrot changed the title add DatagridRouteBuilder Add RouteBuilders Nov 15, 2018
@danrot danrot force-pushed the feature/route-builder branch 6 times, most recently from 79057e0 to 0954883 Compare November 20, 2018 09:04
);
}

return $this->route;
Copy link
Member

Choose a reason for hiding this comment

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

clone ?

src/Sulu/Bundle/AdminBundle/Admin/Routing/Route.php Outdated Show resolved Hide resolved
@danrot danrot force-pushed the feature/route-builder branch 2 times, most recently from 7c0a4fa to d8d3fb9 Compare November 27, 2018 11:47
@danrot danrot added this to the Release 2.0 milestone Dec 19, 2018
@danrot danrot added the Feature New functionality not yet included in Sulu label Dec 19, 2018
public function setResourceKey(string $resourceKey): self;

/**
* @param array $locales
Copy link
Member

Choose a reason for hiding this comment

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

add type or remove

UPGRADE.md Outdated
to use the `RouteBuilderFactory`. It offers methods to create Form, Datagrid and ResourceTabs routes in a typed way,
which means auto completion in the IDE should work as well.

Apart from that the `Route::addOption` was renamed to `Route::setOption`, since it overrides existing option values.
Copy link
Member

Choose a reason for hiding this comment

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

add addAttributeDefault change

->getRoute(),
$this->routeBuilderFactory->createFormRouteBuilder('sulu_category.add_form.detail', '/details')
->setResourceKey('categories')
->setFormKey('categories')
Copy link
Member

Choose a reason for hiding this comment

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

category.details

@danrot danrot force-pushed the feature/route-builder branch 2 times, most recently from 62bef68 to eaf68ef Compare December 21, 2018 11:38
@chirimoya chirimoya merged commit 181316e into sulu:develop Dec 21, 2018
@danrot danrot deleted the feature/route-builder branch December 27, 2018 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New functionality not yet included in Sulu
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants