-
Notifications
You must be signed in to change notification settings - Fork 3
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 Catalog completeness #25
base: master
Are you sure you want to change the base?
Conversation
* Add Bootstrap Progress Bar Import * Add Progress Bar and Quality Icon
* Add french translation * Add english translation
* Add $completeness to Product Entity * Add $completeness_quality to Product Entity
* Create product insight entity * Create insights field in Product Entity
This command updates all the actual Products and create the insights when completeness is not full. This also add completeness bar.
Add quality check for description
* Add hasProductInsights
* Create ProductInsightManager * Add progress bar
* Update FillCompletenessCommand * Update Relatoins between Product & Insights * Add Design to the edit page
} | ||
|
||
$product->setCompleteness($completeness); | ||
$completeness = 8; |
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.
Useless
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.
I'll fix this
$ids = $productManager->findAllId(); | ||
$completeness = 8; | ||
foreach ($ids as $id) { | ||
$product = $productManager->findOneBy(["id" => $id[0]['id']]); |
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.
Don't repeat yourself: this code seems to be duplicated from createProductInsights()
.
Why don't you call this method?
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.
Good idea I'll fix it too
<div class="alert alert-warning row" role="alert"> | ||
<div class="col-md-6"> | ||
{% for insight in insights %} | ||
{% if insight.getCode() == 4 %} |
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.
Might be constants
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.
And 4 spaces indent
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.
Ok
$product = $productManager->createForProducer($producer); | ||
|
||
$form = $this->getForm($product); | ||
if ($request->isMethod('POST')) { | ||
$form->handleRequest($request); | ||
if ($form->isValid()) { | ||
$productInsightsManager->createProductInsight($product); |
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.
I would be smarter to use Doctrine Events to add this behavior.
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.
I'll take a look at it
Use PSR-2 condition style
Fix two space indentation by replacing with a four space indentation
Add catalog completeness through UI notifications on the dashboard.
(SendMail command is not finished)