From 40fd1f4aba1d27b3c04d77c289a7e669a845cd95 Mon Sep 17 00:00:00 2001
From: Yoan VALLET <ext.sopra.yvallet@grandlyon.com>
Date: Wed, 12 Jan 2022 13:14:09 +0000
Subject: [PATCH] feat: add onboarding section

---
 .prettierignore                           |   1 +
 README.md                                 | 182 +++++++++++-----------
 docs/ecolyo/functionalities/onboarding.md |  20 +++
 mkdocs.yml                                |   1 +
 4 files changed, 114 insertions(+), 90 deletions(-)
 create mode 100644 .prettierignore
 create mode 100644 docs/ecolyo/functionalities/onboarding.md

diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 0000000..2e1fa2d
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1 @@
+*.md
\ No newline at end of file
diff --git a/README.md b/README.md
index 8deb2af..ee9feb3 100644
--- a/README.md
+++ b/README.md
@@ -2,10 +2,10 @@
 
 ## Commands
 
-* `py -m pip install mkdocs` - Install mkdocs
-* `mkdocs serve` - Start the live-reloading docs server.
-* `mkdocs build` - Build the documentation site.
-* `mkdocs help` - Print this help message.
+- `py -m pip install mkdocs` - Install mkdocs
+- `mkdocs serve` - Start the live-reloading docs server.
+- `mkdocs build` - Build the documentation site.
+- `mkdocs help` - Print this help message.
 
 ## Mkdocs packages
 
@@ -13,96 +13,98 @@
     py -m pip install plantuml-markdown
 
 ## Setting files hierarchy
+
     inside mkdocs.yml, configure the md files hierarchy
 
 nav:
-  - Home: index.md
-  - Easy Cozy:
-      - Configuration: easycozy/config.md
-      - Commands: easycozy/commands.md
-      - Known errors: easycozy/known_errors.md
-      - Scripts: easycozy/scripts.md
-      - Tips: easycozy/tips.md
-  - Ecolyo:
-      - Introduction: ecolyo/index.md
-      - Getting started:
-          - Setup your environment: ecolyo/getting_started/setup_your_environment.md
-          - Launch the application on local: ecolyo/getting_started/launch_local_application.md
-          - Launch a konnector on local: ecolyo/getting_started/launch_local_konnector.md
-      - Project Architecture:
-          - Architecture: ecolyo/project_architecture/architecture.md
-          - Libraries: ecolyo/project_architecture/libraries.md
-          - Environments: ecolyo/project_architecture/environments.md
-          - DocTypes: ecolyo/project_architecture/doctypes.md
-          - Remote DocTypes: ecolyo/project_architecture/remote_doctypes.md
-      - Application:
-          - Description: ecolyo/application/description.md
-          - Redux: ecolyo/application/redux.md
-          - Scaffolding: ecolyo/application/scaffolding.md
-          - Services: ecolyo/application/services.md
-          - Gitflow: ecolyo/application/gitflow.md
-          - Deploy: ecolyo/application/deploy.md
-          - Mail: ecolyo/application/mail.md
-      - Services: 
-          - Description: ecolyo/services/index.md
-          - Monthly report notification: ecolyo/services/monthly_report_notification.md
-          - Aggregator usage events: ecolyo/services/aggregator_usage_events.md
-          - Consumption Alert: ecolyo/services/consumption_alert.md
-      - Functionalities:
-          - Initialization: ecolyo/functionalities/initialization.md
-          - Consumption: ecolyo/functionalities/consumption.md
-          - Ecogesture: ecolyo/functionalities/ecogesture.md
-          - Challenge: ecolyo/functionalities/challenge.md
-          - Profile Type: ecolyo/functionalities/profile_type.md
-          - Analysis: ecolyo/functionalities/analysis.md
-          - Usage events tracking: ecolyo/functionalities/usage_events_tracking.md
-  - Pilote:
-      - Pilote - TS - Back:
-          - Index: pilote/Pilote - TS - Back/index.md
-          - Application:
-              - Deploy: pilote/Pilote - TS - Back/application/deploy.md
-          - Functionalities:
-              - Routes: pilote/Pilote - TS - Back/functionalities/routes.md
-          - Getting Started:
-              - Launch the application on local: pilote/Pilote - TS - Back/getting_started/launch_local_application.md
-              - Setup your environment: pilote/Pilote - TS - Back/getting_started/setup_your_environment.md
-          - Project Architecture: pilote/Pilote - TS - Back/project_architecture/architecture.md
-      - Pilote - TS - Front:
-          - Index: pilote/Pilote - TS - Front/index.md
-          - Application:
-              - Deploy: pilote/Pilote - TS - Front/application/deploy.md
-          - Functionalities:
-              - Routes: pilote/Pilote - TS - Front/functionalities/functions.md
-          - Getting Started:
-              - Launch the application on local: pilote/Pilote - TS - Front/getting_started/launch_local_application.md
-      - Pilote - Usager:
-          - Application:
-              - Deploy: pilote/Pilote - Usager/application/deploy.md
-              - Doctypes: pilote/Pilote - Usager/application/doctypes.md
-              - Gitflow: pilote/Pilote - Usager/application/gitflow.md
-              - Scaffolding: pilote/Pilote - Usager/application/scaffolding.md
-              - Services: pilote/Pilote - Usager/application/services.md
-              - Store: pilote/Pilote - Usager/application/store.md
-          - Functionalities:
-              - Appointments: pilote/Pilote - Usager/functionalities/appointments.md
-              - Contact: pilote/Pilote - Usager/functionalities/contact.md
-              - Document: pilote/Pilote - Usager/functionalities/document.md
-              - Settings: pilote/Pilote - Usager/functionalities/setting.md
-          - Getting Started:
-              - Launch local doctypes: pilote/Pilote - Usager/getting_started/launch_local_doctypes.md
-              - Launch local services: pilote/Pilote - Usager/getting_started/launch_local_services.md
-  - Konnectors:
-      - Introduction: konnectors/index.md
-      - Enedis: konnectors/enedis.md
-      - GRDF: konnectors/grdf.md
-      - Eau du Grand Lyon: konnectors/egl.md
-  - Proxy:
-      - Description: proxy/description.md
-      - Monitoring: proxy/monitoring.md
-      - Use cases:
-          - Enedis: proxy/use_cases/enedis.md
-          - Grdf Adict: proxy/use_cases/grdfadict.md
 
