Skip to content

Commit

Permalink
(hel-740) fix affichage tableau comparaison (#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
schlaifa authored Jan 20, 2025
1 parent e040d4c commit 0c54f80
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 30 deletions.
7 changes: 6 additions & 1 deletion src/frontend/ui/commun/Table/Table.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@
color: var(--blue-france-sun-113-625);
}

.table_container_surcharge {
.table_container_vscroll {
overflow-x: auto;
max-height: calc(100vh - 200px);
}

.table_container_sticky-header {
overflow: unset !important;
}

Expand Down
8 changes: 5 additions & 3 deletions src/frontend/ui/commun/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { TableExtensionCalculMoyenne } from "./TableExtensionCalculMoyenne";
interface Header {
label: string;
key: string;
nomComplet: string;
isButton?: boolean;
sort?: boolean;
info?: boolean;
Expand Down Expand Up @@ -145,7 +146,8 @@ const TableHeader = ({ headers, order, orderBy, setOrderBy, setOrder, onClickInf
</div>
</th>
{headers.map((header, index) =>
<th className={isCenter ? "fr-cell--center" : ""} key={index}>
<th className={`${isCenter ? "fr-cell--center" : ""} ${header.key === 'socialReason' ? "fr-cell--fixed" : ''}`}
key={index} title={header.nomComplet}>
<span className="fr-cell__title">{header.label}</span>
{header.info && onClickInfobull && (
<button
Expand Down Expand Up @@ -181,7 +183,7 @@ const TableBody = ({ headers, data, forMoyenne, total, selectedRows, handleSelec
</div>
</th>
{headers.map((header, colIndex) => (
<td className={`${isCenter || header.key === "favori" ? "fr-cell--center" : styles["cell-container"]} ${(row as any)[header.key] === 'Consultation non autorisée' ? styles["cell-not-authorized"] : ''}`} key={colIndex}>
<td className={`${isCenter || header.key === "favori" ? "fr-cell--center" : styles["cell-container"]} ${header.key === 'socialReason' ? "fr-cell--fixed" : ''} ${(row as any)[header.key] === 'Consultation non autorisée' ? styles["cell-not-authorized"] : ''}`} key={colIndex}>
{header.key === "delete" && (
<button
aria-controls="fr-modal-2"
Expand Down Expand Up @@ -254,7 +256,7 @@ export const Table = ({
return (
<div id="table-selectable-component">
<div className="fr-table__wrapper">
<div className={`fr-table__container ${!isShowAvrage ? styles["table_container_surcharge"] : ""}`}>
<div className={isShowAvrage ? styles["table_container_vscroll"] : styles["table_container_sticky"]}>
<div className="fr-table__content">
<table id="table-selectable">
<TableHeader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function TableExtensionCalculMoyenne({ dataSource, total, setEstCeOuvert
} else if (cle === "capaciteMoyenne" || cle === "fileActivePersonnesAccompagnesMoyenne") {
return <td className="fr-cell--center" key={cle}>{dataSource && dataSource[cle] ? dataSource[cle] : `-`}</td>;
} else {
return <td className="fr-cell--center" key={cle}>{dataSource && dataSource[cle as keyof MoyenneResultatComparaison] !== null ? `${dataSource[cle as keyof MoyenneResultatComparaison]} %` : `-`}</td>;
return <td className="fr-cell--center" key={cle}></td>;
}
})}
</tr>
Expand Down
37 changes: 19 additions & 18 deletions src/frontend/ui/comparaison/ComparaisonPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,32 @@ export const ComparaisonPage = ({ listeAnnees, datesMisAjour, codeProfiles, code
};

const tableHeaders = [
{ label: "", key: "delete" },
{ label: "", key: "etsLogo", sort: true },
{ label: "", key: "favori" },
{ label: "Raison Sociale Courte", key: "socialReason", sort: true, orderBy: "raison_sociale_courte" },
{ label: "Numéro Finess", key: "numéroFiness", sort: true, orderBy: "numero_finess_etablissement_territorial" },
{ label: "", key: "delete", nomComplet: "" },
{ label: "", key: "etsLogo", nomComplet: "", sort: true },
{ label: "", key: "favori", nomComplet: "" },
{ label: "Raison sociale", nomComplet: "Raison sociale", key: "socialReason", sort: true, orderBy: "raison_sociale_courte" },
{ label: "N° FINESS", nomComplet: "N° FINESS", key: "numéroFiness", sort: true, orderBy: "numero_finess_etablissement_territorial" },
{
label: `Capacité Totale au ` + StringFormater.formatDate(datesMisAjour.date_mis_a_jour_finess),
nomComplet: `Capacité Totale au ` + StringFormater.formatDate(datesMisAjour.date_mis_a_jour_finess),
key: "capacite",
info: true,
sort: true,
orderBy: "capacite_total",
},
{ label: "Réalisation de l'activité", key: "realisationActivite", info: true, sort: true, orderBy: "taux_realisation_activite" },
{ label: "Activité personnes accompagnées", key: "fileActivePersonnesAccompagnes", info: true, sort: true, orderBy: "file_active_personnes_accompagnees" },
{ label: "TO HP", key: "hebergementPermanent", info: true, sort: true, orderBy: "taux_occupation_en_hebergement_permanent" },
{ label: "TO HT", key: "hebergementTemporaire", info: true, sort: true, orderBy: "taux_occupation_en_hebergement_temporaire" },
{ label: "TO AJ", key: "acceuilDeJour", info: true, sort: true, orderBy: "taux_occupation_accueil_de_jour" },
{ label: "Prestations externes vs directes", key: "prestationExterne", info: true, sort: true, orderBy: "taux_prestation_externes" },
{ label: "Rotation du personnel", key: "rotationPersonnel", info: true, sort: true, orderBy: "taux_rotation_personnel" },
{ label: "ETP vacants", key: "etpVacant", info: true, sort: true, orderBy: "taux_etp_vacants" },
{ label: "Absentéisme", key: "absenteisme", info: true, sort: true, orderBy: "taux_absenteisme_hors_formation" },
{ label: "CAF", key: "tauxCaf", info: true, sort: true, orderBy: "taux_de_caf" },
{ label: "Vétusté", key: "vetusteConstruction", info: true, sort: true, orderBy: "taux_de_vetuste_construction" },
{ label: "FRNG", key: "roulementNetGlobal", info: true, sort: true, orderBy: "fonds_de_roulement" },
{ label: "Résultat net comptable", key: "resultatNetComptable", info: true, sort: true, orderBy: "resultat_net_comptable" },
{ label: "Tx de réalisation de l’activité ", nomComplet: "Taux de réalisation de l’activité ", key: "realisationActivite", info: true, sort: true, orderBy: "taux_realisation_activite" },
{ label: "File active des personnes accompagnées sur la période", nomComplet: "File active des personnes accompagnées sur la période", key: "fileActivePersonnesAccompagnes", info: true, sort: true, orderBy: "file_active_personnes_accompagnees" },
{ label: "TO HP", key: "hebergementPermanent", nomComplet: "Taux d’occupation en hébergement permanent", info: true, sort: true, orderBy: "taux_occupation_en_hebergement_permanent" },
{ label: "TO HT", nomComplet: "Taux d’occupation en hébergement temporaire", key: "hebergementTemporaire", info: true, sort: true, orderBy: "taux_occupation_en_hebergement_temporaire" },
{ label: "TO AJ", nomComplet: "Taux d’occupation en accueil de jour", key: "acceuilDeJour", info: true, sort: true, orderBy: "taux_occupation_accueil_de_jour" },
{ label: "Tx de prest ext sur les prest directes", nomComplet: "Taux de prestations externes sur les prestations directes", key: "prestationExterne", info: true, sort: true, orderBy: "taux_prestation_externes" },
{ label: "Tx de rotation du personnel sur effectifs réels", nomComplet: "Taux de rotation du personnel sur effectifs réels", key: "rotationPersonnel", info: true, sort: true, orderBy: "taux_rotation_personnel" },
{ label: "Tx d'ETP vacants au 31/12", nomComplet: "Taux d'ETP vacants au 31/12", key: "etpVacant", info: true, sort: true, orderBy: "taux_etp_vacants" },
{ label: "Tx d'absentéisme", nomComplet: "Taux d'absentéisme", key: "absenteisme", info: true, sort: true, orderBy: "taux_absenteisme_hors_formation" },
{ label: "Taux de CAF", nomComplet: "Tx de CAF", key: "tauxCaf", info: true, sort: true, orderBy: "taux_de_caf" },
{ label: "Taux de vétusté de construction", nomComplet: "Tx de vétusté de construction", key: "vetusteConstruction", info: true, sort: true, orderBy: "taux_de_vetuste_construction" },
{ label: "FRNG", nomComplet: "Fond de roulement net global", key: "roulementNetGlobal", info: true, sort: true, orderBy: "fonds_de_roulement" },
{ label: "Résultat net comptable", nomComplet: "Résultat net comptable", key: "resultatNetComptable", info: true, sort: true, orderBy: "resultat_net_comptable" },
];

// Ovrir la Pop-up d'info des icones de tableau
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import styles from "./ResultatRechercheAvancee.module.css"
import { TableHeaderRechercheAvancee } from "./TableHeaderRechercheAvancee";

const tableHeaders = [
{ label: "", key: "etsLogo", orderBy: "type", sort: true },
{ label: "", key: "favori" },
{ label: "Raison Sociale", key: "socialReason", orderBy: "raison_sociale_courte", sort: true },
{ label: "Commune", key: "commune", sort: true },
{ label: "Département", key: "departement", sort: true },
{ label: "Finess", key: "numéroFiness", orderBy: "numero_finess", sort: true },
{ label: "Rattachement(s)", key: "rattachement" },
{ label: "", nomComplet: "", key: "etsLogo", orderBy: "type", sort: true },
{ label: "", nomComplet: "", key: "favori" },
{ label: "Raison Sociale", nomComplet: "", key: "socialReason", orderBy: "raison_sociale_courte", sort: true },
{ label: "Commune", nomComplet: "", key: "commune", sort: true },
{ label: "Département", nomComplet: "", key: "departement", sort: true },
{ label: "Finess", nomComplet: "", key: "numéroFiness", orderBy: "numero_finess", sort: true },
{ label: "Rattachement(s)", nomComplet: "", key: "rattachement" },
];

export type SelectedRows = Readonly<{
Expand Down

0 comments on commit 0c54f80

Please sign in to comment.