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

Customisation de l'utilisation des topics #503

Closed
wants to merge 10 commits into from
52 changes: 37 additions & 15 deletions configs/defis/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,67 +62,67 @@ website:
- id: '65b76f15d7874915c8e41298'
name: 'Impact Diagnostics de Performance Energétique'
description: 'Quel impact de la classe DPE sur les consommations énergétiques ? Défi porté par Enedis'
url: '/defis/65b76f15d7874915c8e41298/'
url: '/defis/diagnostics-de-performance-energetique'
image_url: 'https://raw.githubusercontent.com/thanhhale7/images/main/odu_enedis4.png'
- id: '65b10aa72d0c187ecf296930'
name: 'Offre culturelle'
description: "Comment valoriser l'offre culturelle et favoriser l'accès à la culture ?"
url: '/defis/65b10aa72d0c187ecf296930/'
url: '/defis/offre-culturelle'
image_url: 'https://raw.githubusercontent.com/thanhhale7/images/main/odu_culture3.png'
- id: '65b22219ffcf892bd066df76'
name: 'Elections'
description: 'Quels liens entre vote et caractéristiques socio-démographiques ?'
url: '/defis/65b22219ffcf892bd066df76/'
url: '/defis/elections'
image_url: 'https://raw.githubusercontent.com/thanhhale7/images/main/odu_elections3.png'
- id: '65b10beae24f409e31c547a5'
name: 'Changement climatique'
description: 'Quelle évolution du climat en France depuis le début du XXe siècle ?'
url: '/defis/65b10beae24f409e31c547a5/'
url: '/defis/changement-climatique'
image_url: 'https://raw.githubusercontent.com/thanhhale7/images/main/odu_climat3.png'
- id: '65b76b8536f029909a82ca1c'
name: 'Commerces de centre-ville'
description: 'Quelle est la structure du tissu commercial ?'
url: '/defis/65b76b8536f029909a82ca1c/'
url: '/defis/commerces-de-centre-ville'
image_url: 'https://raw.githubusercontent.com/thanhhale7/images/main/odu_commerces3.png'
- id: '65a92352ddd3d98e460e83f3'
name: 'Infrastructures cyclables'
description: 'Quels liens entre accidentologie à vélo et infrastructures cyclables ?'
url: '/defis/65a92352ddd3d98e460e83f3/'
url: '/defis/infrastructures-cyclables'
image_url: 'https://raw.githubusercontent.com/thanhhale7/images/main/odu_velo3.png'
- id: '65a92372953d21f206abb110'
name: 'Energie en France'
description: 'Quelles tensions énergétiques passées et futures en France ?'
url: '/defis/65a92372953d21f206abb110/'
url: '/defis/energie-en-france'
image_url: 'https://raw.githubusercontent.com/thanhhale7/images/main/energie3_odu.png'
- id: '65a9237ed493a309fc872e4a'
name: 'Carte scolaire'
description: 'Comment permettre de savoir dans quel établissement inscrire un enfant ?'
url: '/defis/65a9237ed493a309fc872e4a/'
url: '/defis/carte-scolaire'
image_url: 'https://raw.githubusercontent.com/thanhhale7/images/main/odu_ecole4.png'
- id: '65a923a083cf5f728c9934b3'
name: 'Véhicules électriques'
description: 'La répartition des infrastructures de recharge est-elle adaptée ?'
url: '/defis/65a923a083cf5f728c9934b3/'
url: '/defis/vehicules-electriques'
image_url: 'https://raw.githubusercontent.com/thanhhale7/images/main/odu_voiture3.png'
- id: '65a9238c202514467c0163d2'
name: 'Plan France Relance'
description: "Quels impacts des aides distribués sur l'économie et la transition écologique ?"
url: '/defis/65a9238c202514467c0163d2/'
url: '/defis/plan-france-relance'
image_url: 'https://raw.githubusercontent.com/thanhhale7/images/main/odu_francerelance3.png'
- id: '66a0fdf41a40f23f40025444'
name: 'Accès au sport'
description: "Sport pour tous : Évaluer et améliorer l'égalité d'accès aux activités sportives en France"
url: 'defis/66a0fdf41a40f23f40025444/'
url: 'defis/acces-au-sport'
image_url: 'https://raw.githubusercontent.com/thanhhale7/images/main/defi-acces-au-sport.jpg'
- id: '66a0ffa8d8f03afc1d474a53'
name: 'JOP2024 et offre culturelle'
description: "Jeux Olympiques et Paralympiques : Enrichissez l'expérience et mettez en valeur l'offre culturelle"
url: 'defis/66a0ffa8d8f03afc1d474a53/'
url: 'defis/jop2024-et-offre-culturelle'
image_url: 'https://raw.githubusercontent.com/thanhhale7/images/main/defi-jo-offre-culturelle.jpg'
- id: '66a10128a66990ed3d718a53'
name: 'JOP2024 et qualité de l’air'
description: "Jeux Olympiques et Paralympiques : enjeux de pollution de l'air dans le cadre d'une activité physique"
url: 'defis/66a10128a66990ed3d718a53/'
url: 'defis/jop2024-et-qualite-de-lair'
image_url: 'https://raw.githubusercontent.com/thanhhale7/images/main/defi-jo-qualite-de-l%27air.jpg'

