Add Review Bundle (Initial Draft)#431
Conversation
|
You're crazy. ❤️ |
|
Really interesting ! |
|
Really nice! I would just display the rating as 5 stars, it's more visual than a digit. |
app/config/sylius.yml
Outdated
There was a problem hiding this comment.
You can add this to CoreBundle/DI/SyliusCoreExtension and it will be set automatically.
|
What about locale-dependent reviews? As an German speaking i won't have reviews in e.g. Russian. |
|
Congratulations, awesome job! 👍 Follows some considerations I noticed:
|
|
Still have a bunch more stuff @stloyd suggested to do, but wanted to show this off. As for reviewer, the user is always set for audit trail purposes, and so far there is no logic to decide whether guest reviews are allowed. Do we want to make that a setting for the core bundle? |
|
One big issue I have here is handling the form submission, because the form is embedded on the product page. Any ideas? |
|
@Richtermeister my question is from an architectural view. Currently, we can set both an user and a guest reviewer, right? It seems weird, once a guest reviewer is a user (an unregistered one). Then, to decide the review's authority, you created a macro. I think it's not a good place to put this logic, it should be transparent, because you may use it not only in the view layer. For example, let's suppose that I want to send a email to all users that wrote a review about a promotional product, as it is right now, I have to spread this business logic for every part where I need to reference the review's author. |
|
@marcospassos So, you suggest we create |
|
I think adding this methods to the class |
|
@Richtermeister I tend to agree with @marcospassos about the problem with Guess and User reviews. IMO there is no need to have class Reviewer implements ReviewerInterface
{
private $id;
private $name;
private $email;
private $user;
private $createdAt;
private $updatedAt;
public function getId()
{
return $this->id;
}
public function getName()
{
if ($this->user instanceof UserInterface) {
return $this->user->getFullname();
}
return $this->name;
}
public function getEmail()
{
if ($this->user instanceof UserInterface) {
return $this->user->getEmail();
}
return $this->email;
}
} |
|
@stloyd Sounds good but it couples ReviewBundle & CoreBundle... |
There was a problem hiding this comment.
We should be consistant and use integers.
|
@pjedrzejewski This can be done in few ways, and I'm sure that at least one can do this stuff without coupling those two bundles together =) |
There was a problem hiding this comment.
be consistent and leave space after ;
|
Thanks for all the feedback guys. Going to take another run at this tonight. |
|
@Richtermeister I'll submit a PR with Behat features to your repo. |
|
its available in sylius now??? |
|
Closing in favor of #611. |
|
@aniltc Sorry, I still have a bunch of stuff to clean up and change the way the reviewer is handled.. Will work on it this week. |
|
is it available in sylius? |
|
@aniltc not yet |
Hi all,
as promised here: #426 this is an early draft of a review bundle.
Translations, tests and query filtering are still missing, but I wanted to get some feedback before I go the extra mile, in case this is not interesting for Sylius.
Thanks.