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(bouquet): crée un bouquet avec thématique, chantier, et datasets #110

Merged
merged 41 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4cbff9a
Create step component + add chantier
Oct 20, 2023
920a1c9
Edit form
Oct 23, 2023
376f37b
Add test error for step 1
Oct 23, 2023
ef1e716
Add step 3
Oct 24, 2023
9db7d88
Remove useless div
Oct 25, 2023
043e753
Refacto
Oct 25, 2023
85bf12f
Add comment
Oct 25, 2023
2b2971d
Remove comment
Oct 25, 2023
23819da
Change variable name
Oct 25, 2023
63bb4fd
Add config.universe.name for Extras
Oct 25, 2023
908e543
Add change event and remove constants
Oct 25, 2023
faa7f09
Add in config.yaml remove in config.js
Oct 25, 2023
15a85ba
Edit config.universe.name
Oct 25, 2023
d659742
Edit config
Oct 25, 2023
bdcc7fa
Edit naming
Oct 25, 2023
31fbb10
Add temporary search modal
Oct 27, 2023
b4fd48b
Edit step 3
Nov 2, 2023
e14bcab
Fix uri for multiple dataset
Nov 4, 2023
e6aded0
Edit themes and subthemes with new config
Nov 5, 2023
bbf8556
Edit default text
Nov 5, 2023
9eed5f3
Remove code
Nov 6, 2023
ea0ec7e
Add Step4 + Custom Bouquet page
Nov 6, 2023
00009c1
Display data when bouquet is created on edit page
Nov 7, 2023
c45e532
Edit config
Nov 7, 2023
0b83173
Edit path
Nov 7, 2023
3dc6966
use lint
Nov 7, 2023
8a6bcd6
Run format
Nov 7, 2023
37888c8
Edit id for url when there is no dataset
Nov 7, 2023
6c6631b
Standardise text
Nov 8, 2023
390a921
Edit function
Nov 8, 2023
b2163cf
Refacto
Nov 8, 2023
be14dbd
Edit code res
Nov 8, 2023
0fb8ea6
Edit step4 design
Nov 8, 2023
caabc74
Update src/views/bouquets/BouquetEditView.vue
YeLnatSs Nov 8, 2023
a982cc3
Edit step3
Nov 8, 2023
7b063ff
Rename variable
Nov 9, 2023
a2fc666
Edit tag and add blank
Nov 9, 2023
79f80a9
Renaming variable
Nov 9, 2023
0251b87
Rename var
Nov 9, 2023
8526cd5
Fix camelcase variable
Nov 9, 2023
3dcc054
Edit wording
Nov 9, 2023
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
41 changes: 41 additions & 0 deletions configs/ecospheres/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,47 @@ website:
# display settings
organizations_list_page_size: 9

# For step 2 of bouquet creation
themes:
- name: Produire
subthemes:
- name: Nucléaire
- name: Tertiaire (incluant les bâtiments publics de l'État et des collectivités, hors logement)
- name: Production d'électricité décarbonée (hors nucléaire)
- name: Se nourrir
subthemes:
- name: Alimentation
- name: Agriculture et pêche
- name: Se loger
subthemes:
- name: Construction et rénovation des logements
- name: Aménagements des villes
- name: Se déplacer
subthemes:
- name: Voitures et infrastructures routières
- name: Mobilité courte distance (hors voiture)
- name: Mobilité longue distance (avion, train)
- name: Préserver
subthemes:
- name: Eau
- name: Sols
- name: Océans et mers
- name: Forêt
- name: Consommer
subthemes:
- name: Consommation plus durable (ménages)
- name: Numérique responsable
- name: Achats durables (de l'État, des collectivités et des entreprises)
- name: Chantiers transverses
subthemes:
- name: Le financement qui permet de définir des trajectoires d'investissement crédibles et cohérentes
- name: La planification et la différenciation territoriale selon les caractéristiques et les spécificités de chaque territoire, incluant les territoires ultra-marins
- name: La transition des filières avec la gestion des emplois, des formations et des compétences
- name: Les données environnementales
- name: Les services publics exemplaires
- name: La transition juste et les mesures d’accompagnement, pour ne laisser personne au bord du chemin
- name: La sobriété des usages et des ressources

# 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
22 changes: 22 additions & 0 deletions src/assets/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
.multiselect {
--ms-bg: var(--background-contrast-grey);
}

.fr-col-sm-45 {
flex: 0 0 45%;
max-width: 45%;
width: 45%;
}

.justify-between {
justify-content: space-between;
}

.align-baseline {
align-items: baseline;
}

.align-center {
align-items: center;
}

.block {
display: block;
}
7 changes: 6 additions & 1 deletion src/components/Tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ const props = defineProps(['title', 'name', 'show', 'text'])
{{ title }}
<span class="required">&nbsp;*</span>
</div>
<button @click.prevent="show = !show">
<button
@mouseover="show = true"
@mouseout="show = false"
@click.prevent="show = !show"
@blur="show = false"
>
<VIcon
name="ri-question-fill"
color="var(--blue-france-sun-113-625)"
Expand Down
10 changes: 10 additions & 0 deletions src/store/TopicStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ export const useTopicStore = defineStore('topic', {
const idx = this.data.findIndex((b) => b.id === topic_id)
this.data[idx] = res
return res
},
/**
bonjourmauko marked this conversation as resolved.
Show resolved Hide resolved
* Delete an entity (DELETE)
*
* @param {string} entityId
* @returns {Promise}
*/
async delete(entityId) {
return await this.makeRequestAndHandleResponse(
`${this.url()}/${entityId}/`,'delete')
}
}
})
111 changes: 83 additions & 28 deletions src/views/bouquets/BouquetDetailView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useRoute, useRouter } from 'vue-router'

