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

Feat/home design 2024 #574

Merged
merged 101 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
965f59b
Merge pull request #542 from opendatateam/391-home---menu
at-github Oct 16, 2024
d439005
Merge pull request #546 from opendatateam/390-home---header
at-github Oct 23, 2024
7448c7f
Merge pull request #552 from opendatateam/394-home---organiser-la-donnée
at-github Oct 23, 2024
1bb1e12
Merge pull request #550 from opendatateam/393-home---guichet-acces-do…
at-github Oct 24, 2024
45f38e6
Update contribute visual
at-github Nov 4, 2024
2c08334
Update explorer visual
at-github Nov 4, 2024
a4fbdbe
Update descriptions
at-github Nov 4, 2024
d6bf17e
Fix description card font size
Nov 5, 2024
45b4fc2
Update icons
at-github Nov 4, 2024
bdef789
Add title
at-github Nov 4, 2024
d9525d1
Update descriptions
at-github Nov 4, 2024
96cd758
Get topics from store
at-github Oct 25, 2024
75c621d
Rename component
at-github Oct 28, 2024
58380c4
Use new component
at-github Oct 28, 2024
b963e0a
Layout
at-github Oct 28, 2024
aaf738b
Style & space
at-github Oct 28, 2024
828eb6a
Fix mobile & title
at-github Oct 28, 2024
4e14c70
Use theme instead subtheme
at-github Oct 28, 2024
4866f80
Dont show draft
at-github Oct 28, 2024
fceb307
Show subtheme instead theme
at-github Oct 28, 2024
3f137cc
Fix owner avatar ration on mobile
at-github Oct 31, 2024
2611131
Fix tag line height
at-github Oct 31, 2024
cf72120
Break sooner
at-github Oct 31, 2024
e5ad054
Review - Rename components
at-github Nov 4, 2024
05b15ea
Review - Fix component path
at-github Nov 4, 2024
b40fb6e
Fix title
Nov 5, 2024
08ee713
Functional accordion
at-github Oct 22, 2024
5ea1028
Style and content as object
at-github Oct 22, 2024
dce0a6e
Update accordion arrow
at-github Oct 25, 2024
6c90c31
Home - Footer - Update paragraph
Oct 23, 2024
0f211ce
Home - Footer - Update external links
at-github Oct 24, 2024
268434a
Hack to submit
at-github Oct 24, 2024
58cbd97
Review - Rename & improve config
at-github Oct 30, 2024
f588db8
Update wording
at-github Oct 31, 2024
ccacb01
Fix image ration on safary by explicitly setting width & height
at-github Oct 31, 2024
5dd3977
Style new home title
Oct 21, 2024
3b0e219
User HeaderSearch component on home
Oct 21, 2024
9f1ae2a
Rename HeaderSearch to Search
Oct 21, 2024
43cea41
Fix placeholder render under icon
Oct 21, 2024
c53879b
Fix placeholder input and define it for home
Oct 21, 2024
888f581
Fix component name
Oct 21, 2024
9427a0c
Fix placeholder on mobile
Oct 21, 2024
0bf600c
Review - Fix space
at-github Oct 24, 2024
6f00625
Fix title after rebase
at-github Oct 30, 2024
bd63fdc
Review - Fix title
at-github Oct 30, 2024
e4b1c4b
Review - Set forgotten search width
at-github Oct 30, 2024
c3432a6
Review - Fix placeholder
at-github Oct 30, 2024
1762ffe
Review - Fix title size unit
at-github Oct 31, 2024
9889918
Review - Dont use pixel for font-size
at-github Nov 4, 2024
6dc4ba1
Review - Use clamp for title font size
at-github Nov 4, 2024
1ab70f1
Fix duplicate ids
at-github Nov 4, 2024
4a3a877
Update title wording
at-github Nov 4, 2024
becb077
Fix missing import
Nov 5, 2024
54cdeab
Add faq titles
at-github Nov 7, 2024
830682b
First content but italic failed
at-github Nov 7, 2024
43f5cb6
Second content
at-github Nov 7, 2024
104c500
Third content and update ids
at-github Nov 7, 2024
cd1897d
Dynamic accordion ids
at-github Nov 7, 2024
0e520d1
Fourth content
at-github Nov 7, 2024
7b1a792
Fifth content
at-github Nov 7, 2024
45483db
Sixth content
at-github Nov 7, 2024
9203d6a
Seventh content
at-github Nov 7, 2024
c31e959
Last contents
at-github Nov 7, 2024
9973052
Dedicated component
at-github Nov 7, 2024
85d44be
Fix faq styles
at-github Nov 7, 2024
0e578bb
Forgotten dots
at-github Nov 7, 2024
d2acdf8
Add forgotten link for bouquets
at-github Nov 7, 2024
d01aa14
Update FAQ content
at-github Nov 7, 2024
c080f30
Italic
at-github Nov 7, 2024
f45b5a0
Lighter search example
at-github Nov 8, 2024
705ea6e
Fix space blocs
at-github Nov 8, 2024
69b2058
Fix arrows
at-github Nov 8, 2024
a51df83
Fix duplicate id & label for
at-github Nov 8, 2024
594eb65
New imports
at-github Nov 8, 2024
b180ef2
Footer - Inject config directly
at-github Nov 8, 2024
49d5293
Faq - Move forgotten css in dedicated component
at-github Nov 8, 2024
5cd9cc3
Use remix icon
at-github Nov 8, 2024
4c78ecd
Fix defis config logo_operator value
at-github Nov 8, 2024
3f598df
Fix footer logo width on small screen
Nov 12, 2024
003af27
Review - Fix last topic cards on small screen
Nov 12, 2024
b46021b
Review - Fix FAQ removing unnecessaries props
Nov 12, 2024
d25dbb5
Review - FAQ - Move content to the template
Nov 12, 2024
a3e6c50
FAQ - Add hover style
Nov 12, 2024
0cd124e
Search - required prop
Nov 12, 2024
f85eec7
Review - Fix aria prop
Nov 12, 2024
5336124
Review - Remove unnecessary statement
at-github Nov 13, 2024
6b1ec6a
Review - Remove unnecessary attribut
at-github Nov 13, 2024
9754653
Review - pseudo selector
at-github Nov 13, 2024
c194e99
Review - Use router for links
at-github Nov 14, 2024
0abb40b
Review - Fix background faq
at-github Nov 14, 2024
b468013
Search - switch datasets & bouquets in dropdown
at-github Nov 14, 2024
4617216
Review - fix concatenation
at-github Nov 14, 2024
efbc054
Wording & illustrations, fix faq color
at-github Nov 14, 2024
a22d278
Review - add attributs for external link
at-github Nov 14, 2024
11fb6be
Review - add/remove non-breaking space
at-github Nov 14, 2024
593d455
Fix explorer illustration on small screen
at-github Nov 14, 2024
7dfcc9f
Fix invisible space
at-github Nov 14, 2024
fb2e353
Typo + break titles
Nov 15, 2024
d72059b
Update titles
at-github Nov 18, 2024
73c2399
Remove break titles
at-github Nov 18, 2024
b60fe13
Css - px to rem
at-github Nov 18, 2024
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
2 changes: 1 addition & 1 deletion configs/defis/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ website:
href: 'https://www.data.gouv.fr/fr/suivi/'
- label: 'Accessibilité : non conforme'
to: '/accessibility'
logo_operator: ''
logo_operator:
notice:
display: false
content: Notice avec un [lien beta](/beta) et du _style_
Expand Down
24 changes: 17 additions & 7 deletions configs/ecospheres/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ website:
style: 'blue-cumulus'
# leave empty if not pertinent
logo_operator:
src: '/logos/ecospheres-logo.svg'
show_in_header: false
footer:
width: '40px'
height: '219px'
homepage:
title: 'La plateforme des données de la transition écologique'
title:
subtitle:
sections:
- title:
Expand All @@ -47,25 +52,28 @@ website:
display: true
placeholder: Rechercher...
dropdown:
- text: Rechercher {} dans les <strong>bouquets</strong>
route: bouquets
- text: Rechercher {} dans les <strong>jeux de données</strong>
route: datasets
- text: Rechercher {} dans les <strong>bouquets</strong>
route: bouquets
search_bar:
display: true
placeholder: Rechercher une donnée environnementale
secondary_search:
display: false
name:
link:
footer_phrase: "Ce site est une déclinaison thématique de data.gouv.fr sur les données relatives à l'écologie."
footer_phrase: 'Ce site est une déclinaison thématique de data.gouv.fr sur les données relatives à la transition écologique et énergétique, réalisé par le Ministère de la Transition écologique, de l’Énergie, du Climat et de la Prévention des risques.'
footer_external_links:
- label: 'ecologie.gouv.fr'
href: 'https://ecologie.gouv.fr'
title: 'ecologie.gouv.fr - nouvelle fenêtre'
- label: 'data.gouv.fr'
href: 'https://www.data.gouv.fr'
title: 'data.gouv.fr - nouvelle fenêtre'
- label: 'legifrance.gouv.fr'
href: 'https://www.legifrance.gouv.fr/'
title: 'legifrance - nouvelle fenêtre'
- label: 'ecologie.gouv.fr'
href: 'https://ecologie.gouv.fr'
title: 'ecologie.gouv.fr - nouvelle fenêtre'
- label: 'gouvernement.fr'
href: 'https://www.gouvernement.fr'
title: 'gouvernement.fr - nouvelle fenêtre'
Expand All @@ -89,6 +97,8 @@ website:
to: /datasets
- text: Bouquets
to: /bouquets
- text: Organisations
to: /organizations
- text: A propos
to: /about
router:
Expand Down
9 changes: 8 additions & 1 deletion configs/meteo-france/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,14 @@ website:
href: 'https://www.data.gouv.fr/fr/suivi/'
- label: 'Accessibilité : non conforme'
to: '/accessibility'
logo_operator: 'https://static.data.gouv.fr/avatars/81/6374003e904fad9ddac7436315fd15-100.png'
logo_operator:
src: 'https://static.data.gouv.fr/avatars/81/6374003e904fad9ddac7436315fd15-100.png'
header:
width: '60px'
height: '60px'
footer:
width: '92px'
height: '92px'
notice:
display: false
content: Notice avec un [lien beta](/beta) et du _style_
Expand Down
27 changes: 22 additions & 5 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ const quickLinks = computed(() => {
const headerButton = {
label: button.label,
icon: 'ri-lightbulb-line',
href: button.link
href: button.link,
iconRight: true
}

const logLink = {
label: isLoggedIn.value ? 'Déconnexion' : 'Se connecter',
icon: isLoggedIn.value ? 'ri-logout-box-r-line' : 'ri-account-circle-line',
to: isLoggedIn.value ? '/logout' : '/login'
to: isLoggedIn.value ? '/logout' : '/login',
iconRight: true
}

if (!config.website.oauth_option) {
Expand All @@ -63,7 +65,8 @@ onMounted(() => {

const logotext = config.website.rf_title
const servicetitle = config.website.title
const logoOperator = config.website.logo_operator
const logoOperator = config.website.logo_operator?.src
const showLogoOperatorInHeader = config.website.logo_operator?.show_in_header
const logoService = config.website.service_logo
const showBadge = config.website.badge.display
const badgeText = config.website.badge.text
Expand Down Expand Up @@ -130,7 +133,11 @@ watch(
:show-search="config.website.header_search.display"
:logo-text="logotext"
:operator-img-src="logoOperator"
:operator-img-style="{ height: '60px', width: '60px' }"
:show-operator-logo="showLogoOperatorInHeader"
:operator-img-style="{
height: config.website.logo_operator?.header?.width,
width: config.website.logo_operator?.header?.height
}"
:service-logo-src="logoService"
:show-badge="showBadge"
:badge-text="badgeText"
Expand All @@ -149,7 +156,10 @@ watch(
class="fr-mt-16w"
:logo-text="logotext"
:operator-img-src="logoOperator"
:operator-img-style="{ height: '92px', width: '92px' }"
:operator-img-style="{
height: config.website.logo_operator?.footer?.width,
width: config.website.logo_operator?.footer?.height
}"
:service-logo-src="logoService"
:desc-text="footerPhrase"
:ecosystem-links="footerExternalLinks"
Expand All @@ -165,4 +175,11 @@ watch(
.justify-end {
justify-content: flex-end;
}

.fr-footer__brand-link {
box-sizing: content-box;
}
.fr-footer__logo {
max-width: 100%;
}
</style>
2 changes: 2 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
BouquetCard: typeof import('./components/bouquets/BouquetCard.vue')['default']
BouquetCardHome: typeof import('./components/bouquets/BouquetCardHome.vue')['default']
BouquetDatasetAccordionTitle: typeof import('./components/bouquets/BouquetDatasetAccordionTitle.vue')['default']
BouquetDatasetCard: typeof import('./components/bouquets/BouquetDatasetCard.vue')['default']
BouquetDatasetList: typeof import('./components/bouquets/BouquetDatasetList.vue')['default']
Expand Down Expand Up @@ -61,6 +62,7 @@ declare module 'vue' {
ReusesList: typeof import('./components/ReusesList.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
SearchComponent: typeof import('./components/SearchComponent.vue')['default']
SelectDataset: typeof import('./components/forms/dataset/SelectDataset.vue')['default']
SelectSpatialCoverage: typeof import('./components/forms/SelectSpatialCoverage.vue')['default']
SkipLinks: typeof import('./components/SkipLinks.vue')['default']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ defineProps({
searchLabel: {
type: String,
required: true
},
placeholder: {
type: String,
default: ''
},
id: {
type: String,
required: true
}
})

const emits = defineEmits(['search'])

const placeholder = config.website.header_search.placeholder
const dropdown = config.website.header_search.dropdown
const query = ref('')
const selectedMultiSearch = ref()
Expand Down Expand Up @@ -58,21 +65,21 @@ const dropdownLabel = (text: string) => {
/>

<div v-else>
<label id="search-label" for="select-search" class="fr-sr-only"
>Rechercher. Saisissez un mot clé puis choisissez une des options situés
<label :id="`${id}-label`" :for="id" class="fr-sr-only">
Rechercher. Saisissez un mot clé puis choisissez une des options situés
après le champ pour lancer la recherche dans la rubrique souhaitée</label
>
<Multiselect
id="select-search"
:id="id"
v-model="selectedMultiSearch"
class="select-search"
:options="dropdown"
label="text"
track-by="route"
placeholder=""
:placeholder="placeholder"
select-label=""
deselect-label=""
aria-labelledby="search-label"
:aria-labelledby="`${id}-label`"
aria-owns=""
:multiple="false"
:searchable="true"
Expand All @@ -93,7 +100,7 @@ const dropdownLabel = (text: string) => {
<span class="fr-icon-search-line search-icon"></span>
</template>
<template #placeholder>
<span aria-hidden="true" class="visible-label">Rechercher</span>
<span aria-hidden="true" class="visible-label">{{ placeholder }}</span>
</template>
</Multiselect>
</div>
Expand All @@ -115,6 +122,19 @@ const dropdownLabel = (text: string) => {
.visible-label {
margin-left: var(--icon-width);
}
.multiselect__placeholder {
margin-inline-start: var(--icon-width);
font-style: italic;
color: var(--text-mention-grey);
white-space: nowrap;
text-overflow: ellipsis;
width: 100%;
overflow: hidden;
}
::placeholder {
font-style: italic;
color: var(--text-mention-grey);
}
}
:deep(.multiselect__tags) {
border: 0;
Expand Down
144 changes: 144 additions & 0 deletions src/components/bouquets/BouquetCardHome.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<script setup lang="ts">
import {
formatRelativeIfRecentDate,
OrganizationNameWithCertificate,
useOwnerName
} from '@datagouv/components'
import { toRef } from 'vue'
import type { RouteLocationRaw } from 'vue-router'

import OrganizationLogo from '@/components/OrganizationLogo.vue'
import type { Topic } from '@/model/topic'
import { getOwnerAvatar } from '@/utils/avatar'
import { useExtras } from '@/utils/bouquet'
import { useTopicsConf } from '@/utils/config'
import { useSpatialCoverage } from '@/utils/spatial'
import { useThemeOptions } from '@/utils/theme'

const { topicsSlug } = useTopicsConf()

const props = defineProps({
bouquet: {
type: Object as () => Topic,
required: true
}
})

const bouquetRef = toRef(props, 'bouquet')
const spatialCoverage = useSpatialCoverage(bouquetRef)

const ownerName = useOwnerName(props.bouquet)

const { theme, subtheme, datasetsProperties } = useExtras(bouquetRef)

const nbData: number = datasetsProperties.value.length

const bouquetLink: RouteLocationRaw = {
name: `${topicsSlug}_detail`,
params: { bid: props.bouquet.slug }
}

const { themeColors } = useThemeOptions(theme)
</script>

<template>
<article
class="fr-my-md-3w fr-px-3w fr-py-2w border border-default-grey fr-enlarge-link"
>
<div
v-if="bouquet.private"
class="absolute top-0 fr-grid-row fr-grid-row--middle fr-mt-n3v"
>
<p class="fr-badge fr-badge--mention-grey fr-mr-1w">Brouillon</p>
</div>
<div class="fr-grid-row">
<div class="fr-col-12">
<DsfrTag
class="fr-card__detail fr-mt-1w fr-mb-1w card__tag"
:label="subtheme"
/>
</div>
</div>
<div class="fr-grid-row fr-pt-2v">
<div class="fr-col-12 fr-col-sm-3">
<OrganizationLogo
v-if="bouquet.organization"
:size="64"
:object="bouquet"
/>
<div v-else class="border fr-p-1-5v fr-mr-1-5v" style="width: 77px">
<img
:src="getOwnerAvatar(bouquet)"
alt=""
loading="lazy"
class="owner-avatar"
height="64"
width="64"
/>
</div>
</div>
<div class="fr-col-12 fr-col-sm-9 fr-pl-2v">
<h3 class="fr-mb-1v fr-grid-row h4">
<RouterLink :to="bouquetLink" class="text-grey-500">
{{ bouquet.name }}
</RouterLink>
</h3>
<p
v-if="bouquet.organization || bouquet.owner"
class="fr-m-0 fr-text--sm"
>
Par
<template v-if="bouquet.organization">
<OrganizationNameWithCertificate
:organization="bouquet.organization"
/>
</template>
<template v-else>{{ ownerName }}</template>
</p>
</div>
</div>
<div class="fr-grid-row fr-grid-row--gutters fr-grid-row--center">
<div class="fr-col-12">
<p class="fr-m-0 fr-text--sm flex align-center fr-pt-3v">
<VIcon name="ri:time-line" class="fr-mr-1v text-grey-380" />
mis à jour {{ formatRelativeIfRecentDate(bouquet.last_modified) }}
</p>
<p class="fr-tag fr-mt-2v">
<VIcon name="ri-database-2-line" class="fr-mr-1v" />
<span class="fr-mr-1v">
{{
`${nbData > 0 ? nbData : 'Aucune'} donnée${nbData > 1 ? 's' : ''}`
}}
</span>
</p>
<p v-if="spatialCoverage" class="fr-tag fr-ml-1w">
<VIcon name="ri-map-2-line" class="fr-mr-1v" />
<span class="fr-mr-1v">
{{ spatialCoverage.name }}
</span>
</p>
</div>
</div>
</article>
</template>

<style scoped>
.owner-avatar {
margin-bottom: -6px;
display: inline-block;
}
.card__tag {
color: v-bind('themeColors.color');
background-color: v-bind('themeColors.background');
}

.fr-card__detail,
:deep(h3) {
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
line-height: inherit;
}
</style>
Loading
Loading