-
Notifications
You must be signed in to change notification settings - Fork 56
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
EZP-28841: Content On the Fly v2 #366
Conversation
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.
just some phpdocs nitpicks on my part
/** @var LocationService */ | ||
private $locationService; | ||
|
||
private $contentActionDispatcher; |
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.
missing phpdoc here and in constructor
* @param ContentType $contentType | ||
* @param Location $parentLocation | ||
* | ||
* @return ContentCreateView |
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.
ContentCreateView | Response
?
{ | ||
private $contentService; | ||
|
||
private $twig; |
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.
phpdocs
|
||
/** | ||
* @var string | ||
*/ |
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.
/** @var string */
} | ||
|
||
/** | ||
* @return int |
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.
int|null according to typehint
@Nattfarinn have you seen the PHPUnit failure? |
47070f8
to
80c792e
Compare
Three things so far:
|
Is there anything as for developer documentation ? I'm mostly thinking about how you integrate COTF in your custom code and how you may customize the locations/content types that are liste. From the code's perspective, I think that a |
Fixed. |
True. Now it has its own controller. @dew326 Route names changed. I guess you have to update -ezplatform.content.create.on_the_fly:
+ezplatform.content_on_the_fly.create: -ezplatform.content.create.on_the_fly.has_access:
+ezplatform.content_on_the_fly.has_access: |
@dew326 could you address this change so we can unblock QA here? |
@mnocon done, please update branch in ezplatform-admin-ui-modules. |
I cannot create anything now, the "Create content" button is disabled all the time. In Network tab, the request:
|
@mnocon Fixed |
@Nattfarinn we need a rebase here too. |
* @return ContentCreateOnTheFlyView|Response | ||
* | ||
* @throws ApiException\NotFoundException | ||
* @throws \eZ\Publish\Core\Base\Exceptions\InvalidArgumentType |
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 are using short class names instead of FQCN in doc block.
* @throws ApiException\NotFoundException | ||
* @throws \eZ\Publish\Core\Base\Exceptions\InvalidArgumentType | ||
*/ | ||
public function createContentAction(Request $request, string $languageCode, ContentType $contentType, Location $parentLocation) |
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.
Split into multiple lines.
expose: true | ||
|
||
ezplatform.content_on_the_fly.has_access: | ||
path: /content/create/onthefly/{contentTypeIdentifier}/{languageCode}/{locationId}/hasaccess |
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.
Idon'tlikeseeingstufflikethis 😅Can we use path: /content/create/onthefly/{contentTypeIdentifier}/{languageCode}/{locationId}/has-access
?
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.
So... onthefly
is fine, but hasaccess
is not? :P
* @throws \Twig_Error_Runtime | ||
* @throws \Twig_Error_Syntax | ||
* @throws \eZ\Publish\API\Repository\Exceptions\BadStateException | ||
* @throws \eZ\Publish\API\Repository\Exceptions\ContentFieldValidationException |
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.
Short name instead of FQCN
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 agreed to keep FQCN
*/ | ||
public function processPublish(FormActionEvent $event) | ||
{ | ||
/** @var \EzSystems\RepositoryForms\Data\Content\ContentCreateData|\EzSystems\RepositoryForms\Data\Content\ContentUpdateData $data */ |
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.
Short name
use eZ\Publish\Core\MVC\Symfony\MVCEvents; | ||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
|
||
class ViewTemplatesListener implements EventSubscriberInterface |
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.
As we discussed you can set default templates on View object creation. That will make this listener no longer needed.
40863eb
to
5d16387
Compare
I've been through the code, and I'd like to know how flexible we are on the starting location / content type / language options. This includes existing inclusions of COTF, like Relation or RichText. For those, I'd like to keep the system flexible enough so that:
|
@bdunogier Starting location and content type are not developed. The only configuration option is forced language, this is an option per usage in button config. |
What about this ?
As far as I could see, the value comes from the Config Resolver. My concern is that we limit our options in terms of BC. Without thinking it very far, ideally, there would be some kind of event, when COTF is loaded, that can be hooked into and lets you decide of those options. Our own subscriber would set it to the globally configured value for the first iteration. The two options I have described above would still be open for implementation / integration. |
@Nattfarinn rebase is needed |
@bdunogier I agree, but as far as I know, it was more like "Nice to have." instead of requirement. The scope of this was discussed on preplanning and planning, and turned out that we won't be able to deliver everything within one sprint. We can make improvements for next version I guess and I don't think refining a way how the values for a new UDW options/flags is picked will be a BC break. |
To be honest, I'd like it to become a requirement. Do you think that a dedicated story, with detailed expectations, makes sense for this ? As long as it can be done, I don't require it for that particular pull-request. On the other hand, having such an event from the start would also help us keep the doors open for any change we would have in mind. The way I see it, the event would contain:
That way, we can go as much in detail as we want, without requiring anything complex. Where would you see this happening ? I was thinking that one REST call, that would resolve the options, when clicking the COTF button, could work. |
Checklist:
$ composer fix-cs
)ezplatform-admin-ui-modules
: EZP-28841: Content On the Fly v2 #366 (comment)