Skip to content

Commit

Permalink
fix action référentiel : affiche les indicateurs liés enfants
Browse files Browse the repository at this point in the history
  • Loading branch information
cparthur committed Oct 30, 2024
1 parent 46ef39e commit fc0ebc1
Showing 1 changed file with 26 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
import {Link, useHistory} from 'react-router-dom';
import {addTargetToContentAnchors} from 'utils/content';
import {Tabs, Tab} from 'ui/shared/Tabs';
import {ActionDefinitionSummary} from 'core-logic/api/endpoints/ActionDefinitionSummaryReadEndpoint';
import {OrientationQuickNav} from 'app/pages/collectivite/Referentiels/QuickNav';
import { Link, useHistory } from 'react-router-dom';
import { addTargetToContentAnchors } from 'utils/content';
import { Tabs, Tab } from 'ui/shared/Tabs';
import { ActionDefinitionSummary } from 'core-logic/api/endpoints/ActionDefinitionSummaryReadEndpoint';
import { OrientationQuickNav } from 'app/pages/collectivite/Referentiels/QuickNav';
import {
ActionVueParamOption,
makeCollectiviteActionUrl,
ReferentielParamOption,
} from 'app/paths';
import {useActionVue, useReferentielId} from 'core-logic/hooks/params';
import { useActionVue, useReferentielId } from 'core-logic/hooks/params';
import HistoriqueListe from 'app/pages/collectivite/Historique/HistoriqueListe';
import {ActionBottomNav} from './ActionNav';
import { ActionBottomNav } from './ActionNav';
import ScrollTopButton from 'ui/buttons/ScrollTopButton';
import ActionPreuvePanel from 'ui/shared/actions/ActionPreuvePanel/ActionPreuvePanel';
import {DownloadDocs} from './DownloadDocs';
import { DownloadDocs } from './DownloadDocs';
import ActionAuditStatut from '../Audit/ActionAuditStatut';
import {ActionAuditDetail} from '../Audit/ActionAuditDetail';
import {useShowDescIntoInfoPanel} from '../Audit/useAudit';
import {useCurrentCollectivite} from 'core-logic/hooks/useCurrentCollectivite';
import {usePrevAndNextActionLinks} from './usePrevAndNextActionLinks';
import {ActionHeader} from './ActionHeader';
import {useActionPreuvesCount} from 'ui/shared/preuves/Bibliotheque/usePreuves';
import { ActionAuditDetail } from '../Audit/ActionAuditDetail';
import { useShowDescIntoInfoPanel } from '../Audit/useAudit';
import { useCurrentCollectivite } from 'core-logic/hooks/useCurrentCollectivite';
import { usePrevAndNextActionLinks } from './usePrevAndNextActionLinks';
import { ActionHeader } from './ActionHeader';
import { useActionPreuvesCount } from 'ui/shared/preuves/Bibliotheque/usePreuves';
import ActionFollowUp from '../EtatDesLieux/Referentiel/SuiviAction/ActionFollowUp';
import {FichesActionLiees} from './FichesActionLiees';
import {useScoreRealise} from '../EtatDesLieux/Referentiel/data/useScoreRealise';
import {useCycleLabellisation} from '../ParcoursLabellisation/useCycleLabellisation';
import {useFilteredIndicateurDefinitions} from '../Indicateurs/lists/useFilteredIndicateurDefinitions';
import { FichesActionLiees } from './FichesActionLiees';
import { useScoreRealise } from '../EtatDesLieux/Referentiel/data/useScoreRealise';
import { useCycleLabellisation } from '../ParcoursLabellisation/useCycleLabellisation';
import { useFilteredIndicateurDefinitions } from '../Indicateurs/lists/useFilteredIndicateurDefinitions';
import IndicateurChartsGrid from './IndicateurChartsGrid';
import {Alert} from '@tet/ui';
import { Alert } from '@tet/ui';

// index des onglets de la page Action
const TABS_INDEX: Record<ActionVueParamOption, number> = {
Expand All @@ -38,25 +38,28 @@ const TABS_INDEX: Record<ActionVueParamOption, number> = {
historique: 4,
};

const Action = ({action}: {action: ActionDefinitionSummary}) => {
const Action = ({ action }: { action: ActionDefinitionSummary }) => {
const actionVue = useActionVue();
const history = useHistory();
const collectivite = useCurrentCollectivite();
const collectiviteId = collectivite?.collectivite_id;
const referentielId = useReferentielId() as ReferentielParamOption;
const {prevActionLink, nextActionLink} = usePrevAndNextActionLinks(action.id);
const { prevActionLink, nextActionLink } = usePrevAndNextActionLinks(
action.id
);
const preuvesCount = useActionPreuvesCount(action);
const showDescIntoInfoPanel = useShowDescIntoInfoPanel();

const {data: indicateursLies} = useFilteredIndicateurDefinitions({
const { data: indicateursLies } = useFilteredIndicateurDefinitions({
filtre: {
actionId: action.id,
withChildren: true,
},
});

const actionScores = useScoreRealise(action);

const {status: auditStatus} = useCycleLabellisation(action.referentiel);
const { status: auditStatus } = useCycleLabellisation(action.referentiel);

if (!action || !collectivite) {
return <Link to="./referentiels" />;
Expand Down

0 comments on commit fc0ebc1

Please sign in to comment.