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/siret project catalog impact nuxt #1467

Open
wants to merge 75 commits into
base: main
Choose a base branch
from

Conversation

dolemoine
Copy link
Collaborator

@dolemoine dolemoine commented Dec 27, 2024

Ajout du filtrage sur le catalogue projet et refactorisation filtres et composants liées

Améliorations de l'interface utilisateur et des composants :

  • apps/nuxt/src/components/catalog/CatalogLayout.vue : Ajout d'un nouveau composant CatalogLayout pour standardiser la mise en page des catalogue.
  • apps/nuxt/src/components/catalog/CatalogPrograms.vue, apps/nuxt/src/components/catalog/CatalogProjects.vue : Refactorisation de ces composants pour utiliser le nouveau composant CatalogLayout.

Modifications de la gestion des filtres

  • apps/nuxt/src/stores/filters.ts: Ajout d'un nouveau store pour gérer globalement les filtres catalogues et pages de
  • apps/nuxt/src/stores/program.ts et apps/nuxt/src/stores/project.ts: Suppression des filtres spécifiques à chaque store au profit des filtres générique sur store apps/nuxt/src/stores/filters.ts.
  • Refactorisation globale pour utiliser le nouveau store apps/nuxt/src/stores/filters.ts

Modifications supplémentaires :

  • apps/nuxt/src/components/filters/FiltersAccordion.vue : Ajout d'un nouveau composant FiltersAccordion pour gérer la logique d'affichage des filtres et améliorer l'expérience utilisateur. Les ProgramFiltersAccordion.vue et ProjectFiltersAccordion dépendent de ce nouveau FiltersAccordion.vue.
  • apps/nuxt/src/components/filters/ModalFilter.vue: refactorisation du ProgramModalFilter.vue pour le rendre générique et utilisable sur les pages programmes et projet.
  • apps/nuxt/src/components/identification/TeeRegisterModal.vue : Mise à jour de la modal d'inscription pour réinitialiser les états des filtres lors de la réinitialisation du SIRET.

Related issues:

close #1431
close #1433

Introduced a new company data filter to improve the customization of program listings based on selected company attributes. The filter integration enables toggling visibility and selection of programs through company-specific criteria, enhancing user navigation and interaction within the program catalog. Modifications include updates to related components, data handling, and eligibility checks to align with the new filter functionality.
Updated ProgramFiltersAccordion component to enhance filter visibility control by replacing `shouldDisplayFilter` with `canDisplayFilter` and introducing `companyDataFilterVisibilityClass`. This change ensures proper class assignment based on company's data presence, improving clarity and maintainability of the filter logic. Adjusted active accordion index initialization for better UI responsiveness.
This commit introduces a newline to enhance code readability and maintain formatting consistency. While it may seem minor, such adjustments contribute to better organized code and ease of future maintenance.
Replaced hardcoded filter keys with `FilterItemKeys` enum for consistency and maintainability. Updated related components, stores, and utility functions to adopt the new structure. This simplifies key management and improves code readability.
Replaced hardcoded timeouts with a shared `timeOut` constant to enhance maintainability in e2e tests. Simplified logic in `usedTrack.ts` for clarity and updated Playwright reporter configuration for better control on CI systems.
… logic.

