diff --git a/docs/easycozy/tips.md b/docs/easycozy/tips.md new file mode 100644 index 0000000000000000000000000000000000000000..90d78dafd05c36e96cd0d64189731ab5e42c5338 --- /dev/null +++ b/docs/easycozy/tips.md @@ -0,0 +1,64 @@ +# Tips + +## Query data from an instance + +For maintenance reason, we sometime need to check data on a specific instance. For that we use postman to send get / post / delete data. +All posibility are described in the [data section of Cozy documentation](https://docs.cozy.io/en/cozy-stack/data-system/). + +**Example** + +The example will describ how to query userChallenge data from "ecolyotest" instance. +First, you need to be able to connect to the instance in order to retrive the bearer and the cozysessid. + + + +Then use postman to query the data: +``` +Verb: GET +Request: https://ecolyotest.cozy.self-data.alpha.grandlyon.com/data/com.grandlyon.ecolyo.userchallenge/_all_docs?include_docs=true +Header: + Accept: application/json + content-type: application/json + Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + Cookie: cozysessid=AAAAAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +``` + +The result will then be retrieve by postman: +``` +{ + "total_rows": 1, + "offset": 0, + "rows": [ + { + "id": "a353b985c0c5f09229b0acd6b2f37f1b", + "key": "a353b985c0c5f09229b0acd6b2f37f1b", + ... + ] +} +``` + + +## Delete a doctype from a instance + +You can use ACH to delete a doctype. +Please find the [ACH documentation](https://npm.io/package/cozy-ach) to see all commands + +**Example** + +The example will describ how to drop userChallenge doctype from "ecolyotest" instance. +the token provided is the one present in the cozysessid. + +``` +$ ach -t xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -u https://ecolyotest.cozy.self-data.alpha.grandlyon.com drop com.grandlyon.ecolyo.userchallenge +This doctypes will be removed. + +* com.grandlyon.ecolyo.userchallenge + +Type "yes" if ok. +yes +``` + +A browser window will be opened asking for authorization to access to your file. +Just click on "Authorize" to keep on with the doctype droping. + + diff --git a/docs/ecolyo/application/deploy.md b/docs/ecolyo/application/deploy.md index 06e9281cdf93bc32fd605e66b67054a07b32aab3..4d41a3ca671bf57dc942db7e95cd34e12540ee3d 100644 --- a/docs/ecolyo/application/deploy.md +++ b/docs/ecolyo/application/deploy.md @@ -34,9 +34,17 @@ $ yarn deploy-dev $ yarn deploy ``` -## Deploy build-dev branch to Scaleway +## Deploy build-test branch to one Scaleway instance for testing + +You can directly use the content of build-test branch to update one instance for test purpose. +Simply use the dedicated script "update_ecolyo_test.sh <instance_name>" with the targeted instance (from the server). +By default we use the ecolyotest instance for testing intermediate functionnality. +For more informations you can check for [Easy Cozy scripts](../../../easycozy/scripts/). + +## Deploy build-dev branch to all Scaleway instances You can directly use the content of build-dev branch to update apps on dev environment using scripts (from the server). +Simply use the dedicated script "update_all_ecolyo_dev.sh" (from the server). For more informations you can check for [Easy Cozy scripts](../../../easycozy/scripts/). ## Deploy build branch to Cozy diff --git a/docs/ecolyo/application/redux.md b/docs/ecolyo/application/redux.md new file mode 100644 index 0000000000000000000000000000000000000000..ddf381b58ec4e0bdcfe634ae928a3628c3af3c32 --- /dev/null +++ b/docs/ecolyo/application/redux.md @@ -0,0 +1,23 @@ +# Redux + +There are two main store created for this app: + +- Cozy: store information about cozy (konnectors, accounts, settings, db) +- Ecolyo: store all states used for this app + +For a better state management, combineReducers(reducers) is used to split the reducing function into seperate functions. So, each managing independent parts of the state. + +### Ecolyo Store Structure + +| Reducer | Type | Description | +| --------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| global | GlobalState | store global states such as: notification, type device or fluid type<br><br>GlobalState enum<br>- _screenType = ScreenType_<br>- _challengeExplorationNotification = boolean_<br>- _challengeActionNotification = boolean_<br>- _challengeDuelNotification = boolean_<br>- _analysisNotification = boolean_<br>- _fluidStatus = FluidStatus[]_<br>- _fluidTypes = FluidType[]_ | +| profile | Profile | store states about profile information such as: notification, connectionDate, profileType | +| chart | ChartState | store consumption chart states such as: timeStep, graph data<br><br>ChartState enum<br>- _selectedDate = DateTime_<br>- _currentTimeStep = TimeStep_<br>- _currentIndex = number_<br>- _currentDatachart = Datachart_<br>- _currentDatachartIndex = number_<br>- _loading = boolean_ | +| modal | ModalState | store opening state of the feedback modal <br><br>ModalState enum<br>- _isFeedbacksOpen = boolean_ | +| challenge | ChallengeState | store challenge state such as: list of user challenge, data load and current challenge <br><br>ChallengeState enum<br>- _userChallengeList = UserChallenge[]_<br>- _currentChallenge = UserChallenge_<br>- _currentDataload = Dataload[]_ | + +### Updating state process + +Redux-thunk middleware is configured. For now, it is used only for updating the profile. +To update a state, a webservice method is called before trigger a state change inside the store. diff --git a/mkdocs.yml b/mkdocs.yml index 8a682782d3df81277f1718e843f3767a00644bf4..a232e41bf9ff70932bea5543c7bbc9bb13e3dd27 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,93 +5,95 @@ repo_name: "Clone the Project" repo_url: "https://forge.grandlyon.com/web-et-numerique/llle_project/self-data-technical-doc" theme: - name: "material" - # logo: 'img/self_data_grdlyon.png' - favicon: "img/self_data_grdlyon.png" - palette: - primary: "white" - accent: "red" + name: "material" + # logo: 'img/self_data_grdlyon.png' + favicon: "img/self_data_grdlyon.png" + palette: + primary: "white" + accent: "red" markdown_extensions: - - admonition - - plantuml_markdown: - server: http://www.plantuml.com/plantuml - - attr_list - - pymdownx.emoji + - admonition + - plantuml_markdown: + server: http://www.plantuml.com/plantuml + - attr_list + - pymdownx.emoji extra_css: - - "stylesheets/extra.css" + - "stylesheets/extra.css" nav: - - Home: index.md - - Easy Cozy: - - Scripts: easycozy/scripts.md - - Commands: easycozy/commands.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 - - Application: - - Description: ecolyo/application/description.md - - Scaffolding: ecolyo/application/scaffolding.md - - Services: ecolyo/application/services.md - - Gitflow: ecolyo/application/gitflow.md - - Deploy: ecolyo/application/deploy.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 - - 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: - - 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: + - Scripts: easycozy/scripts.md + - Commands: easycozy/commands.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 + - 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 + - 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 + - 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: + - 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