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

[FEATURE] Ajouter un ID sur les slices pour faire des liens dessus (PIX-1576). #228

Merged
merged 1 commit into from
Nov 30, 2020
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
14 changes: 7 additions & 7 deletions components/SliceZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
<prismic-rich-text :field="slice.primary.text" />
</template>
<template v-if="slice.slice_type === 'pop-in'">
<pop-in-campaigns :slice="slice" />
<pop-in-campaigns :slice="slice" :index-for-id="index" />
</template>
<template v-if="slice.slice_type === 'banner'">
<page-banner :slice="slice"></page-banner>
<page-banner :slice="slice" :index-for-id="index" />
</template>
<template v-if="slice.slice_type === 'article'">
<article-slice :slice="slice" :button-class="'section-demo__button'" />
<article-slice :slice="slice" :index-for-id="index" />
</template>
<template v-if="slice.slice_type === 'multiple_block'">
<multiple-block-slice :slice="slice" />
<multiple-block-slice :slice="slice" :index-for-id="index" />
</template>
<template v-if="slice.slice_type === 'partners_logos'">
<partners-logos-slice :slice="slice" />
<partners-logos-slice :slice="slice" :index-for-id="index" />
</template>
<template v-if="slice.slice_type === 'latest_news'">
<latest-news-slice :slice="slice" />
<latest-news-slice :slice="slice" :index-for-id="index" />
</template>
<template v-if="slice.slice_type === 'stat'">
<stat :slice="slice" />
<stat :slice="slice" :index-for-id="index" />
</template>
</section>
</div>
Expand Down
6 changes: 5 additions & 1 deletion components/slices/Article.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :style="[background]">
<div :id="`slice-${indexForId}`" :style="[background]">
<div
class="article"
:class="{
Expand Down Expand Up @@ -81,6 +81,10 @@ export default {
type: Object,
default: null,
},
indexForId: {
type: Number,
default: 0,
},
},
computed: {
content() {
Expand Down
6 changes: 5 additions & 1 deletion components/slices/LatestNews.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<section class="latest-news">
<section :id="`slice-${indexForId}`" class="latest-news">
<prismic-rich-text
v-if="shouldDisplayTitle && hasTitle"
class="latest-news__title"
Expand Down Expand Up @@ -41,6 +41,10 @@ export default {
type: Object,
default: null,
},
indexForId: {
type: Number,
default: 0,
},
},
computed: {
shouldDisplayTitle() {
Expand Down
10 changes: 9 additions & 1 deletion components/slices/MultipleBlock.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<section :class="blockClass" :style="[background]">
<section
:id="`slice-${indexForId}`"
:class="blockClass"
:style="[background]"
>
<prismic-rich-text
v-if="hasTitle && shouldDisplayTitle"
:class="`${blockClass}__title`"
Expand Down Expand Up @@ -52,6 +56,10 @@ export default {
type: Object,
default: null,
},
indexForId: {
type: Number,
default: 0,
},
},
data() {
return {
Expand Down
6 changes: 5 additions & 1 deletion components/slices/PageBanner.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :style="[background]">
<div :id="`slice-${indexForId}`" :style="[background]">
<section class="banner row-block">
<div class="row-block__main-content">
<prismic-rich-text
Expand Down Expand Up @@ -59,6 +59,10 @@ export default {
type: Object,
default: null,
},
indexForId: {
type: Number,
default: 0,
},
},
computed: {
background() {
Expand Down
6 changes: 5 additions & 1 deletion components/slices/PartnersLogos.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<section class="partners-logos">
<section :id="`slice-${indexForId}`" class="partners-logos">
<prismic-rich-text
v-if="hasTitle && shouldDisplayTitle"
class="partners-logos__title"
Expand All @@ -26,6 +26,10 @@ export default {
type: Object,
default: null,
},
indexForId: {
type: Number,
default: 0,
},
},
computed: {
items() {
Expand Down
10 changes: 9 additions & 1 deletion components/slices/PopInCampaigns.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<div class="pop-in-campaigns" :class="{ collapse: isClosed }">
<div
:id="`slice-${indexForId}`"
class="pop-in-campaigns"
:class="{ collapse: isClosed }"
>
<div
class="pop-in-campaigns-content"
v-on="isClosed ? { click: togglePopIn } : {}"
Expand Down Expand Up @@ -39,6 +43,10 @@ export default {
type: Object,
default: null,
},
indexForId: {
type: Number,
default: 0,
},
},
data() {
return {
Expand Down
6 changes: 5 additions & 1 deletion components/slices/Stat.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="stat">
<div :id="`slice-${indexForId}`" class="stat">
<prismic-rich-text :field="content.block_title" />
<prismic-rich-text :field="content.block_presentation" />
<chart-section :data="chartData" />
Expand All @@ -19,6 +19,10 @@ export default {
type: Object,
default: null,
},
indexForId: {
type: Number,
default: 0,
},
},
computed: {
content() {
Expand Down