Skip to content

Commit cb1668a

Browse files
committed
Supprime les blocs indicateurs du TDB referentiel
1 parent 8f64d37 commit cb1668a

File tree

8 files changed

+51
-247
lines changed

8 files changed

+51
-247
lines changed

apps/app/src/referentiels/tableau-de-bord/IndicateursCard.tsx

Lines changed: 0 additions & 88 deletions
This file was deleted.

apps/app/src/referentiels/tableau-de-bord/referentiel.card.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { actionIdToLabel } from '@/app/app/labels';
22
import { ReferentielId } from '@/domain/referentiels';
33
import { TableOptions } from 'react-table';
44
import { ProgressionRow } from '../DEPRECATED_scores.types';
5-
import IndicateursCard from './IndicateursCard';
65
import { EtatDesLieuxGraphs } from './graphs/EtatDesLieuxGraphs';
76
import { ScoreRempli, ScoreVide } from './labellisation/Scores';
87

@@ -46,12 +45,7 @@ export const ReferentielCard = ({
4645
progressionScore={progressionScore}
4746
potentiel={potentiel}
4847
/>
49-
<IndicateursCard
50-
isReadonly={isReadonly}
51-
collectiviteId={collectiviteId}
52-
referentielId={referentiel}
53-
/>
54-
{/** Autres graph */}
48+
5549
<EtatDesLieuxGraphs
5650
referentiel={referentiel}
5751
displayEtatDesLieux={displayEtatDesLieux}
@@ -71,11 +65,6 @@ export const ReferentielCard = ({
7165
axeId: d.action_id,
7266
}))}
7367
/>
74-
<IndicateursCard
75-
isReadonly={isReadonly}
76-
collectiviteId={collectiviteId}
77-
referentielId={referentiel}
78-
/>
7968
</>
8069
)}
8170
</div>

apps/app/src/referentiels/tableau-de-bord/useIndicateurSummary.ts

Lines changed: 0 additions & 37 deletions
This file was deleted.

apps/app/src/referentiels/tableau-de-bord/useOpenDataIndicateurs.ts

Lines changed: 0 additions & 110 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- Deploy tet:indicateurs/remove-view-indicateur-summary to pg
2+
3+
BEGIN;
4+
5+
DROP VIEW indicateur_summary;
6+
7+
COMMIT;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
-- Revert tet:indicateurs/remove-view-indicateur-summary from pg
2+
3+
BEGIN;
4+
5+
CREATE VIEW public.indicateur_summary AS
6+
SELECT c.id AS collectivite_id,
7+
ct.nom AS categorie,
8+
count(def.*) AS nombre,
9+
count(iv.*) AS rempli
10+
FROM collectivite c
11+
CROSS JOIN categorie_tag ct
12+
LEFT JOIN indicateur_categorie_tag ict ON ct.id = ict.categorie_tag_id
13+
LEFT JOIN indicateur_definition def ON ict.indicateur_id = def.id
14+
LEFT JOIN ( SELECT indicateur_valeur.indicateur_id,
15+
indicateur_valeur.collectivite_id
16+
FROM indicateur_valeur
17+
WHERE indicateur_valeur.resultat IS NOT NULL
18+
GROUP BY indicateur_valeur.indicateur_id, indicateur_valeur.collectivite_id) iv ON def.id = iv.indicateur_id AND c.id = iv.collectivite_id
19+
WHERE ct.collectivite_id IS NULL AND (ct.nom <> ALL (ARRAY['resultat'::text, 'impact'::text, 'prioritaire'::text])) AND def.collectivite_id IS NULL
20+
GROUP BY c.id, ct.id
21+
UNION ALL
22+
SELECT perso.collectivite_id,
23+
'perso'::text AS categorie,
24+
count(perso.*) AS nombre,
25+
count(iv.*) AS rempli
26+
FROM indicateur_definition perso
27+
LEFT JOIN ( SELECT indicateur_valeur.indicateur_id,
28+
indicateur_valeur.collectivite_id
29+
FROM indicateur_valeur
30+
WHERE indicateur_valeur.resultat IS NOT NULL
31+
GROUP BY indicateur_valeur.indicateur_id, indicateur_valeur.collectivite_id) iv ON perso.id = iv.indicateur_id AND perso.collectivite_id = iv.collectivite_id
32+
WHERE perso.collectivite_id IS NOT NULL
33+
GROUP BY perso.collectivite_id;
34+
35+
COMMIT;

data_layer/sqitch/sqitch.plan

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,3 +889,4 @@ collectivite/collectivite_relations 2025-08-18T16:30:40Z System Administrator <r
889889
@v4.73.0 2025-08-27T12:05:16Z System Administrator <root@MacBook-Air-de-Thibaut-2.local> # Ajout des relations entre collectivites
890890

891891
2025-07-22-remove-view-action-audit-state 2025-07-22T16:00:42Z Frederic Arnoux <frederic.arnoux@beta.gouv.fr> # Remove view action_audit_state
892+
indicateur/remove-view-indicateur-summary 2025-09-03T15:59:32Z Frederic Arnoux <frederic.arnoux@beta.gouv.fr> # Remove view indicateur_summary
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- Verify tet:indicateurs/remove-view-indicateur-summary on pg
2+
3+
BEGIN;
4+
5+
-- XXX Add verifications here.
6+
7+
ROLLBACK;

0 commit comments

Comments
 (0)