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

Personnalisation 1.1.2.1, plus de 20000 habitants #2538

Open
wants to merge 193 commits into
base: Modification-pondération-4.3.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
cbf34c1
change la fonction d'affichage arrondi des scores
marc-rutkowski Nov 8, 2022
24339ba
Ajout de la colonne est_auditeur à la vue mes_collectivites
amandinejacquelin Nov 8, 2022
0d3cea1
Ajout de la colonne est_auditeur à la vue mes_collectivites
amandinejacquelin Nov 8, 2022
0babe7f
Ajout des anciens fichiers oubliés
amandinejacquelin Nov 8, 2022
40fdb52
change la disposition de la page Action
marc-rutkowski Nov 7, 2022
4077020
n'affiche pas le bouton "Préciser l'avancement" quand l'édition du st…
marc-rutkowski Nov 7, 2022
d0d4190
affiche "Audit" au lieu du niveau d'accès devant le nom de la collect…
marc-rutkowski Nov 7, 2022
8dbf6c9
répare le revert de `mes_collectivites_v2.sql`.
derfurth Nov 8, 2022
fc54a91
fix: Ajoute la table maintenance au realtime.
derfurth Nov 8, 2022
c258219
évite les connexions/déconnexions websockets mutliples aux changement…
marc-rutkowski Nov 8, 2022
d24c2c3
évite une confusion entre les identifiants lors de l'écoute des chang…
marc-rutkowski Nov 9, 2022
f44295c
Ajout de l'icon ThreeDotHorizontal
cparthur Nov 9, 2022
9e9ef1e
Changement de l'icon du menu d'option d'un commentaire
cparthur Nov 9, 2022
027d49b
Modification des mauvaises couleurs dans les options d'un commentaire
cparthur Nov 9, 2022
d4e4448
Ajout d'une couleur manquante lors du focus de l'input discussion/com…
cparthur Nov 9, 2022
24a4b58
Le dropdown changer la vue du feed discussion ne contient plus qu'un …
cparthur Nov 9, 2022
e36e946
Permet à tous les membres d'une collectivité de fermer une discussion
cparthur Nov 9, 2022
29b2de7
Update storyshots
cparthur Nov 9, 2022
0c0674d
tag v1.10.0
derfurth Nov 9, 2022
d8632ea
refacto listes déroulantes
marc-rutkowski Nov 7, 2022
532f88b
adapte l'affichage de la liste des membres au nouveau composant Multi…
marc-rutkowski Nov 7, 2022
19f221e
utilise le MultiSelectDropdown plutôt que material-ui dans les filtre…
marc-rutkowski Nov 7, 2022
22c4ce5
corrige temporairement le composant de sélection des colonnes pour le…
marc-rutkowski Nov 7, 2022
5da5b1a
extrait le composant badge représentant un statut d'audit d'une action
marc-rutkowski Nov 7, 2022
38616a1
ajoute le composant de filtre par statut d'audit des actions
marc-rutkowski Nov 7, 2022
3cd9ecc
base les tests sur les id plutôt que les libellés et évite l'usage de…
marc-rutkowski Nov 7, 2022
11faa20
ajoute le composant de filtre par inscription en séance d'audit
marc-rutkowski Nov 8, 2022
757d985
ajoute les fonctions de chargement de données de la table "Suivi de l…
marc-rutkowski Nov 8, 2022
7dfa7d5
ajoute la vue tabulaire "Suivi de l'audit"
marc-rutkowski Nov 9, 2022
7215df1
ajoute les onglets sur la page Labellisation quand un audit est en cours
marc-rutkowski Nov 9, 2022
f542451
améliore le typage des objets utilisés pour les tests e2e et l'accès …
marc-rutkowski Nov 10, 2022
3824480
ajoute des options aux composants Alerte
marc-rutkowski Nov 10, 2022
8678ef1
change la taille de typo des badges reflétant le statut d'audit d'une…
marc-rutkowski Nov 10, 2022
f9febe1
ajoute l'encadré "En savoir plus sur l’avancement de l’audit" sur la …
marc-rutkowski Nov 10, 2022
4f587ee
améliore le rendu des cellules de la vue tabulaire "Suivi de l'audit"
marc-rutkowski Nov 10, 2022
9653747
change le rendu du titre de la vue Labellisation
marc-rutkowski Nov 10, 2022
355b86b
règle l'espacement avant le bloc Personnalisation sur la page Action
marc-rutkowski Nov 10, 2022
fa740e2
fixe les filtres de la vue tabulaire "Suivi de l'audit"
marc-rutkowski Nov 10, 2022
4118be3
Synchronise les filtres et les onglets de la vue Labellisation avec l…
marc-rutkowski Nov 14, 2022
08e10d9
supprime un élément html superflu (qui empêchait l'application correc…
marc-rutkowski Nov 14, 2022
2674ae5
ajoute la possibilité de plier/déplier simultanément toutes les entré…
marc-rutkowski Nov 14, 2022
5aa4f52
corrige un test e2e
marc-rutkowski Nov 14, 2022
c12223a
Vue suivi de l'audit
derfurth Nov 10, 2022
35c37e9
fix: la vue suivi d'audit.
derfurth Nov 14, 2022
1cef445
améliore le composant Tooltip
marc-rutkowski Nov 14, 2022
911cf00
améliore les infobulles associées aux boutons plier/déplier des vues …
marc-rutkowski Nov 14, 2022
cb3df3d
Tag le plan.
derfurth Nov 15, 2022
6273232
wip: rattrapage ancienne branche historique avec select dans son prop…
cparthur Aug 24, 2022
426b3b6
Ajout de types génériques pour le nouveau MultiSelectFilter
cparthur Aug 25, 2022
55947bf
possibilité de remplacer le bouton d'ouverture du dropdown pour Multi…
cparthur Aug 25, 2022
badb1d7
Ajout de la possibilité de donner un composant custom pour les option…
cparthur Aug 29, 2022
805a94c
wip: sépare SelectDropdown et MultiSelectDropdown en 2 fichiers diffé…
cparthur Nov 7, 2022
d2173b6
wip: passe toute l'option à custonOption dans MultiSelectFilter
cparthur Nov 7, 2022
c54da1a
wip: cherry pick
cparthur Aug 29, 2022
a9809a7
wip: creation des filtres pour l'historique
cparthur Aug 29, 2022
6c86634
Ajout code dans commons poule les selects et update fichier avec ITEM…
cparthur Nov 15, 2022
c114e2c
Refacto MultiSelectDropdown
cparthur Nov 15, 2022
b73552b
Refacto MultiSelectFilter avec le nouveau MultiSelectDropdown
cparthur Nov 15, 2022
4c0289a
Refacto SelectDropdown
cparthur Nov 15, 2022
e584567
Remplace l'ancien MultiSelectFilter avec le nouveau
cparthur Nov 15, 2022
b00bcc2
Remplace le SelectDropdown par le nouveau dans MemberListTableRow
cparthur Nov 15, 2022
d3186ab
bouge ActionStatutBadge dans le dossier shared et donne une propriété…
cparthur Aug 29, 2022
e7f3eae
Fix eslint warning
cparthur Nov 15, 2022
ae040e2
Remplace ancien SelectDropdown par le nouveau dans des composants
cparthur Nov 15, 2022
1fb4993
Suppression de code non utilisé
cparthur Nov 15, 2022
214a7d9
Remplace l'ancien SelectDropdown par le nouveau dans AddPreuveComplem…
cparthur Nov 15, 2022
64540d0
Suppression de l'ancien SelectDropdown non utilisé
cparthur Nov 15, 2022
63c5b20
Update storyshots
cparthur Nov 15, 2022
9eb720b
utilise les nouveaux composants MultiSelect
marc-rutkowski Nov 16, 2022
5b52d48
met à jour les storyshots
marc-rutkowski Nov 16, 2022
7c83285
fixe temporaire (composant inutilisé actuellement)
marc-rutkowski Nov 16, 2022
b189803
fait le build du front au moment du build du container plutôt que lor…
marc-rutkowski Nov 16, 2022
70a4101
évite de tester la présence du bouton support (Crisp chatbox)
marc-rutkowski Nov 16, 2022
345b279
améliore la robustesse du test sur la sélection d'une collectivité de…
marc-rutkowski Nov 16, 2022
98aa1dd
rend plus robuste le test de saisie d'une description sur une preuve
marc-rutkowski Nov 16, 2022
8f1c1e3
fixe les id de test des listes déroulantes
marc-rutkowski Nov 16, 2022
b73a396
met à jour les storyshots
marc-rutkowski Nov 16, 2022
248410d
Create LICENSE
derfurth Nov 16, 2022
8039203
Expose la CLI à la racine du business.
derfurth Oct 21, 2022
023b435
Les nouveaux contenus json
derfurth Oct 21, 2022
5c4530e
Permet de mettre à jour les contenus du référentiel à partir d'un fic…
derfurth Oct 25, 2022
6e9b1b0
Permet de mettre à jour les indicateurs à partir d'un fichier json.
derfurth Oct 25, 2022
3236ed6
fix: Permet la mise à jour des contenus sans service_key
derfurth Oct 25, 2022
bed733d
Permet de mettre à jour les règles de personnalisation et les questio…
derfurth Oct 26, 2022
682b6e8
fix: indicateur/contenu_json revert
derfurth Oct 27, 2022
203ef81
fix: enlève les tests front portant sur le contenu.
derfurth Oct 27, 2022
0285e4b
fix: verify
derfurth Oct 28, 2022
435715b
Refacto evaluation domain : use FastAPI instead of realtime, get rid …
bertrandlalo Oct 10, 2022
1e6adf6
Refacto personnalisation : API post route
bertrandlalo Oct 12, 2022
d7a776a
Update docker-compose business-test command
bertrandlalo Oct 16, 2022
d3212c5
Add fastapi, remove rx and realtime from Pipfile
bertrandlalo Oct 16, 2022
bbf392f
Update business-egg
bertrandlalo Oct 16, 2022
888909a
Change la réponse de l'endpoint 'evaluate'.
derfurth Oct 17, 2022
c3359bf
Fichier api.py à la racine.
derfurth Oct 17, 2022
95d9c54
Remove collectivite domain and unused code
bertrandlalo Oct 17, 2022
a3a4474
Business dans le docker compose.
derfurth Oct 17, 2022
1bb1795
Utilise le nouveau service depuis le DL
derfurth Oct 17, 2022
d4e5659
Répare les deps
bertrandlalo Oct 18, 2022
8d923dd
Expose le port du business pour le tester.
derfurth Oct 18, 2022
9d447bb
Utilise l'endpoint personalisation
derfurth Oct 18, 2022
5a029dd
Fix import logging
bertrandlalo Oct 18, 2022
fade071
Add routes to business API to allow DL to call asynchronously
bertrandlalo Oct 18, 2022
5075849
Endpoints asynchrones
bertrandlalo Oct 18, 2022
8bf507e
Dépendances, on utilise requirements.txt pour le docker.
derfurth Oct 18, 2022
63314ce
fix: les potentiels perso qui sont potentiellement des strings.
derfurth Oct 18, 2022
49773cf
Ajoute une valeur par défaut pour la colonne `score_created_at`de `cl…
derfurth Oct 18, 2022
5898693
Répare l'url score.
derfurth Oct 18, 2022
28690fd
Répare l'upsert des données.
derfurth Oct 18, 2022
0c69d84
Supprime des tests client.
derfurth Oct 19, 2022
029695c
N'appelle plus le business si la configuration est vide, permet de fa…
derfurth Oct 19, 2022
69bf772
Mise à jour des README du business
bertrandlalo Oct 17, 2022
b1c5804
fix: revert http
derfurth Oct 28, 2022
41c31b2
Met à jour la dernière feature.
derfurth Oct 28, 2022
be4261a
Améliore le fonctionnement des endpoints en chainant les calculs dans…
derfurth Oct 28, 2022
17a2276
Load testing avec k6.
derfurth Oct 31, 2022
de8dc07
Améliore (quadruple) les performances des mises à jour des statuts.
derfurth Nov 1, 2022
8342e78
Mise à jour des scores en retard.
derfurth Nov 2, 2022
968dc41
Améliore la construction de la payload.
derfurth Nov 2, 2022
62d199c
Désactive l'API pour le test `reponse.sql`.
derfurth Nov 3, 2022
1f0d639
Appel le business à la suite du chargement des données par le loader …
derfurth Nov 3, 2022
6300d03
Utilise le schéma `evaluation`.
derfurth Nov 3, 2022
685f1b7
Score `modified_at`.
derfurth Nov 3, 2022
8dd2021
Dépendances du container client.
derfurth Nov 3, 2022
01a92cf
Suppression des tests des anciens événements.
derfurth Nov 3, 2022
fc7cc92
Drop des anciens triggers, fix des revert/verify.
derfurth Nov 7, 2022
ba9c4af
Interdit la mise à jour des conséquences et des scores issus de paylo…
derfurth Nov 7, 2022
834220e
Supprime les événements liés aux collectivités.
derfurth Nov 7, 2022
fb67158
Premier test d'intégration de l'API en TypeScript.
derfurth Nov 8, 2022
a2e96fd
Teste le scoring des statuts.
derfurth Nov 9, 2022
c100cbc
Répare le nom de l'app ASGI.
derfurth Nov 9, 2022
2f84406
Amélioration du test de charge.
derfurth Nov 9, 2022
2e9fa10
Fonctions utilitaires signIn/signOut pour plus de clarté.
derfurth Nov 10, 2022
788a126
Lit les variables d'environnement du fichier `.env`.
derfurth Nov 10, 2022
c0c698d
Teste l'ajout de nouveaux utilisateurs de test.
derfurth Nov 10, 2022
9bc2a15
Teste la personnalisation.
derfurth Nov 10, 2022
34c105b
fix: La réponse aux questions de personnalisation entraine un re-calc…
derfurth Nov 10, 2022
b618cee
Anime la barre des scores
derfurth Nov 10, 2022
5f91704
Anime les pourcentages des scores et les points de personnalisation.
derfurth Nov 11, 2022
f4ebada
Permet l'enregistrement des statuts même si le moteur est down.
derfurth Nov 11, 2022
d643ed2
L'endpoint lève une erreur afin que le bon toast s'affiche.
derfurth Nov 13, 2022
d060e66
Répare la labellisation en mettant à jour la fonction `convert_client…
derfurth Nov 15, 2022
e3cf606
Nouveaux tests d'intégration écrits en YAML afin de permettre au meti…
derfurth Nov 15, 2022
e1d75d2
Ajoute les tests pour cae_2.2.3 et les DOMs
derfurth Nov 16, 2022
cf918ef
Supprime un test client déprécié
derfurth Nov 16, 2022
ffd1f05
Ajoute une dep pour les tests
derfurth Nov 16, 2022
31ad135
Répare les tests end-to-end
derfurth Nov 17, 2022
d5c1c62
Nouveau test pour cae_3.3.5.
derfurth Nov 17, 2022
9e386ea
Nouveau test pour cae_3.2.1
derfurth Nov 17, 2022
43ccded
update latest change
derfurth Nov 17, 2022
9908c37
Corrige des coquilles
derfurth Nov 17, 2022
b29656d
Tag le déploiement.
derfurth Nov 17, 2022
7be52b8
fixe la manière d'appliquer les styles conditionnels au badge refléta…
marc-rutkowski Nov 17, 2022
c5ab476
Vues retool
derfurth Nov 18, 2022
38315eb
Met à jour le revert.
derfurth Nov 18, 2022
b8a7919
Répare le non-renseigné.
derfurth Nov 18, 2022
a422fb3
Tag la release v1.13.0.
derfurth Nov 18, 2022
daea757
Publication des storybooks sur Chromatic.
derfurth Nov 27, 2022
6703444
Run chromatic.
derfurth Nov 27, 2022
f1f98da
On ne lance Chromatic que lors des changements du storybook.
derfurth Nov 28, 2022
4f5a55c
Ajoute le schema stats.
derfurth Nov 28, 2022
c73514e
Rework les stats des collectivités.
derfurth Nov 28, 2022
d9d4580
Rework les stats des utilisateurs.
derfurth Nov 28, 2022
f7867fb
Tag le plan v1.14.0
derfurth Nov 29, 2022
b9e7c7b
Création des différents filtres encapsulés dans un composant d'affich…
cparthur Nov 26, 2022
8f48499
Mise à jour de la query/hook pour accueillir les filtres
cparthur Nov 26, 2022
479e7d9
Mise à jour de HistoriqueFiltres avec les nouveaux composants filtre …
cparthur Nov 26, 2022
3586c8b
Donne plus d'espace au titre de la page "journal d'activité"
cparthur Nov 26, 2022
9f1bf5f
Mise à jour de la story HistoriqueFiltres
cparthur Nov 26, 2022
488586d
crop le contenu du placeholder d'un sélecteur si le texte est plus lo…
cparthur Nov 27, 2022
292b1ed
Ajoute les tests e2e pour filtrer l'historique de modification d'une …
cparthur Nov 27, 2022
ca71750
update storyshots
cparthur Nov 27, 2022
bd93795
Passage à Supabase v2 dans les tests de l'API.
derfurth Nov 23, 2022
1686a88
Mise à jour de la doc.
derfurth Nov 24, 2022
026371c
Précisions sur les tests d'inté de l'API.
derfurth Nov 28, 2022
ac542f9
Répare la fusion des commentaires dans la vue retool.
derfurth Nov 24, 2022
3be684f
Ajoute la colonne `modifié le`.
derfurth Nov 24, 2022
0cb04ce
Un utilitaire python pour convertir les exports de l'EMT en csv.
derfurth Nov 25, 2022
e44f74b
supprime des anciens fichiers
marc-rutkowski Nov 24, 2022
b8de32c
migration vers supabase v2 de la partie front
marc-rutkowski Nov 24, 2022
0eb3bab
Précisions sur les tests du datalayer.
derfurth Nov 28, 2022
dad7020
Supprime le visuel déprécié de la doc.
derfurth Nov 28, 2022
6b7ae29
Mets à jour des liens dans la doc.
derfurth Nov 28, 2022
65fcd31
Un audit peut avoir plusieurs auditeurs
amandinejacquelin Nov 24, 2022
ea39237
Un audit peut avoir plusieurs auditeurs
amandinejacquelin Nov 24, 2022
e9d149e
Ajoute le schema migration
amandinejacquelin Nov 24, 2022
f799444
Ajoute le schema migration
amandinejacquelin Nov 24, 2022
b7537bb
Ne pas migrer les auditeurs d'un audit sans auditeurs
amandinejacquelin Nov 24, 2022
53c253e
Correction condition pour le droit d'insert dans la vue action_audit_…
amandinejacquelin Nov 25, 2022
cd65df7
Modification fonction est_auditeur
amandinejacquelin Nov 25, 2022
077eb69
Amélioration tests de charge.
derfurth Nov 19, 2022
4f4a79a
Précisions sur les tests de charge.
derfurth Nov 28, 2022
a028af7
Modification pondération et titres tâches
Emelinejy Nov 8, 2022
1aeed30
Personnalisation 1.1.2.1
Emelinejy Nov 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
42 changes: 42 additions & 0 deletions .github/workflows/deploy-storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publie le storybook sur chromatic

# On ne lance le workflow que si un storyshot ou une story est modifié.
on:
push:
paths:
- '**.storyshot'
- '**.stories.tsx'


jobs:
chromatic-deployment:
runs-on: ubuntu-latest

env:
client-directory: ./app.territoiresentransitions.react
LANG: 'fr_FR.UTF-8'
SUPABASE_SERVICE_ROLE_KEY: ${{secrets.TEST_SERVICE_SUPABASE_KEY}}
SUPABASE_ANON_KEY: ${{secrets.TEST_ANON_SUPABASE_KEY}}

steps:
- uses: actions/checkout@v1

- name: Fixe la langue de l'environnement
run: |
sudo locale-gen ${{env.LANG}}
sudo update-locale LANG=${{env.LANG}}

- name: Copie les variables d'environnement
run: sh make_dot_env.sh

# On n'utilise pas Docker, car l'action Chromatic nécessite Git.
- name: Installe les dépendances.
run: npm install
working-directory: ${{env.client-directory}}

- name: Publication du storybook sur Chromatic
uses: chromaui/action@v1

with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
workingDir: ${{env.client-directory}}
10 changes: 5 additions & 5 deletions .github/workflows/update-preuves.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ jobs:

# Execute CLI on local datalayer if branch not in [upcoming-sandbox, upcoming-production]
- name: Execute parsing scripts to generate JSON files in data_layer/content
run: docker compose run --no-deps business-parse-preuves
run: docker compose run --no-deps business-parse-content

# Check that datalayer loader runs
- name: Run datalayer loader
# Check that datalayer loader runs
- name: Run datalayer loader
run: sh make_dot_env.sh && docker-compose run loader
env:
SUPABASE_SERVICE_ROLE_KEY: ${{secrets.TEST_SERVICE_SUPABASE_KEY}}
SUPABASE_ANON_KEY: ${{secrets.TEST_ANON_SUPABASE_KEY}}

# Commit changes
- name: Commit generated JSON files
uses: EndBug/add-and-commit@v7
with:
default_author: github_actions
message: Generated preuves from updated markdowns.
message: Generated preuves from updated markdowns.
205 changes: 205 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
A l'exception des contenus dans le dossier `markdown` qui sont la
propriété intellectuelle de l'ADEME, le code est sous license
Apache, version 2.0


Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 ADEME

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
21 changes: 6 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Territoires en Transition

Dans le cadre des programmes d'accompagnement des collectivités dans leurs démarches de transition écologique,
l'[ADEME (l'Agence de la transition écologique)](https://www.ademe.fr/) s'est associée à
[beta.gouv.fr](https://beta.gouv.fr/) pour lancer une plateforme numérique pour faciliter et accélérer la mise en oeuvre
des actions de transition écologique dans les collectivités territoriales.
Dans le cadre des programmes d'accompagnement des collectivités dans leurs démarches de transition écologique, l'[ADEME (l'Agence de la transition écologique)](https://www.ademe.fr/) s'est associée à [beta.gouv.fr](https://beta.gouv.fr/) pour lancer une plateforme numérique pour faciliter et accélérer la mise en œuvre des actions de transition écologique dans les collectivités territoriales.

L'interface a pour objectifs de permettre aux utilisateurs :

Expand Down Expand Up @@ -43,18 +40,16 @@ Ces fichiers markdowns représentent des définitions auxquelles sont rattachée
exemple un indicateur tel que [Emissions de GES](markdown/indicateurs/crte/crte_001.md)
est destiné à permettre aux utilisateurs à saisir leurs données annuelles dans notre application.

Ces définitions sont lues par la partie [referentiel](business/business/referentiel) du `business` et sauvegardée en
Ces définitions sont lues par la partie [referentiel](business/business/referentiel/README.md) du `business` et sauvegardée en
base afin d'être

- utilisées pour le processus d'[évaluation](business/business/evaluation)
- utilisées pour le processus d'[évaluation](./business/business/evaluation/README.md)
- affichées dans le `client`
- garantir la cohérence des données utilisateur stockées dans le `data layer` grace
au [schema](data_layer/postgres/definitions)
- utilisées comme garantie de la cohérence des données utilisateur stockées dans le `data layer`

### Les données utilisateurs

Les utilisateurs saisissent pour le compte de leur collectivité des données qui sont stockées dans le `data layer`
qui vérifie leurs droits en écriture grace aux
Les utilisateurs saisissent pour le compte de leur collectivité des données qui sont stockées dans le `data layer` qui vérifie leurs droits en écriture grace aux
[row security policies](https://www.postgresql.˚org/docs/current/ddl-rowsecurity.html)

### Les données d'évaluation
Expand Down Expand Up @@ -82,10 +77,6 @@ Chacun de ses éléments a un périmètre définit :
- il lit les contenus markdown et les enregistre dans le `data layer`
- il évalue les données utilisateur et les enregistre dans le `data layer`

<div align="center">
<img src="design.png" alt="architecture design" >
</div>

## Stack

- Le `client` utilise React ce qui nous permet de bénéficier d'un écosystème riche. Il est développé en TypeScript.
Expand Down Expand Up @@ -145,4 +136,4 @@ Néanmoins, on peut lancer les tests à partir de docker compose :

## Déploiement

Aujourd'hui le `business` et le `client` sont déployés chez Scalingo, le `data layer` est chez supabase.io en mode SAAS.
Aujourd'hui le `business` et le `client` sont déployés chez [Scalingo](https://scalingo.com/), le `data layer` est chez [Supabase](https://supabase.com/) en mode BaaS.
2 changes: 2 additions & 0 deletions api_tests/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SUPABASE_KEY=$SUPABASE_ANON_KEY
SUPABASE_URL=http://localhost:8000
52 changes: 52 additions & 0 deletions api_tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# API tests

Regroupe les tests d'intégration de l'API générée par le Datalayer.

Ces tests écrits en TypeScript nous permettent de produire des scénarios d'utilisation au fur et à mesure du développement de l'API et de s'assurer que l'API est bien accessible par le client.

On se sert des [tests pgTAP](../data_layer/tests) pour tester le comportement de la base de données.

## Utilisation

[Installer deno](https://deno.land/manual/getting_started/installation), puis
lancer les tests avec :

```sh
deno test --allow-net --allow-env --allow-read tests/ --location 'http://localhost'
```

La commande se décompose ainsi :

- `deno test`: le [test runner de deno](https://deno.land/manual/testing)
- `--allow-net`: permet l'accès au network
- `--allow-env`: permet de lire les variables d'environnement
- `--allow-read`: permet de lire les variables d'environnement du ficher `.env`
- `tests/`: tous les fichiers TypeScript `.test.ts` du dossier `tests`
- `--location`: le `location.href` dont le client Supabase a besoin

### Variables d'environnement

- `SUPABASE_URL`: l'URL de Supabase
- `SUPABASE_KEY`: la clé **anon** de l'API

## Générer les types

Nécessite [d'installer la CLI Supabase](https://supabase.com/docs/guides/cli).

```sh
gen_types.sh
```

### Variables d'environnement

- `POSTGRES_PASSWORD`: Le mot de passe de la base locale, voir le `.env` à la
racine.
- `POSTGRES_PORT`: Le port de la base locale

## Formater la doc et le code

Pour le moment on le fait avant commit en attendant de mettre à jour notre CI.

```sh
deno fmt
```
3 changes: 3 additions & 0 deletions api_tests/gen_types.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

supabase gen types typescript --db-url "postgresql://postgres:[email protected]:$POSTGRES_PORT/postgres" > ./lib/database.types.ts
Loading