Skip to content

Commit b5f7af1

Browse files
authored
Déplace le nom de la structure dans la déclaration (#574)
* remove auditor org from first step * add auditor organisation field on statement edit page * display auditor organisation in a11y statement * remove auditor org from create-audit dto * fix typing error * pr feedbacks * update changelog
1 parent 80057da commit b5f7af1

15 files changed

Lines changed: 55 additions & 54 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AlterTable
2+
ALTER TABLE "Audit" ALTER COLUMN "auditorOrganisation" DROP NOT NULL;

confiture-rest-api/prisma/schema.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ model Audit {
5252
auditorName String?
5353
auditorEmail String?
5454
showAuditorEmailInReport Boolean @default(false)
55-
auditorOrganisation String
5655
5756
// A11y declaration edition step
5857
initiator String?
58+
auditorOrganisation String?
5959
procedureUrl String?
6060
contactName String?
6161
contactEmail String?

confiture-rest-api/src/audits/audit-report.dto.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ class ReportContext {
113113
* @example "john-doe@example.com"
114114
*/
115115
auditorEmail: string | null;
116+
/**
117+
* @example "Web Audit Services Corp."
118+
*/
119+
auditorOrganisation: string;
116120

117121
technologies: string[];
118122

confiture-rest-api/src/audits/audit.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export class AuditService {
5858

5959
auditorEmail: data.auditorEmail,
6060
auditorName: data.auditorName,
61-
auditorOrganisation: data.auditorOrganisation,
6261

6362
pages: {
6463
createMany: {
@@ -765,6 +764,7 @@ export class AuditService {
765764
context: {
766765
auditorName: audit.auditorName,
767766
auditorEmail: null,
767+
auditorOrganisation: audit.auditorOrganisation,
768768
desktopEnvironments: audit.environments
769769
.filter((e) => e.platform === 'desktop')
770770
.map((e) => ({

confiture-rest-api/src/audits/create-audit.dto.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,4 @@ export class CreateAuditDto {
6262
@IsEmail()
6363
@IsOptional()
6464
auditorEmail?: string;
65-
66-
/**
67-
* @example "WEB AUDIT SARL"
68-
*/
69-
@IsString()
70-
auditorOrganisation: string;
7165
}

confiture-rest-api/src/audits/update-audit.dto.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ export class UpdateAuditDto extends CreateAuditDto {
8686
@IsOptional()
8787
initiator?: string;
8888

89+
/**
90+
* @example "WEB AUDIT SARL"
91+
*/
92+
@IsString()
93+
@IsOptional()
94+
auditorOrganisation?: string;
95+
8996
/**
9097
* @example "John Referent"
9198
*/

confiture-web-app/src/assets/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
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.
44

5+
## 06/12/2023
6+
7+
### Autres changements ⚙️
8+
9+
- Déplace le champ du nom de la structure qui audite le site dans la page de déclaration ([#574](https://github.com/DISIC/Ara/pull/574))
10+
511
## 01/12/2023
612

713
### Autres changements ⚙️

confiture-web-app/src/components/AuditGeneralInformationsForm.vue

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ const procedureAuditorName = ref(
6161
const procedureAuditorEmail = ref(
6262
props.defaultValues?.auditorEmail ?? accountStore.account?.email ?? ""
6363
);
64-
const procedureAuditorOrganisation = ref(
65-
props.defaultValues?.auditorOrganisation ??
66-
accountStore.account?.orgName ??
67-
""
68-
);
64+
6965
const pageNameFieldRefs = ref<InstanceType<typeof DsfrField>[]>([]);
7066
7167
/**
@@ -102,9 +98,8 @@ function fillFields() {
10298
{ name: "Accueil", url: "https://example.com" },
10399
{ name: "Contact", url: "https://example.com/contact" },
104100
];
105-
procedureAuditorName.value ||= "Etienne Dupont";
106-
procedureAuditorEmail.value ||= "etienne-dupont@example.com";
107-
procedureAuditorOrganisation.value ||= "Example Organisation";
101+
procedureAuditorName.value = "Etienne Dupont";
102+
procedureAuditorEmail.value = "etienne-dupont@example.com";
108103
}
109104
110105
function onSubmit() {
@@ -115,7 +110,6 @@ function onSubmit() {
115110
pages: pages.value.map((p) => ({ ...p, url: p.url.trim() })),
116111
auditorName: procedureAuditorName.value,
117112
auditorEmail: formatEmail(procedureAuditorEmail.value),
118-
auditorOrganisation: procedureAuditorOrganisation.value,
119113
});
120114
}
121115
@@ -233,15 +227,6 @@ const route = useRoute();
233227
hint="Sera affiché dans le rappport de l’audit pour aider le demandeur de l’audit à vous identifier s’il a des questions ou besoin d’aide."
234228
/>
235229

236-
<DsfrField
237-
v-if="!accountStore.account?.orgName"
238-
id="procedure-auditor-organisation"
239-
v-model="procedureAuditorOrganisation"
240-
label="Nom de la structure"
241-
hint="Sera affiché dans la déclaration d’accessibilité, cette mention est une obligation. "
242-
required
243-
/>
244-
245230
<DsfrField
246231
v-if="!accountStore.account"
247232
id="procedure-auditor-email"

confiture-web-app/src/components/ReportA11yStatement.vue

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { ref, computed } from "vue";
2+
import { ref } from "vue";
33
import { useRoute } from "vue-router";
44
55
import { useWrappedFetch } from "../composables/useWrappedFetch";
@@ -28,11 +28,6 @@ function getA11yLevel() {
2828
const statementRef = ref<HTMLDivElement>();
2929
const showCopyAlert = ref(false);
3030
31-
const auditIsInProgress = computed(() => {
32-
// The `initiator` field is requied on the a11y declaration form so we can check that it's not null
33-
return !report.data?.procedureInitiator;
34-
});
35-
3631
async function copyA11yStatementHTML() {
3732
const tagsWithSpacesRegex = /<(?<tagName>\S+)(\s+)>/g; // "<XX >"
3833
const whitespaceFollowedTags = /<(?<tagName>p)>\s{1}/g; // "<p> "
@@ -241,9 +236,9 @@ function hideCopyAlert() {
241236
<h4 class="fr-h2">Résultats des tests</h4>
242237
<p class="fr-mb-9v fr-mb-md-6w">
243238
L’audit de conformité réalisé par
244-
<strong>{{ report.data.procedureInitiator }}</strong> révèle que
245-
<strong>{{ report.data.accessibilityRate }}%</strong> des critères du
246-
RGAA version 4 sont respectés.
239+
<strong>{{ report.data.context.auditorOrganisation }}</strong> révèle
240+
que <strong>{{ report.data.accessibilityRate }}%</strong> des critères
241+
du RGAA version 4 sont respectés.
247242
</p>
248243
<!--ul class="fr-mb-9v fr-mb-md-6w">
249244
<li>

confiture-web-app/src/components/account/settings/Profile.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts" setup>
2-
import { ref, computed, watch } from "vue";
2+
import { ref, computed, watch, onMounted } from "vue";
33
44
import { useAccountStore } from "../../../store/account";
55
import { useNotifications } from "../../../composables/useNotifications";
@@ -11,6 +11,11 @@ const notify = useNotifications();
1111
const name = ref("");
1212
const orgName = ref("");
1313
14+
onMounted(() => {
15+
name.value = accountStore.account?.name || "";
16+
orgName.value = accountStore.account?.orgName || "";
17+
});
18+
1419
watch(accountStore, () => {
1520
if (!accountStore.account) {
1621
return;

0 commit comments

Comments
 (0)