+- Home: index.md
+- Easy Cozy:
+  - Configuration: easycozy/config.md
+  - Commands: easycozy/commands.md
+  - Known errors: easycozy/known_errors.md
+  - Scripts: easycozy/scripts.md
+  - Tips: easycozy/tips.md
+- Ecolyo:
+  - Introduction: ecolyo/index.md
+  - Getting started:
+    - Setup your environment: ecolyo/getting_started/setup_your_environment.md
+    - Launch the application on local: ecolyo/getting_started/launch_local_application.md
+    - Launch a konnector on local: ecolyo/getting_started/launch_local_konnector.md
+  - Project Architecture:
+    - Architecture: ecolyo/project_architecture/architecture.md
+    - Libraries: ecolyo/project_architecture/libraries.md
+    - Environments: ecolyo/project_architecture/environments.md
+    - DocTypes: ecolyo/project_architecture/doctypes.md
+    - Remote DocTypes: ecolyo/project_architecture/remote_doctypes.md
+  - Application:
+    - Description: ecolyo/application/description.md
+    - Redux: ecolyo/application/redux.md
+    - Scaffolding: ecolyo/application/scaffolding.md
+    - Services: ecolyo/application/services.md
+    - Gitflow: ecolyo/application/gitflow.md
+    - Deploy: ecolyo/application/deploy.md
+    - Mail: ecolyo/application/mail.md
+  - Services:
+    - Description: ecolyo/services/index.md
+    - Monthly report notification: ecolyo/services/monthly_report_notification.md
+    - Aggregator usage events: ecolyo/services/aggregator_usage_events.md
+    - Consumption Alert: ecolyo/services/consumption_alert.md
+  - Functionalities:
+    - Initialization: ecolyo/functionalities/initialization.md
+    - Onboarding: ecolyo/functionalities/onboarding.md
+    - Consumption: ecolyo/functionalities/consumption.md
+    - Ecogesture: ecolyo/functionalities/ecogesture.md
+    - Challenge: ecolyo/functionalities/challenge.md
+    - Profile Type: ecolyo/functionalities/profile_type.md
+    - Analysis: ecolyo/functionalities/analysis.md
+    - Usage events tracking: ecolyo/functionalities/usage_events_tracking.md
+- Pilote:
+  - Pilote - TS - Back:
+    - Index: pilote/Pilote - TS - Back/index.md
+    - Application:
+      - Deploy: pilote/Pilote - TS - Back/application/deploy.md
+    - Functionalities:
+      - Routes: pilote/Pilote - TS - Back/functionalities/routes.md
+    - Getting Started:
+      - Launch the application on local: pilote/Pilote - TS - Back/getting_started/launch_local_application.md
+      - Setup your environment: pilote/Pilote - TS - Back/getting_started/setup_your_environment.md
+    - Project Architecture: pilote/Pilote - TS - Back/project_architecture/architecture.md
+  - Pilote - TS - Front:
+    - Index: pilote/Pilote - TS - Front/index.md
+    - Application:
+      - Deploy: pilote/Pilote - TS - Front/application/deploy.md
+    - Functionalities:
+      - Routes: pilote/Pilote - TS - Front/functionalities/functions.md
+    - Getting Started:
+      - Launch the application on local: pilote/Pilote - TS - Front/getting_started/launch_local_application.md
+  - Pilote - Usager:
+    - Application:
+      - Deploy: pilote/Pilote - Usager/application/deploy.md
+      - Doctypes: pilote/Pilote - Usager/application/doctypes.md
+      - Gitflow: pilote/Pilote - Usager/application/gitflow.md
+      - Scaffolding: pilote/Pilote - Usager/application/scaffolding.md
+      - Services: pilote/Pilote - Usager/application/services.md
+      - Store: pilote/Pilote - Usager/application/store.md
+    - Functionalities:
+      - Appointments: pilote/Pilote - Usager/functionalities/appointments.md
+      - Contact: pilote/Pilote - Usager/functionalities/contact.md
+      - Document: pilote/Pilote - Usager/functionalities/document.md
+      - Settings: pilote/Pilote - Usager/functionalities/setting.md
+    - Getting Started:
+      - Launch local doctypes: pilote/Pilote - Usager/getting_started/launch_local_doctypes.md
+      - Launch local services: pilote/Pilote - Usager/getting_started/launch_local_services.md
+- Konnectors:
+  - Introduction: konnectors/index.md
+  - Enedis: konnectors/enedis.md
+  - GRDF: konnectors/grdf.md
+  - Eau du Grand Lyon: konnectors/egl.md
+- Proxy:
+  - Description: proxy/description.md
+  - Monitoring: proxy/monitoring.md
+  - Use cases:
+    - Enedis: proxy/use_cases/enedis.md
+    - Grdf Adict: proxy/use_cases/grdfadict.md
 
 ## Project layout
 
