Skip to content

Commit

Permalink
Permet plus d'option d'environnements de test (#765)
Browse files Browse the repository at this point in the history
* shorten contact fields in declaration page

* adjust derogation block spacing and fields order

* update component to add custom test environments

* remove version fields and migrate database

* display test environments in statement (edit and index) and context pages

* fix env combinations table caption

* update changelog

* fix test environments table in context page
  • Loading branch information
bellangerq authored Jul 24, 2024
1 parent 9b057da commit fc1231d
Show file tree
Hide file tree
Showing 15 changed files with 180 additions and 526 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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");
5 changes: 1 addition & 4 deletions confiture-rest-api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
54 changes: 8 additions & 46 deletions confiture-rest-api/src/audits/audit.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) => ({
Expand Down
22 changes: 5 additions & 17 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 @@ -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 {
Expand Down
21 changes: 0 additions & 21 deletions confiture-rest-api/src/audits/dto/update-audit.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function onInput() {
<caption>
Couples navigateur et technologie d’assistance sur
{{
platform === Platform.DESKTOP ? "ordinateur" : "mobile"
platform
}}
</caption>
<thead>
Expand Down
Loading

0 comments on commit fc1231d

Please sign in to comment.