From 7000abc7e0779ba47a6b8a8eed8d4fe7d613656b Mon Sep 17 00:00:00 2001 From: Quentin Bellanger Date: Thu, 18 Jul 2024 12:20:40 +0200 Subject: [PATCH] display test environments in statement (edit and index) and context pages --- .../src/audits/audit.service.ts | 20 +--- .../src/audits/dto/audit-report.dto.ts | 7 +- .../audit/AuditEnvironmentCheckbox.vue | 2 +- .../TestEnvironmentSelection.vue | 8 +- .../TestEnvironmentSelection/combinations.ts | 79 +++---------- confiture-web-app/src/enums.ts | 4 +- confiture-web-app/src/pages/StatementPage.vue | 70 +++-------- .../src/pages/audit/AuditDeclarationPage.vue | 10 +- .../src/pages/report/ContextPage.vue | 110 ++++-------------- confiture-web-app/src/types/report.ts | 7 +- confiture-web-app/src/types/types.ts | 3 - 11 files changed, 78 insertions(+), 242 deletions(-) diff --git a/confiture-rest-api/src/audits/audit.service.ts b/confiture-rest-api/src/audits/audit.service.ts index 8f370480..a95c8c10 100644 --- a/confiture-rest-api/src/audits/audit.service.ts +++ b/confiture-rest-api/src/audits/audit.service.ts @@ -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) => ({ diff --git a/confiture-rest-api/src/audits/dto/audit-report.dto.ts b/confiture-rest-api/src/audits/dto/audit-report.dto.ts index a7804131..7e70d9a9 100644 --- a/confiture-rest-api/src/audits/dto/audit-report.dto.ts +++ b/confiture-rest-api/src/audits/dto/audit-report.dto.ts @@ -127,8 +127,7 @@ class ReportContext { tools: string[]; - desktopEnvironments: Environment[]; - mobileEnvironments: Environment[]; + environments: Environment[]; } class PageSample { @@ -140,6 +139,10 @@ class PageSample { } class Environment { + /** + * @example "Mobile" + */ + platform: string; /** * @example "Windows" */ diff --git a/confiture-web-app/src/components/audit/AuditEnvironmentCheckbox.vue b/confiture-web-app/src/components/audit/AuditEnvironmentCheckbox.vue index 287eae41..3372db75 100644 --- a/confiture-web-app/src/components/audit/AuditEnvironmentCheckbox.vue +++ b/confiture-web-app/src/components/audit/AuditEnvironmentCheckbox.vue @@ -66,7 +66,7 @@ function onInput() { Couples navigateur et technologie d’assistance sur {{ - platform === Platform.DESKTOP ? "ordinateur" : "mobile" + platform }} diff --git a/confiture-web-app/src/components/audit/TestEnvironmentSelection/TestEnvironmentSelection.vue b/confiture-web-app/src/components/audit/TestEnvironmentSelection/TestEnvironmentSelection.vue index 9295f130..a469dad2 100644 --- a/confiture-web-app/src/components/audit/TestEnvironmentSelection/TestEnvironmentSelection.vue +++ b/confiture-web-app/src/components/audit/TestEnvironmentSelection/TestEnvironmentSelection.vue @@ -223,7 +223,7 @@ function combineEnvironments( label="Appareil" hint="Exemples : mobile, borne interactive" type="text" - required + :required="customEnvironments.length > 1" /> diff --git a/confiture-web-app/src/components/audit/TestEnvironmentSelection/combinations.ts b/confiture-web-app/src/components/audit/TestEnvironmentSelection/combinations.ts index 51883941..43f25c79 100644 --- a/confiture-web-app/src/components/audit/TestEnvironmentSelection/combinations.ts +++ b/confiture-web-app/src/components/audit/TestEnvironmentSelection/combinations.ts @@ -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 } ] }, @@ -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 } ] }, @@ -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 } ] } @@ -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 } ] }, @@ -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, @@ -150,12 +117,7 @@ export function getDesktopCombinations( environments: Omit[] ): string[] { const candidateEnvs = environments.filter((env) => { - return ( - env.platform === Platform.DESKTOP && - !env.assistiveTechnologyVersion && - !env.operatingSystemVersion && - !env.browserVersion - ); + return env.platform === Platform.DESKTOP; }); return desktopCombinations @@ -174,12 +136,7 @@ export function getMobileCombinations( environments: Omit[] ): string[] { const candidateEnvs = environments.filter((env) => { - return ( - env.platform === Platform.MOBILE && - !env.assistiveTechnologyVersion && - !env.operatingSystemVersion && - !env.browserVersion - ); + return env.platform === Platform.MOBILE; }); return mobileCombinations @@ -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)) diff --git a/confiture-web-app/src/enums.ts b/confiture-web-app/src/enums.ts index 0f11efaa..9a3d856c 100644 --- a/confiture-web-app/src/enums.ts +++ b/confiture-web-app/src/enums.ts @@ -1,6 +1,6 @@ export enum Platform { - DESKTOP = "desktop", - MOBILE = "mobile" + DESKTOP = "Ordinateur", + MOBILE = "Mobile" } export enum OperatingSystem { diff --git a/confiture-web-app/src/pages/StatementPage.vue b/confiture-web-app/src/pages/StatementPage.vue index 03931cca..5c5e082c 100644 --- a/confiture-web-app/src/pages/StatementPage.vue +++ b/confiture-web-app/src/pages/StatementPage.vue @@ -301,60 +301,28 @@ const siteUrl = computed(() => { -
Environnement de test
-

- 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 : -

-
    - +
    Pages du site ayant fait l’objet de la vérification de conformité
    diff --git a/confiture-web-app/src/pages/audit/AuditDeclarationPage.vue b/confiture-web-app/src/pages/audit/AuditDeclarationPage.vue index 181e1aaf..2b26b9c1 100644 --- a/confiture-web-app/src/pages/audit/AuditDeclarationPage.vue +++ b/confiture-web-app/src/pages/audit/AuditDeclarationPage.vue @@ -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 } ]; diff --git a/confiture-web-app/src/pages/report/ContextPage.vue b/confiture-web-app/src/pages/report/ContextPage.vue index 2fab511a..611c8639 100644 --- a/confiture-web-app/src/pages/report/ContextPage.vue +++ b/confiture-web-app/src/pages/report/ContextPage.vue @@ -237,93 +237,29 @@ useWrappedFetch(() => report.fetchReport(uniqueId)); conformément aux environnements de test suivants :

    - - - +
    + + + + + + + + + + + + + + + + + + +
    + Environnements de test +
    AppareilTechnologie d’assistanceNavigateurSystème d’exploitation
    {{ env.platform }}{{ env.assistiveTechnology }}{{ env.browser }}{{ env.operatingSystem }}
    +