sub_section_tiles:
Expand Down Expand Up @@ -162,7 +162,7 @@ website:
show_dataset_metadata_panel: false
list_search_topics:
url_search_topics: 'defis'
oauth_option: false
oauth_option: true
footer_phrase: 'Ce site présente des exemples de défis de réutilisations de données publiques sélectionnés par l’équipe data.gouv.fr en collaboration avec les producteurs de données.'
footer_external_links:
- label: 'data.gouv.fr'
Expand Down Expand Up @@ -203,7 +203,29 @@ website:
topic:
display: false
create: false

datasets:
organization_filter: false
add_to_bouquet: false
# similar to QUALITY_METADATA_BACKEND_IGNORE on data.gouv.fr
harvest_backends_quality_warning: []
show_extended_information_panel: false
topics:
topic_name:
slug: defis
name: Défi
extras_to_process: 'defis'
themes:
usage: false
main_name: Thématique
secondary_name: Chantier
page_all_topics: false
display_metadata: false
activate_read_more: false
dataset_editorialization: false
scope_add_topics:
all: false
authorized_users:
- 6230733357772160a4f77fbadd
# list of organisations' ids that should be handled by the portal
# to find an id go to https://www.data.gouv.fr/fr/organizations/ministere-de-la-transition-ecologique/
# then Informations > ID at the bottom of the page
Expand Down
17 changes: 16 additions & 1 deletion configs/ecospheres/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,22 @@ website:
harvest_backends_quality_warning:
- CSW-ISO-19139
show_extended_information_panel: true

topics:
topic_name:
slug: bouquets
name: Bouquet
extras_to_process: 'ecospheres'
themes:
usage: true
main_name: Thématique
secondary_name: Chantier
page_all_topics: true
display_metadata: true
activate_read_more: true
dataset_editorialization: true
scope_add_topics:
all: true
authorized_users:
themes:
- name: Se loger
color: 043574
Expand Down
39 changes: 37 additions & 2 deletions configs/meteo-france/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ website:
menu:
- text: Données
to: /datasets
- text: Bouquets
to: /bouquets
- text: Recherche guidée
to: /form
- text: 'Hackathon le 8 et 9 avril 🚀'
Expand Down Expand Up @@ -114,7 +116,7 @@ website:
- id: '65e0c82c2da27c1dff5fa66f'
name: 'Données de Prévision Numérique du Temps (PNT)'
url_search_topics: 'datasets'
oauth_option: false
oauth_option: true
footer_phrase: 'Ce site est une déclinaison thématique de data.gouv.fr sur les données relatives à la météo et au climat réalisé en collaboration avec Météo-France.'
footer_external_links:
- label: 'meteofrance.com'
Expand Down Expand Up @@ -159,10 +161,43 @@ website:
create: false
datasets:
organization_filter: false
add_to_bouquet: false
add_to_bouquet: true
# similar to QUALITY_METADATA_BACKEND_IGNORE on data.gouv.fr
harvest_backends_quality_warning: []
show_extended_information_panel: false
topics:
topic_name:
slug: bouquets
name: Bouquet
extras_to_process: 'meteofrance'
themes:
usage: false
main_name: Thématique
secondary_name: Chantier
page_all_topics: false
display_metadata: false
activate_read_more: false
dataset_editorialization: false
scope_add_topics:
all: false
authorized_users:
- 6230733357772160a4f77fbaxx
themes:
- name: Données climatologiques
color: 043574
textColor: FFFFFF
subthemes:
- name: Informations sur les stations
- name: Données climatologiques de base
- name: Références à la station
- name: Données de références pour le changement climatiques
- name: Données de prévision numérique du temps (PNT)
color: 1E929E
textColor: FFFFFF
subthemes:
- name: ARPEGE
- name: AROME
- name: Modèle de vague haute

# list of organisations' ids that should be handled by the portal
# to find an id go to https://www.data.gouv.fr/fr/organizations/ministere-de-la-transition-ecologique/
Expand Down
18 changes: 17 additions & 1 deletion configs/simplification/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,23 @@ website:
# similar to QUALITY_METADATA_BACKEND_IGNORE on data.gouv.fr
harvest_backends_quality_warning: []
show_extended_information_panel: false

