diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bf65eb6..06619946 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Tous les changements notables de Ara sont documentés ici avec leur date, leur c ### Autres changements ⚙️ - Ajoute une information pour préciser la nature des contenus dans l’onglet "Points d’améliorations" ([#764](https://github.com/DISIC/Ara/pull/764)) +- Simplifie l’ajout d’environnements de test personnalisés ([#765](https://github.com/DISIC/Ara/pull/765)) ## 11/07/2024 diff --git a/confiture-rest-api/prisma/migrations/20240717150619_remove_environment_version_fields/migration.sql b/confiture-rest-api/prisma/migrations/20240717150619_remove_environment_version_fields/migration.sql new file mode 100644 index 00000000..02483d0f --- /dev/null +++ b/confiture-rest-api/prisma/migrations/20240717150619_remove_environment_version_fields/migration.sql @@ -0,0 +1,47 @@ +/* + Warnings: + + - You are about to drop the column `assistiveTechnologyVersion` on the `TestEnvironment` table. All the data in the column will be lost. + - You are about to drop the column `browserVersion` on the `TestEnvironment` table. All the data in the column will be lost. + - You are about to drop the column `operatingSystemVersion` on the `TestEnvironment` table. All the data in the column will be lost. + - A unique constraint covering the columns `[platform,operatingSystem,assistiveTechnology,browser,auditUniqueId]` on the table `TestEnvironment` will be added. If there are existing duplicate values, this will fail. + +*/ + +-- DropIndex +DROP INDEX "TestEnvironment_platform_operatingSystem_operatingSystemVer_key"; + +/* + Merge: + - "operatingSystem" and "operatingSystemVersion" + - "browser" and "browserVersion" + - "assistiveTechnology" and "assistiveTechnologyVersion" +*/ +UPDATE + "TestEnvironment" +SET + "operatingSystem" = + CASE + WHEN "operatingSystemVersion" IS NOT NULL + THEN "operatingSystem" || ' ' || "operatingSystemVersion" + END, + + "browser" = + CASE + WHEN "browserVersion" IS NOT NULL + THEN "browser" || ' ' || "browserVersion" + END, + + "assistiveTechnology" = + CASE + WHEN "assistiveTechnologyVersion" IS NOT NULL + THEN "assistiveTechnology" || ' ' || "assistiveTechnologyVersion" + END; + +-- AlterTable +ALTER TABLE "TestEnvironment" DROP COLUMN "assistiveTechnologyVersion", +DROP COLUMN "browserVersion", +DROP COLUMN "operatingSystemVersion"; + +-- CreateIndex +CREATE UNIQUE INDEX "TestEnvironment_platform_operatingSystem_assistiveTechnolog_key" ON "TestEnvironment"("platform", "operatingSystem", "assistiveTechnology", "browser", "auditUniqueId"); diff --git a/confiture-rest-api/prisma/schema.prisma b/confiture-rest-api/prisma/schema.prisma index 0f0041d5..7edb012f 100644 --- a/confiture-rest-api/prisma/schema.prisma +++ b/confiture-rest-api/prisma/schema.prisma @@ -96,16 +96,13 @@ model TestEnvironment { id Int @id @default(autoincrement()) platform String operatingSystem String - operatingSystemVersion String? assistiveTechnology String - assistiveTechnologyVersion String? browser String - browserVersion String? audit Audit? @relation(fields: [auditUniqueId], references: [editUniqueId], onDelete: Cascade) auditUniqueId String? - @@unique([platform, operatingSystem, operatingSystemVersion, assistiveTechnology, assistiveTechnologyVersion, browser, browserVersion, auditUniqueId]) + @@unique([platform, operatingSystem, assistiveTechnology, browser, auditUniqueId]) } model AuditedPage { diff --git a/confiture-rest-api/src/audits/audit.service.ts b/confiture-rest-api/src/audits/audit.service.ts index 7a200192..a95c8c10 100644 --- a/confiture-rest-api/src/audits/audit.service.ts +++ b/confiture-rest-api/src/audits/audit.service.ts @@ -248,51 +248,27 @@ export class AuditService { notIn: data.environments.map((e) => e.operatingSystem) } }, - { - operatingSystemVersion: { - notIn: data.environments.map( - (e) => e.operatingSystemVersion - ) - } - }, { assistiveTechnology: { notIn: data.environments.map((e) => e.assistiveTechnology) } }, - { - assistiveTechnologyVersion: { - notIn: data.environments.map( - (e) => e.assistiveTechnologyVersion - ) - } - }, { browser: { notIn: data.environments.map((e) => e.browser) } - }, - { - browserVersion: { - notIn: data.environments.map((e) => e.browserVersion) - } } ] }, upsert: data.environments.map((environment) => ({ where: { - platform_operatingSystem_operatingSystemVersion_assistiveTechnology_assistiveTechnologyVersion_browser_browserVersion_auditUniqueId: + platform_operatingSystem_assistiveTechnology_browser_auditUniqueId: { auditUniqueId: uniqueId, platform: environment.platform, operatingSystem: environment.operatingSystem, - operatingSystemVersion: - environment.operatingSystemVersion, assistiveTechnology: environment.assistiveTechnology, - assistiveTechnologyVersion: - environment.assistiveTechnologyVersion, - browser: environment.browser, - browserVersion: environment.browserVersion + browser: environment.browser } }, create: environment, @@ -895,26 +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, - operatingSystemVersion: e.operatingSystemVersion, - assistiveTechnology: e.assistiveTechnology, - assistiveTechnologyVersion: e.assistiveTechnologyVersion, - browser: e.browser, - browserVersion: e.browserVersion - })), - mobileEnvironments: audit.environments - .filter((e) => e.platform === "mobile") - .map((e) => ({ - operatingSystem: e.operatingSystem, - operatingSystemVersion: e.operatingSystemVersion, - assistiveTechnology: e.assistiveTechnology, - assistiveTechnologyVersion: e.assistiveTechnologyVersion, - browser: e.browser, - browserVersion: e.browserVersion - })), + 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 9593ddbe..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 { @@ -141,34 +140,23 @@ class PageSample { class Environment { /** - * @example "Windows" + * @example "Mobile" */ - operatingSystem: string; - + platform: string; /** - * @example "11" + * @example "Windows" */ - operatingSystemVersion: string; + operatingSystem: string; /** * @example "JAWS" */ assistiveTechnology: string; - /** - * @example "14.2" - */ - assistiveTechnologyVersion: string; - /** * @example "Firefox" */ browser: string; - - /** - * @example "104" - */ - browserVersion: string; } class ReportCriterionResult { diff --git a/confiture-rest-api/src/audits/dto/update-audit.dto.ts b/confiture-rest-api/src/audits/dto/update-audit.dto.ts index 83295937..e1a45481 100644 --- a/confiture-rest-api/src/audits/dto/update-audit.dto.ts +++ b/confiture-rest-api/src/audits/dto/update-audit.dto.ts @@ -22,38 +22,17 @@ class UpdateAuditEnvironment { @IsString() operatingSystem: string; - /** - * @example "11" - */ - @IsString() - @IsOptional() - operatingSystemVersion?: string; - /** * @example "JAWS" */ @IsString() assistiveTechnology: string; - /** - * @example "14.2" - */ - @IsString() - @IsOptional() - assistiveTechnologyVersion?: string; - /** * @example "Firefox" */ @IsString() browser: string; - - /** - * @example "104" - */ - @IsString() - @IsOptional() - browserVersion?: string; } // class CreateAuditRecipients { diff --git a/confiture-web-app/src/components/audit/AuditEnvironmentCheckbox.vue b/confiture-web-app/src/components/audit/AuditEnvironmentCheckbox.vue index 6a293b8d..6d4f71c1 100644 --- a/confiture-web-app/src/components/audit/AuditEnvironmentCheckbox.vue +++ b/confiture-web-app/src/components/audit/AuditEnvironmentCheckbox.vue @@ -69,7 +69,7 @@ function onInput() {
- 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 : -
-+ 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 : +
+
@@ -362,6 +357,7 @@ const isDevMode = useDevMode();
? 'Vous devez renseigner au moins 1 moyen de contact'
: undefined
"
+ class="narrow-field"
/>
- Ces informations doivent faire l’objet d’une discussion entre l’auditeur - ou l’auditrice et le responsable du site audité. C’est le responsable du - site audité qui accepte de prendre le risque juridique de mentionner des - contenus dérogés. Si aucun contenu n’est à déroger, laissez les deux - champs vides. -
++ Les contenus dérogés doivent faire l’objet d’une discussion entre + l’auditeur et le responsable du site audité. C’est le responsable du site + audité qui accepte de prendre le risque juridique de mentionner des + contenus dérogés. +
+