Skip to content

Commit

Permalink
Détache la déclaration du rapport (#696)
Browse files Browse the repository at this point in the history
* remove statement tab in report + update bold content in header

* add statement page

* fix content max width

* update links to statement

* add button to copy statement link in account dashboard

* fix types

* update report/statement page url and setup redirects

* update changelog
  • Loading branch information
bellangerq authored Apr 17, 2024
1 parent 4240454 commit 1958387
Show file tree
Hide file tree
Showing 12 changed files with 510 additions and 441 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Tous les changements notables de Ara sont documentés ici avec leur date, leur c

## 17/04/2024

### Nouvelles fonctionnalités 🚀

- Détache la déclaration d’accessibilité du rapport d’accessibilité ([#696](https://github.com/DISIC/Ara/pull/696))

### Corrections 🐛

- Corrige le problème d’ordre des pages sur le rapport ([#692](https://github.com/DISIC/Ara/pull/692))
Expand Down
6 changes: 5 additions & 1 deletion confiture-rest-api/src/audits/audit.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,7 @@ export class AuditService {
auditType: true,
editUniqueId: true,
consultUniqueId: true,
initiator: true,
pages: {
select: {
results: true
Expand Down Expand Up @@ -1196,6 +1197,8 @@ export class AuditService {
);
}

const statementIsPublished = !!a.initiator;

return {
...pick(
a,
Expand All @@ -1207,7 +1210,8 @@ export class AuditService {
),
complianceLevel,
status: progress < 1 ? "IN_PROGRESS" : "COMPLETED",
estimatedCsvSize: 502 + a.pages.length * 318
estimatedCsvSize: 502 + a.pages.length * 318,
statementIsPublished
};
});
}
Expand Down
21 changes: 21 additions & 0 deletions confiture-web-app/src/components/account/dashboard/AuditRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@ function copyReportLink(uniqueId: string) {
);
});
}
function copyStatementLink(uniqueId: string) {
const url = `${window.location.origin}/declaration/${uniqueId}`;
navigator.clipboard.writeText(url).then(() => {
notify(
"success",
undefined,
`Le lien vers la déclaration d’accessibilité a bien été copié dans le presse-papier.`
);
});
}
</script>

<template>
Expand Down Expand Up @@ -327,6 +339,15 @@ function copyReportLink(uniqueId: string) {
</button>
</li>

<li v-if="audit.statementIsPublished" class="dropdown-item">
<button
class="fr-btn fr-btn--tertiary-no-outline fr-btn--icon-left fr-icon-link fr-m-0"
@click="copyStatementLink(audit.consultUniqueId)"
>
Copier le lien de la déclaration
</button>
</li>

<li aria-hidden="true" class="dropdown-separator"></li>

<li class="dropdown-item dropdown-item--with-meta">
Expand Down
10 changes: 4 additions & 6 deletions confiture-web-app/src/components/overview/StatementStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@ const auditIsPublishable = computed(() => {
:to="
auditIsPublishable
? {
name: 'report',
name: 'a11y-statement',
params: {
uniqueId: audit.consultUniqueId,
tab: 'declaration-daccessibilite'
uniqueId: audit.consultUniqueId
}
}
: {
Expand Down Expand Up @@ -115,10 +114,9 @@ const auditIsPublishable = computed(() => {
<CopyBlock
class="fr-m-0 statement-step-copy-block"
:to="{
name: 'report',
name: 'a11y-statement',
params: {
uniqueId: audit.consultUniqueId,
tab: 'declaration-daccessibilite'
uniqueId: audit.consultUniqueId
}
}"
label="Lien de partage"
Expand Down
Loading

0 comments on commit 1958387

Please sign in to comment.