Skip to content

Commit

Permalink
Ordonne les pages dans la déclaration et le contexte et supprime la p…
Browse files Browse the repository at this point in the history
…age transverse (#819)

* sort returned pages sample by order and remove transverse

* fix pages sorting from backend

* lint stuff

* update changelog
  • Loading branch information
bellangerq authored Nov 6, 2024
1 parent e80fa64 commit aeb07aa
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Tous les changements notables de Ara sont documentés ici avec leur date, leur catégorie (nouvelle fonctionnalité, correction de bug ou autre changement) et leur pull request (PR) associée.

## 06/11/2024

### Corrections 🐛

- Ordonne correctement les pages dans la déclaration d’accessibilité et le contexte de l’audit ([#819](https://github.com/DISIC/Ara/pull/819))

## 31/10/2024

- Corrige un bug rendant impossible la duplication d'un audit contenant des images d'exemple pour des critères transverses ([#836](https://github.com/DISIC/Ara/pull/836))
Expand Down
11 changes: 6 additions & 5 deletions confiture-rest-api/src/audits/audit.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "@prisma/client";
import { nanoid } from "nanoid";
import sharp from "sharp";
import { omit, pick, setWith, uniqBy } from "lodash";
import { omit, pick, setWith, sortBy, uniqBy } from "lodash";

import { PrismaService } from "../prisma.service";
import * as RGAA from "../rgaa.json";
Expand Down Expand Up @@ -924,15 +924,16 @@ export class AuditService {
browser: e.browser
})),
referencial: "RGAA Version 4.1",
samples: [audit.transverseElementsPage, ...audit.pages]
.map((p, i) => ({
samples: sortBy(
[audit.transverseElementsPage, ...audit.pages].map((p, i) => ({
name: p.name,
order: p.order,
number: i + 1,
url: p.url,
id: p.id
}))
.sort((p) => p.order),
})),
"order"
),
tools: audit.tools,
technologies: audit.technologies
},
Expand Down
5 changes: 4 additions & 1 deletion confiture-web-app/src/pages/StatementPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,10 @@ const siteUrl = computed(() => {
Pages du site ayant fait l’objet de la vérification de conformité
</h5>
<ul class="fr-mb-9v fr-mb-md-6w">
<li v-for="page in report.data.context.samples" :key="page.name">
<li
v-for="page in report.data.context.samples.slice(1)"
:key="page.name"
>
{{ page.name }} <strong class="page-url">{{ page.url }}</strong>
</li>
</ul>
Expand Down
3 changes: 2 additions & 1 deletion confiture-web-app/src/pages/report/ContextPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ useWrappedFetch(() => report.fetchReport(uniqueId));

<p>
L’audit a porté sur un échantillon de
<strong>{{ report.data.context.samples.length - 1 }} pages</strong> :
<strong>{{ report.data.context.samples.slice(1).length }} pages</strong>
:
</p>

<div class="fr-table fr-table--no-caption">
Expand Down

0 comments on commit aeb07aa

Please sign in to comment.