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

Comparateur modifs fedene #1003

Merged
merged 20 commits into from
Feb 13, 2025
Merged

Comparateur modifs fedene #1003

merged 20 commits into from
Feb 13, 2025

Conversation

martinratinaud
Copy link
Collaborator

@martinratinaud martinratinaud commented Feb 11, 2025

Suite aux retours reçus, plusieurs modifications

  • affichage du graphe
  • textes
  • ordre des modes de chauffage

https://trello.com/c/hLgdTT2W/1426-comparateur-modifs-suite-retour-fedene

Copy link
Member

@totakoko totakoko left a comment

Choose a reason for hiding this comment

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

👍 Bon le composant devient pas mal complexe mais ça a l'air de toujours marcher. 😁

J'ai fait quelques remarques, mais c'est du bonus.

@@ -171,12 +178,12 @@ export const DisclaimerButton: React.FC<React.HTMLAttributes<HTMLDivElement>> =
return (
<>
<DisclaimerModal />
<Text size="xs" color="warning" className={className}>
<Icon name="fr-icon-info-line" size="xs" /> Tous les modes de chauffage et de refroidissement ne sont pas interchangeables.{' '}
<p className={cx('fr-text--xs text-warning', className)}>
Copy link
Member

Choose a reason for hiding this comment

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

RIP Text 🥹

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Effectivement, Text avait un fr-mb-0 en dur du coup c'était pas adapté là

const costLowerPercent = Math.max(0, Math.round((costLowerBound / scaleCostMaxValue) * 100));
const costUpperPercent = Math.min(100, Math.round((costUpperBound / scaleCostMaxValue) * 100));
const costWidth = costUpperPercent - costLowerPercent;
const graphSectionType: string = name.includes(' individuel') ? 'Chauffage individuel' : 'Chauffage collectif';
Copy link
Member

Choose a reason for hiding this comment

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

Je suppose que le individuel n'est pas une typo ? 🙄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

effectivement, j'ai mis un comment du coup

if (graphSectionTitle !== (graphSectionType as string)) {
showSectionTitle = true;
graphSectionTitle = graphSectionType;
}
Copy link
Member

Choose a reason for hiding this comment

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

  1. je dirais que le as string est inutile vu que graphSectionType est déjà un string
  2. graphSectionTitle vaut toujours graphSectionType non ? pas besoin de if. Et const showSectionTitle = graphSectionTitle !== graphSectionType a priori

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  1. Oui
  2. Non, il faut détecter le moment ou le type de chauffage change et l'assigner à graphSectionTitle du coup ton code ne fonctionne pas

<Checkbox
small
options={(['Réseau de chaleur'] satisfies ModeDeChauffage[]).map(createOptionProps)}
state={nearestReseauDeChaleur ? 'success' : 'default'}
className="[&_p]:!mb-0"
Copy link
Member

Choose a reason for hiding this comment

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

margin bottom 0 important pour tous les p à l'intérieur de la checkbox ? Merci tailwind de faciliter les hacks 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Effectivement mais bien pratique avec le DSFR :-)

le raccordement à un réseau de chaleur est pertinent pour les bâtiments à chauffage collectif (gaz ou fioul), mais nécessite des
travaux conséquents et coûteux pour les bâtiments à chauffage individuel.
le passage d'un mode de chauffage individuel à collectif n'est possible que moyennant des travaux conséquents et coûteux (non pris
en compte dans l'outil)
Copy link
Member

Choose a reason for hiding this comment

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

Ah ouais y'a pas le cout d'installation dans publicodes ? Ca ne prend pas en compte les travaux de voirie ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pas vraiment regardé, c'est le texte que Florence m'a donné et revu avec la FEDENE

<div
className="relative overflow-hidden whitespace-nowrap px-2 py-0.5 text-right font-extrabold text-white hover:overflow-visible sm:text-xs md:text-sm"
style={{ flex: maxCostPercent }}
className="relative bg-fcu-purple/10 whitespace-nowrap py-0.5 tracking-tighter text-left font-extrabold text-fcu-purple sm:text-xs md:text-sm flex items-center justify-start"
Copy link
Member

Choose a reason for hiding this comment

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

Avec tracking-tighter je trouve qu'on ne distingue pas facilement les milliers. C'est peut-être lié à la font / taille de police aussi.
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

J'ai mis tight

@martinratinaud martinratinaud force-pushed the comparateur_modifs_fedene branch from cd52c46 to e40844a Compare February 12, 2025 10:51
@martinratinaud martinratinaud merged commit a7b3e39 into dev Feb 13, 2025
4 of 5 checks passed
@martinratinaud martinratinaud deleted the comparateur_modifs_fedene branch February 13, 2025 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants