Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -3727,12 +3727,6 @@
'count' => 1,
'path' => __DIR__ . '/sources/AppBundle/Controller/Website/CompanyPublicProfile/ListAction.php',
];
$ignoreErrors[] = [
'message' => '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#',
'identifier' => 'foreach.nonIterable',
'count' => 1,
'path' => __DIR__ . '/sources/AppBundle/Controller/Website/Global/HtmlSitemapAction.php',
];
$ignoreErrors[] = [
'message' => '#^Cannot call method getCompanyName\\(\\) on mixed\\.$#',
'identifier' => 'method.nonObject',
Expand Down Expand Up @@ -3769,12 +3763,6 @@
'count' => 1,
'path' => __DIR__ . '/sources/AppBundle/Controller/Website/Global/HtmlSitemapAction.php',
];
$ignoreErrors[] = [
'message' => '#^Method AppBundle\\\\Controller\\\\Website\\\\Global\\\\HtmlSitemapAction\\:\\:talks\\(\\) return type has no value type specified in iterable type array\\.$#',
'identifier' => 'missingType.iterableValue',
'count' => 1,
'path' => __DIR__ . '/sources/AppBundle/Controller/Website/Global/HtmlSitemapAction.php',
];
$ignoreErrors[] = [
'message' => '#^Cannot access offset \'careers_page_url\' on mixed\\.$#',
'identifier' => 'offsetAccess.nonOffsetAccessible',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Afup\Site\Corporate\Feuille;
use AppBundle\Association\Model\Repository\CompanyMemberRepository;
use AppBundle\Event\Model\Repository\TalkRepository;
use AppBundle\Event\Model\Talk;
use AppBundle\Event\Talk\EventTalksSummary;
use AppBundle\Site\Entity\Repository\ArticleRepository;
use AppBundle\Site\Entity\Repository\FeuilleRepository;
use AppBundle\Twig\ViewRenderer;
Expand All @@ -31,7 +31,7 @@ public function __invoke(): Response
'association' => $this->buildPages(Feuille::ID_FEUILLE_ANTENNES),
'members' => $this->members(),
'news' => $this->news(),
'talks' => $this->talks(),
'summaries_by_year' => EventTalksSummary::groupByYear($this->talkRepository->getEventTalksSummaries()),
]);
}

Expand Down Expand Up @@ -89,25 +89,4 @@ private function news(): array

return $news;
}

private function talks(): array
{
$talks = [];
$talkList = $this->talkRepository->getAllPastTalks(new \DateTime()->setTime(29, 59, 59));

/** @var Talk $talk */
foreach ($talkList as $talk) {
$url = $this->generateUrl(
'talks_show',
['id' => $talk->getId(), 'slug' => $talk->getSlug()],
);

$talks[] = [
'name' => $talk->getTitle(),
'url' => $url,
];
}

return $talks;
}
}
10 changes: 8 additions & 2 deletions templates/site/sitemap.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,15 @@
<section id="conferences">
<twig:SectionTitle>
<a href="{{ path('talks_list') }}">Historique des conférences</a>
<span>({{ talks|length }})</span>
</twig:SectionTitle>
{{ _self.list(talks, true) }}
{# Les talks ne sont plus listés un par un (plus d'un millier de liens) : chaque édition
mène à sa page, qui liste ses talks, et les index donnent les autres entrées. #}
{{ _self.list([
{ name: 'Tous les talks et vidéos', url: path('talks_list') },
{ name: 'Tous les événements', url: path('talks_events') },
{ name: 'Tous les speakers', url: path('talks_speakers') },
]) }}
{% include 'site/talks/_events_by_year.html.twig' with { heading_level: 3 } %}
</section>

</div>
Expand Down
25 changes: 25 additions & 0 deletions tests/behat/features/PublicSite/Sitemaps.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,28 @@ Feature: Site Public - Sitemaps
Given I am on "/sitemap.default.xml"
And the response should contain "<loc>https://apachephptest:80/</loc>"
And the response should not contain "<loc>https://apachephptest:80/home</loc>"

@reloadDbWithTestData
Scenario: Le plan du site liste les pages événement et les index, pas les talks un par un
Given I am on "/plan-du-site"
Then the response status code should be 200
And the texts of "section#conferences a[href^='/talks/']" should be, in this order:
"""
Historique des conférences
Tous les talks et vidéos
Tous les événements
Tous les speakers
forum
Un évènement du passé
"""
And the response should contain "href=\"/talks/evenements/forum\""
And the response should contain "href=\"/talks/evenements/passed\""
And the response should contain "href=\"/talks/evenements/\""
And the response should contain "href=\"/talks/speakers/\""
And the response should not contain "href=\"/talks/1-jouons-tous-ensemble-a-un-petit-jeu\""
And I should see "2020" in the "section#conferences section#evenements-2020 h3" element
And I should see "Le site" in the "section#pages h2" element
And I should see "Adhérer à l'AFUP" in the "section#adherer h2" element
And I should see "Association" in the "section#association h2" element
And the response should contain "href=\"/profile/company/1-mycorp\""
And the response should contain "href=\"/news/1-les-videos-du-forum-2018-en-ligne\""
Loading