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 Catalog completeness #25

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

dimensi0n
Copy link

Add catalog completeness through UI notifications on the dashboard.
(SendMail command is not finished)

* 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;
Copy link
Member

Choose a reason for hiding this comment

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

Useless

Copy link
Author

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']]);
Copy link
Member

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?

Copy link
Author

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 %}
Copy link
Member

Choose a reason for hiding this comment

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

Might be constants

Copy link
Member

Choose a reason for hiding this comment

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

And 4 spaces indent

Copy link
Author

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);
Copy link
Member

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.

Copy link
Author

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

Manager/ProductInsightManager.php Outdated Show resolved Hide resolved
Manager/ProductInsightManager.php Outdated Show resolved Hide resolved
Use PSR-2 condition style
Fix two space indentation by replacing with a four space indentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants