public function stylizeAction(Request $request, Widget $widget, $viewReference, $quantum = null)
    {
        $view = $this->getViewByReferenceId($viewReference);
        $this->get('victoire_widget_map.builder')->build($view);

        try {
            $widgetView = $widget->getWidgetMap()->getView();
        } catch (WidgetMapNotFoundException $e) {
            return new JsonResponse([
                'success' => false,
                'message' => $e->getMessage(),
            ]);
        }

        if (!$view instanceof \Victoire\Bundle\TemplateBundle\Entity\Template) {
            $widgetViewReference = $this->get('victoire_view_reference.repository')
                ->getOneReferenceByParameters(['viewId' => $view->getId()]);
            $widgetView->setReference($widgetViewReference);
        }

        $this->get('victoire_core.current_view')->setCurrentView($view);

        try {
            $response = $this->get('widget_manager')->editWidgetStyle(
                $request,
                $widget,
                $view,
                $viewReference,
                $quantum
            );

            $this->congrat($this->get('translator')->trans('victoire.success.message', [], 'victoire'));
        } catch (Exception $ex) {
            $response = $this->getJsonReponseFromException($ex);
        }

        return $response;
    }