topics:
topic_name:
slug: usecases
name: Cas d'usage
extras_to_process: 'ecospheres'
themes:
usage: true
main_name: Domaine
secondary_name: Sous-domaine
page_all_topics: false
display_metadata: false
activate_read_more: false
dataset_editorialization: false
scope_add_topics:
all: false
authorized_users:
- 6230733357772160a4f77fba
# list of organisations' ids that should be handled by the portal
# to find an id go to https://www.data.gouv.fr/fr/organizations/ministere-de-la-transition-ecologique/
# then Informations > ID at the bottom of the page
Expand Down
17 changes: 9 additions & 8 deletions src/components/DiscussionsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,28 @@ import type { ComputedRef, Ref } from 'vue'
import { ref, watchEffect, computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'

import LocalStorageService from '@/services/LocalStorageService'

import config from '../config'
import config from '@/config'
import type {
DiscussionResponse,
DiscussionForm,
SubjectClass,
PostForm,
DiscussionId,
Post
} from '../model/discussion'
import { useDiscussionStore } from '../store/DiscussionStore'
import { useUserStore } from '../store/UserStore'
import { formatDate } from '../utils'
} from '@/model/discussion'
import LocalStorageService from '@/services/LocalStorageService'
import { useDiscussionStore } from '@/store/DiscussionStore'
import { useUserStore } from '@/store/UserStore'
import { formatDate } from '@/utils'

const route = useRoute()
const router = useRouter()

const discussionStore = useDiscussionStore()
const userStore = useUserStore()

const topicName = config.website.topics.topic_name.name

const { loggedIn } = storeToRefs(userStore)
const currentPage: Ref<number> = ref(1)
const showDiscussionForm: Ref<boolean> = ref(false)
Expand All @@ -43,7 +44,7 @@ const props = defineProps({

const subjectClassLabels = {
Dataset: 'jeu de données',
Topic: 'bouquet'
Topic: topicName
}

const discussionForm: Ref<DiscussionForm> = ref({
Expand Down
20 changes: 12 additions & 8 deletions src/components/HomeThemes.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
<script setup lang="ts">
import { onMounted, computed, type ComputedRef } from 'vue'
import { onMounted, computed, type ComputedRef, ref } from 'vue'

import config from '@/config'
import type { Theme } from '@/model/theme'
import { useTopicStore } from '@/store/TopicStore'

import config from '../config'
import type { Theme } from '../model/theme'
import Tile from './Tile.vue'

const topicStore = useTopicStore()
const extrasToProcess = config.website.topics.extras_to_process

const getCustomBoxShadow = (color: string) => {
return `box-shadow: rgb(221, 221, 221) 0px 0px 0px 1px inset, #${color} 0px -4px 0px 0px inset`
}

const topicName = config.website.topics.topic_name.name
const topicSlug = ref(config.website.topics.topic_name.slug)

const getThemeDescription = (theme: Theme) => {
const nbBouquets = topicStore.data.filter((topic) => {
return !topic.private && topic.extras.ecospheres.theme === theme.name
return !topic.private && topic.extras[extrasToProcess].theme === theme.name
}).length
switch (nbBouquets) {
case 0:
return 'Aucun bouquet'
return `Aucun ${topicName}`
case 1:
return '1 bouquet'
return `1 ${topicName}`
default:
return `${nbBouquets} bouquets`
return `${nbBouquets} ${topicName}s`
}
}

Expand Down Expand Up @@ -52,7 +56,7 @@ onMounted(() => {
>
<Tile
:style="getCustomBoxShadow(theme.color)"
:link="{ name: 'bouquets', query: { theme: theme.name } }"
:link="{ name: topicSlug, query: { theme: theme.name } }"
:title="theme.name"
:description="description"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/LineChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { computed, watchEffect } from 'vue'
import { Line } from 'vue-chartjs'

import { datavizStore } from '../store/DatavizStore'
import { datavizStore } from '@/store/DatavizStore'

const options = {
plugins: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { computed, type PropType } from 'vue'
import type { RouteLocationRaw } from 'vue-router'

import { stripFromMarkdown } from '../utils'
import { stripFromMarkdown } from '@/utils'

const props = defineProps({
title: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ import {
formatRelativeIfRecentDate,
OrganizationNameWithCertificate
} from '@etalab/data.gouv.fr-components'
import { toRef } from 'vue'
import { toRef, ref } from 'vue'
import type { RouteLocationRaw } from 'vue-router'

import OrganizationLogo from '@/components/OrganizationLogo.vue'
import config from '@/config'
import { NoOptionSelected } from '@/model/theme'
import type { Topic } from '@/model/topic'
import { stripFromMarkdown } from '@/utils'
import { getOwnerAvatar } from '@/utils/avatar'
import { useExtras } from '@/utils/bouquet'
import { useSpatialCoverage } from '@/utils/spatial'
import { getThemeColor, getThemeTextColor } from '@/utils/theme'

import { useExtras } from '../utils/bouquet'
const topicName = config.website.topics.topic_name.name
const topicSlug = config.website.topics.topic_name.slug

const props = defineProps({
bouquet: {
Expand All @@ -24,17 +27,22 @@ const props = defineProps({
}
})

const bouquetRef = toRef(props, 'bouquet')
const extrasToProcess = ref(config.website.topics.extras_to_process)

const bouquetRef = toRef(props, topicName)
const spatialCoverage = useSpatialCoverage(bouquetRef)

const ownerName = useOwnerName(props.bouquet)

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

const nbData: number = datasetsProperties.value.length

const bouquetLink: RouteLocationRaw = {
name: 'bouquet_detail',
name: `${topicSlug}_detail`,
params: { bid: props.bouquet.slug }
}
</script>
Expand Down
Loading