-
Notifications
You must be signed in to change notification settings - Fork 70
refacto: migration de l'administration des articles sous Symfony #1893
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
base: master
Are you sure you want to change the base?
Conversation
9203f65
to
767d4a9
Compare
@@ -38,3 +38,9 @@ | |||
</div> | |||
{%- endif -%} | |||
{%- endblock datetime_widget -%} | |||
|
|||
{%- block textarea_widget -%} |
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.
Il est peut être plus judicieux d'utiliser la macro wysiwyg()
présente dans templates/admin/event/form.html.twig, quite à la déplacer dans le form_theme_admin.html.twig.
Qu'en pensez-vous ?
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.
Si ça rend le code plus clair pourquoi pas.
Attention par contre à si ça modifie beaucoup de fichiers, ce sera mieux de faire ça dans une PR séparée.
'filter' => $article->getTitle(), | ||
]); | ||
} | ||
dump($article); |
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.
👀
if ($form->isSubmitted() && $form->isValid()) { | ||
$this->articleRepository->save($article); | ||
$this->log('Modification de l\'article ' . $article->getTitle()); | ||
$this->addFlash('notice', 'L\'article ' . $article->getTitle() . ' a été modifiée'); |
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.
$this->addFlash('notice', 'L\'article ' . $article->getTitle() . ' a été modifiée'); | |
$this->addFlash('notice', 'L\'article ' . $article->getTitle() . ' a été modifié'); |
private readonly ArticleRepository $articleRepository, | ||
) {} | ||
|
||
public function __invoke(int $id,Request $request): Response |
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.
public function __invoke(int $id,Request $request): Response | |
public function __invoke(int $id, Request $request): Response |
/** | ||
* @var 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.
Tu peux enlever le docblock du coup
/** | ||
* @return int|null | ||
*/ |
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.
Pas besoin de docblock
* | ||
* @return $this | ||
*/ | ||
public function setPosition($position): self |
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.
Autant en profiter pour avoir un type natif (et pareil pour authorId
)
public function setPosition($position): self | |
public function setPosition(?int $position): self |
return $this; | ||
} | ||
|
||
public function useMarkdown(): bool |
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.
Ce serait plus correct comme ça, sinon ça ressemble à un setter.
public function useMarkdown(): bool | |
public function usesMarkdown(): bool |
@@ -239,6 +239,39 @@ public function findNewsBySlug($slug) | |||
return $events->first(); | |||
} | |||
|
|||
public function getAllArticlesWithCategoryAndTheme($ordre = 'titre', $direction = 'desc', string $filtre = '%') |
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.
public function getAllArticlesWithCategoryAndTheme($ordre = 'titre', $direction = 'desc', string $filtre = '%') | |
public function getAllArticlesWithCategoryAndTheme(string $ordre = 'titre', string $direction = 'desc', string $filtre = '%') |
|
||
if ($form->isSubmitted() && $form->isValid()) { | ||
$this->articleRepository->save($article); | ||
$this->log('Ajout de la rubrique ' . $article->getTitle()); |
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.
$this->log('Ajout de la rubrique ' . $article->getTitle()); | |
$this->log('Ajout de l\'article ' . $article->getTitle()); |
9b338cd
to
fa7f862
Compare
fa7f862
to
78ea080
Compare
Migration de l'administration de articles sous Symfony.
La nouvelle url dans le menu est /admin/site/articles
J'ai volontairement laissé les sources legacy. Si la MR est validée, je ferais une seconde MR pour les supprimer.