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: homepage projects custom priority #1552

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ca5a28d
merge
oumeimaelisbihani Dec 31, 2024
059b214
fixes
oumeimaelisbihani Dec 31, 2024
7f50ec3
logo
oumeimaelisbihani Dec 31, 2024
d6db0ef
move logo
oumeimaelisbihani Dec 31, 2024
b824b48
Merge remote-tracking branch 'origin/main' into feat/nuxt-home-page
oumeimaelisbihani Jan 9, 2025
60a4ba4
add images to texts
oumeimaelisbihani Jan 9, 2025
43ba798
align
oumeimaelisbihani Jan 9, 2025
5e470ca
title align
oumeimaelisbihani Jan 9, 2025
9e0697c
review changes
oumeimaelisbihani Jan 10, 2025
a5d7b63
fix final projectList
oumeimaelisbihani Jan 14, 2025
15cfa32
add logo, sticky header, new logo
oumeimaelisbihani Jan 15, 2025
9cc6742
change logo + hidden small screen
oumeimaelisbihani Jan 15, 2025
13d6574
Merge remote-tracking branch 'origin/main' into feat/nuxt-home-page
oumeimaelisbihani Jan 15, 2025
754ce5d
logo changes + no reset filter from homepage to catalog
oumeimaelisbihani Jan 16, 2025
d855c80
fix responsive
oumeimaelisbihani Jan 16, 2025
b0f90b5
style fix
oumeimaelisbihani Jan 16, 2025
fec8ee8
Merge remote-tracking branch 'origin/main' into feat/nuxt-home-page
oumeimaelisbihani Jan 16, 2025
63f02c9
fix unavailable programs
oumeimaelisbihani Jan 16, 2025
8fa2578
change program
oumeimaelisbihani Jan 16, 2025
c6f835d
Merge branch 'hot-fix/form-playwright-test' into feat/nuxt-home-page
oumeimaelisbihani Jan 16, 2025
7d18804
v1, mise en avant de projects spécifiques sur la homepage
ttdm Jan 17, 2025
3dff299
final changes
oumeimaelisbihani Jan 20, 2025
0b3f87a
fix scss
oumeimaelisbihani Jan 20, 2025
aa27cc1
review changes
oumeimaelisbihani Jan 20, 2025
6d2652a
Merge branch 'feat/nuxt-home-page' into feat/homepage_project_priority
ttdm Jan 20, 2025
5f6d256
update using a navigation tool
ttdm Jan 20, 2025
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
6 changes: 3 additions & 3 deletions apps/nuxt-e2e/src/form/formResultsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const tests: FormResultDataType[] = [
id: 2,
valid: true,
type: 'program',
url: 'questionnaire/resultat/projet/isolation-thermique/renovation-petit-tertiaire-prive?choix-du-parcours=j-ai-un-projet&siret=83014132100034&effectif=TPE&objectifs=building',
url: 'questionnaire/resultat/projet/isolation-thermique/pret-vert?choix-du-parcours=j-ai-un-projet&siret=83014132100034&effectif=TPE&objectifs=building',
values: {
name: { value: 'test', type: 'text' },
surname: { value: 'test', type: 'text' },
Expand All @@ -55,7 +55,7 @@ export const tests: FormResultDataType[] = [
id: 3,
valid: true,
type: 'program',
url: 'aides-entreprise/act-pas-a-pas?siret=83014132100034&effectif=TPE',
url: 'aides-entreprise/baisse-les-watts?siret=83014132100034&effectif=TPE',
values: {
name: { value: 'test', type: 'text' },
surname: { value: 'test', type: 'text' },
Expand Down Expand Up @@ -178,7 +178,7 @@ export const tests: FormResultDataType[] = [
valid: true,
manual: true,
type: 'program',
url: 'aides-entreprise/act-pas-a-pas',
url: 'aides-entreprise/baisse-les-watts',
values: {
name: { value: 'test', type: 'text' },
surname: { value: 'test', type: 'text' },
Expand Down
2 changes: 2 additions & 0 deletions apps/nuxt/src/assets/scss/footer.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@use 'tool';

.fr-footer {
box-shadow: none !important;

&__content {
flex-basis: fit-content;
margin-left: 0;
Expand Down
8 changes: 8 additions & 0 deletions apps/nuxt/src/assets/scss/grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,11 @@
top: 0;
z-index: 1000;
}

.fr-position--relative {
position: relative;
}

.fr-position--absolute {
position: absolute;
}
6 changes: 3 additions & 3 deletions apps/nuxt/src/components/TeeFooter.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<!-- FOOTER -->
<div :class="`fr-footer ${stickToBottom ? 'tee-footer-bottom' : ''}`">
<div :class="`fr-footer fr-pt-md-0 ${stickToBottom ? 'tee-footer-bottom' : ''}`">
<div class="fr-container--fluid fr-mx-md-20v fr-mx-8v">
<!-- FOOTER BODY -->
<div class="fr-footer__body fr-grid-row">
<div class="fr-footer__body fr-hidden-sm fr-grid-row">
<div class="fr-footer__brand fr-col-lg-3">
<p class="fr-logo">
République
Expand All @@ -30,7 +30,7 @@
</div>

<!-- FOOTER PARTNERS -->
<div class="fr-footer__partners">
<div class="fr-footer__partners fr-hidden-sm">
<h4 class="fr-footer__partners-title">Nos partenaires</h4>
<div class="fr-footer__partners-logos fr-grid-row">
<div class="fr-footer__partners-main">
Expand Down
17 changes: 10 additions & 7 deletions apps/nuxt/src/components/catalog/CatalogPrograms.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<template>
<TeeDsfrBreadcrumb v-if="!hasSpinner" />
<CatalogBanner>
<template #title> {{ title }} </template>
<template #description>
{{ description }}
</template>
</CatalogBanner>
<div class="fr-container--fluid fr-container--fluid--no-overflow fr-mt-6v">
<div class="fr-grid-row fr-grid-row--center">
<div class="fr-container fr-m-0 fr-p-0 fr-pl-md-2v">
<div
class="fr-col-12 fr-mt-3v"
:class="{
'fr-col-offset-md-2 fr-col-md-10 fr-col-justify--left': !hasError,
'fr-col-md-12 fr-col-justify--center': hasError
}"
>
<h1 class="fr-text--blue-france">{{ title }}</h1>
</div>
<div
class="fr-col-12 fr-mt-3v"
:class="{
Expand Down Expand Up @@ -96,7 +99,7 @@ onNuxtReady(async () => {
await new ProgramManager().getDependentCompanyData(false)
})

const title = 'Le catalogue des aides publiques à la transition écologique'
const title = 'Les aides à la transition écologique'
const description =
'Réalisez une recherche parmi les aides à la transition écologique des entreprises, proposées par l’ensemble des partenaires publics :' +
'ADEME, Bpifrance, CCI, CMA, etc.'
Expand Down
50 changes: 38 additions & 12 deletions apps/nuxt/src/components/catalog/CatalogProjects.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<template>
<TeeDsfrBreadcrumb />
<CatalogBanner>
<template #title> {{ title }} </template>
<template #description> {{ description }} </template>
</CatalogBanner>

<TeeDsfrBreadcrumb v-if="showBreadcrumbs" />
<div class="fr-container fr-mt-6v">
<div
v-if="showTitle"
class="fr-col-10 fr-col-lg-8"
>
<h1 class="fr-text--blue-france">{{ title }}</h1>
</div>
<div class="fr-grid-row fr-grid-row--center">
<div>
<div class="fr-col-12 fr-col-justify--left fr-mt-3v">
Expand All @@ -19,12 +20,15 @@
radius-size="2-5v"
/>
<div v-if="hasFilteredProjects">
<div class="fr-col-12 fr-text--blue-france tee-font-style--italic fr-mt-3v">
<div
v-if="showCounter"
class="fr-col-12 fr-text--blue-france tee-font-style--italic fr-mt-3v"
>
<TeeCounterResult :to-count="filteredProjects" />
</div>
<div class="fr-grid-row fr-grid-row--gutters fr-grid-row--left fr-mt-0">
<div
v-for="project in sortedProjects"
v-for="project in projectList"
:key="project.id"
class="fr-col-12 fr-col-sm-6 fr-col-md-6 fr-col-lg-4 no-outline"
>
Expand Down Expand Up @@ -59,32 +63,54 @@ import { useProjectStore } from '@/stores/project'
import { ProjectManager } from '@/tools/project/projectManager'
import ProjectFilter from '@/tools/project/projectFilter'
import ProjectSorter from '@/tools/project/projectSorter'
import { ThemeId } from '@/types'
import { RouteName, ThemeId } from '@/types'
import { MetaSeo } from '@/tools/metaSeo'
import { computed } from 'vue'
import { Theme } from '@/tools/theme'
import Navigation from '@/tools/navigation'

const programStore = useProgramStore()
const navigationStore = useNavigationStore()

const navigation = new Navigation()
interface Props {
showTitle?: boolean
showLimit?: number
showCounter?: boolean
showBreadcrumbs?: boolean
}
const props = withDefaults(defineProps<Props>(), {
showTitle: true,
showLimit: -1,
showCounter: true,
showBreadcrumbs: true
})
const { projects, hasError } = storeToRefs(useProjectStore())

await new ProjectManager().getProjects()

const title = 'Le catalogue des projets de transition écologique'
const title = 'Les projets de transition écologique'
const description = 'Accédez à la liste des projets de transition écologique destinées aux entreprises.'

useSeoMeta(MetaSeo.get(title, description))

const theme = Theme.getThemeFromSelectedTheme()

const filteredProjects = ProjectFilter.filter(projects, theme)
const sortedProjects = ProjectSorter.sort(filteredProjects)

const sortedProjects = computed(() => {
if (navigation.isByRouteName(RouteName.Homepage) && (!theme.value || theme.value.length === 0)) {
return ProjectSorter.homepageSort(filteredProjects).value
}
return ProjectSorter.sort(filteredProjects).value
})

const hasSpinner = computed(() => {
return navigationStore.hasSpinner
})

const projectList = computed(() => {
return props.showLimit !== -1 ? sortedProjects.value.slice(0, props.showLimit) : sortedProjects.value
})
const hasThemeCard = computed(() => {
return programStore.hasThemeTypeSelected() && !hasSpinner.value
})
Expand Down
30 changes: 0 additions & 30 deletions apps/nuxt/src/components/catalog/element/CatalogBanner.vue

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<header
role="banner"
class="fr-header"
:class="navigation.isByRouteName(RouteName.Homepage) ? 'fr-sticky' : ''"
>
<div class="fr-header__body">
<div class="fr-container width-inherit">
Expand Down Expand Up @@ -216,6 +217,10 @@ import { DsfrLanguageSelector, DsfrLogo, DsfrSearchBar, registerNavigationLinkKe

import type { DsfrLanguageSelectorElement } from '@gouvminint/vue-dsfr/types/components/DsfrLanguageSelector/DsfrLanguageSelector.vue'
import type { DsfrHeaderProps } from '@gouvminint/vue-dsfr/types/components/DsfrHeader/DsfrHeader.vue'
import Navigation from '@/tools/navigation'
import { RouteName } from '@/types'

const navigation = new Navigation()

const props = withDefaults(defineProps<DsfrHeaderProps>(), {
searchbarId: 'searchbar-header',
Expand Down
4 changes: 2 additions & 2 deletions apps/nuxt/src/components/project/list/ProjectCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ const priorityTag: string = 'A FAIRE EN PRIORITÉ'
const navigationStore = useNavigationStore()
const navigation = new Navigation()
const isCatalog = navigation.isCatalogProjects()

const isHomePage = navigation.isByRouteName(RouteName.Homepage)
const getRouteToProjectDetail = (project: ProjectType): RouteLocationRaw => {
return {
name: isCatalog ? RouteName.CatalogProjectDetail : RouteName.ProjectResultDetail,
name: isCatalog || isHomePage ? RouteName.CatalogProjectDetail : RouteName.ProjectResultDetail,
params: { projectSlug: project.slug },
query: navigationStore.query
}
Expand Down
8 changes: 6 additions & 2 deletions apps/nuxt/src/middleware/resetProgramFilters.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export default defineNuxtRouteMiddleware(() => {
useProgramStore().resetFilters()
import { RouteName } from '@/types'

export default defineNuxtRouteMiddleware((to, from) => {
if (from.name !== RouteName.Homepage) {
useProgramStore().resetFilters()
}
})
Loading
Loading