import config from '@/config'

import Tile from '../../components/Tile.vue'
import { useDatasetStore } from '../../store/DatasetStore'
import { useTopicStore } from '../../store/TopicStore'
import { useUserStore } from '../../store/UserStore'
Expand All @@ -20,11 +19,11 @@ const datasets = ref([])

const description = computed(() => descriptionFromMarkdown(bouquet))

const goToEdit = () => {
router.push({ name: 'bouquet_edit', params: { bid: bouquet.value.slug } })
const goToCreate = () => {
router.push({ name: 'bouquet_add' })
}

const canEdit = computed(() => {
const canCreate = computed(() => {
return (
userStore.isAdmin() ||
(userStore.$state.isLoggedIn &&
Expand All @@ -44,31 +43,87 @@ onMounted(() => {

<template>
<div class="fr-container--fluid fr-mt-4w fr-mb-4w">
<h1>{{ bouquet.name }}</h1>
<div v-html="description"></div>

<h2 class="fr-mt-2w">Jeux de données</h2>
<div v-if="!datasets.length">Pas de jeu de données dans ce bouquet.</div>
<ul v-else class="fr-grid-row fr-grid-row--gutters es__tiles__list">
<li v-for="d in datasets" class="fr-col-12 fr-col-lg-4">
<Tile
:link="`/datasets/${d.slug}`"
:title="d.title"
:description="d.description"
:img="d.organization.logo"
:is-markdown="true"
:notice="
bouquet.extras[`${config.universe.name}:${d.id}:description`]
<div class="bouquet__header fr-mb-4w">
<div class="bouquet__header__left">
<h3 class="fr-m-0">{{ bouquet.name }}</h3>
<DsfrTag
v-if="bouquet.extras"
class="fr-ml-3w"
:label="
bouquet.extras[`${config.universe.name}:informations`][0].theme
"
/>
</li>
</ul>
<DsfrButton
v-if="canEdit"
class="fr-mt-4w"
label="Modifier le bouquet"
icon="ri-pencil-line"
@click="goToEdit"
/>
</div>
<DsfrButton
v-if="canCreate"
label="Créer un bouquet"
icon="ri-pencil-line"
@click="goToCreate"
/>
</div>
<div class="bouquet__container fr-p-6w">
<h5><strong>Objectif du bouquet</strong></h5>
<div v-html="description" />

<div
v-if="
bouquet.extras &&
bouquet.extras[`${config.universe.name}:datasets_properties`]
"
>
<h5>
Données utilisées ({{
bouquet.extras[`${config.universe.name}:datasets_properties`]
.length
}})
</h5>
<DsfrAccordionsGroup>
<li
v-for="property in bouquet.extras[
YeLnatSs marked this conversation as resolved.
Show resolved Hide resolved
`${config.universe.name}:datasets_properties`
]"
>
<DsfrAccordion
:title="property.libelle"
:expanded-id="property.id"
@expand="property.id = $event"
>
<div class="fr-mb-3w">
{{ property.raison }}
</div>
<a
v-if="property.uri"
class="fr-btn fr-btn--secondary block fr-ml-auto"
:href="property.uri"
>Voir le catalogue source</a
>
</DsfrAccordion>
</li>
</DsfrAccordionsGroup>
</div>
</div>
</div>
</template>

<style scoped lang="scss">
.bouquet {
&__header {
display: flex;
align-items: center;
justify-content: space-between;

&__left {
display: flex;
align-items: center;
}
}

&__container {
border: 1px solid var(--border-default-grey);

:deep a {
color: var(--text-action-high-blue-france);
}
}
}
</style>
Loading