diff --git a/docs/ecolyo/functionalities/onboarding.md b/docs/ecolyo/functionalities/onboarding.md
new file mode 100644
index 0000000..e655948
--- /dev/null
+++ b/docs/ecolyo/functionalities/onboarding.md
@@ -0,0 +1,20 @@
+This section explains the way we handle onboarding the application.
+
+## Description
+
+When the user connects for the first time to Ecolyo, onboarding screens will be displayed.
+!!! note "First connection" 
+    The first connection is define by the **isFirstConnection** boolean contains in the **profile** doctype.
+
+### GCU screen
+
+First of all, we display the GCU screen, which allows user to read the General Condition of Use and the Legal Notive. The user should consent to all the terms to go further in the application.
+!!! note "About terms" 
+    More details are available on the (term section)[/ecolyo/functionalities/terms.md].
+
+### Welcome modal
+
+After GCU screen we display a welcome modal to inform user about further steps needed to use Ecolyo (connection to partners to retrieve the data, ...).
+We store in user's profile a boolean _onboarding.isWelcomeSeen_ that allows the app to know is the modal has already be seen. If the modal has been seen we will never display it again.
+
+When user close this modal, the **welcome mail** is sent to the user.
diff --git a/mkdocs.yml b/mkdocs.yml
index a59c2f8..d9cd59c 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -64,6 +64,7 @@ nav:
           - Ecogesture: ecolyo/functionalities/ecogesture.md
           - Feedback: ecolyo/functionalities/feedback.md
           - Initialization: ecolyo/functionalities/initialization.md
+          - Onboarding: ecolyo/functionalities/onboarding.md
           - Price Calculation: ecolyo/functionalities/prices_calculation.md
           - Profile Type: ecolyo/functionalities/profile_type.md
           - Terms: ecolyo/functionalities/terms.md
-- 
GitLab