Skip to content

Commit

Permalink
display test environments in statement (edit and index) and context p…
Browse files Browse the repository at this point in the history
…ages
  • Loading branch information
bellangerq committed Jul 18, 2024
1 parent a354de1 commit 7000abc
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 242 deletions.
20 changes: 6 additions & 14 deletions confiture-rest-api/src/audits/audit.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -871,20 +871,12 @@ export class AuditService {
auditorName: audit.auditorName,
auditorEmail: null,
auditorOrganisation: audit.auditorOrganisation,
desktopEnvironments: audit.environments
.filter((e) => e.platform === "desktop")
.map((e) => ({
operatingSystem: e.operatingSystem,
assistiveTechnology: e.assistiveTechnology,
browser: e.browser
})),
mobileEnvironments: audit.environments
.filter((e) => e.platform === "mobile")
.map((e) => ({
operatingSystem: e.operatingSystem,
assistiveTechnology: e.assistiveTechnology,
browser: e.browser
})),
environments: audit.environments.map((e) => ({
platform: e.platform,
operatingSystem: e.operatingSystem,
assistiveTechnology: e.assistiveTechnology,
browser: e.browser
})),
referencial: "RGAA Version 4.1",
samples: audit.pages
.map((p, i) => ({
Expand Down
7 changes: 5 additions & 2 deletions confiture-rest-api/src/audits/dto/audit-report.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ class ReportContext {

tools: string[];

desktopEnvironments: Environment[];
mobileEnvironments: Environment[];
environments: Environment[];
}

class PageSample {
Expand All @@ -140,6 +139,10 @@ class PageSample {
}

class Environment {
/**
* @example "Mobile"
*/
platform: string;
/**
* @example "Windows"
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function onInput() {
<caption>
Couples navigateur et technologie d’assistance sur
{{
platform === Platform.DESKTOP ? "ordinateur" : "mobile"
platform
}}
</caption>
<thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function combineEnvironments(
label="Appareil"
hint="Exemples : mobile, borne interactive"
type="text"
required
:required="customEnvironments.length > 1"
/>

<DsfrField
Expand All @@ -232,7 +232,7 @@ function combineEnvironments(
label="Logiciel d’exploitation"
hint="Exemple : macOS"
type="text"
required
:required="customEnvironments.length > 1"
/>

<DsfrField
Expand All @@ -241,7 +241,7 @@ function combineEnvironments(
label="Technologie d’assistance"
hint="Exemple : VoiceOver"
type="text"
required
:required="customEnvironments.length > 1"
/>

<DsfrField
Expand All @@ -250,7 +250,7 @@ function combineEnvironments(
label="Navigateur"
hint="Exemple : Safari"
type="text"
required
:required="customEnvironments.length > 1"
/>
</fieldset>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,18 @@ export const desktopCombinations = [
environments: [
{
operatingSystem: OperatingSystem.WINDOWS,
operatingSystemVersion: "",
browser: Browsers.FIREFOX,
browserVersion: "",
assistiveTechnology: AssistiveTechnology.NVDA,
assistiveTechnologyVersion: ""
assistiveTechnology: AssistiveTechnology.NVDA
},
{
operatingSystem: OperatingSystem.WINDOWS,
operatingSystemVersion: "",
browser: Browsers.FIREFOX,
browserVersion: "",
assistiveTechnology: AssistiveTechnology.JAWS,
assistiveTechnologyVersion: ""
assistiveTechnology: AssistiveTechnology.JAWS
},
{
operatingSystem: OperatingSystem.MAC_OS,
operatingSystemVersion: "",
browser: Browsers.SAFARI,
browserVersion: "",
assistiveTechnology: AssistiveTechnology.VOICE_OVER,
assistiveTechnologyVersion: ""
assistiveTechnology: AssistiveTechnology.VOICE_OVER
}
]
},
Expand All @@ -44,27 +35,18 @@ export const desktopCombinations = [
environments: [
{
operatingSystem: OperatingSystem.WINDOWS,
operatingSystemVersion: "",
browser: Browsers.FIREFOX,
browserVersion: "",
assistiveTechnology: AssistiveTechnology.NVDA,
assistiveTechnologyVersion: ""
assistiveTechnology: AssistiveTechnology.NVDA
},
{
operatingSystem: OperatingSystem.WINDOWS,
operatingSystemVersion: "",
browser: Browsers.EDGE,
browserVersion: "",
assistiveTechnology: AssistiveTechnology.JAWS,
assistiveTechnologyVersion: ""
assistiveTechnology: AssistiveTechnology.JAWS
},
{
operatingSystem: OperatingSystem.MAC_OS,
operatingSystemVersion: "",
browser: Browsers.SAFARI,
browserVersion: "",
assistiveTechnology: AssistiveTechnology.VOICE_OVER,
assistiveTechnologyVersion: ""
assistiveTechnology: AssistiveTechnology.VOICE_OVER
}
]
},
Expand All @@ -73,27 +55,18 @@ export const desktopCombinations = [
environments: [
{
operatingSystem: OperatingSystem.WINDOWS,
operatingSystemVersion: "",
browser: Browsers.EDGE,
browserVersion: "",
assistiveTechnology: AssistiveTechnology.NVDA,
assistiveTechnologyVersion: ""
assistiveTechnology: AssistiveTechnology.NVDA
},
{
operatingSystem: OperatingSystem.WINDOWS,
operatingSystemVersion: "",
browser: Browsers.FIREFOX,
browserVersion: "",
assistiveTechnology: AssistiveTechnology.JAWS,
assistiveTechnologyVersion: ""
assistiveTechnology: AssistiveTechnology.JAWS
},
{
operatingSystem: OperatingSystem.MAC_OS,
operatingSystemVersion: "",
browser: Browsers.SAFARI,
browserVersion: "",
assistiveTechnology: AssistiveTechnology.VOICE_OVER,
assistiveTechnologyVersion: ""
assistiveTechnology: AssistiveTechnology.VOICE_OVER
}
]
}
Expand All @@ -106,11 +79,8 @@ export const mobileCombinations = [
environments: [
{
operatingSystem: OperatingSystem.I_OS,
operatingSystemVersion: "",
browser: Browsers.SAFARI,
browserVersion: "",
assistiveTechnology: AssistiveTechnology.VOICE_OVER,
assistiveTechnologyVersion: ""
assistiveTechnology: AssistiveTechnology.VOICE_OVER
}
]
},
Expand All @@ -119,18 +89,15 @@ export const mobileCombinations = [
environments: [
{
operatingSystem: OperatingSystem.ANDROID,
operatingSystemVersion: "",
browser: Browsers.CHROME,
browserVersion: "",
assistiveTechnology: AssistiveTechnology.TALKBACK,
assistiveTechnologyVersion: ""
assistiveTechnology: AssistiveTechnology.TALKBACK
}
]
}
];

/**
* @returns true if same environment (ignoring version fields)
* @returns true if same environment
*/
function compareEnvironments(
a: Partial<AuditEnvironment>,
Expand All @@ -150,12 +117,7 @@ export function getDesktopCombinations(
environments: Omit<AuditEnvironment, "id">[]
): string[] {
const candidateEnvs = environments.filter((env) => {
return (
env.platform === Platform.DESKTOP &&
!env.assistiveTechnologyVersion &&
!env.operatingSystemVersion &&
!env.browserVersion
);
return env.platform === Platform.DESKTOP;
});

return desktopCombinations
Expand All @@ -174,12 +136,7 @@ export function getMobileCombinations(
environments: Omit<AuditEnvironment, "id">[]
): string[] {
const candidateEnvs = environments.filter((env) => {
return (
env.platform === Platform.MOBILE &&
!env.assistiveTechnologyVersion &&
!env.operatingSystemVersion &&
!env.browserVersion
);
return env.platform === Platform.MOBILE;
});

return mobileCombinations
Expand Down Expand Up @@ -210,14 +167,6 @@ export function getCustomEnvironments(
.filter(Boolean);

return environments.filter((env) => {
if (
env.assistiveTechnologyVersion ||
env.operatingSystemVersion ||
env.browserVersion
) {
return true;
}

return !(
d.some((desktopEnv) => compareEnvironments(desktopEnv!, env)) ||
m.some((mobileEnv) => compareEnvironments(mobileEnv!, env))
Expand Down
4 changes: 2 additions & 2 deletions confiture-web-app/src/enums.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export enum Platform {
DESKTOP = "desktop",
MOBILE = "mobile"
DESKTOP = "Ordinateur",
MOBILE = "Mobile"
}

export enum OperatingSystem {
Expand Down
70 changes: 19 additions & 51 deletions confiture-web-app/src/pages/StatementPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -301,60 +301,28 @@ const siteUrl = computed(() => {
</li>
</ul>

<h5 class="fr-h3">Environnement de test</h5>
<p>
Les vérifications de restitution de contenus ont été réalisées sur
la base de la combinaison fournie par la base de référence du RGAA,
avec les versions suivantes :
</p>
<ul class="fr-mb-2w fr-mb-md-3w">
<template v-if="report.data.context.desktopEnvironments.length">
<li
v-for="(env, i) in report.data.context.desktopEnvironments"
:key="i"
>
Sur ordinateur {{ env.operatingSystem }}
<template v-if="env.operatingSystemVersion">{{
env.operatingSystemVersion
}}</template>
avec {{ env.browser }}
<template v-if="env.browserVersion">{{
env.browserVersion
}}</template>
et
<template v-if="report.data.context.environments">
<h5 class="fr-h3">Environnement de test</h5>
<p>
Les vérifications de restitution de contenus ont été réalisées sur
la base de la combinaison fournie par la base de référence du
RGAA, avec les versions suivantes :
</p>
<ul class="fr-mb-2w fr-mb-md-3w">
<li v-for="(env, i) in report.data.context.environments" :key="i">
Sur {{ env.platform }} {{ env.operatingSystem }} avec
{{ env.browser }} et
{{ env.assistiveTechnology }}
<template v-if="env.assistiveTechnologyVersion">{{
env.assistiveTechnologyVersion
}}</template>
</li>
</template>
<template v-if="report.data.context.mobileEnvironments.length">
<li
v-for="(env, i) in report.data.context.mobileEnvironments"
:key="i"
>
Sur mobile {{ env.operatingSystem }}
<template v-if="env.operatingSystemVersion">{{
env.operatingSystemVersion
}}</template>
avec {{ env.browser }}
<template v-if="env.browserVersion">{{
env.browserVersion
}}</template>
et
{{ env.assistiveTechnology }}
<template v-if="env.assistiveTechnologyVersion">{{
env.assistiveTechnologyVersion
}}</template>
</ul>
<h5 class="fr-h3">Outils pour évaluer l’accessibilité</h5>
<ul class="fr-mb-2w fr-mb-md-3w">
<li v-for="tool in report.data.context.tools" :key="tool">
{{ tool }}
</li>
</template>
</ul>
<h5 class="fr-h3">Outils pour évaluer l’accessibilité</h5>
<ul class="fr-mb-2w fr-mb-md-3w">
<li v-for="tool in report.data.context.tools" :key="tool">
{{ tool }}
</li>
</ul>
</ul>
</template>

<h5 class="fr-h3">
Pages du site ayant fait l’objet de la vérification de conformité
</h5>
Expand Down
10 changes: 2 additions & 8 deletions confiture-web-app/src/pages/audit/AuditDeclarationPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,14 @@ function DEBUG_fillFields() {
{
platform: Platform.DESKTOP,
operatingSystem: OperatingSystem.WINDOWS,
operatingSystemVersion: "11",
assistiveTechnology: AssistiveTechnology.NVDA,
assistiveTechnologyVersion: "",
browser: Browsers.FIREFOX,
browserVersion: "104"
browser: Browsers.FIREFOX
},
{
platform: Platform.DESKTOP,
operatingSystem: OperatingSystem.MAC_OS,
operatingSystemVersion: "12.5",
assistiveTechnology: AssistiveTechnology.VOICE_OVER,
assistiveTechnologyVersion: "",
browser: Browsers.SAFARI,
browserVersion: "15.6"
browser: Browsers.SAFARI
}
];
Expand Down
Loading

0 comments on commit 7000abc

Please sign in to comment.