Moved the company filter configuration into a standalone constant and adjusted its rendering logic. This enhances code clarity and maintainability by isolating the company filter from other filters in the accordion.
Replaced the `companyDataAccordion` ref with a primitive `number` value since reactivity was not required. Simplifies the code and avoids unnecessary overhead.
Updated filter to include conditional grey background and text for inactive state. Improved layout with grid rows for better alignment and spacing. This enhances the component's visual hierarchy and accessibility.
Introduce the `resetFilter` method to reset specific filters in the program store. Updated the `ProgramFilter` logic to utilize `resetFilter` for improved filter management consistency. Minor import adjustments were also made for better organization.
Introduced a mapping object to convert StructureSize enums to user-friendly text labels. Updated the company size filter to display these labels, improving clarity and usability of the company data filtering component.
# Conflicts:
#	apps/web-e2e/src/config.ts
#	apps/web-e2e/src/programResults.spec.ts
#	apps/web-e2e/src/projectResults.spec.ts
#	apps/web/src/components/identification/TeeRegisterModal.vue
Replaced all instances of `CompanyDataStorage` with `CompanyData` for streamlined and consistent company data access. Updated methods and references accordingly to enhance maintainability and readability across components.
Replaced `CompanyDataStorage` with `CompanyData` for improved consistency and modernized data handling. Adjusted related method calls and imports, ensuring better alignment with current code practices and reducing redundancy. Updated UI logic to reflect changes in navigation store behavior.
Updated the icon span with a new class for padding and adjusted its pseudo-element styling to improve alignment and consistency. Ensures better visual presentation across the component.
Reinstates the link for the "NotEligible" program state, redirecting users to the catalog of eligible programs. This provides a clearer path for users to explore relevant assistance options.
Renamed the `programFiltersType` type to `ProgramFiltersType` across the codebase for consistency with PascalCase naming conventions. This improves code readability and aligns with type naming standards in the project.
@dolemoine dolemoine requested a review from ttdm January 20, 2025 11:04
# Conflicts:
#	apps/nuxt/src/tools/companyData/companyDataSchemaValidator.ts
#	apps/nuxt/src/tools/companyData/types/companyDataType.ts
#	libs/backend-ddd/src/program/infrastructure/preprocessProgramsPublicodes.ts
#	libs/backend-ddd/src/project/domain/projectFeatures.ts
#	libs/common/src/establishment/naf1.ts
#	libs/common/src/establishment/types.ts
…panyData`

Remove `null` as a possible value for the `title` prop, ensuring stricter type-checking. This update improves type safety and aligns with expected usage.
Reorganized and renamed filter components for better modularity. Introduced a reusable `ModalFilter` component and updated corresponding references. Simplified and standardized filter logic across programs and projects.
apps/nuxt/src/components/catalog/CatalogLayout.vue Outdated Show resolved Hide resolved
apps/nuxt/src/components/catalog/CatalogProjects.vue Outdated Show resolved Hide resolved
apps/nuxt/src/components/catalog/CatalogProjects.vue Outdated Show resolved Hide resolved
apps/nuxt/src/components/catalog/CatalogProjects.vue Outdated Show resolved Hide resolved
apps/nuxt/src/components/filters/FiltersAccordion.vue Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Petite réflexion d'archi globale mais j'ai ll'impression que serait bien de clarifier en réu dev ce qu'on veut traiter comme du filtre front vs de la responsabilité du back.

J'ai l'impression qu'on avait la volonté de passer pas mal de choses dans le back et qu'au final on a tout repassé dans le front.

Après c'est très clean !

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partant pour échanger sur le sujet sur un point tech

apps/nuxt/src/tools/project/projectFilter.ts Show resolved Hide resolved
@ttdm
Copy link
Collaborator

ttdm commented Jan 22, 2025

Message général associé à la review :

Praise, gros travail de refacto !

Suggestion d'amélioration :

  • que ce soit sur la page catalogue projet ou programme, le chevron du filtre enteprise n'est pas fonctionnel; il est impossible de "cacher" les éléments d'entreprise. Idem en Prod. Suggestion (si simple) : supprimer le chevron

Added `<script setup lang="ts"></script>` blocks to ensure proper TypeScript handling in `ProjectModalFilter.vue` and `ProgramModalFilter.vue`. This update improves consistency and follows best practices for script usage in Vue 3 components.
@dolemoine
Copy link
Collaborator Author

Suggestion d'amélioration :

* que ce soit sur la page catalogue projet ou programme, le chevron du filtre enteprise n'est pas fonctionnel; il est impossible de "cacher" les éléments d'entreprise. Idem en Prod. Suggestion (si simple) : supprimer le chevron

Comme discuté ce matin, ce point est vu avec Coline et une amélioration sera embarquée prochainement

@dolemoine dolemoine requested review from yvalentin and removed request for oumeimaelisbihani January 22, 2025 20:19
Introduced `ProjectEligibility` class to centralize the eligibility check, replacing inline filtering logic across the codebase. This improves code maintainability and promotes consistency in project queries. Removed redundant `onNuxtReady` call in `CatalogProjects.vue` for optimization.
# Conflicts:
#	apps/nuxt/src/components/catalog/CatalogPrograms.vue
#	apps/nuxt/src/components/catalog/CatalogProjects.vue
#	apps/nuxt/src/middleware/resetFilters.ts
…ove reusability after home page refacto

Introduced `SimpleProjectList`, `TeeHomeProjectList`, and `CatalogBanner` components to enhance modularity and reusability. Updated existing components to use these new modular elements, simplifying logic and reducing duplication across the codebase.
@dolemoine
Copy link
Collaborator Author

Note : cette PR embarque également un peu de refacto suite à la refonte de la home page. c'est un point d'attention à avoir lors de la review @yvalentin

dolemoine and others added 7 commits January 24, 2025 10:09
…ect Catalog

Move `hasFullRegisteredData` to a reactive `ref` and initialize it within `onNuxtReady`. Simplify template class binding for improved readability and maintainability.
The .project-cards-container style is moved from CatalogProjects.vue to SimpleProjectList.vue for better component structure.
Replaced `projectList` with `sortedProjects` for better clarity and removed redundant computed logic in `CatalogProjects.vue`. Updated layout in `CatalogLayout.vue` to improve error handling, spinner logic, and title rendering. These changes enhance maintainability and UI consistency.
…t-nuxt' into feat/siret-project-catalog-impact-nuxt

# Conflicts:
#	apps/nuxt/src/components/catalog/CatalogProjects.vue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants