Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ vue-dot: Add sitemap link in FooterBar #1897

Merged
merged 1 commit into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

### Vue Dot

- ✨ **Nouvelles fonctionnalités**
- **FooterBar:** Ajout du lien *Plan du site* ([#1897](https://github.com/assurance-maladie-digital/design-system/pull/1897))

- 🐛 **Corrections de bugs**
- **ExternalLinks:** Correction de l'affichage du menu ([#1889](https://github.com/assurance-maladie-digital/design-system/pull/1889)) ([e6f1b7f](https://github.com/assurance-maladie-digital/design-system/commit/e6f1b7f32b55fcf51cd70b0bd413cb13383ffef9))
- **DialogBox:** Correction de l'alignement du titre ([#1890](https://github.com/assurance-maladie-digital/design-system/pull/1890)) ([e329f25](https://github.com/assurance-maladie-digital/design-system/commit/e329f252e1314d31effc426d91ef9215ed8a589a))
- **HeaderBar:** Correction de l'affichage des menus dans le composant ([#1896](https://github.com/assurance-maladie-digital/design-system/pull/1896))
- **HeaderBar:** Correction de l'affichage des menus dans le composant ([#1896](https://github.com/assurance-maladie-digital/design-system/pull/1896)) ([19938e2](https://github.com/assurance-maladie-digital/design-system/commit/19938e2ea04e055533117673d4344cfacf0bca4c))

- ♿️ **Accessibilité**
- **DialogBox:** Ajout de l'attribut `aria-label` sur le bouton fermer ([#1892](https://github.com/assurance-maladie-digital/design-system/pull/1892)) ([7d2aa84](https://github.com/assurance-maladie-digital/design-system/commit/7d2aa8457a758979efa50767f2c629dd5b8892a5))
Expand Down
1 change: 1 addition & 0 deletions packages/docs/src/content/examples/footer-bar/usage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
]
},
booleans: [
'hideSitemapLink',
'hideCguLink',
'hideLegalNoticeLink',
'hideA11yLink'
Expand Down
12 changes: 12 additions & 0 deletions packages/docs/src/data/api/footer-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ export const api: Api = {
description: 'Le niveau de conformité aux règles d’accessibilité de l’application.<br>Cette mention est obligatoire, voir la [documentation du RGAA](https://www.numerique.gouv.fr/publications/rgaa-accessibilite/obligations/#d%C3%A9claration-daccessibilit%C3%A9).',
example: `'non-compliant' | 'partially-compliant' | 'fully-compliant'`
},
{
name: 'sitemap-route',
type: 'RawLocation',
default: `{ name: 'sitemap' }`,
description: 'La valeur de la prop `to` du lien vers le *Plan du site*.'
},
{
name: 'cgu-route',
type: 'RawLocation',
Expand All @@ -28,6 +34,12 @@ export const api: Api = {
default: `{ name: 'a11yStatement' }`,
description: 'La valeur de la prop `to` du lien vers la *Déclaration d’accessibilité*.'
},
{
name: 'hide-sitemap-link',
type: 'boolean',
default: false,
description: 'Masque le lien vers le *Plan du site*.'
},
{
name: 'hide-cgu-link',
type: 'boolean',
Expand Down
16 changes: 16 additions & 0 deletions packages/vue-dot/src/patterns/FooterBar/FooterBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
>
<slot name="prepend" />

<RouterLink
v-if="!hideSitemapLink"
:to="sitemapRoute"
class="my-3 mx-4"
>
{{ locales.sitemapLabel }}
</RouterLink>

<RouterLink
v-if="!hideCguLink"
:to="cguRoute"
Expand Down Expand Up @@ -65,6 +73,10 @@
default: A11yComplianceEnum.NON_COMPLIANT,
validator: (value: A11yComplianceEnum) => propValidator('a11y-compliance', A11Y_COMPLIANCE_ENUM_VALUES, value)
},
sitemapRoute: {
type: [Array, Object, String] as PropType<RawLocation>,
default: () => ({ name: 'sitemap' })
},
cguRoute: {
type: [Array, Object, String] as PropType<RawLocation>,
default: () => ({ name: 'cgu' })
Expand All @@ -77,6 +89,10 @@
type: [Array, Object, String] as PropType<RawLocation>,
default: () => ({ name: 'a11yStatement' })
},
hideSitemapLink: {
type: Boolean,
default: false
},
hideCguLink: {
type: Boolean,
default: false
Expand Down
1 change: 1 addition & 0 deletions packages/vue-dot/src/patterns/FooterBar/locales.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { A11yComplianceEnum } from './A11yComplianceEnum';

export const locales = {
sitemapLabel: 'Plan du site',
cguLabel: 'Conditions générales d’utilisation',
legalNoticeLabel: 'Mentions légales',
versionLabel: 'Version',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

exports[`FooterBar renders correctly 1`] = `
<vfooter-stub color="#fff" elevation="3" height="auto" minheight="40px" tag="footer" class="vd-footer-bar text-sm-center d-flex flex-column flex-sm-row align-start justify-center pa-0 w-100">
<routerlink-stub to="[object Object]" class="my-3 mx-4">
Plan du site
</routerlink-stub>
<routerlink-stub to="[object Object]" class="my-3 mx-4">
Conditions générales d’utilisation
</routerlink-stub>
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2895,11 +2895,6 @@
dependencies:
"@types/node" "*"

"@types/content-disposition@0.5.4":
version "0.5.4"
resolved "https://registry.yarnpkg.com/@types/content-disposition/-/content-disposition-0.5.4.tgz#de48cf01c79c9f1560bcfd8ae43217ab028657f8"
integrity sha512-0mPF08jn9zYI0n0Q/Pnz7C4kThdSt+6LD4amsrYDDpgBfrVWa3TcCOxKX1zkGgYniGagRv8heN2cbh+CAn+uuQ==

"@types/etag@1.8.0":
version "1.8.0"
resolved "https://registry.yarnpkg.com/@types/etag/-/etag-1.8.0.tgz#37f0b1f3ea46da7ae319bbedb607e375b4c99f7e"
Expand Down Expand Up @@ -5766,7 +5761,12 @@ constants-browserify@^1.0.0:
resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75"
integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=

content-disposition@0.5.4, content-disposition@^0.5.3:
content-disposition-header@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/content-disposition-header/-/content-disposition-header-0.6.0.tgz#6346d1e9311bbe739ec5036dabbd38cdb87681a7"
integrity sha512-+PKF6Y7JHgwD2Dld48L5jozC6pGDdnioJHfM7VyfF92pAU6wDF/N8K/cfecoq7b19KnelOnjntkVyN5hMm2F+w==

content-disposition@0.5.4:
version "0.5.4"
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe"
integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==
Expand Down