Skip to content

Commit a5432c5

Browse files
authored
Merge pull request #282 from dnum-mi/feat/footer-links
feat: ✨ Implémente la possibilité de changer les liens de l'…
2 parents 2038a79 + 68f2a35 commit a5432c5

File tree

4 files changed

+82
-22
lines changed

4 files changed

+82
-22
lines changed

src/components/DsfrFooter/DsfrFooter.e2e.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import DsfrFooter from './DsfrFooter.vue'
33
import DsfrFooterLinkList from './DsfrFooterLinkList.vue'
44
import VIcon from '../../icons.js'
55
import '../../main.css'
6-
import { ecosystemLinks } from '../../constants.js'
76

87
const data = {
98
dark: false,
@@ -52,6 +51,23 @@ const data = {
5251
},
5352

5453
}
54+
const ecosystemLinks = [{
55+
label: 'legifrance.gouv.fr',
56+
href: 'https://legifrance.gouv.fr',
57+
},
58+
{
59+
label: 'gouvernement.fr',
60+
href: 'https://gouvernement.fr',
61+
},
62+
{
63+
label: 'service-public.fr',
64+
href: 'https://service-public.fr',
65+
},
66+
{
67+
label: 'data.gouv.fr',
68+
href: 'https://data.gouv.fr',
69+
},
70+
]
5571
const a11yCompliance = 'partiellement conforme'
5672
const allLinks = [
5773
...data.beforeMandatoryLinks,
@@ -87,6 +103,7 @@ const DsfrFooterWrapper = {
87103
:a11y-compliance="a11yCompliance"
88104
:before-mandatory-links="beforeMandatoryLinks"
89105
:after-mandatory-links="afterMandatoryLinks"
106+
:ecosystem-links="ecosystemLinks"
90107
:logo-text="logoText"
91108
:legal-link="legalLink"
92109
:personal-data-link="personalDataLink"

src/components/DsfrFooter/DsfrFooter.stories.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export default {
2323
control: 'object',
2424
description: 'Liste de liens succédant aux liens par défaut (liens obligatoires)',
2525
},
26+
ecosystemLinks: {
27+
control: 'object',
28+
description: 'Liste de liens relatifs au gouvernement (par défaut si la props n\'est pas renseignée elle contient les quatre liens obligatoires pour un site public)',
29+
},
2630
a11yCompliance: {
2731
control: 'radio',
2832
options: [
@@ -72,6 +76,7 @@ export const PiedDePageSimple = (args) => ({
7276
:desc-text="descText"
7377
:home-link="homeLink"
7478
:partners="partners"
79+
:ecosystem-links="ecosystemLinks"
7580
>
7681
<template v-slot:description>
7782
<p>
@@ -101,6 +106,24 @@ PiedDePageSimple.args = {
101106
a11yComplianceLink: '/a11y-conformite',
102107
descText: 'Description',
103108
homeLink: '/',
109+
ecosystemLinks: [
110+
{
111+
label: 'legifrance.gouv.fr',
112+
href: 'https://legifrance.gouv.fr',
113+
},
114+
{
115+
label: 'gouvernement.fr',
116+
href: 'https://gouvernement.fr',
117+
},
118+
{
119+
label: 'service-public.fr',
120+
href: 'https://service-public.fr',
121+
},
122+
{
123+
label: 'data.gouv.fr',
124+
href: 'https://data.gouv.fr',
125+
},
126+
],
104127
partners: {
105128
mainPartner: {
106129
name: 'Partenaire principal',
@@ -135,6 +158,7 @@ export const PiedDePage = (args) => ({
135158
:a11y-compliance="a11yCompliance"
136159
:before-mandatory-links="beforeMandatoryLinks"
137160
:after-mandatory-links="afterMandatoryLinks"
161+
:ecosystem-links="ecosystemLinks"
138162
:logo-text="logoText"
139163
:legal-link="legalLink"
140164
:personal-data-link="personalDataLink"
@@ -194,6 +218,24 @@ PiedDePage.args = {
194218
{ label: 'Lien 2.1', to: '/lien2/1' },
195219
{ label: 'Lien 2.2', to: '/lien 2/2' },
196220
],
221+
ecosystemLinks: [
222+
{
223+
label: 'legifrance.gouv.fr',
224+
href: 'https://legifrance.gouv.fr',
225+
},
226+
{
227+
label: 'gouvernement.fr',
228+
href: 'https://gouvernement.fr',
229+
},
230+
{
231+
label: 'service-public.fr',
232+
href: 'https://service-public.fr',
233+
},
234+
{
235+
label: 'data.gouv.fr',
236+
href: 'https://data.gouv.fr',
237+
},
238+
],
197239
partners: {
198240
mainPartner: {
199241
name: 'Partenaire principal',

src/components/DsfrFooter/DsfrFooter.vue

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { defineComponent } from 'vue'
44
import DsfrLogo from '../DsfrLogo/DsfrLogo.vue'
55
import DsfrFooterPartners from '../DsfrFooter/DsfrFooterPartners.vue'
66
7-
import { ecosystemLinks } from '../../constants.js'
8-
97
export default defineComponent({
108
name: 'DsfrFooter',
119
@@ -59,11 +57,32 @@ export default defineComponent({
5957
type: Array,
6058
default: () => [],
6159
},
60+
ecosystemLinks: {
61+
type: Array,
62+
default: () => [
63+
{
64+
label: 'legifrance.gouv.fr',
65+
href: 'https://legifrance.gouv.fr',
66+
},
67+
{
68+
label: 'gouvernement.fr',
69+
href: 'https://gouvernement.fr',
70+
},
71+
{
72+
label: 'service-public.fr',
73+
href: 'https://service-public.fr',
74+
},
75+
{
76+
label: 'data.gouv.fr',
77+
href: 'https://data.gouv.fr',
78+
},
79+
],
80+
},
81+
6282
},
6383
6484
data () {
6585
return {
66-
ecosystemLinks,
6786
mandatoryLinks: [
6887
{
6988
label: `Accessibilité : ${this.a11yCompliance}`,

src/constants.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)